Welcome, Guest |
You have to register before you can post on our site.
|
Forum Statistics |
» Members: 646
» Latest member: Luca1337
» Forum threads: 1,815
» Forum posts: 14,000
Full Statistics
|
Online Users |
There are currently 118 online users. » 1 Member(s) | 114 Guest(s) Applebot, Bing, Google, KarmaAK
|
Latest Threads |
Allow Pausing Before Race...
Forum: Offline Non-Item
Last Post: Vega
3 hours ago
» Replies: 0
» Views: 10
|
Top 10 Most Influential C...
Forum: Coding & Hacking General Discussion
Last Post: Vega
7 hours ago
» Replies: 2
» Views: 7,348
|
Show Ice Cube on Online P...
Forum: Online Non-Item
Last Post: _Ro
Today, 08:23 AM
» Replies: 0
» Views: 34
|
CPU Control Cycler [Ro]
Forum: Offline Non-Item
Last Post: _Ro
Today, 07:56 AM
» Replies: 7
» Views: 1,010
|
Thunder Cloud Effect Modi...
Forum: Offline; Item
Last Post: JerryHatrick
Yesterday, 11:13 PM
» Replies: 11
» Views: 1,094
|
MKW Coder/Developer of th...
Forum: Coding & Hacking General Discussion
Last Post: Vega
Yesterday, 09:10 PM
» Replies: 10
» Views: 13,841
|
Make it to 10,000
Forum: General Discussion
Last Post: Vega
Yesterday, 08:15 PM
» Replies: 7,338
» Views: 5,671,015
|
Miniturbos and Inside Dri...
Forum: Coding & Hacking General Discussion
Last Post: JerryHatrick
Yesterday, 09:54 AM
» Replies: 1
» Views: 859
|
Code request???
Forum: Code Support / Help / Requests
Last Post: DrTap
01-09-2025, 06:06 PM
» Replies: 3
» Views: 4,956
|
CPUs/Online Players Have ...
Forum: Visual & Sound Effects
Last Post: Zeraora
01-09-2025, 02:26 AM
» Replies: 2
» Views: 515
|
|
|
Possible Error/Bad-Instruction in Gecko Code Handler for C0 Code Usage |
Posted by: Vega - 08-13-2019, 04:09 PM - Forum: Coding & Hacking General Discussion
- Replies (11)
|
|
I'm currently working on a code, this code uses the typical ISFS Routine like my other codes...
Open -> Read - > Close -> Edit Heap -> Open -> Write - > Close
For initial beta testing, I was using the shared item address for the code, so the code was a C2 (InsertASM) Code at that time. Everything worked fine, I had no error values in function returns.
So I need the code ready at every frame, best way to do this is with the C0 Codetype. I get everything set up and the Code is a C0 Type. I get freezes no matter what. I found that during the first ISFS_Open, some crash would occur. I wouldn't even get a error return value, because the execution wouldn't even return from ISFS_Open. Just a plain crash.
The execution of the code would somehow return where my C0 Code is stored (at first instruction). Odd.
I decided to switch back to a C2 type (using some address that breaks every frame, I used this on other codes before), changed nothing of the source (other than add the default instruction of the new address), and BAM, it works.
So if anyone is interested, I will most likely release my new code tomorrow. You can convert it to a C0 type, add Star's Custom Exception Handler Code, and try to debug this. I have no desire to dig anymore into this.
|
|
|
Help with ASM through Bean's CT-Code engine |
Posted by: Noname - 08-09-2019, 09:01 PM - Forum: Code Support / Help / Requests
- Replies (3)
|
|
So i'm working on a battle project that will add many new features to battle mode (inspired by CTGP)
And one of the features that I want to add is a mode called "No mercy" mode. I have completed the coin runners portion where you lose all your coins when hit once (through minigame.kmg edits) and now, I am working on a balloon battle version, where you will die instantly, lose a point, and respawn, (similar to when your last balloon is popped) regardless of the amount of balloons you have.
Anyway, I generated a code for this:
Lose all of your balloons after being hit once
c2865c70 00000002
38000000 981d03c4
60000000 00000000
ASM version:
li r0, 0; /*r0 contains the amount of balloons a player has. Set it to 0 so that the next time a player is hit, trigger the same effects as when they're hit with one balloon left */
stb r0, 964(r29); /*The original instruction after a player is hit, stores the value of r0 into the memory address referenced by r29 + 0x03C4*/
nop;
I tested it through gecko, and it works! However, I want to make this work through Bean's CT-code engine, as it will greatly help me organize the new features i'm adding instead of adding 20 different options in Riivolution. However, there seems to be an issue.
The very first instruction I create is always replaced by another, and I am unsure why. For example;
My sourcecode to implement this using Bean's MOD engine in ct-code:
The values:
This is what I see in dolphin once the new ct-code is executed:
^ Perfect, just like my code says.
^ Nearly perfect... but my li r0, 0 instruction is replaced by subi rtoc, rtoc?
Everything is fine and dandy, the instruction at 0x80865c70 branches to 0x80002348 successfully, but this is where the problem comes in. The instruction "li r0, 0" is replaced by "subi rtoc, rtoc, 1691" and i'm not sure why. Everything else beneath this works perfectly, and it's just as I coded it in perfect order. The problem is the "subi rtoc, rtoc, 1691" causes the game to crash, but thats not supposed to be there in the first place. I tried replacing this instruction with my original "li, r0, 0" through dolphin, and bam: code works perfectly!
So to sum it up, any idea why this "subi rtoc, rtoc, 1691" replaces my original "li r0, 0" instruction, and how I could fix this?
|
|
|
Custom Laps Mini [JoshuaMK] |
Posted by: JoshuaMK - 08-07-2019, 07:39 PM - Forum: Incomplete & Outdated Codes
- No Replies
|
|
Custom Laps Mini [JoshuaMK]
NOTE: This is outdated. A much shorter version of the original code, which can be found here > https://mkwii.com/showthread.php?tid=1245
Note: Compared to the original, this lacks the use of the timer for a lap counter (uses normal lap counter), and doesn't update the positions instantly.
(NTSC-U)
C252FEB4 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C2530094 00000002
3D808140 880C1798
60000000 00000000
C253068C 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C2791674 00000002
3D808140 8B84F0B0
9B8C1799 00000000
C27E4C9C 00000002
3D808140 807FEE20
906C179E 00000000
045309C0 807E0044
(PAL)
C25349FC 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C2534BDC 00000002
3D808140 880C1798
60000000 00000000
C25351D4 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C279A680 00000002
3D808140 8B8438B8
9B8C1799 00000000
C27EEFAC 00000002
3D808140 807F3618
906C179E 00000000
04535508 807E0044
(NTSC-J)
C253437C 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C253455C 00000002
3D808140 880C1798
60000000 00000000
C2534B54 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C2799CEC 00000002
3D808140 8B842918
9B8C1799 00000000
C27EE618 00000002
3D808140 807F2678
906C179E 00000000
04534E88 807E0044
(NTSC-K)
C2522A58 00000005
3D808140 3800000X
980C1798 38A40001
B0A30024 7F802850
3B9C0002 93830044
60000000 00000000
C2522C34 00000002
3D808140 880C1798
60000000 00000000
C252322C 00000003
817A0044 3803FFFF
396BFFFF 917A0044
60000000 00000000
C2788A40 00000002
3D808140 8B841EF8
9B8C1799 00000000
C27DD36C 00000002
3D808140 807F1C58
906C179E 00000000
04523560 807E0044
X = Number of Laps
0 = The moment you first cross the line the race ends.
1 = 1 lap race.
2 = 2 lap race.
3 = 3 lap race. (Normal value)
4 = 4 lap race.
...
8 = 8 lap race.
9 = 9 lap race. (Displays as lap 8 on final lap)
#####
#ASM#
#####
##############
#Inject > 80530094#
#############
lis r12, 0x8140
lbz r0, 0x1798 (r12)
##############
#Inject > 8053068C#
#############
lwz r11, 0x0044 (r26)
subi r0, r3, 1
subi r11, r11, 1
stw r11, 0x0044 (r26)
##############
#Inject > 807E4C9C#
#############
lis r12, 0x8140
lwz r3, -0x1130 (r31)
stw r3, 0x179e (r12)
##############
#Write > 805309C0#
#############
lwz r3, 0x0044 (r30)
##############
#Inject > 8052FEB4#
#############
lis r12, 0x8140
li r0, 5
stb r0, 0x1798 (r12)
addi r5, r4, 1 #Add 1
sth r5, 0x0024 (r3)
sub r28, r5, r0
addi r28, r28, 2
stw r28, 0x0044 (r3)
Code Creator: JoshuaMK
|
|
|
Hi |
Posted by: salmon01 - 08-06-2019, 03:56 AM - Forum: Introductions
- Replies (4)
|
|
Hello! I have visited this site countless times since late 2018 while learning PPC assembly, and I finally decided to join. I primarily code for the Wii U, which also uses PPC and is very similar to the Wii, architecture-wise. I hope to be able to learn even more and also contribute some of the techniques I’ve found to the site.
|
|
|
Assemble + Disassemble PPC ASM with DevKitPPC (Linux) |
Posted by: Vega - 08-05-2019, 02:17 PM - Forum: PowerPC Assembly
- No Replies
|
|
Assemble + Disassemble PPC ASM with DevkitPPC (Linux)
NOTE: This guide is for Linux users only.
NOTE: This is NOT meant to replace any assembler+disassembler regarding ASM codes (such as WiiRDGUI, PyiiASMH), it's just for general PowerPC ASM assembling+disassembling.
Requirements-
Have Devkit installed and working (For Debian, I have an Installation Guide - http://mkwii.com/showthread.php?tid=1200)
Overview-
This guide will teach you how to assemble ASM instructions (in a text file) to a final output in your terminal screen. This guide assumes your ASM txt file is 'example.s' in the your home user account directory.
This guide will also teach you how to disassemble ASM instructions of a binary file and display the source on your terminal screen.
TO ASSEMBLE ASSEMBLY (into binary file)
1. Navigate to DevkitPPC binutils
Open a terminal to where you installed your Devkit (for me, I installed mines to /opt)
cd /opt/devkitpro/devkitPPC/bin
2. Assemble the ASM instructions to object code
./powerpc-eabi-as -mregnames -mbroadway /home/yourusername/example.s -o /home/yourusername/objectcode.o
3. Convert to binary file from the object code
./powerpc-eabi-objcopy -O binary /home/yourusername/objectcode.o /home/yourusername/asm.bin
4. Print the assembled Hex byte code
cd /home/yousername
xxd -p -c 4 -u asm.bin
The assembled instructions (one word per line) are shown. If desired, you can instead open up the asm.bin file in a Hex Editor to view the assembled instructions.
NOTE about assembling source with branch labels:
View the following source~
Code: b label
li r3, 0
label:
stw r3, 0x8 (sp)
There's nothing wrong with the above source, but let's pretend you forgot to add "label:" (the landing spot for 'b label'), and your source now looks like this...
Code: b label
li r3, 0
stw r3, 0x8 (sp)
Even though you are missing the branch's landing spot, this will still assemble on DevkitPPC (powerpc-eabi-as). Powerpc-eabi-as will apply a branch value of zero (a branch that just branches to itself) to any branches that are not equipped with a landing spot. This is important to remember as any branch instruction with a jump of zero will 'crash' your game. I'm not sure if there's an option on the powerpc-eabi-as to disable this 'nuisance'. This 'nuisance' can actually be handy if you are needing to prematurely test out a huge ASM source and haven't yet finished/completed all the branches.
TO DISASSEMBLE ASSEMBLY (from binary file)
1. Navigate to binutils
cd /opt/devkitpro/devkitPPC/bin
2. Disassemble the binary file, display results on terminal screen
./powerpc-eabi-objdump -b binary -m powerpc:750 -M broadway -D -EB /home/yourusername/asm.bin
The source will be displayed on the screen. Please note branch instructions will NOT have normal hex-offset values. The values in the branch instructions are for the addresses within the binary file itself. (Example: b 0x14 = branch to address 0x00000014 of the binary file)
INCLUDE MULTIPLE FILES TRICK
If your file is extremely large, you can break it into multiple files, for easy use of subroutine/function calls.
Example: You have a function call named "init_start" in your example.s file, but you want the function to be in its own file. Create another file called subroutine.s and cut and paste all the contents of the init_start function call from example.s to subroutine.s. Still keep the instruction of "bl init_start" in your example.s file.
At the very top above everything you pasted in, place this in subroutine.s--
Save and close the file and open example.s. Now where ever you want the subroutine code contents to be placed at after compilation, place the following...
Code: .include "/path/to/the/subroutine.s"
Replace /path/to/the with the actual directory path to subroutine.s. This will allow example.s to link together the subroutine.s file. Save and close the file. Now just assemble the example.s in a normal fashion.
Final NOTES:
You could always place all your .include links at the top of your file, but have the first instruction in your main file (example.s) simply be a branch to jump all the them at the very start of the execution of your ASM, like this...
Code: b start_asm
.include "/path/to/the/subroutine.s"
.include "/path/to/the/subroutine2.s"
.include "/path/to/the/subroutine3.s"
.include "/path/to/the/subroutine4.s"
start_asm:
...
Please note that older versions of devkit's binutils and possible future versions may not work with this guide.
Versions of executables used in this guide:
GNU Binutils Version 2.30
|
|
|
Customizable Remove HUD [JoshuaMK] |
Posted by: JoshuaMK - 08-05-2019, 07:41 AM - Forum: Visual & Sound Effects
- Replies (22)
|
|
Customizable Remove HUD [JoshuaMK]
X Determines how much HUD gets removed.
Note: The pause menu still functions normally even if "removed".
(NTSC-U)
0488D090 XXXXXXXX
(PAL)
048914D8 XXXXXXXX
(NTSC-J)
04890B28 XXXXXXXX
(NTSC-K)
0487F8E0 XXXXXXXX
X Values:
3FB00000 = Remove Map + Icons
3FF15000 = Remove Map + Icons + Box Surrounding Item Display
3FF80000 = Remove Map + Icons + Item Display
3FFF0000 = Remove Map + Icons + Item Display + Timer
41000000 = Remove Map + Icons + Item Display + Timer + Countdown
42000000 = Remove Everything
Code Creator: JoshuaMK
|
|
|
Handling Modifier (Inside Drift) [JoshuaMK] |
Posted by: JoshuaMK - 08-05-2019, 06:20 AM - Forum: Offline Non-Item
- No Replies
|
|
Handling Modifier (Inside Drift) [JoshuaMK]
(NTSC-U)
0488D530 XXXXXXXX
(PAL)
04891A48 XXXXXXXX
(NTSC-J)
04891098 XXXXXXXX
(NTSC-K)
0487FE50 XXXXXXXX
X Values:
3CC00000 = Terrible Cornering
3D4CCCCD = Normal Value
3D800000 = Amazing Cornering
3FA00000 = You are now a world class ballerina
Code Creator: JoshuaMK
|
|
|
Wheel Spin Speed Modifier/Hover Kart Code [JoshuaMK] |
Posted by: JoshuaMK - 08-05-2019, 06:06 AM - Forum: Visual & Sound Effects
- No Replies
|
|
Wheel Spin Speed Modifier/Hover Kart Code [JoshuaMK]
(NTSC-U)
0488D520 XXXXXXXX
(PAL)
04891A38 XXXXXXXX
(NTSC-J)
04891088 XXXXXXXX
(NTSC-K)
0487FE40 XXXXXXXX
X Values:
00000000 = Wheels never spin. Even at full speed
3C000000 = Wheels spin slowly.
3E99999A = Normal value.
3F800000 = Wheels spin really fast.
42000000+ = Wheels vanish. You are now driving in a hover kart.
Code Creator: JoshuaMK
|
|
|
Install DevkitPro on Debian Linux |
Posted by: Vega - 08-04-2019, 09:07 PM - Forum: Other
- Replies (1)
|
|
Install DevkitPro (DevkitPPC) on Debian Linux
Chapter 1. Introduction
Many beginners have issues installing DevkitPro in general. In the past, step by step tutorials were not really available to help the newbie install DevkitPro, especially for Debian Linux.
Chpater 2. About DevkitPro and overview of this Guide
DevkitPro is the main program used to create Homebrew Applications. It comes with all the Wii's libraries. You can compile your projects directly to a .dol file (renamed to boot.dol) which HBC can directly boot. You can write your projects in C/C++ code or even in PowerPC Assembly.
This guide will step by step you to install DevkitPro, compile the example project, teach you how to keep Devkit updated, and other various things.
Chapter 3. Download and install Devkit
Open up a terminal in your Home directly (i.e. /home/Vega)
Enter in the following 3 commands to download the devkitpro github's script and execute it
wget https://apt.devkitpro.org/install-devkitpro-pacman
chmod +x ./install-devkitpro-pacman
sudo ./install-devkitpro-pacman
After this, DevkitPro will be installed at the /opt directory of your computer.
Chapter 4. Updating Devkit
Now that devkit is installed, let's make sure to update before installing any libraries/packages. Devkit uses the command 'dkp-pacman' to update/upgrade/etc.
Navigate the /opt directory
cd /opt
Update the Devkit repositories
sudo dkp-pacman -Sy
This is similar to a 'sudo apt-get udpate' command.
If any updates are listed, let's be sure to upgrade to install them.
sudo dkp-pacman -Syu
This is similar to a 'sudo apt-get upgrade' command.
Chapter 5: Installing Wii libraries
Alright, our Devkit is fully updated and upgraded. Let's install the Wii libraries
sudo dkp-pacman -S wii-dev
You will be prompted by a message to install a specific selection, or install all the packages:
Simply press Enter on your keyboard to install everything from wii-dev.
Another prompt will appear asking if you want to proceed with the installation. Press the Y key, hit Enter to proceed. The libraries will install, Should take less than a minute.
Chapter 6: Copying over certain files, setting environment variables
DevkitPro (for wii-dev) comes with an example Wii HBC project for you to compile. It's a good idea to copy paste over the example wii template+project over to a personal folder, so we never lose the original example project.
Let's make a new directory in your user account home directory called projects
mkdir /home/yourusername/projects
Now let's copy over the example project
sudo cp -r /opt/devkitpro/examples/wii/template /home/yourusername/projects/wii-template
As this point, the wii-template folder in projects does not have full user permissions, let's give it back user permissions.
sudo chown -R yourusername:yourusername /home/yourusername/projects/wii-template
Before you can compile any project, you need to edit your export settings for your shell. You can use any text editor you want for this. I like to use nano.
nano /home/yourusername/.bashrc
Be sure to NOT run sudo with the above command. At the very end of the file add this..
export DEVKITPRO=/opt/devkitpro
export DEVKITARM=${DEVKITPRO}/devkitARM
export DEVKITPPC=${DEVKITPRO}/devkitPPC
export PATH=${DEVKITPRO}/tools/bin:$PATH
Close any terminal windows you have open.
Chapter 7: Compiling the example project
Open a new terminal window...
cd /home/yourusername/projects/wii-template
make
The project will now compile! Some new items in /wii-template will be created...
/build (contains items such as the object code and a symbol map)
wii-template.dol
wii-template.elf
Chapter 8: Testing the compiled project in HBC
Rename the wii-template.dol to boot.dol. Insert your SD/USB stick into your computer, and make a folder in your apps folder called Example. Now we also need an icon.png and a meta.xml, you can borrow those from any HBC application you want. Within the Example folder, place your chose icon.png and meta.xml in there. Now take your boot.dol and place it in there too.
Open up the meta.xml and rename the title to something like "hello world app". This way when you load the app preview and read the description, you know its our example project. Eject the SD/USB, place it in your Wii, boot HBC.
Select whatever icon app you used, check the description for 'hello world app'. If you have found it, launch the app! You should see a black screen with the words "Hello World!" at the top left. Congratz!
Chapter 9: Other dkp-pacman commands
To list packages:
sudo dkp-pacman -Sl
To list only libraries supplied by devkitPro:
sudo dkp-pacman -Sl dkp-libs
To search for packages:
sudo dkp-pacman -Ss <search string>
To install a package:
sudo dkp-pacman -S <name of package>
To remove a package:
sudo dkp-pacman -R <name of package>
Here's a list of all devkitPPC packages~
- gp32-dev
- gba-dev
- nds-dev
- 3ds-dev
- gamecube-dev
- wii-dev
- wiiu-dev
- switch-dev
Congrats on installing DevkitPPC!
|
|
|
|