Welcome, Guest |
You have to register before you can post on our site.
|
Online Users |
There are currently 154 online users. » 0 Member(s) | 151 Guest(s) Bing, Google, Yandex
|
Latest Threads |
Make it to 10,000
Forum: General Discussion
Last Post: Fifty
42 minutes ago
» Replies: 7,743
» Views: 6,013,701
|
Item Cycler v2 [Ro]
Forum: Online; Item
Last Post: _Ro
02-26-2025, 11:14 PM
» Replies: 10
» Views: 812
|
Change Miis In Between Ra...
Forum: Online Non-Item
Last Post: Vega
02-25-2025, 05:35 PM
» Replies: 0
» Views: 85
|
Change HUD position
Forum: Textures/Mods/CT's
Last Post: shaymcn02
02-25-2025, 04:21 PM
» Replies: 0
» Views: 86
|
(Request) Battle Timer Mo...
Forum: Code Support / Help / Requests
Last Post: Vega
02-25-2025, 02:31 PM
» Replies: 1
» Views: 114
|
Press Button to Restart G...
Forum: Misc/Other
Last Post: Vega
02-24-2025, 01:46 PM
» Replies: 0
» Views: 68
|
Press Button To Turn Off ...
Forum: Misc/Other
Last Post: Vega
02-24-2025, 01:45 PM
» Replies: 0
» Views: 39
|
(Request) Remove Highligh...
Forum: Code Support / Help / Requests
Last Post: WaluigiisFluffy
02-23-2025, 11:00 PM
» Replies: 0
» Views: 80
|
(Request) Multiplayer Mul...
Forum: Code Support / Help / Requests
Last Post: WaluigiisFluffy
02-23-2025, 09:57 PM
» Replies: 0
» Views: 49
|
Show Kart Statuses on Min...
Forum: Visual & Sound Effects
Last Post: _Ro
02-23-2025, 07:12 PM
» Replies: 7
» Views: 1,402
|
|
|
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! 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! 
Credits:
Everything in NANDTools.zip package (except Wii Flash Toolz) created by: Giantpune
Wii Flash Toolz created by: StreamLineHD
|
|
|
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)
|
|
|
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.
|
|
|
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
|
|
|
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
|
|
|
Everyone On Your Screen Has Same Line Color [Vega] |
Posted by: Vega - 08-28-2018, 03:11 PM - Forum: Incomplete & Outdated Codes
- No Replies
|
 |
Everyone On Your Screen Has Same Line Color [Vega]
NOTE: Outdated by CLF78's version which works in all game codes and allows custom color settings
This code will make it to where everyone in an online race will have the line color of your choice. Obviously, this only effects the visuals on your screen.
NTSC-U
0461E0CC 3880000X
PAL
046513E0 3880000X
NTSC-J
04650A4C 3880000X
NTSC-K
0463F6F8 3880000X
X = Region ID/Line Color
0 = Japan (red)
1 = Americas (blue)
2 = Europe (green)
3 = AUS/NZ (yellow)
4 = Taiwan (white)
5 = S. Korea (purple)
6 = China (white)
7+ = white
Code creator: Vega
Code credits: Star (address founder)
|
|
|
Beginner's Simple ASM Reference Page |
Posted by: Vega - 08-21-2018, 10:46 PM - Forum: Resources and References
- Replies (7)
|
 |
