Jump to content

Patching GS codes to Zelda OoT Debug Rom help


Gazpacho146
 Share

Recommended Posts

Hello, I've been trying to patch a gameshark code to the Zelda 64 Debug Rom with multiplayer. I want to patch all the color codes, but the ROM seems to be getting broken every time I try it.

The color codes are:

Player 2: 8022BD1C 0095

Player 3: 8022820C 0050

Player 4: 802246FC 005C

These are simple color codes that change the other Link's tunic colors to be more like Four Swords.

So let's say I'm trying to patch the color code for player 2: I took my code, and split it up like this

80

22BD1C

0095

 

I copied the middle part

22BD1C and then opened up my windows calculator in developer mode and did

 

245000 - 22BD1C = 192E4

 

(Doing 22BD1C - 254000 wielded the result of FFFFFFFFFFFD7D1C)

Once I got the offset of 192E4, I saw the code 00 04

and in the cheat, the last part (0095) ends in 95. So I changed it to 00 95 and saved it. Upon opening the rom I got the 'infinite loop' error. I tried running it through CHKSUM64 and I still got the same error. What am I doing wrong?

Halp guise

Link to comment
Share on other sites

Hello, I've been trying to patch a gameshark code to the Zelda 64 Debug Rom with multiplayer. I want to patch all the color codes, but the ROM seems to be getting broken every time I try it.

The color codes are:

Player 2: 8022BD1C 0095

Player 3: 8022820C 0050

Player 4: 802246FC 005C

These are simple color codes that change the other Link's tunic colors to be more like Four Swords.

So let's say I'm trying to patch the color code for player 2: I took my code, and split it up like this

80

22BD1C

0095

 

I copied the middle part

22BD1C and then opened up my windows calculator in developer mode and did

 

245000 - 22BD1C = 192E4

 

(Doing 22BD1C - 254000 wielded the result of FFFFFFFFFFFD7D1C)

Once I got the offset of 192E4, I saw the code 00 04

and in the cheat, the last part (0095) ends in 95. So I changed it to 00 95 and saved it. Upon opening the rom I got the 'infinite loop' error. I tried running it through CHKSUM64 and I still got the same error. What am I doing wrong?

Halp guise

 

You're assuming the entire rom is loaded consecutively at 0x80000000, which is not the case. The roms can be either 24MB or 48 MB, plus most of them are compressed, and the n64 only has 32MB of ram. So, the rom is divided into files who's logical addresses (where they are loaded at in RAM) are the sometimes the same. eg. 0xABCD could be in 4 or 5 different files.

Link to comment
Share on other sites

Mybad. Still, my point's the same. You can't directly translate a GS code to a rom offset.

 

Very true, right. There's two things that come to mind which Gazpacho could try, tho: 1) open the ROM in ex. Nemu, look at the memory at the addresses you've given, and try to search the ROM for the data there. Or 2) set write breakpoints on those addresses and try to figure out from where in ROM the game gets the data that way. No guarantee that'll work, or even work easily tho.
Link to comment
Share on other sites

Looks like those addresses are somewhere in the 'actor structure' for each Link actor that's loaded since the first one is always 802245B0 iirc. These will be written to from somewhere in Link's actor so as xdaniel said you'd have to set a write breakpoint and see what writes to those addresses (they should all give the same result) and find that in the ROM. You probably won't find an easy way of setting the values from there though.

Link to comment
Share on other sites

Thanks for the support. I'll need to delve deeper into ROM hacking. Anyone have some n00b friendly tutorials on hexadecimal and ASM?

 

Obviously you don't know what hexidecimal is. It's not something new, it's just a different way to write numbers. In hexadecimal, 0-F = 0-15. For example, in hexadecimal, 05 is still 5, 0A is 10, and 10 is 16 (because F = 15).

 

eg. How to count to 20 in hexadecimal:

 

00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F 10 11 12 13 14

 

As for asm, you'll need to learn MIPS R4000 assembly, here's the users manual

But I can tell you right now, most people don't move on to assembly until after years of programming experience, and it'll probably be to much for you to handle. From there, you can just enable the debugging tools in PJ64 and dump the memory to assembly, or you can use other tools like Galatea on the actor / code files themselves.

Link to comment
Share on other sites

There are ways to patch that code. Z64Hook is a nice little convenient hook you can use to get those codes patched. The only thing you need to write is a little ASM/C hack and get it assembled/compiled. Here's what it would basically look like:

 

.ORG 0x80600000

/* 
You need to write some code which checks if the four Links are loaded
which I left it out because I don't really want to go through the trouble
of thinking up a method to do so right now... Unless of course these codes
can be used to on boot with no crashes.
*/

LUI K1, 0x8022
ORI AT, R0, 0x005C
SB AT, 0x46FC(K1)
LUI K1, 0x8023
ORI AT, R0, 0x0050
SB AT, 0x820C(K1)
ORI AT, R0, 0x0095
SB AT, 0xBD1C(K1)

Exit:
OR AT, R0, R0 
JR RA
ORI K1, R0, 0x0AAA 

/*
I cleared the two registers at the end because... I don't
know, it feels right? Also, I don't even really need 2 registers
to write this code; I just wanted to keep it short.
*/

Assemble as a binary and then follow the instructions of Z64Hook to figure it out from there.

 

Z64Hook : http://spinout182.com/z64hook/

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.