Patching AR Codes into ISO

All your console related questions and answers :)
Post Reply
PapaCokeDope
Posts: 3
Joined: Thu Aug 08, 2019 9:16 pm

Patching AR Codes into ISO

Post by PapaCokeDope » Thu Aug 08, 2019 10:31 pm

Hello everyone! I apologize if my question sounds odd, but I was wondering if there was anyway to patch AR Codes into the game's iso? I know others have made patches for Gamecube games in the past and I was wondering is it would be possible to do something akin to this again.

ex: https://www.romhacking.net/hacks/2971/

I would want to do this to patch Pal subtitles into the NTSC versions, and patch other odd AR codes into games here and there. Thanks for the help!
User avatar
Aleron Ives
Posts: 90
Joined: Thu Oct 13, 2016 3:56 am
Location: California

Re: Patching AR Codes into ISO

Post by Aleron Ives » Thu Aug 08, 2019 11:21 pm

How easy it is to do depends on the type of code. If it's a simple assembly patch such as noping one instruction, you just need to find the right offset in the dol file by searching for that area in a memory dump and then searching for that code block in the dol. If you're adding new code, then you need a place in the dol to store that code, such as garbage text that is never used. Assuming such a place exists, you have to recalculate all the branch offsets to match the new position of the code you're adding. If you're relying on the AR codehandler to do something, then you can't patch the ISO unless you rewrite the code to accomplish whatever the AR codehandler is doing via assembly, instead.
PapaCokeDope
Posts: 3
Joined: Thu Aug 08, 2019 9:16 pm

Re: Patching AR Codes into ISO

Post by PapaCokeDope » Fri Aug 09, 2019 5:14 am

Okay that's what I kinda thought. I was planning on mostly using pre-existing AR codes for most if not all the patch work ideas I had in mind. Stuff like Luigi's Mansion Regular Flashlight/Poltergust Control by Ralf, and stuff like 60fps and widescreen codes. I don't think those would be hard to patch in, but I have no idea on how to even make patches like the one I linked above let alone how to take ar codes and than make it into a patch....so it could be more difficult than what I except. Worth a try just for a learning experience
User avatar
Aleron Ives
Posts: 90
Joined: Thu Oct 13, 2016 3:56 am
Location: California

Re: Patching AR Codes into ISO

Post by Aleron Ives » Sat Aug 10, 2019 2:25 pm

Look at the Readme linked on that page. It has the actual patch data in it:

Code: Select all

In case you want to hex edit yourself:

	Original	New
Offsets Values		Values
2A384   38 C0 00 10  -> 38 C0 00 00
AC60C   7F E3 FB 78  -> 38 60 00 05
Since the offsets are so small, they're probably relative to the dol. Use GCRebuilder to extract the dol file, open it with a hex editor, go to offset 0x2A284, and see if the value is 0x38C00010. If it is, change it to 0x38C00000, then do the same thing for the second offset and import the modified dol back into the ISO.
PapaCokeDope
Posts: 3
Joined: Thu Aug 08, 2019 9:16 pm

Re: Patching AR Codes into ISO

Post by PapaCokeDope » Sat Aug 10, 2019 3:15 pm

Okay great! Thanks for the help I'll try that out when I've got a chance too later today :)
Post Reply