Stop All Opponents Offline Only [Hamster35000vr]
#2
Bump, I had lots of requests to get this code ported. So I went ahead and analyzed this code, and overhauled the entire source. I got rid of the need of a region dependent pointer to reference Mem81. Fixed the offroad bug as well. Total compiled code length was cut down from 9 to 5 lines.

Here's the old source plus a list of issues with it if anyone is curious... (new source included in original post ofc)

old Source:
lis r14,-32711
addi r14,r14,19736
lwz r14,0(r14)
addi r14,r14,1232
subi r14,r14,184
addi r14,r14,27
cmpw r3,r14
bge- 0x10
lis r14,16256
stw r14,184(r3)
b 0x0C
li r14,0
stw r14,184(r3)
li r14,0

Issues with old Source:
-Using r14 w/o backup
-Using a region dependent pointer for mem81
-Two instances of stw r14, 184 (r3), non optimized branching
-Adding 1232, then subtracting 184, then readding 27 (lol), why not just add 1075 in the first adding instruction?
-Default instruction wasn't included, so a value of 1 for a float was implemented for the End User thus causing a bug where you could drive offroad with no speed loss
-The bge- is was incorrect, it should have been bge+, hence why my new source uses blt-
-The comparison for the branch was done as signed. Granted it didn't matter in this case since both values being compared are always 811XXXXX. But it's obvious the comparison was meant as both numbers being positive, so the comparison should have been done logically
Reply


Messages In This Thread
RE: Stop All Opponents Offline Only [Hamster35000vr] - by Vega - 08-28-2019, 01:37 PM

Forum Jump:


Users browsing this thread: 1 Guest(s)