I want to convert my current game from a MMC-1 with 256 KB to MMC-1 with 512 KB.
I did all the changes that I think are needed, but the game doesn't start anymore.
This is what I did:
I changed the fifth value in the NES header from 16 to 32:
I added new memory and segment entries in the config file.
Those are the corresponding original values:
Here, I put bank 15-30 between 14 and fix.
Same with the code itself.
Original versions:
I added bank 15-30 between bank 14 and bank fix.
By the way, RESET_START is a macro that contains this code:
All in all, the version with 16 banks works fine. But with 32 banks, it doesn't even start.
So, what else do I need to add, so that the code works?
I did all the changes that I think are needed, but the game doesn't start anymore.
This is what I did:
I changed the fifth value in the NES header from 16 to 32:
Code:
.segment "HEADER"
.byte "NES", $1A
.byte 32
.byte 0
.byte %00010010
.byte "NES", $1A
.byte 32
.byte 0
.byte %00010010
I added new memory and segment entries in the config file.
Those are the corresponding original values:
Code:
PRG_ROM_BANK_0: type = ro, start = $8000, size = $4000, file = %O, fill = yes;
...
PRG_ROM_BANK_14: type = ro, start = $8000, size = $4000, file = %O, fill = yes;
PRG_ROM_BANK_FIX: type = ro, start = $C000, size = $4000, file = %O, fill = yes;
...
PRG_ROM_BANK_14: type = ro, start = $8000, size = $4000, file = %O, fill = yes;
PRG_ROM_BANK_FIX: type = ro, start = $C000, size = $4000, file = %O, fill = yes;
Code:
BANK_0_RESET: load = PRG_ROM_BANK_0, type = ro;
...
BANK_14_RESET: load = PRG_ROM_BANK_14, type = ro;
BANK_FIX_RESET: load = PRG_ROM_BANK_FIX, type = ro;
...
BANK_14_RESET: load = PRG_ROM_BANK_14, type = ro;
BANK_FIX_RESET: load = PRG_ROM_BANK_FIX, type = ro;
Code:
BANK_0_VECTORS: load = PRG_ROM_BANK_0, type = ro, start = $BFFA;
...
BANK_14_VECTORS: load = PRG_ROM_BANK_14, type = ro, start = $BFFA;
BANK_FIX_VECTORS: load = PRG_ROM_BANK_FIX, type = ro, start = $FFFA;
...
BANK_14_VECTORS: load = PRG_ROM_BANK_14, type = ro, start = $BFFA;
BANK_FIX_VECTORS: load = PRG_ROM_BANK_FIX, type = ro, start = $FFFA;
Here, I put bank 15-30 between 14 and fix.
Same with the code itself.
Original versions:
Code:
.segment "BANK_0_RESET"
RESET_START
...
.segment "BANK_14_RESET"
RESET_START
.segment "BANK_FIX_RESET"
Reset:
RESET_START
RESET_START
...
.segment "BANK_14_RESET"
RESET_START
.segment "BANK_FIX_RESET"
Reset:
RESET_START
Code:
.segment "BANK_0_VECTORS"
.addr Nmi, Reset, 0
...
.segment "BANK_14_VECTORS"
.addr Nmi, Reset, 0
.segment "BANK_FIX_VECTORS"
.addr Nmi, Reset, 0
.addr Nmi, Reset, 0
...
.segment "BANK_14_VECTORS"
.addr Nmi, Reset, 0
.segment "BANK_FIX_VECTORS"
.addr Nmi, Reset, 0
I added bank 15-30 between bank 14 and bank fix.
By the way, RESET_START is a macro that contains this code:
Code:
.macro RESET_START
SEI
CLD
LDX #$40
STX ApuFrameCounter
LDX #$FF
TXS
STX $8000
.endmacro
SEI
CLD
LDX #$40
STX ApuFrameCounter
LDX #$FF
TXS
STX $8000
.endmacro
All in all, the version with 16 banks works fine. But with 32 banks, it doesn't even start.
So, what else do I need to add, so that the code works?