Page 1 of 1

NESASM incbin placement in ROM file

Posted: Wed Dec 20, 2017 1:23 pm
by swee
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: Select all

  .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

Posted: Wed Dec 20, 2017 1:30 pm
by lidnariq
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

Posted: Wed Dec 20, 2017 4:14 pm
by tokumaru
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

Posted: Sun Dec 24, 2017 8:57 am
by zzo38
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.