Distance Meter; DBZ BT3
#1
DBZ BT3 Distance Meter

This code will display the current measured lateral distance between you and P2/COM via the match timer. The closer the opponent is to you, the more the number will decrease. The farther away the opponent is from you, the more the number will increase. The value 999 is the max, so if the distance measurement exceeds 999, the reading will still be 999. The actual timer of the match will still continue as normal. The distance values in this code only effect the display value of the match timer.

NTSC-U
C207B7A4 00000005
FDA0001C 3D808000
D9AC1600 816C1604
3D808012 3D6B3B80
916C1B44 D01E0044
60000000 00000000



Source:
fctiw f13, f0 #f0 contains distance float, convert it. Store result in FPR 13
lis r12, 0x8000 #Setup Exception Vector Area Address
stfd f13, 0x1600 (r12) #Store converted float double-word to 0x80001600
lwz r11, 0x1604 (r12) #Word at 0x80001604 contains our hex value, load it into r12
lis r12, 0x8012 #80121B44 is Timer Display Code's Memory Address
addis r11, r11, 0x3B80 #Add 3B800000 to r12
stw r11, 0x1B44 (r12) #Store 0x3B800XXXX (new instruction) to static memory address 0x80121B44
stfs f0, 0x0044 (r30) #Default Instruction



Code creator: zak
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)