News: 11 March 2016 - Forum Rules
Current Moderators - DarkSol, KingMike, MathOnNapkins, Azkadellia, Danke

Author Topic: Game Genie Guy!  (Read 38652 times)

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Game Genie Guy!
« on: January 20, 2014, 02:37:30 pm »
Game Genie Guy! is out.  :)

This is a small Windows utility for applying Game Genie codes to roms. This saves you the trouble of having to enter them each time the game is played. PC Engine and Master System are supported by using supplied codes.

http://srktt.com/files/GGGuy.exe



Usage:

1. Click the Browse button and select an unzipped Game Boy/Game Gear/Genesis/NES/SNES rom
 - The system dropdown should populate based on the file extension
 - The checksum box will also be enabled for non-NES games
2. Enter the desired codes, one per line. Multiple codes can be combined with +
3. Click Patch when all codes have been entered
4. Open the created 'File GG.rom' in an emulator to test

Checksum:

uCON64 is used for checksum correction. This is required if you are using flash carts. Most emulators are not bothered by it. I recommend the MinGW version because it has no dependencies.

Download ucon64-2.0.0-win32-mingw-bin.zip and extract ucon64.exe to same folder as GGGuy.exe:
http://ucon64.sourceforge.net/

Notes:

Master System and PC Engine support added. Only use the codes from the supplied text files. Pro Action Replay codes are not supported.

Not all codes like being applied in this fashion. Ex: Contra Hard Corps 99 lives work fine while infinite lives does not. If you do not get the desired result try another code.

8 digit NES codes are preferrable to 6. 8 digit codes contain validation that ensures the game is being patched in the right spot. 6 digit codes just go for it. Applying too many 6 digit codes can make a game crash. Try fewer codes if this occurs.

Use BIN or GEN roms for Genesis/Mega Drive. SMD roms are not supported.

Troubleshooting:

If you can't get a code to work try the following:

1. Try a different code. If another code works then the file is being patched properly.
2. Try a different rom - look for a good dump (!) or use Nointro roms.
3. Try it with CCCGP to see if it works. If it does let me know with the full rom name and code you are using. I'll check it out.
http://crackerscrap.com/projects.php

Why would I use this instead of CCCGP?

Tiny standalone file (60KB) - no DLLs/dependencies/registry writes
System auto-detection based on the rom's extension
Original files are copied to avoid overwriting: mario.nes - mario GG.nes
Auto-fixes checksum if uCON64 available
Always on top for easier pasting of codes from browser
Simplified code input doesn't require description
Full source code provided

Thanks to:

cracker: CCCGP
WyrmCorp: UGGCONV/source
Lazy Bastard: tutorials
John David Ratliff: tutorials
Tony Hedstrom: tutorials
Zazer: ggconv
Maël Hörz: HxD

References:

http://gamehacking.org/library/114
http://www.videogamesource.com/genie/gg/gghandbk/p12.html
http://www.ticalc.org/cgi-bin/zipview?92plus/asm/source/ggdecodesrc92.zip;snes.txt
http://romhack.wikia.com/wiki/SNES_header

Source code is provided. BCX and LCC are required to compile:

http://www.bcxbasic.com/
http://www.cs.virginia.edu/~lcc-win32/

January 20, 2014, 02:43:43 pm - (Auto Merged - Double Posts are not allowed before 7 days.)
Added another small feature since the OP was written. Multiple codes can be on a single line, separated with a + sign. This allow you to use codes like this without splitting them into multiple lines. Both " + " and  "+" are valid.

14   CB8A-64D5 + 108A-6405 + 3C8A-6465   Always score 100 points

« Last Edit: October 29, 2015, 07:54:02 pm by Kyle »

Special T

  • Hero Member
  • *****
  • Posts: 566
    • View Profile
Re: Game Genie Guy!
« Reply #1 on: January 20, 2014, 10:20:43 pm »
Nice job, if you haven't done so already you should add this to the utilities section   :thumbsup:

Gideon Zhi

  • IRC Staff
  • Hero Member
  • *****
  • Posts: 3469
    • View Profile
    • Aeon Genesis
Re: Game Genie Guy!
« Reply #2 on: January 20, 2014, 10:45:27 pm »
How does this handle codes that freeze a RAM location instead of a ROM location?

Revenant

  • Full Member
  • ***
  • Posts: 203
    • View Profile
Re: Game Genie Guy!
« Reply #3 on: January 20, 2014, 11:51:51 pm »
I don't know about the Genesis / Master System Game Genies, but the NES and SNES ones cannot modify RAM in the first place.

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #4 on: January 21, 2014, 06:12:17 am »
Game Genie doesn't do RAM. That's Pro Action Replay. PAR can do ROM but most of the codes for it are RAM since they are easier to make.

