Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 546
» Latest member: Fishyyyy
» Forum threads: 1,666
» Forum posts: 12,015

Full Statistics

Online Users
There are currently 142 online users.
» 0 Member(s) | 136 Guest(s)
Bing, DuckDuckGo, Facebook, Google, Twitter, Yandex

Latest Threads
Make it to 10,000
Forum: General Discussion
Last Post: Fifty
2 hours ago
» Replies: 5,748
» Views: 4,224,511
Connect to AltWFC again
Forum: Incomplete & Outdated Codes
Last Post: marito_yo
05-03-2024, 06:27 AM
» Replies: 0
» Views: 56
Request: Mission Mode - P...
Forum: Code Support / Help / Requests
Last Post: Wingcapman
05-02-2024, 08:54 PM
» Replies: 0
» Views: 62
Custom Kart Working on Do...
Forum: Code Support / Help / Requests
Last Post: CorvoPSY
04-27-2024, 01:14 PM
» Replies: 1
» Views: 152
Boot into TT cup selectio...
Forum: Misc/Other
Last Post: Vega
04-26-2024, 08:27 PM
» Replies: 3
» Views: 2,947
Request: Custom brsars pe...
Forum: Code Support / Help / Requests
Last Post: lschlick
04-25-2024, 05:45 PM
» Replies: 0
» Views: 65
E-mails not working on th...
Forum: General Discussion
Last Post: Fifty
04-19-2024, 04:56 AM
» Replies: 3
» Views: 414
More missing info from Br...
Forum: Coding & Hacking General Discussion
Last Post: Vega
04-15-2024, 10:04 PM
» Replies: 0
» Views: 261
Request: Custom music vol...
Forum: Code Support / Help / Requests
Last Post: lschlick
04-15-2024, 06:13 PM
» Replies: 0
» Views: 228
Request: Additional sound...
Forum: Code Support / Help / Requests
Last Post: _Ro
04-15-2024, 01:50 AM
» Replies: 6
» Views: 282

 
  Custom Font on ISO/WBFS
Posted by: Vega - 09-10-2018, 07:39 PM - Forum: Other - No Replies

Mini Guide to Edit MKWii's FONT on ISO/WBFS


NOTE: This guide assumes you are somewhat familiar with WIT/SZS Tools. This guide is meant for intermediate users, not beginners. Linux is used in this guide. Guide works for both raw ISO files and WBFS files.

You will need Atlas's brfnt2tpl exe program. Download link - http://avsys.xyz/files/software/Atlas/br...nt2tpl.exe

1. Open Terminal: cd (location of your copied wbfs/iso)
2. Example: /home/yourusername/isos/NTSCU.wbfs
3. wit extract NTSCU.wbfs /home/yourusername/Test
4. cd /home/yourusername/Test/DATA/files/Scene/UI

NOTE: Scrubbed ISOs/WBFSs won't have a DATA folder. Do - cd/home/yourusername/Test/files/Scene/UI

5a. wszst xd Font.szs
5b. replace Font.szs with Font_K.szs for Korean ISOs
6. A Font.d folder is now created in the /UI directory. There are 7 files in that directory. 6 brfnt files and a txt file. Move
the kart_kanji_font.brfnt to a empty directory (to keep things from getting cluttered).
7. Run Atlas's brfnt2pl exe program (Wine users: you must run it under Mono for the program to work. Do - mono brftn2tpl.exe).
8. Program opens, find and choose the kart_kanji_font.brfnt that you moved to an empty directory from the previous step
9. A tpl and vbfta file is now created along side the brfnt file.
10. Open a terminal in that directory. Do this command: wimgt decode kart_kanji_font.tpl
11. You will now have 2 new png images--
kart_kanji_font.tpl.png
kart_kanji_font.tpl.mm1.png

NOTES FOR KOREAN ISOS:
Korean ISO's are much more complex. You will have 14 new png (the main tpl.png and 13 mm.png's) images instead of two. Also due to a 'bug' in Wiimm's Tools, the png's will not extract with a transparent background. The background will be black. Therefore you will need to make all the black backgrounds be transparent with your preferred Image Editor program. I personally use Gimp. I create an alpha channel layer. Then use the fuzzy select tool to select all the black areas. For each time a black area is slected, I press delete, The black turns to transparent. You will probably have to google to figure out more details if needed (do not ask here plz). THIS IS NOT AN GIMP TUT!

12. Edit all the pngs to your liking. Do NOT change the names of the png images. A simple first timer could simply edit the font color. Change it to red or w/e you like. More experienced users can add in their own font characters, change shadows, change language, effects, size, etc etc.
13. Once you have edit all the pngs. DELETE the kart_kanji_font.tpl file. (not the png file!)
14. Run ths command in the directory: wimgt encode --all kart_kanji_font.tpl.png (do NOT use a 'mm.png' file for this command!)
15. A new kart_kanji_font.tpl file is created. Now delete all the png files. You no longer need them.
16. DELETE the kart_kanji_font.brfnt file. We are about to compile a new one.
17. Reopen Atlas's program. At first no files will be listed. Click the scroll down menu for Files of Types. Change it from BRFNT to TPL. Your new
tpl file will now appear. Select it and click Open.
18. The tpl file will now be compiled with the VBFTA file to make the new kart_kanji_font.brfnt file. New brfnt file is created.
19. Move the new brfnt file back into the Font.d file of your extracted iso/wbfs
20. DELETE the Font.szs file now. We are about to compile a new one from our Font.d folder.
21. In terminal: cd /home/yourusername/Test/DATA/files/Scene/UI
22a. wszst create --encode-all ./Font.d
22b. replace ./Font.d with ./Font_K.d for Korean ISOs
23. A new Font.szs file is now created! You are done, only thing left is to compile the extracted iso/wbfs
24. cd /home/yourusername
25. wit copy ./Test /home/yourusername/YourNewWBFS.wbfs

Congratz!  Cool


Credits:
Atlas for brfnt2tpl program
Wiimm for Wiimm's Tools

Print this item

  Setup Your Own Local MKW Server
Posted by: Vega - 09-08-2018, 07:49 PM - Forum: Other - Replies (51)

Tutorial to Setup Your Own Local MKW Server


In this guide, I will teach you how to setup and run a mkw server whether its for a private use (LAN network) or for public use (anyone around the world can access it). The guide will include methods for both webservers, Apache and Nginx.

