KingMike
03-06-2003, 07:53 PM
Ok, I'm working on an NES game (Famicom Board Game: Tetsudo-Oh) (mapper #3, which is CNROM (I think), which only switches the CHR by writing a value to anywhere between 8000 and FFFF).
I'm trying to change the ROM to MMC1, so I can (hopefully) have multiple PRG pages, which means all the text space I'll need.
AFAIK, MMC1 needs to have $80 written to any register before writing actual data to a register, and the 5-bit values must be written one bit at a time.
Mainly, the problem is that I killed the graphics with this. I can tell by the sound that the game still runs, but no graphics. Am I missing some ASM code to re-activate the graphics?
Here's how I initialize it.
00/D720: A9 80 LDA #$80 ;need to write #$80
00/D722: 20 70 D7 JSR $D770 ;routine to write the bits
00/D725: A9 0F LDA #$0E ;data to be written to reg.0
;00001110 =
;8KB CHR pages
;16KB PRG switching
;page $C000 page swap
;H/V mirroring \Tried messing with these two, got nothing.
;vertical mirroring /
00/D727: 20 70 D7 JSR $D770
00/D72A: A2 2F LDX #$2F ;code overwritten
00/D72C: 9A TXS ;by JMP code to this function, after
00/D72D: A9 00 LDA #$00 ;initialization code
00/D72F: 4C 1E 80 JMP $801E ;at game begin
;---CHR page change----
00/D732: A9 80 LDA #$80 ;must write $80 to reg.0
00/D734: 20 70 D7 JSR $D770
00/D737: B9 23 83 LDA $8323,Y ;reading page-change data (what original game had)
00/D73A: 8D 00 A0 STA $A000 ;must write 5 bits
00/D73D: 4A LSR ;one bit at a time
00/D73E: 8D 00 A0 STA $A000 ;and writing to $A000 is supposed to control which
00/D741: 4A LSR ;page of CHR is in memory
00/D742: 8D 00 A0 STA $A000
00/D745: 4A LSR
00/D746: 8D 00 A0 STA $A000
00/D749: 4A LSR
00/D74A: 8D 00 A0 STA $A000
00/D74D: 4C 20 83 JMP $8320
00/D750: 00 00 BRK $00
00/D752: 00 00 BRK $00
00/D754: 00 00 BRK $00
00/D756: 00 00 BRK $00
00/D758: 00 00 BRK $00
00/D75A: 00 00 BRK $00
00/D75C: 00 00 BRK $00
00/D75E: 00 00 BRK $00
00/D760: 00 00 BRK $00
00/D762: 00 00 BRK $00
00/D764: 00 00 BRK $00
00/D766: 00 00 BRK $00
00/D768: 00 00 BRK $00
00/D76A: 00 00 BRK $00
00/D76C: 00 00 BRK $00
00/D76E: 00 00 BRK $00
00/D770: 8D 00 80 STA $8000 ;function to write 5 bit values to register 0
00/D773: 4A LSR
00/D774: 8D 00 80 STA $8000
00/D777: 4A LSR
00/D778: 8D 00 80 STA $8000
00/D77B: 4A LSR
00/D77C: 8D 00 80 STA $8000
00/D77F: 4A LSR
00/D780: 8D 00 80 STA $8000
00/D783: 60 RTS
00/D784: 00 00 BRK $00
00/D786: 00 00 BRK $00
00/D788: 00 00 BRK $00
00/D78A: 00 00 BRK $00
00/D78C: 00 00 BRK $00
00/D78E: 00 00 BRK $00
Used info at nesdev.parodius.com. Or is there a different, less evil mapper I should try to change it to?
Thanks to anybody with help.
I'm trying to change the ROM to MMC1, so I can (hopefully) have multiple PRG pages, which means all the text space I'll need.
AFAIK, MMC1 needs to have $80 written to any register before writing actual data to a register, and the 5-bit values must be written one bit at a time.
Mainly, the problem is that I killed the graphics with this. I can tell by the sound that the game still runs, but no graphics. Am I missing some ASM code to re-activate the graphics?
Here's how I initialize it.
00/D720: A9 80 LDA #$80 ;need to write #$80
00/D722: 20 70 D7 JSR $D770 ;routine to write the bits
00/D725: A9 0F LDA #$0E ;data to be written to reg.0
;00001110 =
;8KB CHR pages
;16KB PRG switching
;page $C000 page swap
;H/V mirroring \Tried messing with these two, got nothing.
;vertical mirroring /
00/D727: 20 70 D7 JSR $D770
00/D72A: A2 2F LDX #$2F ;code overwritten
00/D72C: 9A TXS ;by JMP code to this function, after
00/D72D: A9 00 LDA #$00 ;initialization code
00/D72F: 4C 1E 80 JMP $801E ;at game begin
;---CHR page change----
00/D732: A9 80 LDA #$80 ;must write $80 to reg.0
00/D734: 20 70 D7 JSR $D770
00/D737: B9 23 83 LDA $8323,Y ;reading page-change data (what original game had)
00/D73A: 8D 00 A0 STA $A000 ;must write 5 bits
00/D73D: 4A LSR ;one bit at a time
00/D73E: 8D 00 A0 STA $A000 ;and writing to $A000 is supposed to control which
00/D741: 4A LSR ;page of CHR is in memory
00/D742: 8D 00 A0 STA $A000
00/D745: 4A LSR
00/D746: 8D 00 A0 STA $A000
00/D749: 4A LSR
00/D74A: 8D 00 A0 STA $A000
00/D74D: 4C 20 83 JMP $8320
00/D750: 00 00 BRK $00
00/D752: 00 00 BRK $00
00/D754: 00 00 BRK $00
00/D756: 00 00 BRK $00
00/D758: 00 00 BRK $00
00/D75A: 00 00 BRK $00
00/D75C: 00 00 BRK $00
00/D75E: 00 00 BRK $00
00/D760: 00 00 BRK $00
00/D762: 00 00 BRK $00
00/D764: 00 00 BRK $00
00/D766: 00 00 BRK $00
00/D768: 00 00 BRK $00
00/D76A: 00 00 BRK $00
00/D76C: 00 00 BRK $00
00/D76E: 00 00 BRK $00
00/D770: 8D 00 80 STA $8000 ;function to write 5 bit values to register 0
00/D773: 4A LSR
00/D774: 8D 00 80 STA $8000
00/D777: 4A LSR
00/D778: 8D 00 80 STA $8000
00/D77B: 4A LSR
00/D77C: 8D 00 80 STA $8000
00/D77F: 4A LSR
00/D780: 8D 00 80 STA $8000
00/D783: 60 RTS
00/D784: 00 00 BRK $00
00/D786: 00 00 BRK $00
00/D788: 00 00 BRK $00
00/D78A: 00 00 BRK $00
00/D78C: 00 00 BRK $00
00/D78E: 00 00 BRK $00
Used info at nesdev.parodius.com. Or is there a different, less evil mapper I should try to change it to?
Thanks to anybody with help.