NESASM incbin placement in ROM file

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
NESASM incbin placement in ROM file
by on (#210482)
I'm trying to understand why NESASM is placing my .incbin file at $0524 in ROM file when the i want it to place at $8514 ?
The only code im compileing is:

Code:
  .inesprg 8   ; 8x 16KB PRG code
  .ineschr 0   ; 1x  8KB CHR data
  .inesmap 0   ; mapper 0 = NROM, no bank swapping
  .inesmir 0   ; background mirroring
 
  .bank 0
  .org $8514
  .incbin "noheader.nsf"
Re: NESASM incbin placement in ROM file
by on (#210483)
NESASM forces you to use 8 KiB banks.
ORG only lets you set the address within that bank (as well as the nominal memory address that will be used when it's referred to later)
NES files have a sixteen byte header.

($8514) & $1FFF = $0514
$0514 + 16 = $0524.

Also, you are going to have a bad time trying to stuff a bigger-than-32KiB NSF inside a ROM. Just use rainwarrior's eznsf tool instead.
Re: NESASM incbin placement in ROM file
by on (#210496)
ROM begins at $8000, so the contents of file offset $0524 will indeed be loaded at CPU address $8514, after you take the 16-byte ($10 in hex) iNES header into account.

But yeah, I don't know if NESASM's 8KB banks limitation will let you .incbin a file larger than that.
Re: NESASM incbin placement in ROM file
by on (#210681)
tokumaru wrote:
But yeah, I don't know if NESASM's 8KB banks limitation will let you .incbin a file larger than that.
I believe it will; incbin is the only exception to that limitation.