So, I've got my Mapper #0 ROM showing up with 2 x 16k banks of PRG-ROM and 1 x 8kb bank of CHR-ROM inside Shiru's NES Space Checker, with the intention that I put all my level code into the second bank, whilst retaining the game code in bank #0, but I have no clue as to how bankswitching works on the NES.
I've used multiple 16kb banks on the gameboy with GBDK which kept the process fairly simple but can't figure out, or find, resources on how the NES would handle it all.
Do I need to write to a register somewhere to flip banks? Is the second bank just already present or is there something else at play?
Mapper 0 ('NROM') is "no" bankswitching.
The first 16 KiB of the provided PRG is mapped from $8000-$BFFF. The last 16KiB of the provided PRG is mapped from $C000-$FFFF. These locations cannot be changed at runtime.
This is basically identical to a 32KiB gameboy game.
Ah, so I don't need to set it out as 2 16kb banks then? just one solid 32kb bank.
rychan wrote:
Ah, so I don't need to set it out as 2 16kb banks then? just one solid 32kb bank.
Right. The reason NES Space Checker displays everything as 16 KB banks is that the iNES ROM file format header stores the ROM size as a multiple of 16 KB.
That and DMC playback addresses start at $C000.
Ahh, that's cool tepples, so I can just overflow the data without the unnecessary extra bank making. I'll expereiment with this tonight!
Actually, in NESASM specifically you're forced to split everything into 8 KB banks, even though really it's a continuous 32 KB bank with no bankswitching needed. It's a limitation of the assembler.
Is there anyway to get around this limitation? I've made a bunch of attempts tonight to no avail, aside from grey screens of course.
Should I try another assembler perhaps?
rychan wrote:
Is there anyway to get around this limitation? I've made a bunch of attempts tonight to no avail, aside from grey screens of course.
Not in plain NESASM, although in Unofficial-MagicKit you can predefine the consecutive 8K banks with the same name, and then when you go from one bank to the next one will automatically do. Bank numbers in the assembler will still be 8K though.
Other assemblers will also avoid this limitation.
Cool, I think I've found a way around it last night / this morning, whatever 1am really classes itself as anyway
Thanks again for all your kind help, it's a fun struggle this ASM coding