Custom Laps (Mini Edition)
#1
Custom Laps (Mini Edition)

A much shorter version of the original code, which can be found here > https://mkwii.com/showthread.php?tid=1169

Note: Compared to the original, this lacks the use of the timer for a lap counter (uses normal lap counter), and doesn't update the positions instantly.

(NTSC-U)
C252FEB4 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C2530094 00000002
3D808140 880C1798
60000000 00000000
C253068C 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C2791674 00000002
3D808140 8B84F0B0
9B8C1799 00000000
C27E4C9C 00000002
3D808140 807FEE20
906C179E 00000000
045309C0 807E0044

(PAL)
C25349FC 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C2534BDC 00000002
3D808140 880C1798
60000000 00000000
C25351D4 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C279A680 00000002
3D808140 8B8438B8
9B8C1799 00000000
C27EEFAC 00000002
3D808140 807F3618
906C179E 00000000
04535508 807E0044

(NTSC-J)
C253437C 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C253455C 00000002
3D808140 880C1798
60000000 00000000
C2534B54 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C2799CEC 00000002
3D808140 8B842918
9B8C1799 00000000
C27EE618 00000002
3D808140 807F2678
906C179E 00000000
04534E88 807E0044

(NTSC-K)
C2522A58 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C2522C34 00000002
3D808140 880C1798
60000000 00000000
C252322C 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C2788A40 00000002
3D808140 8B841EF8
9B8C1799 00000000
C27DD36C 00000002
3D808140 807F1C58
906C179E 00000000
04523560 807E0044

X = Number of Laps
0 = The moment you first cross the line the race ends.
1 = 1 lap race.
2 = 2 lap race.
3 = 3 lap race. (Normal value)
4 = 4 lap race.
...
8 = 8 lap race.
9 = 9 lap race. (Displays as lap 8 on final lap)

#####
#ASM#
#####

##############
#Inject > 80530094#
#############

lis r12, 0x8140
lbz r0, 0x1798 (r12)

##############
#Inject > 8053068C#
#############

lwz r11, 0x0044 (r26)
subi r0, r3, 1
subi r11, r11, 1
stw r11, 0x0044 (r26)

##############
#Inject > 807E4C9C#
#############

lis r12, 0x8140
lwz r3, -0x1130 (r31)
stw r3, 0x179e (r12)

##############
#Write > 805309C0#
#############

lwz r3, 0x0044 (r30)

##############
#Inject > 8052FEB4#
#############

lis r12, 0x8140
li r0, 5
stb r0, 0x1798 (r12)
addi r5, r4, 1    #Add 1
sth r5, 0x0024 (r3)
sub r28, r5, r0
addi r28, r28, 2
stw r28, 0x0044 (r3)

Code Creator: JoshuaMK
Was lucky enough to be one of few to learn proper ASM. Now I'm writing codes that I hope amaze!  Tongue
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)