WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: Sharkbyte on April 22, 2010, 03:29:10 PM

Title: Combining Pointers
Post by: Sharkbyte on April 22, 2010, 03:29:10 PM
How would I combine the following 2 codes to make them shorter?

CE000000 80008180
04B37EB4 00000002
E0000000 80008000
48000000 8036EAA0   different
DE000000 80008180
58010000 000000C4
DE000000 80008180
14000010 00000000
14000014 00000000
14000018 00000000
E0000000 80008000

and

CE000000 80008180
04B37EB4 00000002
E0000000 80008000
48000000 8036EC50   different
DE000000 80008180
58010000 000000C4
DE000000 80008180
14000010 00000000
14000014 00000000
14000018 00000000
E0000000 80008000

notice the offsets are the same, the only thing different is pointer address.
Title: Re: Combining Pointers
Post by: Deathwolf on April 22, 2010, 03:43:41 PM
like this?

CE000000 80008180
04B37EB4 00000002
E0000000 80008000
4A000000 80000000
DE000000 80008180
58010000 000000C4
DE000000 80008180
1436EAB0 00000000
1436EAB4 00000000
1436EAB8 00000000
1436EC60 00000000
1436EC64 00000000
1436EC68 00000000
E0000000 80008000
Title: Re: Combining Pointers
Post by: Deathwolf on April 22, 2010, 04:05:25 PM
for this you must use 4A codetype (42 only at 90000000)

CE000000 80008180
04B37EB4 00000002
E0000000 80008000
4A000000 80000000 <--- offset
14[36EAB0] 00000000<-----
14[36EAB4] 00000000<-----
14[36EAB8] 00000000<----- pointers
14[36EC60] 00000000<-----
14[36EC64] 00000000<-----
14[36EC68] 00000000<-----
E0000000 80008000

eventually it works now?^^
Title: Re: Combining Pointers
Post by: Deathwolf on April 22, 2010, 04:18:59 PM
lol?

8036EA[A0] + 140000[10] = 1436EAB0 <-- new pointer

8036EA[A0] + 140000[14] = 1436EAB4 <-- new pointer

8036EA[A0] + 140000[18] = 1436EAB8 <-- new pointer

8036EC[50] + 140000[10] = 1436EC60 <-- new pointer

8036EC[50] + 140000[14] = 1436EC64 <-- new pointer

8036EC[50] + 140000[18] = 1436EC68 <-- new pointer

now 14000000 <-- no pointer
and 8036EAA0 - 36EAA0 = 80000000 <-- offset

are you sure your pointers are correct?
Title: Re: Combining Pointers
Post by: Deathwolf on April 22, 2010, 04:32:51 PM
hmm okay...
sorry I don't know
Title: Re: Combining Pointers
Post by: wiiztec on April 22, 2010, 05:06:38 PM
The only codes that load pointers in this topic are sharkbyte's

And I'm not sure what's trying to be done here, do the 2 codes do different things? if not and the game alternates between storing the pointer in the 2 addresses then you might not have found a stable pointer or it might be a pointer in a pointer in a pointer

but anyways those codes could be shortened and combined like this

04B37EB4 00000002
48000000 8036EAA0  
DE000000 80008180
58010000 000000C4
DE000000 80008180
12000010 00050000
E0000000 80008000
48000000 8036EC50  
DE000000 80008180
58010000 000000C4
DE000000 80008180
12000010 00050000
E0000000 80008000
Title: Re: Combining Pointers
Post by: Deathwolf on April 22, 2010, 08:29:43 PM
12 is for 16bit but what about the 05 value?
Title: Re: Combining Pointers
Post by: wiiztec on April 22, 2010, 09:45:05 PM
12000010 00050000 writes 0000 to 12000010 and 5 half words ahead of it (it writes 0000 to 12000010, 12000012, 12000014, 12000016, 12000018, & 120000C0) so it basicly does what your three lines did in one line

This is explained albeit poorly in the codetype document
Title: Re: Combining Pointers
Post by: dcx2 on April 23, 2010, 12:28:30 AM
Yeah, the 12 codetype is a 16-bit RAM-write & fill.  The 0005 is the YYYY part in the code type doc.  It's how many extra sequential 16-bit half-words will be written to (in addition to the first one, which is why YYYY = 0000 only writes over one 16-bit half-word).

Quote12______ YYYYXXXX : 16bits ram write and fill (po) writes XXXX YYYY+1 times at po+address