Scalable Gravity [JoshuaMK]
#5
All Regions Fixed

(07-06-2019, 09:00 PM)Vega Wrote: So I haven't stepped-by-stepped your code in Dolphin yet so I have no idea how your code really works. I'm not sure why 2 out of the 4 gravity destinations are loading the halfword while the other 2 are loading the whole word. I'm sure there's an obvious reason to it. Anyway, I noticed your code has some redundancy. Try this source out... let me know how it works...


lwz r12, 0 (r31) #Load whole word into r12

lis r11, 0x8034 #PAL GCN used for compilation
ori r11, r11, 0x8200
lhz r11, 0 (r11)

andi. r10, r11, 0x0882 #Example GCN button values used for compilation
cmpwi r10, 0x0882
beq- add_lots_gravity
andi. r10, r11, 0x0881
cmpwi r10, 0x0881
beq- sub_lots_gravity
andi. r10, r11, 0x0082
cmpwi r10, 0x0082
beq- add_gravity
andi. r10, r11, 0x0081
cmpwi r10, 0x0081
bne+ dont_touch

subi r12, r12, 0x2000
b the_end

sub_lots_gravity:
srwi r12, r12, 16 #This will simulate a lhz
subis r12, r12, 1
b the_end

add_lots_gravity:
srwi r12, r12, 16 #This will simulate a lhz
addis r12, r12, 1
b the_end

add_gravity:
addi r12, r12, 0x2000

the_end:
stw r12, 0 (r31)

dont_touch:
lfs f1, 0 (r31)


Compiled code, no address assigned:
C2000000 0000000E
819F0000 3D608034 #Replace 8034 with 8033 if korea ofc...
616BXXXX A16B0000
716AUUUU 2C0AUUUU
4182003C 716ADDDD
2C0ADDDD 41820024
716AUUUU 2C0AUUUU
41820030 716ADDDD
2C0ADDDD 40A2002C
398CE000 48000020
558C843E 3D8CFFFF
48000014 558C843E
3D8C0001 48000008
398C2000 919F0000
C03F0000 00000000
Okay I will check it out. The lhz commands were actually part of an older version of this code that some how made its way into this post. They are supposed to be lwz commands.

Updated the codes as your shortened source works, although I did take out the srwi instructions as they were unneeded. I put your name in the credits for optimizing the ASM. Honestly I can't believe I didn't think to store the andi. results into a separate register lol.  Rolleyes
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply


Messages In This Thread
Scalable Gravity [JoshuaMK] - by JoshuaMK - 07-06-2019, 09:20 AM
RE: Scalable Gravity - by Vega - 07-06-2019, 01:19 PM
RE: Scalable Gravity - by JoshuaMK - 07-06-2019, 03:47 PM
RE: Scalable Gravity - by Vega - 07-06-2019, 09:00 PM
RE: Scalable Gravity - by JoshuaMK - 07-06-2019, 09:09 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)