Converting from an N64 patch to GameShark pro code.

OmarElsayed

Active Member
OP
Newcomer
Joined
Aug 29, 2019
Messages
36
Trophies
0
Age
20
XP
180
Country
Canada
Is it possible if I made a patch for simple changes in an N64 ROM to convert that to hex code I can use with an N64 GameShark pro? Is there any software that does this?
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
Did we not cover this in https://gbatemp.net/threads/question-on-n64-gameshark-and-patches.626326/ ?

You have three options maybe.

1) Hope what few ROM edit type codes are available (and it is a tiny amount, usually aimed at dodging issues with CIC and anti piracy) are enough to do what you want, and likely not as you probably need them to boot and even if not it would be.
2) If the binary is copied to memory for some reason then you can make a code to edit that as at that point it is basically just RAM editing. You might also be able to inject some code via a RAM write and forcibly branch to it but that is a rather more advanced trick (well beyond any simple program).
3) If there is some data in memory you are editing you could check to see if that is written (or something else that is happening at the same time) and then have the memory edited instead. Can be for infinite potions as it were, and might be able to trouble graphics and text.
3a) If it is something you could do with an edited save (might not have infinite money but 999999999 is almost as good sort of thing) you might be able to do that.

https://doc.kodewerx.org/hacking_n64.html covers the code types available. The N64 is rather more primitive than what you might have seen in later devices but you do have options to read memory (which could include key presses, some devices even having a button on it you can press to activate things) and write accordingly which is enough to get some of those done.

All of this is also solved by get a decent flash cart (though the everdrive stuff is a bit expensive these days) or use an emulator.
Equally most people go the other way and want cheats patched into the ROM so they can run it on a flash cart without cheat support or not have to fiddle with it.
 

OmarElsayed

Active Member
OP
Newcomer
Joined
Aug 29, 2019
Messages
36
Trophies
0
Age
20
XP
180
Country
Canada
Did we not cover this in https://gbatemp.net/threads/question-on-n64-gameshark-and-patches.626326/ ?

You have three options maybe.

1) Hope what few ROM edit type codes are available (and it is a tiny amount, usually aimed at dodging issues with CIC and anti piracy) are enough to do what you want, and likely not as you probably need them to boot and even if not it would be.
2) If the binary is copied to memory for some reason then you can make a code to edit that as at that point it is basically just RAM editing. You might also be able to inject some code via a RAM write and forcibly branch to it but that is a rather more advanced trick (well beyond any simple program).
3) If there is some data in memory you are editing you could check to see if that is written (or something else that is happening at the same time) and then have the memory edited instead. Can be for infinite potions as it were, and might be able to trouble graphics and text.
3a) If it is something you could do with an edited save (might not have infinite money but 999999999 is almost as good sort of thing) you might be able to do that.

https://doc.kodewerx.org/hacking_n64.html covers the code types available. The N64 is rather more primitive than what you might have seen in later devices but you do have options to read memory (which could include key presses, some devices even having a button on it you can press to activate things) and write accordingly which is enough to get some of those done.

All of this is also solved by get a decent flash cart (though the everdrive stuff is a bit expensive these days) or use an emulator.
Equally most people go the other way and want cheats patched into the ROM so they can run it on a flash cart without cheat support or not have to fiddle with it.
Thank you. I already have a flash cart, I just wanted to see some stuff using authentic carts and a GameShark pro. Sorry for the second question, my original question was about applying patches using the GameShark and this question is about making codes from patches. Know anyone by any chance I can commission to make codes? Or do you know where I can get started for options 2 or 3? (I'm kind of new to this).
 

FAST6191

Techromancer
Editorial Team
Joined
Nov 21, 2005
Messages
36,798
Trophies
3
XP
28,321
Country
United Kingdom
There might be some out there. Paying hackers is always a fun one on multiple fronts, though not as bad for cheats. I don't know where you might go for N64 stuff these days.

2) You can usually find the code (as in what the CPU runs) for a system easily enough in the ROM, and if you edited it for your hack then you already know. Find where it (or the relevant fragment) sits in RAM by checking in an emulator while it is running.
From there it is easy enough to convert to edit where it lands in memory.
The subverting an existing one is almost the mirror of one of the main methods of what people do to hardpatch cheats. Here the code you want to edit might not be running in memory that the gameshark can reach out and touch but that does not matter because something is, you can edit that to instead branch/jump to another area of memory (find a free segment, see if you can use an expansion pack, overwrite something that is not necessary... dealer's choice there) which you loaded up with your own lines of code to do something more fun (overwrite graphics, change text, perform a cheat that might be marginally more complex than you care to encode in the gameshark engine).

3) Where code landing in memory is debatable depending upon the system (the GBA has a tiny bit but mostly not, the DS does it by default but also swaps things out, anything from a cassette, floppy disc or optical disc will, the N64 is just on the edge though so less than some but not unheard of) then the non code data landing in memory is fairly par for the course.
If say the text gets copied (possibly even decompressed) from the ROM to memory and then operated upon you can make a cheat to watch for the unique combo of that data (or just something that happens to also be happening at the same time - why look for level data and find the unique aspect of it when the game might have a level counter on screen you can search for like any other high score, timer, lives, mana, damage boost... cheat, or something deeper but never the less directly connected and unique to it) and fire off a memory overwrite cheat as a result. This is what the conditional cheats towards the end of the cheat device sections/code types on the enhacklopedia link are about;"If the byte at XXXXXXX is equal to ??, then the code on the next line is executed." being the classic IF ELSE loop that every intro to programming in whatever language you care to pick guide will take time to cover.

3a) was just noting that not everything has to be all infinite all the time. There are often many ways to achieve a result or an acceptable outcome.

2 and 3 can also be combined and you can have some of your own code attempt to rewrite data it sees coming in to be something else. Most would normally save this for things they can compress down or are so repetitive that code can do in a few lines what might take a more basic cheat several hundred (have say 20 characters in a RPG party, having individual codes to give max stats might take 20xhowever many stats the game tracks lines, or "for this section write 255 in every line" in far fewer, this being called a slide code when you encounter it on later systems but you are not limited to just them as that is just an example).

Basically what you describe has happened on many systems, and maybe if I was building a gameshark in the current space year for the N64 it would have a nice chunk of those features because it is almost easier to include them than not (the limiting factor is largely the hardware on the cart itself, what would have been ridiculously expensive back in the N64 era would today be primitive you might have hard times to even get something as basic as). If you are going to be limited to the styles of cheats that were present in the rather more primitive options of the time then it is going to be harder, if not impossible.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    Veho @ Veho: Firefox users be like "look at what they have to do to mimic a fraction of our power."