Jump to content

Gameshark Code Patcher (WIP)


Jason777
 Share

Recommended Posts

I've been working on something on-and-off recently: a patcher for all gameshark codes. The program would be geared towards OoT debug, but in theory it should work for all N64 games. I say this because I plan to include an "advanced" option where the user can specify free RAM space and areas where sections of the ROM are always loaded into the same area.

 

The neat thing about this tool is that it'll be able to handle conditional codes (D0, D1, D2, D3). Another thing is that it'll be able to patch practically all codes that one may throw at it (with the exception of 50 type codes... unless I add support) . This is all possible through an assembly routine I have made that reads a list of GS codes that directly follow it.

 

Codes that fall into an area of RAM that is always in the same space, that has no conditional code types, and can be converted easily to a ROM offset will be patched normally via simple modifications of bytes. Anything else uses the assembly routine I had mentioned above.

 

Another feature I plan to add to the program is the ability to show and modify (add, remove, edit) a list of "active" codes that are to be used by the assembly routine.

 

A preview:

 

 

You can use this program to create tests for the assembly routine below...

Just for simple tests in RAM, I came up with a simple console program to create gameshark codes out of gameshark codes... lol.

 

What I mean is that you provide the program with a text file filled with gameshark codes, it asks you for the RAM address you want these codes to start at, and then it spits out a text file file that is a gameshark code that patches the RAM with the codes you gave the program.

 

For example say we have a gameshark code like this (in.txt):

D033AFA0 0008
D033B1C4 0000
8133B1C4 4450
And then we run the program (write_gs_ram.exe)...

Gameshark file: in.txt
Address to write values to: 806000F4
Format the output as a nemu cheat? (y / n): y
Cheat name: Test (use with GSCI)
Cheat number: 20
Processed 3 lines.
We would be left with a text file (nemu.txt)

CheatName20=Test (use with GSCI)
CheatName20Code0=816000F4 D033
CheatName20Code1=816000F6 AFA0
CheatName20Code2=816000F8 0008
CheatName20Code3=816000FA D033
CheatName20Code4=816000FC B1C4
CheatName20Code5=816000FE 0000
CheatName20Code6=81600100 8133
CheatName20Code7=81600102 B1C4
CheatName20Code8=81600104 4450
CheatName20Count=9
Here is the C++ source code (write_gs_ram.cpp):

#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
#include <stdlib.h>

using namespace std;

int main()
{
	// Variables used for files
	string FilePath;
	ifstream In;
	ofstream Out;

	// Address to write to
	unsigned int GS_Write;

	// Variables used for nemu cheat files
	char NemuFormat;
	string CheatName;
	unsigned int CheatNumber;

	// Variables used for temporary reading
	unsigned int TEMP;
	string TEMP_s;
	int i = 0;
	int j = 0;

	// Get filepath to text file that holds gameshark code
	cout << "Gameshark file: ";
	getline(cin, FilePath);

	// Get the address to write to
	cout << "Address to write values to: ";
	cin >> hex >> GS_Write;
	if (GS_Write >= 0x80800000) return -1;

	// Format the address for gameshark code writing
	GS_Write = ((GS_Write & 0x00FFFFFF) | 0x81000000);

	// Get whether or not to output as a nemu cheat
	cout << "Format the output as a nemu cheat? (y / n): ";
	cin >> NemuFormat;	
	if (NemuFormat == 'y' || NemuFormat == 'Y')
	{
		// Get cheat name
		cin.ignore();
		cout << "Cheat name: ";
		getline(cin, CheatName);

		// Get cheat number
		cout << "Cheat number: ";
		cin >> dec >> CheatNumber;
		if (CheatNumber < 0) return -1;
	}

	// Open files
	In.open(FilePath.data());
	if (!In || !In.is_open() || !In.good() || In.fail()) return -1;
	Out.open("out.txt");
	if (!Out || !Out.is_open() || !Out.good() || Out.fail()) return -1;

	// Grab values from text file that holds gameshark code
	Out << hex << uppercase;
	In >> hex;
	while (In >> TEMP)
	{
		// If we are currently on the address of a gameshark code...
		if (!(i % 2))
		{
			unsigned int hi_addr = TEMP >> 16;
			unsigned int lo_addr = TEMP & 0x0000FFFF;
			Out << GS_Write + j << " " << setfill('0') << setw(4) << hi_addr << endl;
			Out << GS_Write + 0x02 + j << " " << setfill('0') << setw(4) << lo_addr << endl;
		}
		// Else we are on the value to write to that address... 
		else
		{
			Out << GS_Write + 0x04 + j << " " << setfill('0') << setw(4) << TEMP << endl;
			j += 0x06;
		}

		i++;
	}

	// Output number of lines of gameshark code
	cout << "Processed " << (i / 2) << " lines.\n";

	// Close files
	In.close();
	Out.close();

	// If we wanted to have a nemu formatted cheat code...
	if (NemuFormat == 'y' || NemuFormat == 'Y')
	{
		// Open files
		In.open("out.txt");
		if (!In || !In.is_open() || !In.good() || In.fail()) return -1;
		Out.open("nemu.txt");
		if (!Out || !Out.is_open() || !Out.good() || Out.fail()) return -1;

		// Specify cheat name
		Out << dec;
		Out << "CheatName" << CheatNumber << "=" << CheatName << endl;

		// Grab values from text file that holds gameshark code 
		i = 0;
		while (In >> TEMP_s)
		{
			// If we are currently on the address of a gameshark code, specify code line and start the code
			if (!(i % 2)) Out << "CheatName" << CheatNumber << "Code" << (i / 2) << "=" << TEMP_s << " ";
			// Else we are on the value to write to that address, write the code value 
			else Out << TEMP_s << endl;

			i++;
		}
		// Specify the number of lines of gameshark code in cheat
		Out << "CheatName" << CheatNumber << "Count=" << (i / 2) << endl;
		
		// Close files
		Out.close();
		In.close();

		// Delete the old "out.txt" file
		#if defined(WIN32) || defined(WIN64)
		system("del out.txt");
		#elif defined(UNIX)
		system("rm out.txt");
		#endif
	}

	// Exit
	cin.get();
	cin.ignore();
	return 0;
}
There's no real use for it for the average hacker/modder. In fact, it's only really useful when testing out this hack :P
Here is the assembly routine...

