Page 1 of 1

Game Genie - when it compares memory value for replacement?

Posted: Wed Sep 06, 2017 3:25 pm
by krzysiobal
I am in a way of building KrzysioGenie - an utility cartridge which will offer features of Game Genie (modyfying ROM value - for example in order to cheat) and Action Replay (save/load game state into micro SD card).
Image Image Image Image Image

When I first read about the idea how Gallob's Game Genie works, it looked amazingly simple & briliant to me.
I rev-ed its PCB: Image
Those resistor between gallob's data bus and cpu data bus are quite weird to me, but maybe gallob's data bus is not tristate and that's the reason.

However, the process of replacing memory value WHEN DATA COMPARISION IS TURNED ON is unclear to me. What is unclear is when Game Genie's chip detect that there is right moment to read CPU's data & address bus and if they match, turn off cartridge's PRG-ROM and put his own value on data bus?

*1. It can't do that on falling edge of ROMSEL because cartridge's PRG-ROM has not placed data on the bus yet
*2. It can't do that on rising edge of ROMSEL because even if it put his own value on data bus and disabled cartridge's PRG-ROM memory, it would take tens of ns for the memory to turn off, but CPU fetches data almost immediatelly after falling edge of M2 (and rising of ROMSEL) so it would fetch garbage,
*3. it can't do that asynchronously when ROMSEL is low because there data bus is unstable and it could detect transient state on data bus as a final data and start process of replacing it,
*4. it also can't do that after some fixed amount of time after falling edge of ROMSEL because there is no external timer components (R/C) nor faster crystal oscillator, but maybe they are inside gallob's chip?

Or maybe it does 2) and the aim of the resistor is to minimize current flow upon bus conflict (when memory hasn't fully turn off yet but game genie put its values on?)

Re: Game Genie - when it compares memory value for replaceme

Posted: Wed Sep 06, 2017 3:57 pm
by lidnariq
The functionality of the NES Game Genie is described by expired US patent 5112051 ... it looks like the data comparison is an asynchronous process.

Re: Game Genie - when it compares memory value for replaceme

Posted: Fri Sep 08, 2017 12:00 pm
by Myask
[quote="krzysiobal]I am in a way of building KrzysioGenie - an utility cartridge which will offer features of Game Genie (modyfying ROM value - for example in order to cheat) and Action Replay (save/load game state into micro SD card).[/quote]
How do you intend to register the mapper, for knowing what to watch for to save and restore bankregs, etc.?

Re: Game Genie - when it compares memory value for replaceme

Posted: Fri Sep 08, 2017 12:15 pm
by krzysiobal
1. GameGenie can calculate crc of $e000-$ffff which is almost always tied to some known bank at powerup of every mapper and then check into hardcoded database what mapper is that,
or
2. if crc does not match any known game, user can chose mapper from list.

Re: Game Genie - when it compares memory value for replaceme

Posted: Fri Sep 08, 2017 12:34 pm
by thefox
3. You should be able to detect most mappers by probing the registers and checking what happens.

Re: Game Genie - when it compares memory value for replaceme

Posted: Fri Sep 08, 2017 7:42 pm
by Memblers
I don't have any good answer to the question, but I wanted to say this project looks awesome. Game Genie is one of my favorite hardware devices of any kind, so it's really cool to see a more modernized one coming to the Famicom. I'm working on a similar type of device, but I took the path of having 2 fully separate data buses on the logic, so it flows through it.

You've probably also thought of Pro Action Replay codes, too (Game Action Replay is the savestate one). But if not, the PAR I think it just takes over the NMI vector, then you can run your own code to force a variable to be whatever value.

I also was thinking the $E000-$FFFF CRC should work well enough, but there's a good amount of games that do start with a random 32kB bank (including a certain revision of MMC1). So the most compatible way would be to either:
A) detect the mapper first, then set it to the last bank, and then CRC.
or
B) have a CRC match for every possible startup bank, if you don't mind growing the comparison list.

Re: Game Genie - when it compares memory value for replaceme

Posted: Sat Sep 16, 2017 1:38 pm
by B00daW
Do you pronounce it "KshissioGenie" ?

Re: Game Genie - when it compares memory value for replaceme

Posted: Sat Sep 16, 2017 3:23 pm
by Bregalad
B00daW wrote:Do you pronounce it "KshissioGenie" ?
Polish rz is normally pronounced "j", but becomes "sh" after voiceless consonants.
Polish Y is between i and e, but I find it to be closer to e.
So it's pronunced ksheshio-genie.

I still wonder wether the "g" is supposed to be plosive (german/polish style) as in "game" or affricate (english/french style) as in "giant". Since "genie" is a valud word in all those languages pronounced differently we can't know for sure.

Re: Game Genie - when it compares memory value for replaceme

Posted: Sat Sep 16, 2017 3:41 pm
by tepples
Anyone who has watched Disney's Aladdin with English audio would know "genie" keeps the affricate pronunication of Arabic "djinn". Thus it's the "soft" G as in ゲームジニー (geemu-jinii).

Re: Game Genie - when it compares memory value for replaceme

Posted: Mon Sep 18, 2017 3:53 am
by Bregalad
tepples wrote:Anyone who has watched Disney's Aladdin with English audio would know "genie" keeps the affricate pronunication of Arabic "djinn".
Does this means that Djins from the game series Golden Sun on GBA are actually Genies ?

Re: Game Genie - when it compares memory value for replaceme

Posted: Mon Sep 18, 2017 12:57 pm
by rainwarrior
Bregalad wrote:Does this means that Djins from the game series Golden Sun on GBA are actually Genies ?
"djinn" and "genie" should normally be synonyms, I believe.

Even though the Golden Sun ones don't look like the stereotypical genie, they seem to have the "elemental spirit" idea that djinn are usually associated with in RPG/Fantasy?

Re: Game Genie - when it compares memory value for replaceme

Posted: Mon Sep 18, 2017 6:58 pm
by Fisher
Interesting...
For me, genie, djin and genius were synonymous.
Maybe it's because my mother language. :roll:
Now with a little research, seems that genie is the good guy, djin is the bad guy and genius is the smart guy.
It may be a wrong assumption, at least the genie vs djin part.

Re: Game Genie - when it compares memory value for replaceme

Posted: Mon Sep 18, 2017 7:21 pm
by lidnariq

Re: Game Genie - when it compares memory value for replaceme

Posted: Mon Sep 18, 2017 11:16 pm
by Bregalad
Fisher wrote:Interesting...
For me, genie, djin and genius were synonymous.
Maybe it's because my mother language. :roll:
Now with a little research, seems that genie is the good guy, djin is the bad guy and genius is the smart guy.
It may be a wrong assumption, at least the genie vs djin part.
Genius is just the english equivalent of Gernie in the other languages. Djin seems to be the arabic equivalent.