Beginner's Simple ASM Reference Page
This reference page is for beginner ASM Coders. It covers most instructions that are suitable for beginner-level Assembly work. It does include some 'intermediate level' stuff. Therefore, if you are a Beginner and some of the stuff confuses you, you can always visit this page back later after you have gained more ASM knowledge/experience.
Advanced ASM Coders have basically no need for this page, as they should be knowledgeable enough to decipher a 'professional' level PPC-based User's Manual.
General overview:- Instruction Name
- Syntax
- Signed vs Unsigned treatment of Values (if applicable)
- Description & Notes
- Example (if necessary)
Notes for Syntax format:- rD = Destination General Purpose Register
- rA = Source General Purpose Register
- rB = 2nd Source General Purpose Register
- SIMM = Signed 16-bit Immediate Value Range
- UIMM = Unsigned 16-bit Immediate Value Range
- NB = Number of Bytes (for lswi and stswi only)
Load Immediate
li rD, SIMM
Loads SIMM into rD.
li r3, 0x00CC
Loads the immediate value 0x00CC into r3. r3 is now 0x000000CC.
Nop
This instruction will literally make the CPU do nothing. Nop is short for No-Operation. Some C2 Insert ASM Codes may have a nop added at the very end (by the ASM Assembler) as the source of any C2 ASM Code needs to have an odd amount of instructions.
Example:
li r0, 1
stw r0, 0 (r12)
nop
Add
add rD, rA, rB
The result of rA + rB is placed into rD.
add r6, r5, r4
If..
r5 = 4
r4 = 5
Then r6 would equal 0x00000009
Subtract
sub rD, rA, rB
The result of rA - rB is placed into rD.
sub r12, r11, r4
If..
r11 = 0
r4 = 4
Then r12 would equal -4 (0xFFFFFFFC)
Add Immediate
addi rD, rA, SIMM
The result of rA + SIMM is placed into rD. If rA = r0, then rA is treated as literal 0.
addi r6, r5, 2
If..
r5 = 4
Then r6 would equal 0x00000006
Subtract Immediate
subi rD, rA, SIMM
The result of rA - SIMM is placed into rD. If rA = r0, then rA is treated as literal 0.
subi r30, r16, 1
If..
r16 = 1
Then r30 would equal zero.
Load Immediate Shifted
lis rD, UIMM
Loads UIMM into the upper 16 bits of rD. Lower 16 bits of rD are cleared (zeroed)
lis r12, 1
Loads the immediate value of 1 into the upper 16 bits of r12, lower 16 bits are cleared. r12 is now 0x00010000
Or Immediate
ori rD, rA, UIMM
For most uses in Assembly Codes, ori is used along with lis to write a complete word value to a register.
Example:
lis r4, 0x8000
ori r4, r4, 0x15EC
r4 is now 0x800015EC
Add Immediate Shifted
addis rD, rA, UIMM
UIMM (as VVVV0000) is added to rA. The result is placed into rD. Therefore, the lower bits of rA will always be 'copied' over to rD in any addis instruction. If rA = r0, then rA is treated as literal 0.
addis r6, r5, 2
If..
r5 = 4
Then r6 would equal 0x00020004.
Subtract Immediate Shifted
subis rD, rA, SIMM
The result of rA minus SIMM (as VVVV0000) is placed into rD. Therefore, the lower bits of rA will always be 'copied' over to rD in any subis instruction. If rA = r0, then rA is treated as literal 0.
subis r11, r7, 0x2000
If..
r7 = 0x10005555
Then r11 would equal 0xF0005555.
Store Word
stw rD, SIMM (rA)
Word value in rD is stored to the memory address designated by SIMM+rA. If rA = r0, then rA is treated as literal 0.
stw r3, 0x0002 (r4)
If..
r3 = 0x00000005
r4 = 0x80001574
Then the word at Memory Address 0x80001576 is now 0x00000005.
Store Halfword
sth rD, SIMM (rA)
Halfword value in rD is stored to the memory address designated by SIMM+rA. If rA = r0, then rA is treated as literal 0.
sth r3, 0x0002 (r4)
If..
r3 = 0x00000005
r4 - 0x80001574
Then the halfword at Memory Address 0x80001576 is now 0x0005.
Store Byte
stb rD, SIMM (rA)
Byte value in rD is stored to the memory address designed by SIMM+rA. If rA = r0, then rA is treated as literal 0.
stb r3, 0x0002 (r4)
If..
r3 = 0x00000005
r4 = 0x80001574
Then the byte at Memory Address 0x80001576 is now 0x05.
Load Word & Zero
lwz rD, SIMM (rA)
The word value in Memory located at SIMM+rA is loaded into rD. If rA = r0, then rA is treated as literal 0.
lwz r3, 0x0002 (r4)
If...
r4 = 0x80001574
& Word value at Memory Address 0x80001576 is 0x1500FFFF
Then r3 would equal 0x1500FFFF.
Load Halfword & Zero
lhz rD, SIMM (rA)
The halfword value in Memory located at SIMM+rA is loaded into rD. Upper 16 bits of rD are cleared (zeroed). If rA = r0, then rA is treated as literal 0.
lhz r3, 0x0002 (r4)
If..
r4 = 0x80001574
& Halfword value at Memory Address 0x80001576 is 0x1500
Then r3 would equal 0x00001500.
Load Byte & Zero
lbz rD, SIMM (rA)
The byte value in Memory located at SIMM+rA is loaded in rD. The left-hand side 3 bytes of rD are cleared (zeroed). If rA = r0, then rA is treated as literal 0.
lbz r3, 0x0002 (r4)
If..
r4 = 0x80001574
& Byte value at Memory Address 0x80001576 = 0x15
Then r3 would equal 0x00000015.
Move Register
mr rD, rA
Value of rA is copied to rD.
mr r4, r3
If..
r3 = 0xFFFFFFD0
Then r4 = 0xFFFFFFD0.
Multiply Low Word Signed
mullw rD, rA, rB
Signed
The result of rA x rB is placed into rD. The multiplication is Signed. If the result exceeded a 32-bit sized value, then only the lower 32 bits of said value are used as the result in rD.
mullw r9, r3, r0
If...
r0 = 0x00000005
r3 = 0x0000000B
Then r9 would equal 0x00000037
Multiply Immediate Signed
mulli rD, rA, SIMM
Signed
Thre result of rA x rB is placed into rD. The multiplication is Signed. If the result exceeded a 32-bit sized value, then only the lower 32 bits of said value are used as the result in rD>
mulli r10, r10, 0x0004
If..
r10 = 0x0000000C
Then r10 would equal 0x00000030
Divide Word Signed
divw rD, rA, rB
Signed
The result of rA / rB is placed into rD. The division is Signed. If rounding is needed, the number will round *DOWN* to the closest whole number. Let's pretend you executed a divw instruction that had a result of 1.9 (0x1.E66~ in Hex), the result placed into rD will be 1.
divw r4, r30, r15
If..
r30 = 0xFFFFFFFC
r15 = 0x00000002
Then r4 would equal 0xFFFFFFFE.
Divide Word Unsigned/Logical
divwu rD, rA, rB
Unsigned/Logical
The result of rA / rB is placed in rD. The division is Unsigned and thus, all values are treated as positive. If rounding is needed, the number will round *DOWN* to the closest whole number.
divwu r4, r30, r15
If..
r30 = 0xFFFFFFFC
r15 = 0x00000002
Then r4 would equal 0x7FFFFFFE.
Branch
b SIMM
The execution of the CPU will jump forward/backward based on the amount designated in SIMM. SIMM must be divisible by 4. If SIMM is positive then the CPU jumps 'down', visually speaking. If SIMM is negative, then the CPU jumps 'back up'. If SIMM is zero, the CPU simply halts.
For Assembly Codes, branch labels (SIMM is replaced with a custom name) are used instead of writing out the Signed 16-bit Immediate Value (SIMM).
Example:
b the_label
li r5, 0
the_label:
stb r5, 0 (r12)
The instruction where the Brancj jump lands at is also present but needs to have a colon appended. The 'li r5, 0' instruction is skipped because the branch above to jumping to 'the_label' which is pointing to the stb instruction.
Branch If Equal
beq SIMM
If the previous comparison instruction had a condition where the result was equal, then the branch will be taken. Branch labels (custom names) are used in place of SIMM.
Example code showing use of beq instruction
cmpwi r5, 3
beq some_label
li r0, 9
some_label:
stw r0, 0 (r12)
beq is part of a large family of Conditional Branch Instructions.
List of other commonly used Conditional Branches~
bgt = Branch If Greater Than
blt = Branch If Less Than
ble = Branch If Less Than Or Equal
bge = Branch If Greater Than Or Equal
Compare Word Immediate Signed
cmpwi rD, SIMM
Signed
Value in rD is compared to SIMM. The comparison is Signed. A conditional branch should be placed afterwards to branch based on the result of the comparison.
Compare Word Signed
cmpw rD, rA
Signed
Value in rD is compared to value in rA. The comparison is Signed. A conditional branch should be placed afterwards to branch based on the result of the comparison.
Compare Logical Word Immediate Unsigned/Logical
cmplwi rD, UIMM
Logical
Value in rD is compared to UIMM, the comparison is unsigned. All values are treated as unsigned. A conditional branch should be placed afterwards to branch based on the result of the comparison.
Compare Logical Word Unsigned/Logical
cmplw rD, rA
Logical
Value in rD is compared to value in rA, the comparison is unsigned. All values are treated as unsigned. A conditional branch should be placed afterwards to branch based on the result of the comparison.
Store Word Indexed
stwx rD, rA, rB
The word value of rD is stored to the Memory Address designated by rA + rB. If rA = r0, then it is treated as literal zero.
stwx r12, r12, r29
If...
r12 = 0x00000200
r29 = 0x80001000
Then the word at Memory Address 0x80001200 is now 0x00000200.
sthx is for halfwords, stbx is for bytes
Load Word & Zero Indexed
lwzx rD, rA, rB
The word value located at the Memory Address designated by rA + rB is loaded into rD. If rA = r0, then it is treated as literal zero.
lwzx r30, r4, r16
If...
r4 = 0x00000008
r16 = 0x80005000
& word value at Memory Address 0x80005008 is 0x000000FF
Then r30 would equal 0x000000FF.
lhzx is for halfwords, lbzx is for bytes
Move to Count Register
mtctr rD
The value in rD is copied to the Count Register (CTR).
Move from the Count Register
mfctr rD
The value in the Count Register (CTR) is copied to rD
Branch Decrement When Not Zero
bdnz SIMM
The count register is subtracted by 1 (aka decremented), then the count register is compared to the value of 0. If the count register is not zero, the branch is taken. For assembly codes, the use of label names replace SIMM. SIMM must be divisible by 4, this is not a concern for Coders if they stick to using branch label names.
This instruction is used to make loops (along with the mtctr instruction).
Move To Link Register
mtlr rD
The value rD is copied to the Link Register (LR).
Move From Link Register
mflr rD
The value in the Link Register (LR) is copied to Register rD
Branch & Link
bl SIMM
An unconditional branch is executed, the amount the branch 'jumps' is based on SIMM. SIMM must be divisible by 4. This won't be an issue for you if you use branch labels. After the branch has been executed, the address of the branch instruction+4 is written to the Link Register.
This instruction is used mainly for creating subroutines in your code.
Example showing mem addresses and instructions~
80456124 : bl 0x1F8C
80456128 : cmpwi r3, 0
8045612C : add r5, r3, r4
Once the 'bl 0x1F8C' instruction has executed, the Link Register will now contain 80456128.
Branch to Link Register
blr
Execution of the CPU will branch/jump to the Memory Address that's in the Link Register.
Branch to Count Register
bctr
Execution of the CPU will branch/jump to the Memory Address that's in the Count Register.
Store Multiple Word
stmw rD, SIMM (rA)
Multiple words are stored starting at Memory Address designated by SIMM+rA. If rA = r0, then it is treated at literal 0. SIMM+rA must be divisible by 4.
The amount of words stored is based on which GPR for rD is used.
If rD is r30, then...
r30's word value is stored to SIMM+rA
r31's word value is stored to SIMM+rA+4
If rD is 25, then...
r25's word value is stored to SIMM+rA
r26's word value is stored to SIMM+rA+4
r27's word value is stored to SIMM+rA+8
r28's word value is stored to SIMM+rA+12
r29's word value is stored to SIMM+rA+16
r30's word value is stored to SIMM+rA+20
r31's word value is stored to SIMM+rA+24
Using this instruction when rD = r31 is pointless, since a basic stw instruction can be used instead.
Example:
stmw r29, 0x00EC (r5)
If..
r5 = 0x80455000
r29 = 0x00001000
r30 = 0x00002000
r31 = 0x00003000
Then..
The word at Address 0x804550EC would equal 0x00001000
The word at Address 0x804550F0 would equal 0x00002000
The word at Address 0x804550F4 would equal 0x00003000
Load Multiple Word
lmw rD, SIMM (rA)
Multiple words are loaded starting at Memory Address designated by SIMM+rA. If rA = r0, then it is treated as literal 0. SIMM+rA must be divisible by 4.
The GPR used for rD *MUST* be a higher GPR that is used for rA. Therefore, it is impossible for rD to ever be r0.
The amount of words loaded is based on which GPR for rD is used.
If rD is r30, then...
Word at SIMM+rA is loaded into r30
Word at SIMM+rA+4 is laoded into r31
If rD is r25, then...
Word at SIMM+rA is loaded into r25
Word at SIMM+rA+4 is loaded into r26
Word at SIMM+rA+8 is loaded into r27
Word at SIMM+rA+12 is loaded into r28
Word at SIMM+rA+16 is loaded into r29
Word at SIMM+rA+20 is loaded into r30
Word at SIMM+rA+24 is loaded into r31
Using this instruction when rD = r31 is pointless, since a basic lwz instruction can be used instead.
lmw r29, 0x00EC (r5)
If...
r5 = 0x80442000
The word at Address 0x804420EC = 0x000A0000
The word at Address 0x804420F0 = 0x000B0000
The word at Address 0x804420F4 = 0x000C0000
Then ..
r29 would equal 0x000A0000
r30 would equal 0x000B0000
r31 would equal 0x000C0000
Store Word & Update
stwu rD, SIMM (rA)
Word value in rD is stored to Memory Address designated by SIMM+rA. If rA = r0, then it is treated as literal 0. After the word value has been stored, rA will be updated with a new value. rA's new value is calculated by SIMM+rA.
Example:
stwu r25, 0x0018 (r31)
If....
r25 = 0x1000270F
r31 = 0x80001600
Word value of 0x1000270F is stoed to Memory Address 0x80001618. Afterwards, r31 will now have the value of 0x80001618.
sthu is for halfwords, stbu is for bytes
Load Word Zero & Update
lwzu rD, SIMM (rA)
Word value located at Memory Address designated by SIMM+rA is loaded into rD. If rA = r0, then it is treated as literal 0. After the word has been loaded into rD, rA will be updated with a new value. rA's new value is calculated by SIMM+rA.
Example:
lwzu r27, 0x1000 (r4)
Load the word at address of Register 4 plus 0x1000 into Register 27. Afterwards the address of Register 4 is incremented by 0x1000
If...
r4 = 0x80EF0050
lhzu is for halfwords, lbzu is for bytes
Store String Word Immediate
stswi rD, rA, NB
A string of bytes is stored to Memory Address designated by rA. If rA = r0, then it is treated as literal zero. NB stands for Number of Bytes. It sets the byte amount for the string. It can be anything from 0 to 31. If set to 0, it is treated as 32.
The Starting Byte that will be used in the string is the far left most byte of rD. Ending Byte depends on NB. Once all bytes of a GPR are used up, but the string still has more bytes left that need to be stored, more bytes will then be used from the next higher GPR. (i.e. r7 -> r8).
If there are bytes in the string still left to be stored but GPR r31 has already been used up, then bytes of r0 will then be used.
Example:
stswi r3, r25, 12
The first 12 consecutive bytes starting from r3 going towards higher GPR's are stored to the address in r25.
If..
r3 = 0x10203040 <--First 4 out of 12 bytes
r4 = 0xFFFF0000 <--Second 4 out of 12 bytes
r5 = 0x000000028 <--Third 4 out of 12 bytes
r25 = 0x8167DE00 <--Memory Address to store string of bytes to
Then...
The entire value of 0x10203040FFFF000000000028 is stored at address 0x8167DE00.
Load String Word Immediate
lswi rD, rA, NB
A string of bytes is loaded from the Memory Address designed by rA. If rA = r0, then it is treated as literal zero. NB stands for Number of Bytes. It sets the byte amount for the string. It can be anything from 0 to 31. If set to 0, it is treated as 32.
The first byte that is loaded is loaded into the far left byte of rD. Ending byte depends on NB. Once all bytes of a GPR are used up, but the string still has more bytes left to be loaded, more bytes will then be used from the next higher GPR (i.e. r7 -> r8).
The bytes loaded cannot 'hit' rA. Therefore, because of this (and the fact NB as 0 = 32), the GPR used for rD cannot be the same GPR used for rA. If there are bytes in the string still left to be loaded, but GPR r31 has already been used up, then bytes of r0 will then be used.
The GPR used for rA *can* be higher then rD as long as NB uses a value so bytes loaded don't 'spill' back into rA itself.
Example:
lswi r3, r25, 12
The 12 bytes of data starting at the address in r25 will be loaded into the first 12 consecutive bytes starting at register 3 going towards the higher registers
If..
r25 = 0x8167DE00
And the 12 bytes starting at that address is 0x10203040FFFF000000000028
Then after the instruction is executed..
r3 = 0x10203040
r4 = 0xFFFF0000
r5 = 0x00000028
Example of an invalid use of lswi:
lswi r3, r5, 14
This is invalid because 4 bytes are loaded into r3, then 4 bytes are loaded into r4, then bytse will begin loading into r5. Thus, loaded bytes have 'spilled' back into rA. Instruction is invalid.
Here's a basic equation to know if your lswi is invalid or not
Step 1: rA minus rD (their GPR numbering values, not the values within them!)
Step 2: Multiply step 1 result by 4
Step 3: If NB is greater than Step 2 result, instruction is invalid
NOTICE that ASM Assemblers will actually allow you to compile invalid lswi instructions! You have been warned!
|
|
|
Lap Count Increased Modifier [Vega] |
Posted by: Vega - 08-19-2018, 07:40 PM - Forum: Offline Non-Item
- No Replies
|
 |