Alcaro: I knew that that function existed! I just couldn't remember what file to include...

 

Kazeshin: Technically, I use the mips-gcc assembler (mips-as.exe), but more specifically I use a MIPS r4k hacking tool called Galatea which uses GCC. It was made entirely by Marshall Brenden Rogers (ZZT32 - the guy who taught messian/frauber a bunch of cool crap). It can handle a large variety of opcodes including ones having to do with floating point registers. Also, code types A0 and A1 are the same as 80 and 81.

 

Alright, here we have the new and improved gameshark code interpreter - OoT Debug edition!

.org	0x801064B0
	.set 	noreorder
	.set	noat
#include <mips.h>

	j	Gameshark_Interpret

	.org	0x80600000
	.set	noreorder
	.set	noat
#include <mips.h>

	.global	Gameshark_Interpret
Gameshark_Interpret:

	lui	$at,%hi(Start_GS_List)
	ori	$at,$at,%lo(Start_GS_List)

Main_Loop:
	lbu	t0,0x0000($at)
	lbu	t1,0x0001($at)
	lhu	t2,0x0002($at)
	sll	t1,t1,0x10
	addu	t1,t1,t2
	lui	t2,0x8000
	addu	t1,t1,t2

	li	t2,0x80
	lbu	t3,0x0005($at)
	beql	t0,t2,Loop_Update
	sb	t3,0x0000(t1)
	li	t2,0xA0
	beql	t0,t2,Loop_Update
	sb	t3,0x0000(t1)

	li	t2,0x81
	lhu	t3,0x0004($at)
	beql	t0,t2,Loop_Update
	sh	t3,0x0000(t1)
	li	t2,0xA1
	beql	t0,t2,Loop_Update
	sh	t3,0x0000(t1)

	li	t2,0xD0
	lbu	t3,0x0005($at)
	bne	t0,t2,D1_Check
	lbu	t2,0x0000(t1)
	beq	t2,t3,Loop_Update
	nop
	b	More_D_Check
	addiu	$at,$at,0x0006

D1_Check:
	li	t2,0xD1
	lhu	t3,0x0004($at)
	bne	t0,t2,D2_Check
	lhu	t2,0x0000(t1)
	beq	t2,t3,Loop_Update
	nop
	b	More_D_Check
	addiu	$at,$at,0x0006

D2_Check:
	li	t2,0xD2
	lbu	t3,0x0005($at)
	bne	t0,t2,D3_Check
	lbu	t2,0x0000(t1)
	bne	t2,t3,Loop_Update
	nop
	b	More_D_Check
	addiu	$at,$at,0x0006