This is pretty much feature complete for what I set out to do. I'm open to suggestions. A guy at Gamehacking said I should have it link up to their site but I don't think I'm that ambitious. I had another suggestion for N64. The codes for it are almost all RAM. Same with GBA etc.
« Last Edit: January 21, 2014, 06:31:42 am by Kyle »

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Game Genie Guy!
« Reply #5 on: January 21, 2014, 08:43:38 pm »
Really cool.  I noticed a bunch of emulators automatically save codes for games and auto-load them when I load the rom so I don't have to re-enter them every time.  Sometimes I use a game genie code to test something and then I forget to disable it when I reload the rom and wonder why my hex changes don't work.

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #6 on: January 21, 2014, 08:56:12 pm »
Thanks Drakon. My reasoning for this is that I don't play on emulators at all (well, maybe to confirm a code is working). Otherwise it's all real consoles, flash carts and CRT via SCART/component. I spend dumb monies on hardware. I have tons of actual carts as well but this is for fun.

Added Nintendo (Alt) and Game Boy/Gear (Alt) options. With 6 digit codes this patches only the first offset rather than all potential offsets. If the default doesn't work or cause the game to crash try this.
« Last Edit: January 22, 2014, 07:42:08 am by Kyle »

Drakon

  • Sr. Member
  • ****
  • Posts: 277
    • View Profile
    • 16 Bit Gamer
Re: Game Genie Guy!
« Reply #7 on: January 25, 2014, 10:10:00 am »
Oh I think I misunderstood what your software does, it hard codes the game genie code into the rom?  I use real hardware too I don't like romhacks that don't run on real hardware.  This is definitely a time saver I've hex edited game genie codes into games before and it took a little effort.

henke37

  • Hero Member
  • *****
  • Posts: 643
    • View Profile
Re: Game Genie Guy!
« Reply #8 on: January 25, 2014, 10:14:12 am »
Such a pity that some cheat codes does rather fancy shenanigans. Flow control and pointers!

KingMike

  • Forum Moderator
  • Hero Member
  • *****
  • Posts: 6744
  • *sigh* A changed avatar. Big deal.
    • View Profile
Re: Game Genie Guy!
« Reply #9 on: January 25, 2014, 10:51:40 am »
Added Nintendo (Alt) and Game Boy/Gear (Alt) options. With 6 digit codes this patches only the first offset rather than all potential offsets. If the default doesn't work or cause the game to crash try this.

I want to guess those codes were intended only to be used on mapperless games (32KB ROMs for GB/GG. For NES, only the PRG-ROM is affected by the GG, so a 6-letter code would only be safe on games with no PRG switching: those with up to 32KB PRG).
"My watch says 30 chickens" Google, 2018

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #10 on: January 28, 2014, 04:34:20 am »
I want to guess those codes were intended only to be used on mapperless games (32KB ROMs for GB/GG. For NES, only the PRG-ROM is affected by the GG, so a 6-letter code would only be safe on games with no PRG switching: those with up to 32KB PRG).
That's a good thought. Maybe I can revise this so the method is based on the rom's file size and not require two options.

Zoinkity

  • Hero Member
  • *****
  • Posts: 557
    • View Profile
Re: Game Genie Guy!
« Reply #11 on: January 28, 2014, 01:25:41 pm »
Sort of surprising nobody's done this before, honestly.  Great job!

