How to patch Game Shark codes into an N64 ROM: This guide shows you how to patch an N64 Game Shark code into the ROM, so you will have the code permanently hacked in the ROM without having to enter the code. Written by: Tony Hedstrom 2/4/2020 http://codehut.gshi.org/ (no ads on this site) http://www.angelfire.com/games2/codehut/ This method will only work with assembly type Game Shark codes. It can be a little difficult to tell if a Game Shark code is an assembly type code or not. Game Shark codes that start with "81", and end in "2400" or "3000" (eg. 81053414 2400) are almost always an assembly type code. These are the type of codes we will focus on in this guide. Almost all of the N64 codes on my site are assembly type codes. Anytime you patch a code into an N64 ROM, you will change the checksum value for that ROM. Some emulators won't run a game with a bad checksum value. If you find that your game doesn't run after making changes to the ROM, it might be because of the checksum. There are a few programs that will fix the checksum for you: uCON64, Real N64 CRC Tool v2, etc. If you would prefer to just disable the checksum check altogether, I will explain how to do that at the end of this guide. Now on to the fun stuff... We will be using the Project64 emulator. I'm using ver 2.4.0.1107, but any version that allows you to view memory will work. In order to be able to view memory, you will need to click on "Options/Settings" and then uncheck "Hide Advanced Settings", then click on "Advanced" and check "Enable Debugger". This is very important: You will need to get a BattleTanx (U) [!].z64 ROM for our example (or whatever ROM you want to patch). The ROM must be a "z64" type ROM. I've found that most ROM sites have "n64" type ROMs. If you can't find the z64 type ROM, you will need to use a tool to convert the n64 ROM to z64 (I use a program called Tool64). Here's an easy way to tell what type ROM you have... Open up your ROM with a hex editor. If you can see the name of the game in plain text (on the right side with many hex editors), then you have the right type of ROM. For our example, we're going to patch a code I made for Battle Tanx into the ROM... 81099874 3000 Allows most weapons to shoot ultra fast (no reload delay). The main cannon can shoot 25 shells per second if you hold the button down. Most of the rest of the weapons will shoot as fast as you can press the button. As you can see, the code begins with 81 and ends with 3000, so we can be pretty certain it's an assembly code. Start Battle Tanx and as soon as the game has started, click on "Debugger". Now click on either "View Memory" or "Memory/View". Make sure that "Is VAddr" or "Virtual" is checked in the Memory window that just opened. In the upper left corner, we will enter in the address from our Game Shark code with one small change. Our code address is: 81099874. We just need to change the 81 at the beginning to 80, so our address is now 80099874. Enter 80099874 into the spot in the upper left corner. Copy the first 8 bytes (16 digits) of memory from the Memory window for use later in your hex editor. You may need to copy more or less than 8 bytes depending on how many matches you get in the hex editor. Ideally, you only want one match when searching with your hex editor. In our example, the first 8 bytes of memory are: AEE200048EE30000. Open up the Battle Tanx ROM with a hex editor and search for the 8 bytes we copied from the memory viewer (AEE200048EE30000). Some hex editors use the "Find" option for searching. Make sure you are searching for hex values. When you find a match, search again to make sure there is only one match. If you have more than one match, just add more numbers from the memory viewer in the emulator. In our example, there is only one match at ROM address 00029874. The next step will be what we've all been waiting for, to patch the Game Shark code into the ROM. Anytime your Game Shark code ends in 2400 or 3000, you'll need to change the first 4 bytes of your match to 00000000. Here's what the before and after looks like in our example: AEE200048EE30000 Before 000000008EE30000 After Save your changes and you're done (maybe). If you open up your patched Battle Tanx ROM, you'll find that your main gun will now fire off around 25 shells per second, and most of the other guns will shoot as fast as you can press the button. Yay! If your game doesn't run after patching, you probably need to fix the checksum. See the end of the guide for more info. When your code ends in 2400 or 3000, this is a shortened version of a NOP assembly instruction (NOP = No Operation). We need to change it to the regular long version for NOP (00000000) for it to work correctly in our patch. If the code you're patching is something else besides 2400 or 3000, you can probably just patch in the actual value from the code. I may add some more info about that later. ---------------------------------- Fixing checksum problems. Some emulators will play games just fine with a bad checksum, but some won't. If your game doesn't run after patching your ROM, you have a few options. You can use programs like uCON64 or Real N64 CRC Tool v2 to fix the checksum. Another option is to disable the checksum check by patching the ROM. This is useful if you can't get those programs working, or if you're planning on patching several codes, and you don't want to make a new checksum every time you patch in a new code. Nintendo uses a few different ways for doing checksum checks. There are two different methods explained below. The first method will work with almost all games. The second method will work with the few remaining games, or if method 1 doesn't work. Here is a list of games that will use method 2: Star Fox 64, Banjo-Kazooie, Paper Mario, Zelda: OoT, Zelda: Majora's Mask, Yoshi's Story, and F-Zero X. If the game you're patching is on this list, or if method 1 doesn't work, go to method 2. Method 1 (works on most games): If your game wasn't on that list, here is how to disable the checksum check (this method will work with most games). Open up your patched ROM with a hex editor and go to ROM address 00066C. Make sure that you see this number: 14E80006. Change 14E80006 to 00000000. Next, go to ROM address 000678. Make sure that you see this number: 16080003. Change 16080003 to 00000000. If you see different numbers than what I listed, do not make any changes and use method 2 instead (below). If everything looked good, save your changes and you're done (finally). If you remember from before, 00000000 is a NOP instruction. That is exactly what we're doing here. We're breaking the checksum check. You'll find that some emulators (like Project64) will notify you of an unknown CIC checksum, but the game will still run. Success! Method 2: This method is only used on a handful of games (from the list above), or if method 1 doesn't work. This method will almost certainly work on any game, however I can't guarantee that the first match for each of the searches will be the correct address. There is a very slight chance that a ROM could have the exact same number that we're searching for, but at a different address. I've tested it with the games listed and they will all work correctly with this method. All of the ROM addresses that we need to change to disable the checksum check will always be between 00063C & 000778. The chances of this method not working on a game are extremely slim, but figured I'd add the disclaimer just to be safe. :-) Open up your patched ROM with a hex editor. Search for 14E80006. At the first match, change 14E80006 to 00000000. Next, search for 16080003. At the first match, change 16080003 to 00000000. Save your changes and you're done. As I mentioned before, what we have done is changed a couple instructions to disable the checksum check. Your ROM should now work with most emulators. You may get an Unknown CIC checksum notification, but the game should still run. One last word, if you've disabled the checksum check and your game still won't run, you'll probably need to patch in the correct checksum value. Don't forget that there are programs out there that will do this for you. It is possible to maually patch in the correct checksum in needed (may add this info later).