Requirements:
Experience with Wii Hacking and ISO Usage (have HBC installed, know how to run codes, etc)
Computer with Linux***
Experience with Linux in general (this isn't for Linux first-timers)

***This guide is specifically for Debian 9! I will include a small modification which should allow this to work on Ubuntu 14.04 LTS & 16.04 LTS.

It is best to start with a fresh installation of Debian 9. I have no idea what packages you already have installed on your Linux computer. They could conflict with the packages being installed on this guide.

Chapter  1. Update, Upgrade, Get Packages

Open a terminal. We need to get Debian fully updated and upgraded before we do anything.


sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade && sudo apt-get autoremove && sudo apt-get autoclean


If upgrades were done, reboot your computer. Now run the following command in terminal to install the necessary packages.


sudo apt-get update && sudo apt-get install ufw apache2 python python-twisted dnsmasq zip unzip



If using nginx replace 'apache2' with 'nginx'.
Small modification for Ubuntu: replace 'python' with 'python-2.7'


Chapter 2. Configuring Firewall, Port Forwarding

The package ufw that was downloaded is a simplified front-end for manipulating Linux's IP-Tables. If you have any current IP-Table firewall settings, clear/flush them now. Be sure to back them up if desired. Run the following terminal commands to get ufw setup with the proper port forwarding


sudo ufw default deny incoming
sudo ufw default allow outgoing


At this point we setup the basic default policies. Do this command now...


sudo ufw allow 80/tcp


There are more ports to open, but we need to test apache/nginx first. To make firewall changes take effect, run the following commands....


sudo ufw enable
sudo ufw status verbose


Your terminal should show on output that the TCP port 80 for both IPv4 and IPv6 is enabled. Let's boot Apache/Nginx now.


sudo service apache2 start


If using nginx, replace 'apache2' with 'nginx'

Open up a web browser. Type in localhost for the web address. You should be greeted by the default Apache Welcome Index Page (or the Nginx default index page if using Nginx).

Ok so Apache/Nginx works, and our firewall is working too. Now we need to punch open more ports. Just use the command that you did earlier for port 80/tcp, and do it for the following ports.

53
443
8000
9000
9001
9002
9003
9009
9998
27500
27900
27901
28910
29900
29901
29920

Alrighty, we're done with TCP ports. But most online gaming servers require the opening of UDP ports. We need all UDP ports opened. So run this command...


sudo ufw allow 2:65535/udp


All UDP ports are now opened. Let's reload the firewall for changes to take effect.


sudo ufw reload


Chapter 3: MKW Server package Download

Go to this link - https://github.com/barronwaffles/dwc_net...r_emulator

Click on the green button that says 'Clone or download'. Click on Download Zip. The MKW server package is now downloaded.

Assuming your downloads go to the folder "/home/yourusername/Downloads", run the following command...


cd /home/yourusername/downloads
unzip dwc_network_server_emulator-master.zip


Or just use any GUI extractor/file-archiver to unzip it.

A folder with the same name as the zip package will appear. Move that folder to a desired place. I personally move it to my main user directory (/home/yourusername). For demo purposes let's assume you move it to that directory.

Chapter 4a: Apache Configuration (skip if using Nginx)


sudo cp /home/yourusername/dwc_network_server_emulator-master/tools/apache-hosts/* /etc/apache2/sites-available


The apache host files have now been copied over to their proper location. We need to make some changes to Apache's config file. Go to /etc/apache2/apache2.conf, and open up that file (with proper sudo permissions) with your preferred text editor.

Scroll all the way to the very bottom and add these two lines...


ServerName localhost

HttpProtocolOptions Unsafe

Save and exit.

Run the following terminal command...


sudo a2ensite


A menu will appear allowing you to select which options you want to enable. Simply enter "*" (without the quotations) and press enter. Apache host files are now enabled.

Now run this command....


sudo a2enmod proxy proxy_http


Apache's Proxy Modules are now enabled. Restart Apache for all your new changes to take effect.


sudo service apache2 restart


Skip Chapter 4b, go to Chapter 5

Chapter 4b: Nginx Configuration (skip if using Apache)

Make a new file called nginx-hosts at the location of /etc/nginx/sites-available

Put the following contents in the nginx-hosts file...

Code:
server {
    listen 80;
    listen [::]:80;
    server_name gamestats.gs.nintendowifi.net gamestats2.gs.nintendowifi.net;
    location / {
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:9002;
    }
}

server {
    listen 80;
    listen [::]:80;
    server_name naswii.nintendowifi.net nas.nintendowifi.net conntest.nintendowifi.net;
    location / {    
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:9000;
    }
}

server {
    listen 80;
    listen [::]:80;
    server_name sake.gs.nintendowifi.net *.sake.gs.nintendowifi.net secure.sake.gs.nintendowifi.net *.secure.sake.gs.nintendowifi.net;
    location / {
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8000;
    }
}

server {
    listen 80;
    listen [::]:80;
    server_name dls1.nintendowifi.net;
    location / {
        proxy_set_header X-Forwarded-Host $host:$server_port;
        proxy_set_header X-Forwarded-Server $host;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:9003;
    }
}

Run the following command...


sudo ln -s /etc/nginx/sites-available /etc/nginx/sites-enabled


And now restart nginx...


sudo service nginx restart


Chapter 5. DNSMasq

We need to make some small changes on DNSMasq's config file. Open up the file /etc/dnsmasq.conf usnig proper sudo permissions with your preferred text editor. Scroll down thru the file and look for the following line....


#address=/double-click.net/127.0.0.1


First, you need to remove the '#'. Next change the '127.0.0.1' to your machine's local IP. This is the IP that your internet modem/router assigns to your machine for the lcoal LAN network. This is NOT your public IP. If you don't know the machine's local IP, run this...


hostname -I


If both IPv4 and IPv6 appear, you need the IPv4 (the number that doesn't use colons). For demo purposes, let's say our machine's local IP is 192.168.1.9.

So now the line in the config file would look like this....


address=/double-click.net/192.168.1.9


We're not done yet. Replace double-click.net with nintendowifi.net. So now the line looks like this..


address=/nintendowifi.net/192.168.1.9


Save and exit. Restart DNSMasq for changes to take effect...


sudo service dnsmasq restart


Chapter 6. Admin Page Setup (optional)

This is totally optional. If you don't care to see what your Wiis' Local IP's and MAc Addresses are (w/ ability to ban profiles), then skip to the next chapter.

Make a blank file in the /home/yourusername/dwc_network_server_emulator-master folder called adminpageconf.json Enter in the following contents for adminpageconf.json


{"username":"yourusernamehere","password":"yourpasswordhere"}


yourusernamehere = the username to log in as admin
yourpasswordhere = the password, duh

Do NOT remove the quotations!

Make changes, save and exit.

Chapter 7. First Time Server Boot

Run the following commands.....


sudo service apache2 restart
sudo service dnsmasq restart


If using nginx, replace 'apache2' with 'nginx'.

This is done to make sure all changes to all configurations are enabled. Now do this..


cd /home/yourusername/dwc_network_server_emulator-master
python master_server.py


Once you have pressed enter, the python script will start. Wait about 30 full seconds. This is a first time boot and the storage server can take roughly that time to fully start up.

Alright, the SERVER IS BOOTED!!!

Let's do a quick test now. Open up a web browser and type localhost:9001

This is the Stats page. You can use this page to see how many profiles are online. If you are able to load and see the Stats page then the server is running and it's time for an actual connection test on the Wii.

Chapter 8. Wii Connection Test

Ok we got the computer side-of-things done. Now we need to do some things to the Wii.

Go to Wii Settings, then Internet Settings. Make a brand new connection. Once you have done the connection test and it is complete, go back into the that Connection. Select Change Settings. Scroll left/right until you see 'Auto-Obtain DNS'. Change Yes to No. Click on Advance Settings.

For both Primary and Secondary DNS, enter in your Machine's Local IP address. (The same one you had to enter in for the dnsmasq.conf file from chapter 5)

Save changes, then preform the required Connection Test.

Watch your Linux terminal screen as you do the connection Test. The terminal will spit out some information about receiving a request. Then the Wii should finalize the test and say it is successful. Once successful, exit out of Wii Settings.

Chapter 9.  Connecting to your MKW server

There are a variety of different methods to test the MKW Wifi on your server. For this guide, we will assume you have a clean unmodified ISO/WBFS. Do NOT use any ISOs that have been patched in the past for other servers!!!

Add your clean ISO/WBFS to your USB stick, however you usually do it. Plug USB into Wii. Launch HBC.

If you don't have USB Loader GX (revision 1256 or later), then you can use this cheat code HERE. This code disables the game's SSL connection which is required.

Once you are in USB Loader GX, go to Loader Settings, There is an option for Private Server. Change that to "NoSSL".

Boot your game! You will need to use a fresh license or a license that does NOT have an FC. Make required license.


Go online!!! Watch your Linux terminal screen as you connect online on MKW. A boatload of info will be displayed. After a short time, the info will stop and you will then be online. Congratz! The terminal screen will now do some occasional messages about "keep alive requests". This is normal.

Wink

Chapter 10. Intro to making your MKW server work for public use (anyone can access it)

NOTE to the Noobs: Don't try running this from a computer in your basement, just use a VPS. You can find some for only $3 per month, no hidden fees. Use an 'unmanaged' VPS that allows root access.

You need...
A VPS (virtual private server) already bought for, and it's working. It MUST have an IPv4 address!
A domain name you have already bought (if using the domain name method), that's already been configured to point to your VPS

Chapters 10 and 11 of the guide are not going to baby step every little detail. It's expected that you already have some experience with VPS usage. If you don't know what a VPS is, don't bother trying to do this part of the guide until you know how to purchase one and get it running.

Alright so you got an MKW server to work on the LAN network, now it's time to host it on the world wide web. There are two methods for this: Have users connect with the VPS's public IP, or have them connect via a domain name that points to your VPS.

Chapter 11a. Public IP Method (skip if using Domain Name method)

Simply repeat the steps in this guide from earlier that got your private/LAN MKW server working. However there will be some slight changes plus additions.

On Chapter 2 (Firewall): You will ALSO need to punch open all the TCP and UDP ports on your VPS's firewall. This varies per VPS provider, but just find the settings in your Account page somewhere and open up all the necessary ports.
On Chapter 5 (DNSMasq): Instead of using the private IP of the computer that you were using, you will instead put in your VPS's IPv4 IP.

Reboot (hard reboot) your VPS before launching the MKW server! Process to Chapter 12.

NOTE: Due to some limitations of certain VPS providers, the public IP method might not work even if you did everything correctly.

Chapter 11b. Domain Name Method (skip if using Public IP method)

NOTE: Even though you are doing the domain name method, your VPS still needs an IPv4 address.

Simply repeat the steps in this guide from earlier that got your private/LAN MKW server working.

HOWEVER, skip Chapter 5 entirely (DNSMasq). If you have it already installed from an earlier server install, remove it.

On Chapter 2 (Firewall): You will ALSO need to punch open all the TCP and UDP ports on your VPS's firewall. This varies per VPS provider, but just find the settings in your Account page somewhere and open up all the necessary ports.
On Chapter 4a (apache2 config): In all the files within the apache-hosts folder, replace any instance of 'nintendowifi.net' with your domain name (example: mydomain.com)
On Chapter 4b (nginx config): In the nginx-hosts file, replace any instance of 'nintendowifi.net' with your domain name (example: mydomain.com)

Also, on your VPS, your provider should have a page to edit in DNS names. Add the following DNS names...
Code:
www
nas
naswii
dls1
conntest
*.gs

Reboot (hard reboot) your VPS before launching the MKW server. Please keep in mind that the DNS updates won't take effect for at least 15 minutes on the world wide web.

Chapter 12. Connecting to public MKW Server Online

If using the Public IP method, just repeat how you connected to the LAN MKW server from your Wii, except be sure to now use your VPS's public IP address.
If using the Domain Name method, patch your game using NoSSL code HERE, plus the Domain Full Name Changer code HERE. You won't need the NoSSL code if you are using NoSSL within the USBLoaderGX options.

Regardless of what method you are using, be sure you are testing this with a clean ISO/WBFS!

Try connecting your server. If it fails, view Chapter 13. If it works, congratz!! Big Grin

Chapter 13. Some notes and Troubleshooting

To stop the MKW Server... just exit out of the Terminal Screen. If you are online while you do this, you will receive EC's 84010 or 91010.

To login into the Admin page.. visit localhost:9009 on your web browser.

General Troubleshooting:
Problem: The python script won't run!!!
Answer1: Be sure you have both python and python-twisted installed. Be sure you have configured the proxy for Apache/Nginx correctly. Reboot Apache/Nginx, try again. Apache/Nginx must be running BEFORE you start the script.

Problem: Script has started, but I can't even access the Stats Page!
Answer1: Be sure you have entered in your actual Machine's Local IP correctly on the dnsmasq.conf. Don't just copy what you see posted in this guide. 

Answer2: Instead of typing in localhost:9001 in the web browser, try replacing 'localhost' with your machine's local Ip

Problem: I can't access the Admin Page!
Answer1: Be sure there are no typos in the adminpageconf.json filename. Be sure you didn't accidentally remove any quotations within the file. 

Answer2: Instead of typing in localhost:9009 in the web browser, try replacing 'localhost' with your machine's local Ip

Problem: I keep getting error codes when making a Wii Connection test to the server!
Answer1: Don't forget to edit the Primary/Secondary Addresses. Be sure you didn't typo your Local IP when entering it in too.

Answer2: Did you remember to start the script?

Answer3: Be sure you have opened up all the necessary ports on UFW firewall. Be sure the firewall is running. Reload it to be sure. 

Troubleshooting MKW Specific EC's when connecting online:
20100:
Game was already patched (not clean)
You forgot to set the No SSL options on within USB Loader GX
(If not using USB Loader GX) You forgot to use the NoSSL cheat code
You forgot to enter in the Primary/Secondary DNS IP Addresses (or you made a typo entering them in)
A very very very crappy Internet connection can cause this EC too

234XX:
You forgot to add those small edits needed on the apache2.conf file
You were not on a clean installation of Linux and your apache/nginx configuration already had some files and/or SSL certs installed, so its blocking the connection

23502:
Apache/Nginx is running but the script is not

5XXXX:
Crappy Internet connection, or you forgot to make an Internet connection in Wii Settings

60000:
You used a License with an FC already made on it. Use a brand new License.

84010 & 91010:
The script died or you accidentally closed it


Credits to Polaris!!!! (original python code writer/author for the dwc-network-emulator)

Print this item

  Hello
Posted by: FancyWheelies - 09-03-2018, 09:51 PM - Forum: Introductions - Replies (3)

Hey guys, it's me Fancy and hello!
I'm also on MarioKartBoards as FancyWheelies2Win.
I'm not exactly famous for anything.
The only things that have some kind of popularity are my YT channel Fancy Second Channel and my CT pack Fancy's CT pack which you can get from the Game Mods - Mario Kart Wii section of the Wii-homebrew.com forums.
I'm also on GBATemp as FancyNintendoGamer567.
My Twitter is @FancyOfficial22.
I hope you guys enjoy me being here.

Print this item

  Thread about Flashhax
Posted by: FancyWheelies - 09-03-2018, 08:17 PM - Forum: Coding & Hacking General Discussion - Replies (1)

Can you make a pinned thread about the Flashhax method of getting Wiimmfi, via chadsotft.co.uk/wiimmfi? Would be useful for anyone who found this thread and want to play on Wiimmfi but got no SD card.

Print this item

  Time Trial Starting Item Modifier [Vega]
Posted by: Vega - 09-03-2018, 06:08 PM - Forum: Time Trials & Battle - Replies (6)

Time Trial Starting Item Modifier [Vega]

Code allows you select whatever item you want to start a TT run with. Item will function normally.

NTSC-U
007907EF 000000XX
047ADEF8 3800000Y

PAL
007997FB 000000XX
047BC958 3800000Y

NTSC-J
00798E67 000000XX
047BBFC4 3800000Y

NTSC-K
00787BBB 000000XX
047AAD18 3800000Y

XX/Y Item Values:
00/1 = Green
01/1 = Red
02/1 = Nana
03/1 = Fib
04/1 = Shroom
05/3 = Trip Shrooms (default)
05/2 = 2/3 Trip Shrooms
05/1 = 1/3 Trip Shrooms, same as 04/01
06/1 = Bomb
07/1 = Blue
08/1 = Shock
09/1 = Star
0A/1 = Golden
0B/1 = Mega
0C/1 = Blooper
0D/1 = POW
0E/1 = TC
0F/1 = Bill
10/3 = Trip Greens
10/2 = 2/3 Trip Greens
10/1 = 1/3 Trip Greens
11/3 = Trip Reds
11/2 = 2/3 Trip Reds
11/1 = 1/3 Trip Reds
12/3 = Trip Nanas
12/2 = 2/3 Trip Nanas
12/1 = 1/3 Trip Nanas, same as 02/01
14/0 = Nothing

Code creator: Vega
Code credits: XeR (2nd set of code addresses originally found by him)

Print this item

  Re-Virginize Your Wii
Posted by: Vega - 09-03-2018, 02:20 AM - Forum: HBC & General Wii Softmodding - Replies (11)

How to Re-Virginize Your Wii's NAND


This guide will teach you how to reformat your Wii's NAND to a 'virgin' state. Almost identical to the way it was as if you bought said Wii brand new in box. You can also use this guide to re-virginize NAND files for Dolphin use. Your Wii NAND will have the 4.1 System Menu after it has been 're-virginize'. Why 4.1? Because it's the highest system menu that doesn't have the crazy anti-hack patches (such as 003 check) and can use Bannerbomb (v1) to install HBC.

This guide will be for experienced 'Softmodders'.


Chapter 1: Intro

Requirements:
A Wii with GCN ports ('family'/later-model Wiis cannot do a Bootmii backup restoration no matter what)
A NAND Backup (nand.bin file) of your Wii
A Backup of your Wii's Secret Keys (keys.bin file)
Your Bootmii folder to launch Bootmii
A Windows computer on XP (SP3) or later
SD card at least 1 GB (preferably a non-SDHC card)
HBC and Bootmii already installed
Know how to launch bootmii, and navigate thru it
Special NOTE!: If you have bootmii as boot2 installed on your Wii, you actually do NOT need a NAND & Wii Keys backup! Big Grin Thus, you can use this guide to repair a fully bricked Boot2 Wii with no current NAND backup!

If you don't have a NAND + Keys backup and you have Bootmii as an IOS installed instead with the purpose of using this guide to fix a bricked Wii, you must still be able to access Bootmii (thru HBC or priiloader). If not, your Wii is perma-bricked. If you have a NAND backup (like on your computer already) you still need to be able to access Bootmii thru HBC or Priiloader.



Chapter 2: Getting NAND Backup if you don't have one.

Skip this chapter if you already have a NAND backup file, Keys.bin Backup file, and a backup Bootmii folder

For those who don't have a proper backup bootmii folder to launch bootmii:

FIRST: Format your SD card to FAT32.

You will need the BootmiiFolders.zip package. Add me on discord (vega8365).

In the BootmiiFolders.zip package, you will see 5 folders.

- NewNTSCBootmii (later version of Bootmii for 480i NTSC)
- NewPALBootmii (later version of Bootmii for PAL)
- NewProgressiveBootmii (later version of Bootmii for 480p NTSC)
- OldNTSCBootmii (archaic version of Boomtii for NTSC)
- OldPALBootmii (archaic version of Bootmii for PAL)

It's recommended you try one of the later versions of Bootmii first. Now choose the one that is right for you. Within the folder that you have chosen is a folder just called Bootmii.

Move the Bootmii folder to your SD card.

Launch Bootmii-

Boot2 users: SD into Wii, power on Wii. Bootmii main menu will appear.

Bootmii IOS users: Access HBC. Press the Home button and click on Launch Bootmii. Bootmii appears, preform a standard NAND backup. If you can't access HBC, but still have Priiloader. Launch Priiloader and click Bootmii IOS. Bootmii main menu will appear.

NOTE: If Bootmii fails to launch, then try using one of the Old Bootmii versions from the BootmiiFolders.zip package.

You can use a GCN controller to navigate thru Bootmii. If not you will need to use the Console buttons.

Power = Move Right
Eject = Move Left
Reset = Select

Choose the far right option (double gear icon)

You will already be pre-selected on the far left icon (green arrow pointing to SD card). Simply select it. Bootmii will begin backing the NAND...

Once the NAND has been backed up, Bootmii isn't finished yet. It will then verify the back up. Do NOT skip this step. Afterwards, Bootmii will notify you that the verification has succeeded. You can now exit (press any button).

At this point, you will be back to the menu where the SD icons are shown. You can just unplug your Wii. But if you don't want to, then select the far right option to return back to Bootmii's main menu.

Now you can decide if you wanna select Wii Menu or HBC to return back to. Remove SD card from Wii, insert it into your computer.



Chapter 3: Formatting & Rebuilding NAND

Your SD should show the following items now..
/Bootmii
/keys.bin
/nand.bin

You will need NANDTools. Add me on Discord (vega8365) for more information
The region of Virgin NAND FIles that you use must match the original region of your Wii.

Extract/unzip the NANDTools.zip package. Open the program called ohneschwanzenegger.exe. Click the “Search…” button. Select the nand.bin from your SD card or where ever you currently have it at. Program will set a path to that nand.bin. At the top bar, click Content, setting.txt. A screen will appear with some important Wii info. What we need to be concerned with is just the 'Code' and 'SerNo'. Take a screenshot and/or copy paste the info to a quick txt file. We will need that info for later.

Click OK or cancel. Window will close. Click Content again. Click Format. You will be asked if you are sure. Be absolutely sure you are using the correct nand.bin file that you want to use.

Click Yes. Program will now say that the Nand has been formatted. NAND file is now completely formatted. 100% nothing in it. No system menu, no serial number, no save data, no Wii ID, no IOSs, no channels, nothing.

There are 4 different Virgin NAND packages.
4.1EVirginFiles.zip = European or Australian Wiis
4.1JVirginFiles.zip = Japanese or Taiwanese Wiis
4.1KVirginFiles.zip = Korean Wiis
4.1UVirginFiles.zip = American Wiis

Choose the one that is for your original region of your Wii Console. Extract/unzip the package. There will be a main 4.1XVirginFiles Folder (X = the region of the zip download).

Go back to the ohneschwanzenegger.exe program. Click on the button called "Local Cache". Now browse to and SELECT the that folder (4.1XVirginFiles). Click Open. The path to that folder will now be listed in the program to the left of the Local Cache button.

In the very top left empty field bar type 4.1X (X = the region). Make sure X is equal to the region of files that you have downloaded. Click the 'Get it!' button.

The program will then use the files from the 4.1XVirginFiles folder selected earlier and install it all onto the NAND.bin file. This should only take a few minutes. Once completed, the setting.txt prompt will auto appear on the program with some default (not yours) values for Code and SerNo. Remember when I told you to back your original Code and SerNo values? We will need that info now. Replace the value in Code to the value that you backed up from earlier. Replace the value in SerNo to the value that you also backed up from eari.er. Be sure it is all correct!

Click OK! NAND is almost ready for injection back into the Wii!



Chapter 4: Wii Flash Toolz

Exit out of ohneschwanzenegger.exe. Now open the file WiiFlashToolxV0.3.exe. At the top right there’s a “...” button. Click it and find the nand.bin you that just formatted and rebuilt. Program will notify you once Nand is loaded. 

Click OK

At the very bottom right of the screen (next to extract keys). There’s another “...” button. Click it and select the keys.bin that you got earlier from the bootmii NAND backup or from wherever you have it backed up on your computer.

At the bottom you will see an Append Keys button. Click it. The program will append your Wii's unique keys to your rebuilt nand.bin.

Click OK. Exit the program. Now move the finalized nand.bin file onto your SD (you won't need the keys.bin file anymore, just move it to a safe place for storage for possible future use if it's ever needed). Be sure you don’t have the old.bin files still in the SD, and also be sure that the Bootmii folder is still present. If you have your own backup of your Bootmii folder (didn't place a Bootmii folder onto SD card earlier if you didn't have to do the Bootmii backup), move it to the SD card. These 2 items should be on your SD

bootmii folder
nand.bin (formatted then rebuilt, keys appended, ready for injection into Wii)

If you are doing this for Dolphin Emulator use, then you are already done. You already have your nand.bin file ready for use. Congratz.



Chapter 5: Injecting NAND back Into Wii

SD card back into Wii. Enter into Bootmii. Go back to the menu that had the SD icons. Now this time you will select the one that as the red arrow pointing from the SD card to a chip. You will be notified about a simulation being preformed first. Click A (Reset) to continue.

Bootmii will begin restore simulation, green squares will partially fill the gray grid. Once that is done, you will be prompted to press Eject to begin the  realNAND restore or press any other button to abort and exit.

**Bootmii as IOS users will receive a warning that the NAND backup is too dangerous and to exit. If you are really sure you want to proceed you will need to enter the Konami code. Press these buttons in this exact order on your GCN: Up-Up-Down-Down-Left-Right-Left-Right-B-A-Start.. If you mess up entering the Konami code, you will be booted from RestoreMii and have to attempt to enter the code again.**

Press Eject, RestoreMii will begin. Once done, you will see the message 'I HAZ SUCCESS!”. Press any button to exit.

Now simply exit back to Bootmii's main menu.

SELECT THE ICON TO LAUNCH THE WII MAIN MENU



Chapter 6: Wii Boot after Success, Conclusion

Now, give your Wii a moment. It is booting up as if you bought it brand new. You have just completely wiped everything from the Wii. Every mod, literally everything. The NAND is clean with only the default factory-given IOSs/wads + channels to run your Wii.

You will be welcomed to the Wii's first-time boot setup screen. Complete your wii setup. You will be back to the Wii Main Menu. Congratz! Your Wii has been completely “re-virginized”. 

NOTE for Boot2 Users: Bootmii as Boot2 is the only thing that doesn't get wiped. If you using this guide for the purpose to sell your Wii as 100% Virgin, do any exploit to bring up the Hackmii Installer (for 4.1 system menu; such as BannerbombV1 or BannerbombV2). Then go to Bootmii and click Uninstall Bootmii as Boot2. Once done, exit the Hackmii Installer.

Welp that's it!   Tongue



Credits:
Everything in NANDTools.zip package (except Wii Flash Toolz) created by: Giantpune
Wii Flash Toolz created by: StreamLineHD

Print this item

  Graphical WiFi Status & Host Detector [Vega]
Posted by: Vega - 09-01-2018, 09:24 PM - Forum: Online Non-Item - Replies (3)

Graphical WiFi Status & Host Detector [Vega]

NOTE: It's recommended to also include this code to eliminate frame flickers -> https://mkwii.com/showthread.php?tid=1530

This code will tell you (via a graphical image/message on the bottom left of your screen)) what your Wifi Status is. Thus, you can use this code to see whether or not you are the host of a WW Race/Battle.

List of Graphical Image Outputs:
Idling, or went offline after being Online - ONLINE
Guest (non-host) of race/battle - GUEST
Searching for WW/regional - SEARCH
Joining Open Room - JOIN..
Host of race/battle - HOST
Haven't connected online for first time - N/A

NTSC-U
C200A3F0 00000007
9421FF80 BC610008
806DA358 80630044
80630000 3D808002
618C23E0 7D8803A6
4E800021 B8610008
38210080 80010014
60000000 00000000
C2009640 0000001A
9421FF80 BC610008
3D808000 816C1508
38800000 2C0B0001
41820030 2C0B0002
41820038 2C0B0003
41820040 2C0B0004
41820048 2C0B0005
41820050 3C604E2F
60634100 4800004C
3C604F4E 60634C49
3C804E45 4800003C
3C604755 60634553
3C805400 4800002C
3C605345 60634152
3C804348 4800001C
3C604A4F 6063494E
3C802E2E 4800000C
3C60484F 60635354
6186150C 7C6645AA
38600009 388000DA
38A00001 3FE08002
63EC1DF0 7D8803A6
4E800021 63EC1DD0
7D8803A6 4E800021
B8610008 38210080
81830000 00000000
C20FC4A4 00000002
3D808000 93EC1508
93FC023C 00000000

PAL
C200A430 00000007
9421FF80 BC610008
806DA360 80630044
80630000 3D808002
618C2480 7D8803A6
4E800021 B8610008
38210080 80010014
60000000 00000000
C2009680 0000001A
9421FF80 BC610008
3D808000 816C1508
38800000 2C0B0001
41820030 2C0B0002
41820038 2C0B0003
41820040 2C0B0004
41820048 2C0B0005
41820050 3C604E2F
60634100 4800004C
3C604F4E 60634C49
3C804E45 4800003C
3C604755 60634553
3C805400 4800002C
3C605345 60634152
3C804348 4800001C
3C604A4F 6063494E
3C802E2E 4800000C
3C60484F 60635354
6186150C 7C6645AA
38600009 388000DA
38A00001 3FE08002
63EC1E90 7D8803A6
4E800021 63EC1E70
7D8803A6 4E800021
B8610008 38210080
81830000 00000000
C20FC544 00000002
3D808000 93EC1508
93FC023C 00000000

NTSC-J
C200A38C 00000007
9421FF80 BC610008
806DA360 80630044
80630000 3D808002
618C23A0 7D8803A6
4E800021 B8610008
38210080 80010014
60000000 00000000
C20095DC 0000001A
9421FF80 BC610008
3D808000 816C1508
38800000 2C0B0001
41820030 2C0B0002
41820038 2C0B0003
41820040 2C0B0004
41820048 2C0B0005
41820050 3C604E2F
60634100 4800004C
3C604F4E 60634C49
3C804E45 4800003C
3C604755 60634553
3C805400 4800002C
3C605345 60634152
3C804348 4800001C
3C604A4F 6063494E
3C802E2E 4800000C
3C60484F 60635354
6186150C 7C6645AA
38600009 388000DA
38A00001 3FE08002
63EC1DB0 7D8803A6
4E800021 63EC1D90
7D8803A6 4E800021
B8610008 38210080
81830000 00000000
C20FC464 00000002
3D808000 93EC1508
93FC023C 00000000

NTSC-K
C200A538 00000007
9421FF80 BC610008
806DA380 80630044
80630000 3D808002
618C24E0 7D8803A6
4E800021 B8610008
38210080 80010014
60000000 00000000
C2009788 0000001A
9421FF80 BC610008
3D808000 816C1508
38800000 2C0B0001
41820030 2C0B0002
41820038 2C0B0003
41820040 2C0B0004
41820048 2C0B0005
41820050 3C604E2F
60634100 4800004C
3C604F4E 60634C49
3C804E45 4800003C
3C604755 60634553
3C805400 4800002C
3C605345 60634152
3C804348 4800001C
3C604A4F 6063494E
3C802E2E 4800000C
3C60484F 60635354
6186150C 7C6645AA
38600009 388000DA
38A00001 3FE08002
63EC1EF0 7D8803A6
4E800021 63EC1ED0
7D8803A6 4E800021
B8610008 38210080
81830000 00000000
C20FC5BC 00000002
3D808000 93EC1508
93FC023C 00000000



List of Sources:
1st ASM (When Game loads StaticR.rel, Get Render Mode & Call Direct Print Setup Frame Buffer)

#~~~~~~~~~~~~~~~~#
# START ASSEMBLY #
#~~~~~~~~~~~~~~~~#

#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Register Notes: #
# No need to backup r0 or LR #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~#
# Macros & Statements #
#~~~~~~~~~~~~~~~~~~~~~#

.macro push_stack
stwu r1, -0x80 (r1)
stmw r3, 0x8 (r1)
.endm

.macro pop_stack
lmw r3, 0x8 (r1)
addi r1, r1, 0x80
.endm

.macro call_link address
lis r12, \address@h
ori r12, r12, \address@l
mtlr r12
blrl
.endm

.macro default_instruction
lwz r0, 0x0014 (r1)
.endm

.set region, '' #Must set region value, or else source will not compile

.if (region == 'E' || region == 'e') # RMCE
.set nw4r_db_DirectPrint_SetupFB, 0x800223E0
.elseif (region == 'P' || region == 'p') # RMCP
.set nw4r_db_DirectPrint_SetupFB, 0x80022480
.elseif (region == 'J' || region == 'j') # RMCJ
.set nw4r_db_DirectPrint_SetupFB, 0x800223A0
.elseif (region == 'K' || region == 'k') # RMCK
.set nw4r_db_DirectPrint_SetupFB, 0x800224E0
.else # Invalid Region
.abort
.endif

#~~~~~~~~~~~~~~~~~~~~~~~#
# Start Register Safety #
#~~~~~~~~~~~~~~~~~~~~~~~#

push_stack

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Get Render Mode (RKSystem->mpVideo()->pRenderMode) #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

.if (region == 'E' || region == 'e') # RMCE
lwz r3, -0x5CA8(r13)
.elseif (region == 'P' || region == 'p') # RMCP
lwz r3, -0x5CA0(r13)
.elseif (region == 'J' || region == 'j') # RMCJ
lwz r3, -0x5CA0(r13)
.elseif (region == 'K' || region == 'k') # RMCK
lwz r3, -0x5C80(r13)
.endif

lwz r3, 0x0044(r3)
lwz r3, 0x0 (r3)

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Call nw4r::db: DirectPrint_SetupFB #
# r3 = Render Mode #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

call_link nw4r_db_DirectPrint_SetupFB

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# End Register Safety; Default Instruction #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

pop_stack
default_instruction

#

#~~~~~~~~~~~~~~#
# END ASSEMBLY #
#~~~~~~~~~~~~~~#

==========

2nd ASM (Draw Text to Screen)

#~~~~~~~~~~~~~~~~#
# START ASSEMBLY #
#~~~~~~~~~~~~~~~~#

#

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#      Register Notes:      #
# No need to backup r0, or LR #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~#
# Macros & Statements #
#~~~~~~~~~~~~~~~~~~~~~#

.macro push_stack
    stwu r1, -0x80 (r1)
    stmw r3, 0x8 (r1)
.endm

.macro pop_stack
    lmw r3, 0x8 (r1)
    addi r1, r1, 0x80
.endm

.macro call_nw4r address
    ori r12, r31, \address@l
    mtlr r12
    blrl
.endm

.macro default_instruction
    lwz r12, 0x0 (r3)
.endm

.set region, ''

.if    (region == 'E' || region == 'e') # RMCE
    .set nw4r_db_DirectPrint_Printf, 0x1DF0
    .set nw4r_db_DirectPrint_StoreCache, 0x1DD0
.elseif (region == 'P' || region == 'p') # RMCP
    .set nw4r_db_DirectPrint_Printf, 0x1E90
    .set nw4r_db_DirectPrint_StoreCache, 0x1E70
.elseif (region == 'J' || region == 'j') # RMCJ
    .set nw4r_db_DirectPrint_Printf, 0x1DB0
    .set nw4r_db_DirectPrint_StoreCache, 0x1D90
.elseif (region == 'K' || region == 'k') # RMCK
    .set nw4r_db_DirectPrint_Printf, 0x1EF0
    .set nw4r_db_DirectPrint_StoreCache, 0x1ED0
.else # Invalid Region
    .err
.endif

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#          Mem Address Notes:            #
# 0x80001504 = Online/Offline Status Word #
#      0x80001508 = Wifi Word Number      #
#  0x8000150C thru 1514 = ASCii String  #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

#~~~~~~~~~~~~~~~~~~~~~~~#
# Start Register Safety #
#~~~~~~~~~~~~~~~~~~~~~~~#

push_stack

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# Load WiFi Status Number, Do Checks, Apply ASCii in Registers #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

lis r12, 0x8000
lwz r11, 0x1508 (r12)
li r4, 0x0

cmpwi r11, 0x1
beq- online_1
cmpwi r11, 0x2
beq- guest_2
cmpwi r11, 0x3
beq- search_3
cmpwi r11, 0x4
beq- connectfriend_4
cmpwi r11, 0x5
beq- host_5

lis r3, 0x4E2F
ori r3, r3, 0x4100
b status_done

online_1:
lis r3, 0x4F4E
ori r3, r3, 0x4C49
lis r4, 0x4E45
b status_done

guest_2:
lis r3, 0x4755
ori r3, r3, 0x4553
lis r4, 0x5400
b status_done

search_3:
lis r3, 0x5345
ori r3, r3, 0x4152
lis r4, 0x4348
b status_done

connectfriend_4:
lis r3, 0x4A4F
ori r3, r3, 0x494E
lis r4, 0x2E2E
b status_done

host_5:
lis r3, 0x484F
ori r3, r3, 0x5354

status_done:
ori r6, r12, 0x150C #r6 Arg set for DirectPrint
stswi r3, r6, 8

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
#              DirectPrint Printf & Store Cache              #
#                  Purpose: Draw on Screen                    #
#            r3 = X coordinate (starts far left)              #
#            r4 = Y coordinate (starts at very top)          #
#  r5 = 0 No Wrap; 1 Wrap #Put Black Border Fill around text  #
# r6 = Address Pointer to String that will be Drawn on Screen #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

li r3, 0x9  # X coordinate of text start
li r4, 0xDA # Y coordinate of text start
li r5, 0x1  # Wrap text

lis r31, 0x8002 #For nw4r macro

call_nw4r nw4r_db_DirectPrint_Printf
call_nw4r nw4r_db_DirectPrint_StoreCache

#~~~~~~~~~~~~~~~~~~~~~#
# End Register Safety #
#~~~~~~~~~~~~~~~~~~~~~#

pop_stack

#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
# dont_execute label; Default Instruction #
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#

default_instruction

#

#~~~~~~~~~~~~~~#
# END ASSEMBLY #
#~~~~~~~~~~~~~~#

==========

3rd ASM (Store WiFi Status Number):
lis r12, 0x8000
stw r31, 0x1508 (r12)
stw r31, 0x023C (r28) #Default Instruction



Code creator: Vega
Code credits: Star & Riidefi (Draw Text to Screen Code)

Print this item

  Register Safety for the Beginner
Posted by: Vega - 08-29-2018, 06:13 PM - Forum: PowerPC Assembly - No Replies

Register Safety for the Beginner



Once your ASM code creating skills have gone beyond 'super basic', you will eventually run into a situation where you will need to use other registers than just the ones that are used by the default/original instruction of your Code. This thread will cover GPR register safety only.

Let's discuss Register Safety

A code creator simply cannot choose at will which registers to use as a temporary space to read and/or write data. Doing so can cause unwanted effects on the game. Even if a code appears to be working, you may be effecting 'hidden' functions of the game.

Let's go over all the General Purpose Registers and explain which ones you are allowed to use...



Register 12 (99.9% Safe)

r12 is the safest register. 99.9% of the time, you can use this register freely. Freely meaning you do not have to restore it's original contents at any point in your source.



Register 11 (99% Safe)

r11 is what I call r12's little brother in regards to safety. 99% of the time, you can use this register freely.



Register 0, and Registers 3 thru 10 (Semi Safe)

r0, and r3 thru r10 are what is known as volatile registers.

You can sometimes use these registers freely w/o restoring their original values, but this is not wise. If you must use these registers, please restore their original value(s) at some point in your code.

Even with that being said, restoring the original value(s) is NOT a 100% guarantee for register safety. Let's say you have a code, and you notice that r7 appears to always be the value of 0 whenever the default instruction at the code's address is executed. Maybe you came to this conclusion because you left a Breakpoint active/on and noticed the pattern of r7 always being Zero. Therefore, at the end of your code, you write the following.. 

li r7, 0 #Restore r7's original value

Good, right? Maybe not. There's still a chance that r7 can be something other than 0. This chance could be uncommon. Which can result in your code becoming "buggy" or your game randomly crashing. Even if r7 always being Zero is true, writing a code in a such a fashion is not "proper".

Generally speaking with the volatile registers, the higher the number, the safer it is. So r10 would be the most 'safest' to use, with r3 being the least safe. r0 plus r3 and r4 are generally less safe than r5 thru r10.

If you must use one of these registers, then stick with r10. I would give r10 a 95% 'safety rating'.



Registers 14 thru 31 (Not Safe)

r14 thru r31 are non-volatile registers. They are called the Global Variable Registers (or just GVR's). Their values must always be preserved.



Registers 1, 2, & 13 (Dangerous)

Never, and I repeat NEVER use r1, r2, and r13!! Even if you backup their values and restore them, this is still dangerous. These registers are used by the CPU to access specific areas of memory related to constants, global variables, etc.  They will be read during interrupts which you will not see or know about. For specific circumstances, r1 can be used with its original value backed up (called pushing/popping the stack), which will be covered in the next segment.

Fyi: r1 is also called sp (stack pointer), and r2 is also called rtoc (register table of contents).




At this point, you are probably wondering what is the correct way to get more free registers. Here's one tip...

Looking Ahead Beyond your Code Address...

We know we can almost always use r11, and r12. Let's say the very next instruction after your code's address is this...

mulli r31, r8, 0x4

You can actually use r31 freely. This is because once your code is completely finished and the next address's instruction is executed by the game, r31 is going to be overwritten regardless. Obviously, this also shows that we cannot utilize r8 at all because r8 is being used as a source register for the mulli instruction.

Now you know that handy trick to get some more free registers, here's a nice method that allows you to use r14 thru r31.

This method is called the 'Push/Pop the Stack' method.

Code:
#Default/original instruction could reside here...

stwu sp, -0x0050 (sp) #make space for 18 registers
stmw r14, 0x8 (sp) #push r14-r31 onto the stack pointer

#Your ASM contents go here

lmw r14, 0x8 (sp) #pop r14-r31 off the stack pointer
addi sp, sp, 0x0050 #release the space

#Default/original instruction could reside here...

As a beginner ASM coder, you don't need to worry about the technical details of how this works.

You can now use r14 thru r31. If you include r11 and r12, you will have 20 free registers to use!

Question: Are there any cons to using the Push/Pop Stack method?

Generally, no. If you are nit picky about shortening the length of assembled code as much as possible, then try to avoid using it.

There is a very very rare chance that this can cause a crash. I would rate it a 99.99% 'success' rate.



Conclusion:

Proper register safety is a must for any code. It is dependent on the responsibility of the coder to do his/her research and have their code(s) be safe for use in the game.

All Credits to:
dcx2
Y.S.

Print this item

  Force Character/Vehicle [Vega]
Posted by: Vega - 08-29-2018, 03:05 PM - Forum: Online Non-Item - No Replies

Force Character/Vehicle [Vega]

Works everywhere. Online, offline, battle, etc.

This code will force the character/vehicle combo that you set on the code for you to use no matter what you choose during the character and vehicle selection screens. Due to the nature of this code, you will see funny depictions of the characters and vehicles. These depictions do not effect anything. Whenever the race/battle begins, you will have the character/vehicle combo that you set for the code.

NTSC-U
C2823670 00000002
3BA000KK 93A4012C
60000000 00000000
C2829E20 00000002
3BE000VV 93E3013C
60000000 00000000

PAL
C283E0D0 00000002
3BA000KK 93A4012C
60000000 00000000
C2846CF8 00000002
3BE000VV 93E3013C
60000000 00000000

NTSC-J
C283D73C 00000002
3BA000KK 93A4012C
60000000 00000000
C2846364 00000002
3BE000VV 93E3013C
60000000 00000000

NTSC-K
C282C490 00000002
3BA000KK 93A4012C
60000000 00000000
C28350B8 00000002
3BE000VV 93E3013C
60000000 00000000

KK Values:
00 = Mario
01 = Baby Peach
02 = Waluigi
03 = Bowser
04 = Baby Daisy
05 = Dry Bones
06 = Baby Mario
07 = Luigi
08 = Toad
09 = Donkey Kong
0A = Yoshi
0B = Wario
0C = Baby Luigi
0D = Toadette
0E = Koopa
0F = Daisy
10 = Peach
11 = Birdo
12 = Diddy Kong
13 = King Boo
14 = Bowser Jr.
15 = Dry Bowser
16 = Funky Kong
17 = Rosalina
18 = S Mii AM
19 = S Mii AF
1A = S Mii BM
1B = S Mii BF
1C = S Mii CM
1D = S Mii CF
1E = M Mii AM
1F = M Mii AF
20 = M Mii BM
21 = M Mii BF
22 = M Mii CM
23 = M Mii CF
24 = L Mii AM
25 = L Mii AF
26 = L Mii BM
27 = L Mii BF
28 = L Mii CM
29 = L Mii CF
2A = M Mii
2B = S Mii
2C = L Mii

VV Values:
00 = Standard Kart S
01 = Standard Kart M
02 = Standard Kart L
03 = Booster Seat
04 = Classic Dragster
05 = Offroader
06 = Mini Beast
07 = Wild Wing
08 = Flame Flyer
09 = Cheep Charger
0A = Super Blooper
0B = Piranha Prowler
0C = Tiny Titan
0D = Daytripper
0E = Jetsetter
0F = Blue Falcon
10 = Sprinter
11 = Honeycoupe
12 = Standard Bike S
13 = Standard Bike M
14 = Standard Bike L
15 = Bullet Bike
16 = Mach Bike
17 = Flame Runner
18 = Bit Bike
19 = Sugarscoot
1A = Wario Bike
1B = Quacker
1C = Zip Zip
1D = Shooting Star
1E = Magikruiser
1F = Sneakster
20 = Spear
21 = Jet Bubble
22 = Dolphin Dasher
23 = Phantom

Source
#Character code#
li r29, KK
stw r29, 0x012C (r4)
nop

#Vehicle code#
li r31, VV
stw r31, 0x013C (r3)
nop

Code creator: Vega

Print this item

  Private Room Messages Stay Prompted Forever [Vega]
Posted by: Vega - 08-29-2018, 02:39 PM - Forum: Online Non-Item - No Replies

Private Room Messages Stay Prompted Forever [Vega]

This code nops the function of the game that is responsible to remove a prompted private room message after a specific set time. Thus, (on your screen only) any messages that are sent in the private room will stay prompted forever until another message is sent, or if the room has started.

NTSC-U
0462B14C 60000000

PAL
045DABD8 60000000

NTSC-J
045DA4B4 60000000

NTSC-K
045C8D74 60000000

Code creator: Vega

Print this item