D3_Check:
	li	t2,0xD3
	lhu	t3,0x0004($at)
	bne	t0,t2,Exit
	lhu	t2,0x0000(t1)
	bne	t2,t3,Loop_Update
	nop
	addiu	$at,$at,0x0006

More_D_Check:
	li	t2,0xD0
	lbu	t0,0x0000($at)
	andi	t0,t0,0x00F0
	beql	t2,t0,More_D_Check
	addiu	$at,$at,0x0006

Loop_Update:
	b	Main_Loop
	addiu	$at,$at,0x0006

Exit:
	jr	$ra
	nop

Start_GS_List:
To assemble, use Galatea

 

However, if you don't want to then here's the GS code:

811064B0 0818
811064B2 0000
81600000 3C01
81600002 8060
81600004 3421
81600006 00FC
81600008 9028
8160000A 0000
8160000C 9029
8160000E 0001
81600010 942A
81600012 0002
81600014 0009
81600016 4C00
81600018 012A
8160001A 4821
8160001C 3C0A
8160001E 8000
81600020 012A
81600022 4821
81600024 240A
81600026 0080
81600028 902B
8160002A 0005
8160002C 510A
8160002E 002F
81600030 A12B
81600032 0000
81600034 240A
81600036 00A0
81600038 510A
8160003A 002C
8160003C A12B
8160003E 0000
81600040 240A
81600042 0081
81600044 942B
81600046 0004
81600048 510A
8160004A 0028
8160004C A52B
8160004E 0000
81600050 240A
81600052 00A1
81600054 510A
81600056 0025
81600058 A52B
8160005A 0000
8160005C 240A
8160005E 00D0
81600060 902B
81600062 0005
81600064 150A
81600066 0005
81600068 912A
8160006A 0000
8160006C 114B
8160006E 001F
81600070 0000
81600072 0000
81600074 1000
81600076 0018
81600078 2421
8160007A 0006
8160007C 240A
8160007E 00D1
81600080 942B
81600082 0004
81600084 150A
81600086 0005
81600088 952A
8160008A 0000
8160008C 114B
8160008E 0017
81600090 0000
81600092 0000
81600094 1000
81600096 0010
81600098 2421
8160009A 0006
8160009C 240A
8160009E 00D2
816000A0 902B
816000A2 0005
816000A4 150A
816000A6 0005
816000A8 912A
816000AA 0000
816000AC 154B
816000AE 000F
816000B0 0000
816000B2 0000
816000B4 1000
816000B6 0008
816000B8 2421
816000BA 0006
816000BC 240A
816000BE 00D3
816000C0 942B
816000C2 0004
816000C4 150A
816000C6 000B
816000C8 952A
816000CA 0000
816000CC 154B
816000CE 0007
816000D0 0000
816000D2 0000
816000D4 2421
816000D6 0006
816000D8 240A
816000DA 00D0
816000DC 9028
816000DE 0000
816000E0 3108
816000E2 00F0
816000E4 5148
816000E6 FFFC
816000E8 2421
816000EA 0006
816000EC 1000
816000EE FFC6
816000F0 2421
816000F2 0006
816000F4 03E0
816000F6 0008
816000F8 0000
816000FA 0000
Try testing it out using this code:

