MKW LAN Mod Guide [USB Loading, some Gecko > BSlug conversions, and no DWC Emulator!]
#1
Ramble-y Preamble: Feel Free to Skip

So, I had a MKW LAN party late last year using DWC emulator, and while it went great, I don't think I'll ever bother to set up (or maintain/keep around) DWC emulator again, since its honestly kind of a pain in the ass, and it doesn't seem to have been maintained in a few years now, so it'll only continue to be more and more of a pain in the ass as time goes on.

So, I wanted to find a better solution that wasn't "Fuck it, I'mma just use Wiimmfi", so I turned my attention back to the MKW LAN mod made by Chadderz and MrBean35000vr. The reasons I hadn't used it then were pretty simple: I couldn't USB Load with it (or so I thought), I couldn't run any Gecko codes with it (which does seem to be true, but some elbow grease has gotten me some pay off here, enough to satisfy me), and it doesn't work in Dolphin (which is through no fault of the mod as far as I know, its an issue with Dolphin). Well, if I can resolve a couple of these enough to satisfy me, then this can be a much simpler and more permanent solution to hosting a MKW LAN party in the future.

I set to work first to figure out how to get it to USB load. I already knew it couldn't be ISO patched at all, and while its not impossible for BrainSlug module support to be added into a USB loader directly, no one has done it. I've got to use the BrainSlug boot.dol no way around it. Well, it just so happens I lucked, out: You can go into your game settings and simply enable alternate dol and place the BSlug .dol according, and it will load BrainSlug, and then BrainSlug will load its modules and then the game .dol like a charm. I can't believe I didn't think to do that before, but now I don't have to worry about ordering 6 copies of Mario Kart Wii.

The biggest effort I had to put in was not having Gecko Codes of course. The first thing I tried was turning on Ocarina codes in USB Loader GX, and no dice. Nothing changed. In the same vein as the last problem, I also tried to see if I could get BrainSlug to load GeckoOS or the other way around, and then load into the game, but I just couldn't find any way to do this. Finally, I simply tried to patch the codes into the game's main.dol with wstrt, and again nothing. Nothing changed at all even though no vanilla dol was available! Well, I guess BrainSlug just wacks off any attempt to load a Gecko code handler, and there ain't much to change about that.

If I'm getting cheats to run with the LAN Mod, its going to be in BSlug module form. I could make a BSlug module that loads a gecko code handler and then loads codes for the game, but honestly IDK shit about Gecko, Wii ASM, coding in C, or any of the Wii methods/environment, etc, so making a BSlug Gecko handler would be *way* out of my ability. I instead looked for a short cut: armed with a template module, a handful of module source code to reference (including the MKW LAN modules source), Gecko code documentation and some computer fundamentals, I went about trying to convert basic codes into stand alone BSlug modules.

I'll spare some of the details, but I tried Auto A at Strap Screen first, copying the USB Gecko Debugger source nearly verbatim and hey, it worked! Didn't work for other codes tho, because turns out writing it to RAM at start and never again doesn't work. Looking at the MKW LAN mod revealed to me that I should do the RAM writes in the OSLink method instead, and hey! I got a basic RAM write code to work!

I didn't get any other kind of code to work, because again, I don't understand ASM, and just dumping the ASM at the write place didn't work (game just crashed if it was ever called), and I gave up there knowing that its well beyond my understanding. Anything else I can do would just be shooting in the dark. So I decided instead to scale back what codes I "need", and found "good enough" alternatives for ASM codes, and got a result that works for me. Lets see it shall we?



MKW LAN Mod: Pros & Cons, is it right for you?

Pros:
 + Simple, easy
 + Doesn't require an extra computer
 + Can use a modified WBFS for custom tracks and such if you USB Load (you could probably use Riivolution and a real disc too, just didn't test that)

Cons:
 - Can't use Dolphin
 - Lacks full Gecko Code support, so you'll have to make compromises on the non-vanilla changes you're used to having
 - Can't invite remote players, if the whole gang can't be there

If you know your way around Linux, got an extra computer/VPS/Rasberry Pi, and want access to a full range of Gecko codes and/or to invite remote friends to join in, you'd be better off using DWC Emulator (or if you're not good with Linux, saying fuck it and using Wiimmfi).

If you just want simple and easy, and aren't very picky about a mostly vanilla experience, this is the guide for you.



Tutorial: How to get set up and running (Real disc and USB Loading)

Requirements
- Every Wii you plan to use will need to have the homebrew channel installed (and cIOS if you plan to USB load the game on that Wii). Check out https://wii.guide/ for a tutorial on that.
- Other than that, ensure you have at least half as many Wiis as you do players (you can have 1 or 2 players per Wii), 1 TV per Wii, 1 controller per player, and a router to network them all together. You can go insane and go full ethernet, or you can just use wifi for everything.

