Error in F-1 Race (1984)

Discuss emulation of the Nintendo Entertainment System and Famicom.

Moderator: Moderators

User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Error in F-1 Race (1984)

Post by Memblers »

It is possible to soft-mod the Game Genie to freeze RAM locations, and I've done it myself, but it won't work with every game.

Find an unused RAM location, if possible. You need a minimum of 10 bytes. Note the address. Find the game's NMI vector, note it. Find code in the game that clears RAM. If possible, see if it can be disabled with a single byte patch.

1) replace Game Genie EPROM
2) clear NES RAM
3) put an NMI routine at the unused RAM location, and have it write your frozen RAM location. Instead of RTI, ends with JMP absolute to the cart's (previously noted) NMI vector.
4) use the Game Genie's first 2 wishes to change the NMI vector, pointing it to your replacement in RAM.
5) use the 3rd wish to patch the game's RAM clearing routine, preserving your code in RAM.

The 10 byte NMI routine, for freezing one RAM location is like:

Code: Select all

 pha
 lda #$XX
 sta $YYYY
 pla
 jmp real_game_NMI
Note that if you change the Game Genie ROM, never leave any of the GG's registers initialized. If you do, the chip seems to become damaged permanently after a short period of time. Several days to weeks, it seemed like. I fried a few, until I started doing it right.
Bavi_H
Posts: 193
Joined: Sun Mar 03, 2013 1:52 am
Location: Texas, USA
Contact:

Re: Error in F-1 Race (1984)

Post by Bavi_H »

Memblers wrote: Sun May 28, 2023 7:16 pmNote that if you change the Game Genie ROM, never leave any of the GG's registers initialized. If you do, the chip seems to become damaged permanently after a short period of time. Several days to weeks, it seemed like. I fried a few, until I started doing it right.
I find this interesting. Can you provide more details what you mean by "leaving any of the Game Genie's registers initialized"?

In other words, if I understand you correctly, it sounds like you originally omitted some of the Game Genie's original register writes in your customized code, but then you discovered this seemed to damage the Game Genie somehow. Can you remember exactly which register writes you omitted that caused the problem?


Game Genie Register Writes:

Code: Select all

FFF0  00000000
FFF1  00000000
FFF0  00000000
800C  RRRRRRRR  Code 3 replace value
800B  CCCCCCCC    compare value
800A  AAAAAAAA    address low
8009  0AAAAAAA    address high
8008  RRRRRRRR  Code 2 replace value
8007  CCCCCCCC    compare value
8006  AAAAAAAA    address low
8005  0AAAAAAA    address high
8004  RRRRRRRR  Code 1 replace value
8003  CCCCCCCC    compare value
8002  AAAAAAAA    address low
8001  0AAAAAAA    address high
8000  0DDDCCC1  Disable code 3/2/1, Compare enable in code 3/2/1
8000  00000000
Sources:
Re: game genie
Re: Docs on game genie hardware
NESdev Wiki - Game Genie
User avatar
Memblers
Site Admin
Posts: 4044
Joined: Mon Sep 20, 2004 6:04 am
Location: Indianapolis
Contact:

Re: Error in F-1 Race (1984)

Post by Memblers »

Bavi_H wrote: Sun May 28, 2023 9:39 pm
Memblers wrote: Sun May 28, 2023 7:16 pmNote that if you change the Game Genie ROM, never leave any of the GG's registers initialized. If you do, the chip seems to become damaged permanently after a short period of time. Several days to weeks, it seemed like. I fried a few, until I started doing it right.
I find this interesting. Can you provide more details what you mean by "leaving any of the Game Genie's registers initialized"?

In other words, if I understand you correctly, it sounds like you originally omitted some of the Game Genie's original register writes in your customized code, but then you discovered this seemed to damage the Game Genie somehow. Can you remember exactly which register writes you omitted that caused the problem?
That's correct. I was able to find an older copy of some source that includes the error. I left out writes to $8001-$800C.

Code: Select all

        lda #0
        sta $FFF0
        jsr gg_delay
        sta $FFF1
        sta gg_delay
        sta $FFF0
        sta gg_delay
        
        (unrelated stuff)

        lda #%01110001
        sta $8000
        lda #0
        sta $8000        
User avatar
krzysiobal
Posts: 1037
Joined: Sun Jun 12, 2011 12:06 pm
Location: Poland
Contact:

Re: Error in F-1 Race (1984)

Post by krzysiobal »

If you are using chip-based (non Nes-on-chip) console, you can make yourself an improved game genie cartridge that can also override RAM or PPU read addresses that will work with any game. I will write some longer article in that topic soon.
Image My website: http://krzysiobal.com | Image My NES/FC flashcart: http://krzysiocart.com
Post Reply