816000FC D021
816000FE 2034
81600100 0008
81600102 813F
81600104 4372
81600106 28A0
81600108 D021
8160010A 2034
8160010C 0008
8160010E 813F
81600110 4392
81600112 28D0
81600114 D021
81600116 2034
81600118 0008
8160011A 813F
8160011C 4332
8160011E 2B98
81600120 D021
81600122 2034
81600124 0008
81600126 813F
81600128 4352
8160012A 29D0
8160012C D021
8160012E 2034
81600130 0008
81600132 813F
81600134 43F2
81600136 3138
81600138 D021
8160013A 2034
8160013C 0008
8160013E 813F
81600140 4412
81600142 2A60
81600144 D021
81600146 2034
81600148 0008
8160014A 813F
8160014C 43B2
8160014E 2880
81600150 D021
81600152 2034
81600154 0008
81600156 813F
81600158 43D2
8160015A 2CD8
8160015C D021
8160015E 2034
81600160 0008
81600162 813F
81600164 44D2
81600166 2890
81600168 D021
8160016A 2034
8160016C 0008
8160016E 813F
81600170 4442
81600172 29C0
81600174 8022
81600176 4E08
81600178 3F70
8160017A 8106
8160017C 2078
8160017E 3402
81600180 D021
81600182 2034
81600184 0008
81600186 8106
81600188 207A
8160018A 0022
8160018C D021
8160018E 2034
81600190 0008
81600192 8115
81600194 8D93
81600196 FFFF
81600198 D021
8160019A 2034
8160019C 0008
8160019E 8015
816001A0 8D93
816001A2 FFFF
816001A4 D021
816001A6 2034
816001A8 0008
816001AA 8015
816001AC 8D94
816001AE FF00
816001B0 D021
816001B2 2034
816001B4 0008
816001B6 8115
816001B8 8D94
816001BA 00FF
816001BC D021
816001BE 2034
816001C0 0008
816001C2 8015
816001C4 8D95
816001C6 FF00
816001C8 D021
816001CA 2034
816001CC 0008
816001CE 8115
816001D0 8D95
816001D2 00FF
816001D4 D021
816001D6 2034
816001D8 0008
816001DA 8015
816001DC 8D96
816001DE FF00
816001E0 D021
816001E2 2034
816001E4 0008
816001E6 8115
816001E8 8D96
816001EA 00FF
816001EC D021
816001EE 2034
816001F0 0008
816001F2 8015
816001F4 8D97
816001F6 FF00
816001F8 D021
816001FA 2034
816001FC 0008
816001FE 8115
81600200 8D97
81600202 00FF
81600204 D021
81600206 2034
81600208 0008
8160020A 8015
8160020C 8D98
8160020E FF00
81600210 D021
81600212 2034
81600214 0008
81600216 8115
81600218 8D98
8160021A 00FF
8160021C 8015
8160021E 8D99
81600220 FF00
81600222 D021
81600224 2034
81600226 0008
81600228 D021
8160022A 2034
8160022C 0008
8160022E 8022
81600230 46FC
81600232 007F
81600234 8022
81600236 4DE9
81600238 0050
8160023A 8122
8160023C 4DF7
8160023E 0202
81600240 D021
81600242 2034
81600244 0004
81600246 813F
81600248 4372
8160024A 2B98
8160024C D021
8160024E 2034
81600250 0004
81600252 813F
81600254 4392
81600256 2B70
81600258 D021
8160025A 2034
8160025C 0004
8160025E 813F
81600260 4332
81600262 29A0
81600264 D021
81600266 2034
81600268 0004
8160026A 813F
8160026C 4352
8160026E 2A98
81600270 D021
81600272 2034
81600274 0004
81600276 813F
81600278 43F2
8160027A 29D0
8160027C D021
8160027E 2034
81600280 0004
81600282 813F
81600284 4412
81600286 29A0
81600288 D021
8160028A 2034
8160028C 0004
8160028E 813F
81600290 43B2
81600292 28C0
81600294 D021
81600296 2034
81600298 0004
8160029A 813F
8160029C 43D2
8160029E 2B98
816002A0 D021
816002A2 2034
816002A4 0004
816002A6 813F
816002A8 4502
816002AA 34A0
816002AC D021
816002AE 2034
816002B0 0004
816002B2 813F
816002B4 44D2
816002B6 2B98
816002B8 D021
816002BA 2034
816002BC 0004
816002BE 813F
816002C0 4442
816002C2 29D0
816002C4 8106
816002C6 2078
816002C8 3402
816002CA D021
816002CC 2034
816002CE 0004
816002D0 8106
816002D2 207A
816002D4 00F2
816002D6 8022
816002D8 4E08
816002DA 3F70
816002DC D021
816002DE 2034
816002E0 0004
816002E2 8015
816002E4 8D97
816002E6 FF00
816002E8 D021
816002EA 2034
816002EC 0004
816002EE 8015
816002F0 8D97
816002F2 FF00
816002F4 D021
816002F6 2034
816002F8 0004
816002FA 8115
816002FC 8D97
816002FE FF00
81600300 D021
81600302 2034
81600304 0004
81600306 8115
81600308 8D93
8160030A 6666
8160030C D021
8160030E 2034
81600310 0004
81600312 8015
81600314 8D94
81600316 00FF
81600318 D021
8160031A 2034
8160031C 0004
8160031E 8115
81600320 8D92
81600322 00FF
81600324 D021
81600326 2034
81600328 0004
8160032A 8022
8160032C 46FC
8160032E 009F
81600330 8022
81600332 4DE9
81600334 0050
81600336 8122
81600338 4DF7
8160033A 0202
8160033C D021
8160033E 2034
81600340 0002
81600342 813F
81600344 4372
81600346 2B98
81600348 D021
8160034A 2034
8160034C 0002
8160034E 813F
81600350 4392
81600352 2B70
81600354 D021
81600356 2034
81600358 0002
8160035A 813F
8160035C 4332
8160035E 29A0
81600360 D021
81600362 2034
81600364 0002
81600366 813F
81600368 4352
8160036A 2940
8160036C D021
8160036E 2034
81600370 0002
81600372 813F
81600374 43F2
81600376 2A68
81600378 D021
8160037A 2034
8160037C 0002
8160037E 813F
81600380 4412
81600382 2940
81600384 D021
81600386 2034
81600388 0002
8160038A 813F
8160038C 43B2
8160038E 2A50
81600390 D021
81600392 2034
81600394 0002
81600396 813F
81600398 43D2
8160039A 2A50
8160039C D021
8160039E 2034
816003A0 0002
816003A2 813F
816003A4 4502
816003A6 34A0
816003A8 D021
816003AA 2034
816003AC 0002
816003AE 813F
816003B0 44D2
816003B2 2B98
816003B4 D021
816003B6 2034
816003B8 0002
816003BA 813F
816003BC 4442
816003BE 2900
816003C0 D021
816003C2 2034
816003C4 0002
816003C6 8106
816003C8 2078
816003CA 3402
816003CC D021
816003CE 2034
816003D0 0002
816003D2 8106
816003D4 207A
816003D6 00E2
816003D8 8022
816003DA 4E08
816003DC 3F70
816003DE D021
816003E0 2034
816003E2 0002
816003E4 8022
816003E6 46FC
816003E8 00D4
816003EA D021
816003EC 2034
816003EE 0002
816003F0 8015
816003F2 8D97
816003F4 FF00
816003F6 D021
816003F8 2034
816003FA 0002
816003FC 8115
816003FE 8D97
81600400 FF00
81600402 D021
81600404 2034
81600406 0002
81600408 8115
8160040A 8D93
8160040C 5566
8160040E D021
81600410 2034
81600412 0002
81600414 8015
81600416 8D96
81600418 00FF
8160041A D021
8160041C 2034
8160041E 0002
81600420 8115
81600422 8D95
81600424 00FF
81600426 8022
81600428 4DE9
8160042A 0050
8160042C 8122
8160042E 4DF7
81600430 0202
81600432 D021
81600434 2034
81600436 0001
81600438 813F
8160043A 4372
8160043C 2A80
8160043E D021
81600440 2034
81600442 0001
81600444 813F
81600446 4392
81600448 2B98
8160044A D021
8160044C 2034
8160044E 0001
81600450 813F
81600452 4332
81600454 28C0
81600456 D021
81600458 2034
8160045A 0001
8160045C 813F
8160045E 4352
81600460 28D0
81600462 D021
81600464 2034
81600466 0001
81600468 813F
8160046A 43F2
8160046C 29F0
8160046E D021
81600470 2034
81600472 0001
81600474 813F
81600476 4412
81600478 2A60
8160047A D021
8160047C 2034
8160047E 0001
81600480 813F
81600482 43B2
81600484 2880
81600486 D021
81600488 2034
8160048A 0001
8160048C 813F
8160048E 43D2
81600490 2940
81600492 D021
81600494 2034
81600496 0001
81600498 813F
8160049A 4502
8160049C 3220
8160049E D021
816004A0 2034
816004A2 0001
816004A4 813F
816004A6 44D2
816004A8 29C0
816004AA D021
816004AC 2034
816004AE 0001
816004B0 813F
816004B2 4442
816004B4 2A60
816004B6 8022
816004B8 4E08
816004BA 3F70
816004BC 8106
816004BE 2078
816004C0 3402
816004C2 D021
816004C4 2034
816004C6 0001
816004C8 8106
816004CA 207A
816004CC 00C3
816004CE D021
816004D0 2034
816004D2 0001
816004D4 8022
816004D6 46FC
816004D8 0096
816004DA 8022
816004DC 4DE9
816004DE 0050
816004E0 8122
816004E2 4DF7
816004E4 0202
A video of what the code should look like can be seen here.

 

 

