Here is a short bit of code that tracks how many racers are participating in a race via the C2 codetype.
This is useful for when you need to do loops and stuff in a code based on how many racers there are.
(NTSC-U)
C2791674 00000002
3D808140 8B84F0B0
9B8CXXXX 00000000
(PAL)
C279A680 00000002
3D808140 8B8438B8
9B8CXXXX 00000000
(NTSC-J)
C2799CEC 00000002
3D808140 8B842918
9B8CXXXX 00000000
(NTSC-K)
C2788A40 00000002
3D808140 8B841EF8
9B8CXXXX 00000000
XXXX = Whatever spot in Mem81 you want.
This is useful for when you need to do loops and stuff in a code based on how many racers there are.
(NTSC-U)
C2791674 00000002
3D808140 8B84F0B0
9B8CXXXX 00000000
(PAL)
C279A680 00000002
3D808140 8B8438B8
9B8CXXXX 00000000
(NTSC-J)
C2799CEC 00000002
3D808140 8B842918
9B8CXXXX 00000000
(NTSC-K)
C2788A40 00000002
3D808140 8B841EF8
9B8CXXXX 00000000
XXXX = Whatever spot in Mem81 you want.
Code:
.set region, '' #Fill in E, P, J, or K within the quotes for your region
.if (region == 'E' || region == 'e') # RMCE
.macro _setOffset
lbz r28, -0x0F50 (r4)
.endm
.elseif (region == 'P' || region == 'p') # RMCP
.macro _setOffset
lbz r28, 0x38B8 (r4)
.endm
.elseif (region == 'J' || region == 'j') # RMCJ
.macro _setOffset
lbz r28, 0x2918 (r4)
.endm
.elseif (region == 'K' || region == 'k') # RMCK
.macro _setOffset
lbz r28, 0x1EF8 (r4)
.endm
.else # Invalid Region
.abort
.endif
lis r12, 0x8140 #Set for Mem81 Storage
_setOffset #Set up Offset by Region
stb r0, 0 (r12) #Store Racer Count to Mem81
Super Mario Eclipse, what Super Mario Sunshine could've been.