Converting from an N64 patch to GameShark pro code.

OmarElsayed

Active Member
OP
Newcomer
Joined
Aug 29, 2019
Messages
36
Trophies
0
Age
21
XP
190
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,348
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
21
XP
190
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,348
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
  • K3Nv2 @ K3Nv2:
    It must be the 1st already
  • BakerMan @ BakerMan:
    1st of what?
  • BakerMan @ BakerMan:
    may?
  • K3Nv2 @ K3Nv2:
    Oh yeah it's in September
  • Xdqwerty @ Xdqwerty:
    @BakerMan, yea i think its different
  • BakerMan @ BakerMan:
    ok, because here it's in september, right before the fuckin school year starts
  • Xdqwerty @ Xdqwerty:
    good night
  • BakerMan @ BakerMan:
    as to you
  • K3Nv2 @ K3Nv2:
    How do you know if the night will be good when you're asleep
  • BakerMan @ BakerMan:
    because i didn't say i was asleep
  • BakerMan @ BakerMan:
    i said i was sleeping...
  • BakerMan @ BakerMan:
    sleeping with uremum
  • K3Nv2 @ K3Nv2:
    Even my mum slept on that uremum
  • TwoSpikedHands @ TwoSpikedHands:
    yall im torn... ive been hacking away at tales of phantasia GBA (the USA version) and have so many documents of reverse engineering i've done
  • TwoSpikedHands @ TwoSpikedHands:
    I just found out that the EU version is better in literally every way, better sound quality, better lighting, and there's even a patch someone made to make the text look nicer
  • TwoSpikedHands @ TwoSpikedHands:
    Do I restart now using what i've learned on the EU version since it's a better overall experience? or do I continue with the US version since that is what ive been using, and if someone decides to play my hack, it would most likely be that version?
  • Sicklyboy @ Sicklyboy:
    @TwoSpikedHands, I'll preface this with the fact that I know nothing about the game, but, I think it depends on what your goals are. Are you trying to make a definitive version of the game? You may want to refocus your efforts on the EU version then. Or, are you trying to make a better US version? In which case, the only way to make a better US version is to keep on plugging away at that one ;)
  • Sicklyboy @ Sicklyboy:
    I'm not familiar with the technicalities of the differences between the two versions, but I'm wondering if at least some of those differences are things that you could port over to the US version in your patch without having to include copyrighted assets from the EU version
  • TwoSpikedHands @ TwoSpikedHands:
    @Sicklyboy I am wanting to fully change the game and bend it to my will lol. I would like to eventually have the ability to add more characters, enemies, even have a completely different story if i wanted. I already have the ability to change the tilemaps in the US version, so I can basically make my own map and warp to it in game - so I'm pretty far into it!
  • TwoSpikedHands @ TwoSpikedHands:
    I really would like to make a hack that I would enjoy playing, and maybe other people would too. swapping to the EU version would also mean my US friends could not legally play it
  • TwoSpikedHands @ TwoSpikedHands:
    I am definitely considering porting over some of the EU features without using the actual ROM itself, tbh that would probably be the best way to go about it... but i'm sad that the voice acting is so.... not good on the US version. May not be a way around that though
  • TwoSpikedHands @ TwoSpikedHands:
    I appreciate the insight!
    TwoSpikedHands @ TwoSpikedHands: I appreciate the insight!