Which assembler are you using again? If ca65, I have a project template that sets most of this up for you.
ca65, yes. Also, I'm trying to use MMC1.
To prevent IRQs from happening during the init code. True, the CPU already sets the interrupt priority bit to 1 (NMIs only) when coming out of reset, but having an explicit SEI makes the game more compatible with badly coded multicart menus that start the game with a JMP ($FFFC) but put the interrupt priority at 0 (CLI).
But why would one expect an interrupt? Anyways, do you clear the flag at the end of the init code then?
* * *
Here's my linker code at the moment.
Code: Select all
MEMORY {
# Header
HEADER: start = $0000, size = $0010;
# Ram
# ZEROPAGE: start = $0000, size = $0100;
# STACK: start = $0100, size = $0100;
RAM: start = $0200, size = $0600, fill = yes;
# Rom
LOWER_PROG_ROM: start = $8000, size = $2000, fill = yes;
LOWER_CHAR_ROM: start = $A000, size = $1000, fill = yes;
UPPER_CHAR_ROM: start = $B000, size = $1000, fill = yes;
UPPER_PROG_ROM: start = $C000, size = $4000, fill = yes;
}
#-------------------------------------------------------------------------------
SEGMENTS {
# Header
HEADER: load = HEADER, type = ro;
# Ram
# ZEROPAGE: load = ZEROPAGE, type = zp;
# STACK: load = STACK, type = rw;
RAM: load = RAM, type = rw;
# Rom
CODE: load = LOWER_PROG_ROM, type = ro;
FONT: load = LOWER_CHAR_ROM, type = ro;
TILES: load = UPPER_CHAR_ROM, type = ro;
MORE_CODE: load = UPPER_PROG_ROM, type = ro;
VECTORS: load = UPPER_PROG_ROM, type = ro, start = $FFFA;
}
#-------------------------------------------------------------------------------
Do I need to include the zeropage and stack segments even if nothing gets initialized there? Also, when I open it in FCEUX, I don't see any code at $8000 in the debugger, even though there should be.
And my header:
Code: Select all
.byte $4E, $45, $53, $1A ; "NES", eof
.byte 1 ; Number of 16 kB prog ROM Segments
.byte 1 ; Number of 8 kB char ROM Segments
.byte %00010001 ; Byte 6 (Mirroring (0xx0: Horizontal, 0xx1: Vertical), Ignored if the mapper controls mirroring.)
.byte %00000000 ; Byte 7
.byte 0 ; Number of 8 kB prog RAM Segments
.byte 0 ; Byte 9 (0: NTSC, 1: PAL)
.byte 0 ; Byte 10 (Sporadically Supported)
.byte 0, 0, 0, 0, 0 ; Filler
;-------------------------------------------------------------------------------
Does MMC1 even use 8kb PROG RAM?