C2 Racer Count Tracker
#1
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.



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.
Reply


Messages In This Thread
C2 Racer Count Tracker - by JoshuaMK - 07-28-2019, 06:34 AM
RE: C2 Racer Count Tracker - by Vega - 07-28-2019, 12:35 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 07-28-2019, 06:18 PM
RE: C2 Racer Count Tracker - by Vega - 07-28-2019, 07:14 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 07-28-2019, 07:28 PM
RE: C2 Racer Count Tracker - by Vega - 07-28-2019, 07:33 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 07-28-2019, 07:37 PM
RE: C2 Racer Count Tracker - by Vega - 07-28-2019, 08:30 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 07-28-2019, 08:38 PM
RE: C2 Racer Count Tracker - by Vega - 07-28-2019, 09:20 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 07-28-2019, 10:02 PM
RE: C2 Racer Count Tracker - by Vega - 07-29-2019, 01:44 AM
RE: C2 Racer Count Tracker - by JoshuaMK - 07-29-2019, 11:41 PM
RE: C2 Racer Count Tracker - by Vega - 07-29-2019, 11:44 PM
RE: C2 Racer Count Tracker - by Vega - 11-04-2019, 03:35 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 11-04-2019, 05:07 PM
RE: C2 Racer Count Tracker - by Vega - 11-04-2019, 07:04 PM
RE: C2 Racer Count Tracker - by JoshuaMK - 11-04-2019, 07:29 PM

Forum Jump:


Users browsing this thread: 4 Guest(s)