(Forgive me if I wasn't reading closely enough to realize this is what it already does)
Wasn't the point of the extra two bytes to replace only when the value matches?  You could always test the offset in each bank until you get a hit, then if there's more than one ask for disambiguation.

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #12 on: January 29, 2014, 07:13:46 am »
To be fair there's another utility called CCCGP that does this. This is my take on it.

I reworked the NES 6 digit code to be a file size check. Games 48kb and under get the first offset and larger games get patched repeatedly.

It seems like it's better overall to just use 8 digit codes. There are only a handful of games in the official book that get 6 digit codes.

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #13 on: March 19, 2014, 07:53:31 pm »
I fixed a SNES bug and added IPS creation.
http://srktt.com/files/GGGuy.zip




celestinx

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: Game Genie Guy!
« Reply #14 on: May 13, 2014, 02:29:26 pm »
Great program, i got them working for Genesis, however, i could not get some Mastersystem SMS games to work.

Scramble Spirits (Europe) for example, i want infinite lives, but no codes seem to work.

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #15 on: June 10, 2014, 07:15:14 am »
Added IPS patching via uCON64. I've tested it against a number of rom hacks. If you have issues let me know.

Click browse and open an IPS file
Choose your rom from the second prompt

http://srktt.com/files/GGGuy.zip

southbird

  • Jr. Member
  • **
  • Posts: 32
  • Super Mario Bros. 3Mix
    • View Profile
    • Sonic Epoch, also home of 3Mix
Re: Game Genie Guy!
« Reply #16 on: June 12, 2014, 10:45:25 am »
To be fair there's another utility called CCCGP that does this. This is my take on it.

I reworked the NES 6 digit code to be a file size check. Games 48kb and under get the first offset and larger games get patched repeatedly.

It seems like it's better overall to just use 8 digit codes. There are only a handful of games in the official book that get 6 digit codes.

Just wanted to weigh in on this issue, though I realize it's a few months ago :P Regarding NES and 6 vs 8:

Yes, obviously a 6 letter code could patch several areas of a ROM, but it needs context. As you well know, GG treats 6 letter codes as "any time the console is requesting a byte from address X, send them byte value Y intead." And an 8 letter code is "any time the console is requesting a byte from address X, and the cart is returning byte Y, return byte Z instead." (The "compare" method.)

Any time we have a game that's using a mapper that modifies the 32KB ROM space (and almost all of them do), if a code is intending to patch the dynamic part of that window, it best be an 8 letter code or there could be severe side effects. I would imagine that most of the originally released GG codes in the books were 6 letters for fixed window games and 8 letters for complex mapper games, but I haven't checked.

But here's where it gets sketchy: For example, Super Mario Bros. 3 uses an MMC3, which means that the 32KB ROM space is broken up into 4 windows, where two are fixed and two are dynamic.  The MMC3 always locks $E000-$FFFF to the last 8KB bank (at least the end of this address area needs to be predictable to support the vectors.) Then the programmer has an option about choosing a second fixed bank. In SMB3's case, they use $8000-$9FFF as the second fixed space.

Okay, so where I'm going with this is, a 6 letter GG code for SMB3 needs context -- if the 6 letter code is patching $8000-$9FFF or $E000-$FFFF, it should only be applied once, and only to (starting from 0) bank 30 (i.e. second-to-last bank) or 31 (last bank), respectively. But since there's an option in the MMC3 to make $C000-$DFFF fixed instead (SMB3 doesn't use this), so a different MMC3 game should have the above rule effect this address space instead. So a 6 letter code applied to a fixed region of a mapper-based game is in fact valid and will only target a particular bank in the ROM. Sometimes you can predict what this is (e.g. if a ROM is using an MMC3, you KNOW where $E000-$FFFF codes will land), and sometimes you can't (e.g. any other region in an MMC3 game, unless you know the rules of said game.)

In short, some 6 letter codes effect a fixed region even when using a mapper and thus ARE valid (in the sense there's no unintended patching and the code is predictable) for those games. Any 6 letter code in SMB3 effecting $8000-$9FFF or $E000-$FFFF would actually be valid and would only effect the end of the ROM. (SMB3 never puts bank 30 or 31 into the dynamic space, which would be silly anyway since the addressing would be wrong.)

What it boils down to is, the best response we can get from your software is one of the following:
  • Never allow applying a 6 letter GG code to any game where the 32KB ROM window can change (check the mapper for very specific ones on a short list)
  • Write code for each known mapper to allow a 6 letter GG code to apply when it's predictable (e.g. MMC3 $E000-$FFFF), but deny user when it's not
  • Write code for each known mapper to allow a 6 letter GG code to apply when it's predictable, and when it's not allow user to select some kind of override option (getting complex, and would require user to be technically-aware.)
  • Write code for each known mapper to allow a 6 letter GG code to apply when it's predictable (e.g. MMC3 $E000-$FFFF), consult some kind of database of "game rules" (e.g. for SMB3, $8000-$9FFF or $E000-$FFFF are predictable, other regions overwrite all banks except 30 and 31), and finally deny user if there's no further info

Technically speaking, an 8 letter code is also subject to this, though on a lower impact level. It is possible (though less likely due to "compare") that another bank that would never be in the address window specified by the code is erroneously targeted due to the software not having context.

Kyle

  • Jr. Member
  • **
  • Posts: 24
    • View Profile
Re: Game Genie Guy!
« Reply #17 on: June 12, 2014, 10:53:57 am »
There are actually only 2 or 3 games in the entire NES codebook that use 6 character codes. They are much more commonly made by hobbyists. I've converted a number of 6 to 8s myself so the result won't be so wonky. I appreciate all of the tech insight.

southbird

  • Jr. Member
  • **
  • Posts: 32
  • Super Mario Bros. 3Mix
    • View Profile
    • Sonic Epoch, also home of 3Mix
Re: Game Genie Guy!
« Reply #18 on: June 12, 2014, 05:40:34 pm »
There are actually only 2 or 3 games in the entire NES codebook that use 6 character codes. They are much more commonly made by hobbyists. I've converted a number of 6 to 8s myself so the result won't be so wonky. I appreciate all of the tech insight.

Well, I have some official books and ... you're basically right! XD But yeah, it has more to do with that occasional person who DOES try to use them, the software would best be able to handle it correctly to avoid a certain amount of folks who will just complain it simply doesn't work right. Or that's my opinion anyway.

Entroper

  • Jr. Member
  • **
  • Posts: 7
    • View Profile
Re: Game Genie Guy!
« Reply #19 on: July 22, 2014, 01:06:19 am »
There are actually only 2 or 3 games in the entire NES codebook that use 6 character codes. They are much more commonly made by hobbyists. I've converted a number of 6 to 8s myself so the result won't be so wonky. I appreciate all of the tech insight.

Is there a utility for this, or any other way of doing so easily? I want to combine some 6 digit codes for Metroid (NES) but can't do so without breaking the game.