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
#2
Does this do in-race room size or overall room size (such as includes ppl in watching live view)?

Also, if it's for in-race size, does this instruction execute every frame during the race?

I have an address for overall size (breaks every frame during idle room, in-between races, during race, etc). I also have an address for in-race room size but unfortunately it only gets called when you hit a box (for item probability adjustment just in case somebody D/Ced)

NTSC-U addresses (both founded by me)
overall - 80653664 lwz r0, 0x0040 (r4) #r0 holds size after instruction is executed EDIT: Counts guests as 0
in-race - 807AC3C0 cmpwi r9, 0xC #r9 holds size
Reply
#3
(07-28-2019, 12:35 PM)Vega Wrote: Does this do in-race room size or overall room size (such as includes ppl in watching live view)?

Also, if it's for in-race size, does this instruction execute every frame during the race?

I have an address for overall size (breaks every frame during idle room, in-between races, during race, etc). I also have an address for in-race room size but unfortunately it only gets called when you hit a box (for item probability adjustment just in case somebody D/Ced)

NTSC-U addresses (both founded by me)
overall - 80653664 lwz r0, 0x0040 (r4) #r0 holds size after instruction is executed
in-race - 807AC3C0 cmpwi r9, 0xC #r9 holds size
It is in-race size as far as I can tell. It executes twice, once at the very beginning of each race, and once the moment the track file loads right after the track selection screen goes black.

Btw how do I test codes online in Dolphin?
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#4
(07-28-2019, 06:18 PM)JoshuaMK Wrote:
(07-28-2019, 12:35 PM)Vega Wrote: Does this do in-race room size or overall room size (such as includes ppl in watching live view)?

Also, if it's for in-race size, does this instruction execute every frame during the race?

I have an address for overall size (breaks every frame during idle room, in-between races, during race, etc). I also have an address for in-race room size but unfortunately it only gets called when you hit a box (for item probability adjustment just in case somebody D/Ced)

NTSC-U addresses (both founded by me)
overall - 80653664 lwz r0, 0x0040 (r4) #r0 holds size after instruction is executed
in-race - 807AC3C0 cmpwi r9, 0xC #r9 holds size
It is in-race size as far as I can tell. It executes twice, once at the very beginning of each race, and once the moment the track file loads right after the track selection screen goes black.

Btw how do I test codes online in Dolphin?

Forgot to mention that my in-race address also executes once at the very beginning of race as well. To test codes online in Dolphin, you can use Wiimmfi or ALTWFC.



For Wiimmfi:
You cannot use the default NAND that is supplied on Dolphin (it's banned). You need to do a NAND backup for your Wii, and follow this guide here http://mkwii.com/showthread.php?tid=735

After that, there is a config file for Dolphin (idk where it is at for Windows, I use Linux) that contains what your Wii's MAC Address will be. It comes with some default one like 00-17-AB-xx-xx-xx. Change it to what your Wii's MAC is. Now once you try to get on Wiimmfi, you will be forced to wait the 7 day period (EC 23899) even if your Wii's NAND was already registered (this is normal). If for some reason, you get a Ban error code (239xx), go to the Wii-Homebrew forums and find the thread -About Banning. 

Another note about Dolphin and Wiimmfi: Each different region of ISO will cause the Wiimmfi server to create a new profile as if it was a new NAND. Example: You are registered on Wiimmfi with USA iso. You want to play on PAL iso, you will get EC 23899. This is normal. For some dumbass reason the dolphin devs decided they would make dolphin change the product code of the serial number in accordance to what region of wii iso you are loading. I'm assuming this serial number change flags the Wiimmfi server to register you again.

When testing codes on Wiimmfi, only test them in a private room with a friend. I wouldn't even chance it trying them in the WHackR region where hacks are allowed. I've seen the dumbest bans you can ever think of on the Wiimmfi server. Therefore, don't chance anything.



For ALTWFC:
I haven't made a dolphin guide to access ALTWFC, but basically follow this guide here - http://mkwii.com/showthread.php?tid=27 but instead of using a USB loader in HBC, simply apply the No SSL code in your cheat manager http://mkwii.com/showthread.php?tid=56

And also set the DNS settings on your computer's OS to the ALTWFC IP as well (idk how to do this on Windows, google is your friend). ALTWFC is instant access and there are no rules. I play on ALTWFC most of the time, once you get an FC there, hit me up. I'll give you mines.
Reply
#5
EDITED: Now uses address that gets read 15 times every frame. This address also doesn't get read until a track has loaded, and doesn't stop until you finish said race.

Also I will try ALTWFC. It sounds like less of a hassle lol.
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#6
A good way to verify that it's in race room size:
Have two wiis and dolphin, or two dolphins and a wii. Start a 2 player WW in ALTWFC (make sure those 2 players have No D/C code equipped). While it's in a race, have your 3rd profile join to the live view watch. Then set instruction BP on your address for one of the 2 players in the race. If the value says 3, then it's using overall room size instead.
Reply
#7
I have no way to do that because I only have 1 Wii and 1 PC, so that is only 2 players. I would need you to join too in order for me to test.

Been sitting at "Connecting to Nintendo WFC..." for about 5 minutes now, I guess I did something wrong? I set the DNS's on both the PC and on Dolphin, + I've got the No SSL code on. Anything else?
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#8
What code did you get during connection test after setting the DNS on the Wii internet settings?

Was it 11731 or 6xxxx?

Before trying to test the connection in the wii settings again, reboot your computer so any DNS changes will take effect on Windows. After the reboot, be sure your changes in w/e config files of Windows are being saved.

Regarding using the code: Be sure the XFB settings (store XFB copies to texture) is unchecked. Sometimes the external frame buffer can mess with codes.
Reply
#9
(07-28-2019, 08:30 PM)Vega Wrote: What code did you get during connection test after setting the DNS on the Wii internet settings?

Was it 11731 or 6xxxx?

Before trying to test the connection in the wii settings again, reboot your computer so any DNS changes will take effect on Windows. After the reboot, be sure your changes in w/e config files of Windows are being saved.

Regarding using the code: Be sure the XFB settings (store XFB copies to texture) is unchecked. Sometimes the external frame buffer can mess with codes.
I got error 60000
Super Mario Eclipse, what Super Mario Sunshine could've been.
Reply
#10
Make a new license. You can't use a wiimm license on altwfc and vice versa
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)