How to shorten up this code? (many size modifiers)

Started by CosmoCortney, March 03, 2013, 11:40:43 AM

Previous topic - Next topic

CosmoCortney

Hi,
today i hacked some size modifiers for many characters in Tales Of Symphonia: Dawn of the New World.

04B5DF4C XXXXXXXX
04B5DF50 XXXXXXXX
04B5DF54 XXXXXXXX
04B5EF3C XXXXXXXX
04B5EF40 XXXXXXXX
04B5EF44 XXXXXXXX
04B5FF2C XXXXXXXX
04B5FF30 XXXXXXXX
04B5FF34 XXXXXXXX
04B60F1C XXXXXXXX
04B60F20 XXXXXXXX
04B60F24 XXXXXXXX
04B61F0C XXXXXXXX
04B61F10 XXXXXXXX
04B61F14 XXXXXXXX
04B62EFC XXXXXXXX
04B62F00 XXXXXXXX
04B62F04 XXXXXXXX
04B63EEC XXXXXXXX
04B63EF0 XXXXXXXX
04B63EF4 XXXXXXXX

floating point value for XXXXXXXX


what i have noticed is, that the distance between the 1st, 4th, 7th... lines is FF0. between the the 3rd and 4th, 6th and 7th,... lines FE8.

i thought about to combine 06 and 08 code types. but i doesn't seem to be possible..
(i planned to change the size of all characters by button activation. but without shorting them up, the code would be insane long)
i also tryed to change the size by asm. i found the multiplication's factor in r23. but it modifies the size of p1 character, too and that's what i dont really want. and only the Z-sizes of all characters is modified..
any solution for that?

Deathwolf

I don't think so... Actually, as you already said the places of values is 1st, 4th, 7th and 3rd 4th, 6th and 7th. In other words, there is no serial or string code possible (Sure it is from 3rd - 4th and 6th - 7th but that isn't really necessary) You could try to do some ASM with comparison. Try to get some information about the character datas. It be will only activated if character data X is loaded.

cmpwi r0,0x0001        # Compare if value is 0
bne- END1                # If not, skip the ASM Code and branch to the next comparison.
lis r12,0x4000
ori r12,r12,0x0000
stw r12,0(r31)

END1:
cmpwi r0,0x0002       # Compare if value is 1
bne- END2               # If not, skip the ASM Code and branch to the next comparison.
lis r12,0x4000
ori r12,r12,0x0000
stw r12,0(r31)

END2:                      #Compare if value is 1
cmpwi r0,0x0003        # If not, skip the ASM Code and branch to the original address.
bne- END3
lis r12,0x4000
ori r12,r12,0x0000
stw r12,0(r31)

END3:
stw 29,0(r31)             # Original address.

Code:

C2000000 00000009
2C000001 40820010
3D804000 618C0000
919F0000 2C000002
40820010 3D804000
618C0000 919F0000
2C000003 40820010
3D804000 618C0000
919F0000 93BF0000
60000000 00000000
lolz

Bully@Wiiplaza

#2
3 times 08 codetype ;)

08B5DF4C XXXXXXXX
20060FF0 000000000
08B5DF50 XXXXXXXX
20060FF0 000000000
08B5DF54 XXXXXXXX
20050FF0 000000000

I´m pretty sure it´s the shortest possible.
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully

dcx2

Bully gave you a good starting point.  However, to make this adjustable with a button activator, you'll need some more.  I once did a Gecko Register Slider code.

http://wiird.l0nk.org/forum/index.php/topic,8671.msg72146.html#msg72146

Gecko Register Slider with Self-Modifying codes.  The idea is that you load the dynamic value (your size in this case) into grN, and then you use a 4E code to point at the 08 code's X variable, and you copy the value from grN over top of the slider's X variable.  Then for your button activator, all you need to do is tickle the value in grN and your slider will automatically adjust.

82200000 811A532C # gr0 = [811A532C]
4E00000C 00000000 # po = address of slider code's X
94210000 00000000 # [po] = gr0
091AA3C8 00000000 # slider, addr = 811AA3C8, X = modified by 9421 above
20080260 00000000 # 32-bit, repeat 8 additional times, Z = 0x260
E0000000 80008000 # terminator

(as an a-side, I love this game, I should probably try playing it again soon.  There are a ton of amazing codes for it, too, including probably the most complex code I ever made)

CosmoCortney

Thank you for the answers^^

@Bully
this method is really simple. thank you^^

but when i look at the other answers, i see i have to learn a bit more about asm and gecko registers..

but thanks alot^^
i use Bully's solution and it works flawless^^

Bully@Wiiplaza

dcx2´s is the best. You only have XXXXXXXX once and it´s the same length as "mine".
82200000 811A532C
4E00000C 00000000
94210000 00000000
091AA3C8 XXXXXXXX
20080260 00000000
E0000000 80008000
My Wii hacking site...
http://bullywiihacks.com/

My youtube account with a lot of hacking videos...
http://www.youtube.com/user/BullyWiiPlaza

~Bully