0) Ensure you have a disc copy of MKW, or have a WBFS of the game on your USB and ready to rock for each Wii (U) console you will be using. You can use discs and WBFSs in any mixture, you just need 1 per Wii. Every following step will focus on just one Wii, repeat for each Wii.
1) Download the MKW LAN mod from here: http://www.chadsoft.co.uk/downloads/LAN_MKW_v0.9.zip
2) Copy the contents to the SD card.
2.1) If you are USB Loading, you will need to make a copy of the boot.dol file in the /apps/brainslug folder and move/rename to the appropriate location to use it as an alternate dol. For USB Loader GX, you should rename boot.dol to RMCE01.dol (for NTSC-U, use RMCP01 for PAL, and RMCJ01 for NTSC-J) and put it on the root of your USB or SD card.
3) Check the attached files on this post for a zip folder containing BrainSlug conversions of various cheats found on this forum. Pick any modules that strike your fancy, and copy them to the /brainslug/modules folder on your SD card.
4) Once you have everything copied over, insert your SD card (and USB) into your Wii and turn it on. If you are playing on a disc, you can just launch BrainSlug from the homebrew channel. BrainSlug will now load all your modules and boot the game. This Wii is now ready to go.
4.1) If you are USB loading, launch your USB loader, and turn "alternate dol" on, then launch the game. You should see BrainSlug appear and start loading modules. It should boot into the game once it is done. This Wii is now ready.

Pro tip: BrainSlug modules are loaded entirely into RAM, so once the game boots you can remove the SD card and reuse it on the next Wii!

5) Now that all the Wiis are ready, if they are all set up on the same network, you should be able to hit 1 or 2 player on LAN Multiplayer on all of them, have one of them open a room, and the rest of them can check the friends list and join the host. Thats it! Its time to play!



Gecko Codes: But 100cc sucks! And I need everything unlocked! And how am I going to get rid of those shitty TCs?

As I mentioned in some of the previous sections, I've gotten *only* very basic Gecko codes to work by converting them to BrainSlug modules. This means that while you are locked out of the nice and fancy ASM based codes we are all spoiled by, like XeR's Force Room CC code that will let us force 150cc and forget 100cc even exists. (Ha! 50cc! Now thats a funny joke!) This sucks, but thankfully, we can work around this by turning Leseratte's Engine Class Modifier code, which we *can* get running, into a "100cc has 150cc speeds" codes. Basically, if you didn't know, all modes takes 150cc and multiplies its speed by a static factor to slow you down to create the effect of a smaller engine. 50cc has a multiplier of 0.8, 100c has a multiplier of 0.9, and Battle has a multiplier of 0.7. If we take just the second line of that code (100cc), and enter in a float value of 1.0, 100cc will now be just as fast as 150cc, making them effectively the same thing. If we can't remove 100cc from friend rooms, then we make it identical to 150cc. There is a down side of course: we can't stop the game from picking Mirror Mode either. If everyone has a 5000vr license, this has something like a 5% chance of happening, so hopefully this should be a "good enough" alternative to forcing 150cc.

