Rock Band 2 [SZAP69]

Started by Patedj, April 19, 2011, 11:57:25 AM

Previous topic - Next topic

Patedj

What's up with this!

Pointer in pointer
3 options
[spoiler]MATCH: ((90072E34+44)[==FX91C409E4,PX90366F80]+0) ==PX90366F80
* data2((90072e34+44)[==Fx90072e34,Px91ae2ac0]+0) ==Px900ef5b0
USE: [(90072E34+44)+0] IN YOUR POINTER IN POINTER CODE.

MATCH: ((9038BB60+6740)[==FX90368480,PX90361870]+5710) ==PX90366F80
* data2((9038bb60+6740)[==Fx9038bb60,Px90340010]+5710) ==Px900ef5b0
USE: [(9038BB60+6740)+5710] IN YOUR POINTER IN POINTER CODE.

MATCH: ((900CBAC4+7134)[==FX9036A994,PX90361620]+5960) ==PX90366F80
* data2((900cbac4+7134)[==Fx900cbac4,Px90457700]+5960) ==Px900ef5b0
USE: [(900CBAC4+7134)+5960] IN YOUR POINTER IN POINTER CODE.[/spoiler]

Code option 3:
[spoiler]48000000 900CBAC4
DE000000 90009340
58010000 00006740
DE000000 90009340
58010000 00007134
4A100000 00000000
DE000000 90005960
14000000 3F800000
E0000000 80008000

Is this Right? None of them work.[/spoiler]

ASM Version
[spoiler]4E000008 00000000 --> float load
C2033B1C 00000003
3F800000 7D8802A6 --> float is 1 because f is indexed
C02C0000 7C23F52E
60000000 00000000
14000000 3F800000 --> make float 1

I had another version that fadds but I thought it wouldn't be necessary.. anyways. I'm stumped.[/spoiler]



Function attached. Walking the stack took me way back...
You can pm me, I've got time for your troubles.

dcx2

#1
You misunderstood pointer in pointer.  It says there are three individual results that you should investigate separately.  You interpreted as one big pointer-in-pointer-in-pointer.  And your last DE line, DE000000 90005960, is invalid  Then you add 0 to po with 4A1...which is unnecessary.

Your ASM attempts to use the bl trick...without the bl.


lis r28,0  # .float 1.0
mflr r12
lfs f1,0(r12)
stfsx f1,r3,r30

Without bl, the LR will not have a pointer to the data.  mflr will not put a pointer to the data in r12.  So this will not work like you wanted it to.

Without bl, the .float 1.0 will be interpreted as ASM.  3F800000 not only means "a 1.0 in floating point", but it ALSO means "lis r28,0".  It's like it has multiple personality syndrome; 3F800000 means different things depending on how it is interpreted.  All kinds of random damage can happen by accidentally wiping out r28 like that.

The bl for the bl trick serves two purposes: 1) prevent the floating point data from being interpreted as an ASM instruction by branching over it, and 2) placing a pointer to the data into the LR so that we can use mflr to get a pointer to the floating point data.

The bl trick is only good for being able to hot-swap ASM floats with a button activator, or if you need somewhere to store data over the long-term.  If you just need to write a simple constant, this will do.

lis r12, 0x3F80
stwx r12,r3,r30

Patedj

#2
For some reason I thought I couldn't. I will simply store with index r12 into r3 and r30 and that should do the trick.

Conclusion: wrong address
You can pm me, I've got time for your troubles.

Patedj

Rock meter adds  Afro
0403EA88 EC40082A
You can pm me, I've got time for your troubles.