I feel proper forum etiquette requires a follow up post.
Something along the the lines of "I got it to work, thanks", or "I'm still having issues with X", or "I'm too busy to work on this now, but I'm making slow progress"
When you have multiple people trying to help you, and you leave it hanging like this, it tends to generate bitter feelings, and people will likely be less enthusiastic about helping you in the future.
If you are using NROM you can have only one or two PRG banks. Each PRG bank is 16 kB so if your game is bigger than that (minus the 8 kB CHR-ROM) you need two banks. If your PRG-ROM is bigger than 32 kB you need to consider using another mapper.
Tokumaru's templates automatically calculates the PRG-ROM start address ($C000 or $8000 for NROM) depending on what you set the PRG_COUNT define to (1 or 2 for NROM).
You have to decide yourself how many and which banks will be dedicated to the main engine, the audio engine, level maps, graphics (in case of CHR-RAM), and so on, and design the code in a way that allows it to access all of this stuff. When you start a project, you need to know the mapper you're gonna use, since there are many different bank layouts across the different mappers, and estimate how much space you're gonna use. These things don't have to be set in stone, as it may be possible to switch to a similar mapper later on or increase the ROM size (as long as the mapper supports it), but more drastic changes may need a lot of refactoring.
Another important thing to note is that ROM sizes bust be powers of 2. you can't have 110KB of PRG-ROM, you have to round it up to the next multiple of 2, which is 128KB. For example, if you currently have 64KB of PRG-ROM that's completely full, and need to implement a new feature that only needs 1 extra byte, you have to double the ROM size to 128KB, even though you only need 1 extra byte, otherwise emulators won't know how to map you ROM file.
In ASM6 you can put the cointents of different banks in separate files, and include them all in a master file that will be assembled. Something like this:
Code: Select all
;PRG-ROM bank 0 .base $8000 .include "bank0.asm" .org $c000 ;PRG-ROM bank 1 .base $8000 .include "bank1.asm" .org $c000 ;PRG-ROM bank 2 .base $8000 .include "bank2.asm" .org $c000 ;PRG-ROM bank 3 .base $c000 .include "bank3.asm" .org $fffa ;interrupt vectors .dw NMI .dw Reset .dw IRQ
1, 2, 4, 8, 16
Don't worry about how many banks you need yet. Just stick to NROM128 (Donkey Kong, Pacman) or NROM256 (Super Mario Bros) sized right now.
If you have so much code that you overflow past FFFF, the assembler will give you an error. Until that happens, it's not a worry.