Faulty code... that works?!

Started by GaryCXJk, October 11, 2008, 06:04:29 PM

Previous topic - Next topic

GaryCXJk

4A000000 9018F128
38000032 FF000035
48000000 8065AE4C
DE000000 80008180
58010000 00000008
DE000000 80008180
58010000 000000B0
DE000000 90009380
90010000 00000000
80000001 90179760
82200002 90179768
88000001 00000002
82200002 9017976C
88000001 00000002
4A001001 00000000
DE000000 90009380
30000000 544C4430
80000003 00000000
4A100000 00000010
DE000000 90009380
60000000 00000000
90010007 00000000
92210004 00000004
86400004 0000FFFF
88000004 00000003
86400004 0000FFFF
4A001001 00000008
94210004 00000000
34000000 00000000
4A001007 00000000
92210005 00000000
88000005 00000001
92210006 00000004
88000006 00000000
4A001005 00000006
92110008 00000000
4E000000 00000000
4A100000 00000010
94110008 00000001
8A000056 00000000
4A001007 00000008
64000000 00000000
E0000000 80008000


This is a faulty code. At the loop (60000000 00000000 - Repeat), it's supposed to be checking until gr3 is equal to gr4. Using a simple 46 and replacing gr3 and gr4 with addresses will mostly result in a crash, for some unknown reason in GeckoOS 1.07b, at least for me, so using this workaround should work. However, by pure accident, I forgot to add one to gr3.

However, as you might have guessed based on the title, it works. Adding a line to add one to gr3 however results in a crash.

Can anyone tell me what I did wrong, or actually, right here? It's a PAL code for Super Smash Bros. Brawl, Custom Stage Texture Swap, but with the instructions I actually gave in the US request thread, one should be able to easily port this one.

By the way, this is how the code should work, but doesn't (using the gr3 and gr4 pointer checks):

4A000000 9018F128
38000032 FF000035
48000000 8065AE4C
DE000000 80008180
58010000 00000008
DE000000 80008180
58010000 000000B0
DE000000 90009380
90010000 00000000
80000001 90179760
82200002 90179768
88000001 00000002
82200002 9017976C
88000001 00000002
4A001001 00000000
DE000000 90009380
30000000 544C4430
12000004 00000000
90010004 00000006
90010003 00000004
4A100000 00000010
DE000000 90009380
60000000 00000000
90010007 00000000
A6000000 43000000 *
86010003 00010000
4A001007 00000000
92210005 00000000
88000005 00000001
92210006 00000004
88000006 00000000
4A001005 00000006
92110008 00000000
4E000000 00000000
4A100000 00000010
94110008 00000001
8A000056 00000000
4A001007 00000008
64000000 00000000
E0000000 80008000


* Due to some strange error in GeckoOS or its documentary, A6000000 43000000 isn't an If [grN] < [grM], but rather the other way around.