Bank switching - How Do you handle this in NESASM?
Moderator: Moderators
Bank switching - How Do you handle this in NESASM?
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?
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?
Probably The "Most Filthy Casual" NES ASM Developer https://refreshgames.co.uk/
Re: Bank switching - How Do you handle this in NESASM?
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.
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.
Re: Bank switching - How Do you handle this in NESASM?
Ah, so I don't need to set it out as 2 16kb banks then? just one solid 32kb bank.
Probably The "Most Filthy Casual" NES ASM Developer https://refreshgames.co.uk/
Re: Bank switching - How Do you handle this in NESASM?
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.rychan wrote:Ah, so I don't need to set it out as 2 16kb banks then? just one solid 32kb bank.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: Bank switching - How Do you handle this in NESASM?
That and DMC playback addresses start at $C000.
Re: Bank switching - How Do you handle this in NESASM?
Ahh, that's cool tepples, so I can just overflow the data without the unnecessary extra bank making. I'll expereiment with this tonight!
Probably The "Most Filthy Casual" NES ASM Developer https://refreshgames.co.uk/
Re: Bank switching - How Do you handle this in NESASM?
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.
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: fo.aspekt.fi
Re: Bank switching - How Do you handle this in NESASM?
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?
Should I try another assembler perhaps?
Probably The "Most Filthy Casual" NES ASM Developer https://refreshgames.co.uk/
Re: Bank switching - How Do you handle this in NESASM?
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.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.
Other assemblers will also avoid this limitation.
(Free Hero Mesh - FOSS puzzle game engine)
Re: Bank switching - How Do you handle this in NESASM?
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
Probably The "Most Filthy Casual" NES ASM Developer https://refreshgames.co.uk/