Lap Count Increased Modifier [Vega]
This code will change the amount that the lap number increments by when starting a race. Therefore setting the value in the code to 0 will act as an Infinite Laps/No Lap Gains Code. Setting the code value to 4 will allow you to always win the race as long as you cross the start line to get the lap number to 4, you will still win the race even if somebody else finish their legit lap 3. However, this won't beat timer manipulation codes.
NTSC-U
0052FEB7 0000000X
PAL
005349FF 0000000X
NTSC-J
0053437F 0000000X
NTSC-K
00522A57 0000000X
X Values:
0 = Laps Never Increased (Infinite Racing)
1 = Default Value of Game
2 = Pass start line, you're on Lap 2, do a lap, now on Lap 4 which is your final lap
3 = Pass start line, you're on Lap 3 which is your final lap
4 = Pass start line, you're on Lap 4 which is your final lap (beat any legit racer even if they finish their lap 3 before your hacked lap 4)
Code created by: Vega
|
|
|
Force Character/Vehicle Offline [Phyz] |
Posted by: Vega - 08-19-2018, 06:20 PM - Forum: Incomplete & Outdated Codes
- No Replies
|
 |
Force Character/Vehicle Offline [Phyz]
NOTE: Outdated by Vega's version which works everywhere
Works Offline only.
This code will force you to start the race/battle with whatever character/vehicle is set in the code regardless of what you actually choose in the game.
KK = Character
VV = Vehicle
NTSC-U
C28238E4 00000002
3BA000KK 93A30C24
60000000 00000000
C2829F54 00000002
3BE000VV 93E30C20
60000000 00000000
PAL
C283E344 00000002
3BA000KK 93A30C24
60000000 00000000
C2846E2C 00000002
3BE000VV 93E30C20
60000000 00000000
NTSC-J
C283D9B0 00000002
3BA000KK 93A30C24
60000000 00000000
C2846498 00000002
3BE000VV 93E30C20
60000000 00000000
NTSC-K
C282C704 00000002
3BA000KK 93A30C24
60000000 00000000
C28351EC 00000002
3BE000VV 93E30C20
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
Code creator: Phyz
|
|
|
MKW Hack Pack |
Posted by: Huili - 08-19-2018, 02:37 AM - Forum: Textures/Mods/CT's
- No Replies
|
 |
The custom track selections on MKW Hack Pack serve this purpose: 1. To represent under rated, obscure, or unknown custom track authors by fixing up their tracks and making them fit today's standards.
Another thing about the MKW Hack Pack is that there are a lot of edited files, Huili wants to be able to change as many files as possible by replacing original files with modified files.
|
|
|
|