Everyone's needs will be different, so I won't waste too much time going on about "good enough" alternatives. If there is something you are hoping to use, you should check my BSlug modules attached below, and see if I got something kind of like what you're looking for. Here are some notable mentions however:
  • 100cc is 150cc (Because I know you skimmed right to this list)
  • High Data Rate (This is actually comes built in with the LAN mod, but I didn't know this until I dug through its source!)
  • Unlock All (I was able to convert _tZ's code, which does not modify the save file but temporarily gives you everything)
  • Friend Room Race Count (I have a 3 and 5 race one already compiled, I can do other numbers on request)
  • No Background Music (What, you want to hear Coconut Mall 12 times simultaniously?)
  • Force Thunder Cloud Glitch & No Thunder Cloud Speed Gain (put them together, and it basically makes the TC useless, which is about as good as removing it outright)
  • And more! Just check out the attached zip

I also included a basic java program that can take a single line 00/02/04 code and turn it into source code for a brainslug module and a bash script to compile it and move the module into a folder with the rest of them, if you don't find the code you wanted in my zip (or if you don't use NTSC-U. Sorry, I just couldn't be bothered to do it all again for JP and PAL). I also included source for all included modules, with a comment in each for a URL link of what code I based it on.



Conclusion: Thanks to all you dedicated modders

Honestly, I already put all my words (too many words!) into the rest of this thread, so I don't have too much more to say. A massive thanks and shout out to all the dedicated modders out there that have done so much to learn and document so much stuff about the Wii and modding it, Mario Kart Wii and how it works, as well as mod the game to hell and back with ASM cheat codes, custom tracks, and just tons of insane work I can't even begin to mention like the LAN Mod this guide is about, and all the tools and info out there to be find and used. What I've done here with converting basic RAM write codes into BrainSlug modules is childs play in comparison to what everyone else has done, and I wouldn't have been able to do any of it if I didn't have all this stuff to use as a foundation. Thank you all so much!


Attached Files
.zip   MKW Gecko Code to BrainSlug Module Conversions.zip (Size: 200.96 KB / Downloads: 3)
Reply
#2
Reserved. IDK what I'd need a second post for, but I'll take it just in case Tongue
Reply
#3
You can hex edit ASM codes onto an WBFS/ISO but it's a pain.

https://mkwii.com/showthread.php?tid=998 old guide that I haven't updated in a long time, so excuse any noobiness
Reply
#4
Local BrainSlug aficionado here; to get Gecko codes working, if you're using the "gecko.mod" module that comes with BrainSlug itself, you can make a module that just runs "memcpy((void*)0x800028B8, GCTArray, sizeof(GCTArray));" upon startup, where GCTArray is a C char[] with the contents of a GCT file.
Reply
#5
(08-31-2021, 11:31 PM)Vega Wrote: You can hex edit ASM codes onto an WBFS/ISO but it's a pain.

https://mkwii.com/showthread.php?tid=998 old guide that I haven't updated in a long time, so excuse any noobiness

I looked at this, and thats all above my head, but that is a solution.

(09-05-2021, 02:59 PM)InvoxiPlayGames Wrote: Local BrainSlug aficionado here; to get Gecko codes working, if you're using the "gecko.mod" module that comes with BrainSlug itself, you can make a module that just runs "memcpy((void*)0x800028B8, GCTArray, sizeof(GCTArray));" upon startup, where GCTArray is a C char[] with the contents of a GCT file.

...but I'm going to have to toy with this. This looks very promising, thanks for dropping me this tid bit!
Reply
#6
(09-05-2021, 02:59 PM)InvoxiPlayGames Wrote: Local BrainSlug aficionado here; to get Gecko codes working, if you're using the "gecko.mod" module that comes with BrainSlug itself, you can make a module that just runs "memcpy((void*)0x800028B8, GCTArray, sizeof(GCTArray));" upon startup, where GCTArray is a C char[] with the contents of a GCT file.

HOLY SHIT THIS WORKS THIS IS AWESOME! Thank you so much!

Now, if there was a way to make this work by loading a GCT off the SD instead of baking it right into the module, then that'd be perfect.
Reply
#7
(09-06-2021, 01:56 PM)Yuri Bacon Wrote: Now, if there was a way to make this work by loading a GCT off the SD instead of baking it right into the module, then that'd be perfect.

This is definitely do-able, albeit codes like "automatically press A on strap screen" won't work - you'd want to make sure libfat, libfat-sd and libsd are loaded, and make a module that hooks OSLink, to load the GCT into the above memory address then call onto the original OSLink.

Something a bit like this: (this is psuedocode for all intents and purposes, this will not compile + run without a bit of tweaking, I wrote this in 30 seconds in Notepad)
Code:
int OSLinkHook(void* addr1, void* addr2) {
    SD_Mount();
    int fd = SD_Open("sd:/codes/RMCP01.gct");
    SD_Read(fd, 0x800028B8);
    SD_Close(fd);
    return OSLink(addr1, addr2);
}

If you need help making a module that does this, reach out to me on Discord - InvoxiPlayGames#0161 - I'll gladly help you out with it there. (or if you want me to do the work for you, I wouldn't mind whipping something up quickly when I get spare time, although there's a lot of fun in learning!)
Reply
#8
(09-06-2021, 11:09 PM)InvoxiPlayGames Wrote:
(09-06-2021, 01:56 PM)Yuri Bacon Wrote: Now, if there was a way to make this work by loading a GCT off the SD instead of baking it right into the module, then that'd be perfect.

This is definitely do-able, albeit codes like "automatically press A on strap screen" won't work - you'd want to make sure libfat, libfat-sd and libsd are loaded, and make a module that hooks OSLink, to load the GCT into the above memory address then call onto the original OSLink.

Something a bit like this: (this is psuedocode for all intents and purposes, this will not compile + run without a bit of tweaking, I wrote this in 30 seconds in Notepad)
Code:
int OSLinkHook(void* addr1, void* addr2) {
    SD_Mount();
    int fd = SD_Open("sd:/codes/RMCP01.gct");
    SD_Read(fd, 0x800028B8);
    SD_Close(fd);
    return OSLink(addr1, addr2);
}

If you need help making a module that does this, reach out to me on Discord - InvoxiPlayGames#0161 - I'll gladly help you out with it there. (or if you want me to do the work for you, I wouldn't mind whipping something up quickly when I get spare time, although there's a lot of fun in learning!)

I figured I'd need those libraries. I can toy with it when I have some time, but I just got other stuff going on this week. If you make it instead that's awesome. Honestly, I'm surprised this wasn't already a thing, seems like a big oversight to me.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)