Distance Meter; DBZ BT3
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.

C207B7A4 00000002
3D808000 D00C1600
D01E0044 00000000
C2122678 00000004
3D808000 C16C1600
FD60581C D96C1604
806C1608 9068000C
60000000 00000000

List of Sources

1st ASM (Store Distance Float):
lis r12, 0x8000 #Set 1st half address of Crash Handler
stfs f0, 0x1600 (r12) #Store Distance Float to 0x80001600
stfs f0, 0x0044 (r30) #Default Instruction

2nd ASM (Convert Float to Hex, place value in Register for Timer's default instruction)
lis r12, 0x8000 #Set 1st half address of Crash Handler
lfs f11, 0x1600 (r12) #Load Distance Float into f11
fctiw f11, f11 #Convert float to decimal, use standard rounding
stfd f11, 0x1604 (r12) #Store the double float (second word is our hex value) to 0x80001604
lwz r3, 0x1608 (r12) #Load converted hex value from 0x80001608 into r3
stw r3, 0x000C (r8) #Default Instruction; store hex value so Timer will then display it as a decimal value

Code creator: zak

Forum Jump:

Users browsing this thread: 1 Guest(s)