Game Genie - when it compares memory value for replacement?

This is an archive of a topic from NESdev BBS, taken in mid-October 2019 before a server upgrade.
View original topic
Game Genie - when it compares memory value for replacement?
by on (#204061)
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
by on (#204062)
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
by on (#204174)
[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
by on (#204176)
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
by on (#204177)
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
by on (#204201)
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
by on (#204665)
Do you pronounce it "KshissioGenie" ?
Re: Game Genie - when it compares memory value for replaceme
by on (#204674)
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
by on (#204676)
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
by on (#204748)
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
by on (#204766)
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
by on (#204782)
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
by on (#204783)
They're all the same etymology.
https://en.wiktionary.org/wiki/genius#Etymology
https://en.wiktionary.org/wiki/jinn#Etymology
Re: Game Genie - when it compares memory value for replaceme
by on (#204788)
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.