Credits:

The program is based off the concepts used in gameshark code patcher for SM64: http://jul.rustedlogic.net/thread.php?id=16157

It was made by ShenoxVII, Tamkis, and Kazeshin.

  • Like 3
Link to comment
Share on other sites

Zelda's Birthday 2 is one step closer to reality now.

 

My version of Roc's Feather 2(jump), Shiek's Magic's, Invisible Link, Exploding Arrows, and Death Mount Trail 2.

 

All new icons, new spells, new arrows, new cutscenes, and many suprise features!

 

New Ocarina Songs(hard coded).

 

It's no replacement for the URA project, but I hope I'll still get enough help to complete it.

 

6 new dungeons, new music, some new actors, ect.

 

3 new bosses, 3 old bosses.

 

Need help.

 

Many thanks!!!

  • Like 1
Link to comment
Share on other sites

Zelda's Birthday 2 is one step closer to reality now.

 

My version of Roc's Feather 2(jump), Shiek's Magic's, Invisible Link, Exploding Arrows, and Death Mount Trail 2.

 

All new icons, new spells, new arrows, new cutscenes, and many suprise features!

 

New Ocarina Songs(hard coded).

 

It's no replacement for the URA project, but I hope I'll still get enough help to complete it.

 

6 new dungeons, new music, some new actors, ect.

 

3 new bosses, 3 old bosses.

 

Need help.

 

Many thanks!!!

If you're in need of help, I'll do assembly or find addresses you need. Just private message me here and we shall further discuss.

 

Edit: Ocarina songs? I uploaded this onto spin's wiki three years ago

  • Like 1
Link to comment
Share on other sites

  • 8 months later...

Warning: I have not yet tested this method, but, in theory, it should work just fine.

 

â–²ChriisTiianâ–² asked me how to use this a couple of days ago. I figured I might give a little mini-tutorial on how to patch GS codes. Keep in mind that once my program is complete, this won't be the way things are done:

 

 

Go to these URLs for some of the files needed:

First, I should say that this (GS Code Patcher Project) is largely untested and incomplete so the steps I'm giving you won't be the "official" way to do this once I actually get work started on it. Alright, now that the disclaimer is out of the way, let's get started.

 

STEP 1: Download z64hook-0.0.2.ppf and patch your ROM with it.

STEP 2: The patch of z64hook has us place our code at placed at 0x80600000 in the RAM and since my hack was already compiled with this RAM address as the start point, we can just take our assembled Gameshark Code Interpreter and paste write it wherever z64hook specifies us to place our code in the ROM. This is offset is 0x03600000, so go ahead paste-write it there.

STEP 3: Take all the GS codes you want to patch, as long as you don't go past 0x03601000 you can paste all the GS codes you want at 0x036000FC. As an example, say you wanted to patch the "replace roll with jump" GS code. You would literally overwrite (paste-write) the bytes at 0x036000FC with the complete GS code:

D1 22 47 80 3F A0 81 22 46 10 40FF
The original GS code was:

D1224780 3FA0
81224610 40FF
 

Limitiations:

Using z64hook-0.0.2.ppf, we can only place GSCI.bin at 0x03600000 which is a very popular spot in ROM to place any modifications that need to be relocated and this can cause trouble. The way to get around this for now, is to take z64hook's source code, modify it so that it uses GNU syntax and can be compilable by Galatea, and then modify the following lines to use a different ROM offset, then recompile:

LUI T1, 0x1360 ;This specifies 0x03600000 + 0x10000000... which actually describes the ROM offset to use (change this)
SW T1, 0x0004(T2)
Another thing that we are limited to is the amount of space that is transferred from ROM to RAM (0x1000 bytes). Take the source code of z64hook and modify these lines and then recompile:

LUI T1, 0x0000  ;To change transfer size, change this
ORI T1, R0, 0x0FFF ;And this (Subtract 1 from total size, 0x1000 = 0xFFF)
Another thing is the RAM address that the hack is placed at (0x80600000), but I'll only get into that if it actually bothers you.

 

I'd imagine it would get quite tedious when patching long GS codes so I think I'll cook up a quick program later today that takes a text file of GS codes and spits out a binary that is ready to be placed at 0x036000FC.

 

EDIT: According to â–²ChriisTiianâ–², the method is a success!!

  • Like 1
Link to comment
Share on other sites

That's cool. A long time ago I made a code for OoT before we knew about map select. It combined the use items anywhere with the ability to turn the interface on and off as needed and a value that determined the object set in the scene. You could use Farore's Wind to warp anywhere including into cutscenes that link could normally not appear in (like the end credits or goddess cutscene without appear in strange places code) Problem is, it was a bit unstable on the actual gameshark, probably because mine was old, and worked perfectly on emulator. It would be cool to patch that to rom and make my own debugging tools for a mod. 

Link to comment
Share on other sites

 Share

×
×
  • Create New...

Important Information

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