How to Make your own Cheat Codes
#21
(04-12-2023, 07:14 PM)Vega Wrote: I'm suprised that code works at all considering it's not meant for NTSC-U.

It's not that the code works in NTSC-U (actually it doesn't), what happens is that I'm creating the codes with Dolphin, and since the code was in PAL I decided to download Mario Sports Mix in PAL version to test said code and check if it worked (and it did), but my question was more about how to fix that code for the problems I already mentioned (in case there is a solution).

But seriously, is it that hard to create load pointer code?

(04-12-2023, 07:14 PM)Vega Wrote: What about playing on ISOs w/ USB Loader? I personally have all 4 MKWii's (NTSC-U/J/K and PAL) on 1 USB stick and choose whatever one I feel like playing at the time (granted I only boot MKWii upon request for code help nowadays, haven't actually played in 2 years lol)

Well, in fact, if I play my Wii games in USB Loader GX, although I had no idea that the Wii would accept any game from any region, in my case, since my Wii is Ver. 4.3U, I thought it would only accept NTSC-U games, although I do not play my games in ISO format, but rather in WBFS.

(04-12-2023, 07:14 PM)Vega Wrote: Fyi some games require a special hooktype for codes to be reliable. By default your HBC app (w/e you use to launch your games), uses the VBI hooktype (located in the Ocarina setting of said app). Try GXDraw or OSSleepThread.

If those codes still botch, recreating what you asked about shouldn't be too difficult. It reminded me of several DBZ BT3 codes I've made (ki, stock blasts, health etc).

Usually those type of things are Word or Halfword integers. Focus on your special attack bar first. If bar is zero search for zero. Get the bar to increase, continue the search but select "increased". When bar increases again, continue search using "increased" again. If decreases, continue search using "decreased", etc etc.

If you end up making this code successfully, it's a high chance the code will effect both Blue and Red team. If that's the case, you will need to learn about the "GVRs". as those may hold the key to "upgrading" the code to allow choosing between Blue vs Red

https://mariokartwii.com/showthread.php?tid=1962

You also mentioned about stumbling onto my post (How to Make codes thread). If you haven't ran into my "Noob to ASM Coder" index, I recommend it. If puts all the important ASM tutorials i've made into the order they should be followed in.

https://mariokartwii.com/showthread.php?tid=1114

I was looking for what you say (GXDraw and OSSleepThread) on the internet, but I didn't find anything, I have no idea what that is, is it a cIOS?

But what do you mean that the special attack bar is zero, the value of the bar itself, or the levels that the bar handles (0, 1, 2, 3, 4 and 5)?

The truth is that I did not know that you had so many tutorials, I will try to read them all for a better understanding.
Reply
#22
(04-13-2023, 09:47 PM)LightKingdom666 Wrote: It's not that the code works in NTSC-U (actually it doesn't), what happens is that I'm creating the codes with Dolphin, and since the code was in PAL I decided to download Mario Sports Mix in PAL version to test said code and check if it worked (and it did), but my question was more about how to fix that code for the problems I already mentioned (in case there is a solution).

But seriously, is it that hard to create load pointer code?

It's not hard, it's just most of the time, they are not justified. Assembly can be written instead which can result in a better more optimized code. There are some cases where it may be needed but that's basically because of a Code Handler limitation/bug.

(04-13-2023, 09:47 PM)LightKingdom666 Wrote: Well, in fact, if I play my Wii games in USB Loader GX, although I had no idea that the Wii would accept any game from any region, in my case, since my Wii is Ver. 4.3U, I thought it would only accept NTSC-U games, although I do not play my games in ISO format, but rather in WBFS.

When I used the term ISO i mean anything from the USB stick, whether it's ISO or WBFS. Your Wii can play NTSC-U, PAL, and NTSC-J games already. The language or video/tv setting may need to be changed within USB Loader GX, it depends. But you should already be able to do it. For NTSC-K games, it's much more complex.

(04-13-2023, 09:47 PM)LightKingdom666 Wrote: I was looking for what you say (GXDraw and OSSleepThread) on the internet, but I didn't find anything, I have no idea what that is, is it a cIOS?

But what do you mean that the special attack bar is zero, the value of the bar itself, or the levels that the bar handles (0, 1, 2, 3, 4 and 5)?

The truth is that I did not know that you had so many tutorials, I will try to read them all for a better understanding.

The value of the bar itself. Also, your codes are applied by a Code Handler called Gecko. The Code Handler itself it basically a giant cheat code per say. It is injected at a particular address. The Hooktype setting determines which address to hook the Code Handler to. A majority of games run the Code Handler fine on the VBI/VI/default setting. Others need a different hooktype for the Code Handler to work correctly. Go to the Hooktype setting within USB Loader GX settings. Select desired Hooktype.
Reply
#23
(04-13-2023, 09:47 PM)Vega Wrote: It's not hard, it's just most of the time, they are not justified. Assembly can be written instead which can result in a better more optimized code. There are some cases where it may be needed but that's basically because of a Code Handler limitation/bug.

Isn't justified what? The creation of said code? Well, in the case of the code that I am giving as an example, I think it has many problems (which I have already mentioned several times), so I think it is necessary to create it from scratch.

In case you have any tutorial on how to create load pointer codes, could you please pass it on to me?

(04-13-2023, 09:47 PM)Vega Wrote: When I used the term ISO i mean anything from the USB stick, whether it's ISO or WBFS. Your Wii can play NTSC-U, PAL, and NTSC-J games already. The language or video/tv setting may need to be changed within USB Loader GX, it depends. But you should already be able to do it. For NTSC-K games, it's much more complex.

Wow, the truth is that I had no idea about that, could it be done now because the console is already hacked?

(04-13-2023, 09:47 PM)Vega Wrote: The value of the bar itself. Also, your codes are applied by a Code Handler called Gecko. The Code Handler itself it basically a giant cheat code per say. It is injected at a particular address. The Hooktype setting determines which address to hook the Code Handler to. A majority of games run the Code Handler fine on the VBI/VI/default setting. Others need a different hooktype for the Code Handler to work correctly. Go to the Hooktype setting within USB Loader GX settings. Select desired Hooktype.

Well, I already changed the Hooktype to those two that you recommended and it didn't give any results, I suppose the problem is the code itself.
Reply
#24
(04-14-2023, 04:33 AM)LightKingdom666 Wrote: Isn't justified what? The creation of said code? Well, in the case of the code that I am giving as an example, I think it has many problems (which I have already mentioned several times), so I think it is necessary to create it from scratch.

In case you have any tutorial on how to create load pointer codes, could you please pass it on to me?

As in writing the Load Pointer code in ASM equivalent code (C0 codetype) is better in both speed and compiled length. There are no specific tutorials on this site for creating Load Pointer Gecko Opcode based Codes.

There is a thread covering overall Gecko Code Documentation though - https://mariokartwii.com/showthread.php?tid=545

The documentation is not "noob friendly" but with enough determination, you can figure out how to use any of the Opcodes available in the Code Handler.

(04-14-2023, 04:33 AM)LightKingdom666 Wrote: Wow, the truth is that I had no idea about that, could it be done now because the console is already hacked?
As of right now, with the cIOS's you've installed (I'm assuming cIOS249 and 250), you can play games on USB Loader GX that are not your region. If a game is giving you trouble, a simple language or video setting change may be needed, which can be done within USB Loader GX.

(04-14-2023, 04:33 AM)LightKingdom666 Wrote: Well, I already changed the Hooktype to those two that you recommended and it didn't give any results, I suppose the problem is the code itself.
Appears that way.
Reply
#25
(04-14-2023, 04:33 AM)Vega Wrote: Appears that way.

I have no idea what you mean.

But again changing the subject, do you know how to make codes but now for Nintendo DS games? I have noticed that Nintendo DS games also use the hexadecimal system (the same as with Wii games), but I don't know how to do them, and although I admit that I found a tutorial, the truth is that I did not understand it much: https://www.reddit.com/r/learnprogrammin...play_code/

I want to create a code that works for exactly the same thing as the code I created a few days ago for Mario Sports Mix (force the character selection to choose the same character multiple times) but now applied to a Nintendo DS game called Mario Hoops 3-on-3 (which is also sports, although in this case it is only Basketball).

P.S: I use DeSmuME (Game Emulator for Nintendo DS) to create these codes, and I admit that I tried to follow the same methodology that I used for the code I created for Mario Sports Mix (only now applied to Mario Hoops 3-on-3), although without much success.
Reply
#26
You stated "I suppose the code itself is the problem". If the hooktype switching didn't fix the code then there is something faulty with the code itself hence why I said "Appears that way".

Regarding the 3DS, I have no idea. I did a quick scroll thru of that reddit post. Basically looks like a slightly different form of Gecko Opcodes. I didn't see any ARM assembly stuff though. (3DS runs on a CPU that uses ARM-32bit architecture).
Reply
#27
(04-14-2023, 08:20 PM)Vega Wrote: Usually those type of things are Word or Halfword integers. Focus on your special attack bar first. If bar is zero search for zero. Get the bar to increase, continue the search but select "increased". When bar increases again, continue search using "increased" again. If decreases, continue search using "decreased", etc etc.

Well, I already found the instructions to create the code, but the problem I have now is with the FPRs. The code instructions are:

Code:
8018b4c8 stfs f3, 0x010C (r3) - Levels 1 to 5 (Full Bar)

8018b224 stfs f0, 0x010C (r5) - Level 0 (Empty Bar) #The first instruction changes to this only when the bar is empty, that is, when I do the special attack.

The values of the bar are these:

Level 0 (Empty Bar)

32-bit: 00000000
64-bit: 0000000000000000

Level 1

32-bit: 3E4CCCCD
64-bit: 3FC99999A0000000

Level 2

32-bit: 3ECCCCCD
64-bit: 3FD99999A0000000

Level 3

32-bit: 3F19999A
64-bit: 3FE3333340000000

Level 4

32-bit: 3F4CCCCD
64-bit: 3FE99999A0000000

Level 5 (Full Bar)

32-bit: 3F800000
64-bit: 3FF0000000000000

I was reading the tutorial on Working with Floats (https://mariokartwii.com/showthread.php?tid=1744) and it's not that I didn't have the ability to understand it, but there is something that doesn't add up to me, and it happens in the Chapter 2 of said tutorial, since in one part you say that you set r3 to 0x42013333, but I wonder how you did it? Because the values of the bar appear in 64-bit FPR (f0 to f31), but not They appear in the 32-bit registers (r0 to r31), the 32-bit values appear in memory when I find the address but not in the registers (and that is the problem).

I ask this because I assume it is necessary at assembly time, since the formula you used was this:

Code:
lis rX, 0x4201 #Single precision float value for decimal value of 32.3
ori rX, rX, 0x3333
stw rX, 0x20 (r5) #Write over what's going to be loaded from memory
lfs f2, 0x20 (r5) #Now load it; default statement

P.S: I really hope you can solve my doubt.
Reply
#28
Code:
8018b4c8 stfs f3, 0x010C (r3) - Levels 1 to 5 (Full Bar)

Just to clarify, does this instruction only occur when the exact specific Levels change?

If so, I was hoping you would find the instruction that occurs when the Bar increases/decreases in value regardless of a Level change or not, or does the Bar not work in such a manner?

Regarding your question on lis+ori... these 2 instructions can be used to write in any custom 32-bit value to a GPR. It's covered in Chapter 7 of the Beginner's Assembly Tutorial - https://mariokartwii.com/showthread.php?tid=940

Example: I want to write 0x1234ABCD to r12
Code:
lis r12, 0x1234
ori r12, r12, 0xABCD

You cannot use this method for the float values in FPRs. Therefore you need to use lis+ori first. Then store that GPR value to memory. And finally, load value from memory into the desired FPR.

So let's say you want f3 (in the first instruction) to be 0x3F4CCCCD. You can do this...
Code:
lis r12, 0x3F4C
ori r12, r12, 0xCCCD
stw r12, 0x010C (r3)
lfs f3, 0x010C (r3)

If you are wondering which GPR to choose for lis+ori, read this thread on Register Safety ---> https://mariokartwii.com/showthread.php?tid=873

It discusses what registers you can freely use that aren't part of your Original/Default code instruction.

Going back again to your first code instruction ... 8018b4c8 stfs f3, 0x010C (r3),
you can write something funny that may force Level 5 to be reached the moment you hit a new level, regardless of what the current Level is...

Code:
lis r12, 0x3F80 #Write 0x3F800000 to r12
stw r12, 0x010C (r3)
lfs f3, 0x010C (r3)

There's no need to add in an ori instruction if the ori instruction is utilizing a zero value (i.e. ori r12, r12, 0x0000). Using an ori instruction with the value of zero literally does nothing.

With your second code instruction, you may be able to "nop" it. A nop is an instruction that simply 'tells' the CPU to do nothing. This nop instruction is meant to overwrite the 'stfs f0, 0x010C (r5)' instruction.

To do that, you don't need a C2 ASM code. You can use a 32-bit RAM Write code to overwrite the instruction.

Example:
0418B224 60000000

This will write 60000000 at memory address 8018B224. 60000000 is the hex-compiled form of the Nop PPC instruction. This will write the nop instruction over the store-float instruction.

With this nop, this may prevent the Level Bar being reset to 0 once you use the Special Attack. Ofc nothing is assumed, that's why we always test our codes.

Fyi, nop is what is known as a "simplified mnemonic". It's actually an ori instruction (ori r0, r0, 0x0000).
Reply
#29
(04-26-2023, 01:16 AM)Vega Wrote:
Code:
8018b4c8 stfs f3, 0x010C (r3) - Levels 1 to 5 (Full Bar)

Just to clarify, does this instruction only occur when the exact specific Levels change?

If so, I was hoping you would find the instruction that occurs when the Bar increases/decreases in value regardless of a Level change or not, or does the Bar not work in such a manner?

No, actually I have realized that I was wrong, and in fact I checked it since when I created the code with the other address, the code was quite unstable so I discarded it.

I found other instructions, the only problem is that there are two, and what's wrong with that? Well, one instruction only works for Basketball while the other works only for the three remaining sports (Volleyball, Dodgeball and Hockey), the truth is that I don't know if there is any way to merge these two instructions to make it a single code and not two.

The instructions are these:

8135639c stw r0, 0x0224 (r5) - Basketball.

8018b300 stfs f31, 0x010C (r5) - Volleyball, Dodgeball and Hockey.

Another thing, the first instruction only uses values from 0 (Empty Bar) to 5 (Full Bar), while the second is with the other values that I published.

(04-26-2023, 01:16 AM)Vega Wrote: Going back again to your first code instruction ... 8018b4c8 stfs f3, 0x010C (r3),
you can write something funny that may force Level 5 to be reached the moment you hit a new level, regardless of what the current Level is...

Code:
lis r12, 0x3F80 #Write 0x3F800000 to r12
stw r12, 0x010C (r3)
lfs f3, 0x010C (r3)

And wouldn't there be some way to start with a full bar from the beginning? (I mean that you don't have to throw the ball to fill it up, and also that when you do the special attack it never empties).

I'm also having problems with the GVRs (to be able to choose between the blue or red team), since I tried to create both codes this way, but it didn't work, I don't know if it's because I'm structuring it wrong or if the record is wrong:

Code:
cmpwi r28, 0x0 #Team Value
bne jump_code

li r0, 0x5 #Bar Value

jump_code:
stw r0, 0x0224 (r5)

Code:
cmpwi r31, 0x0 #Team Value
bne jump_code

lis r12, 0x3F80 #Bar Value
stw r12, 0x010C (r5)

jump_code:
lfs f31, 0x010C (r5)
Reply
#30
(04-28-2023, 04:01 AM)LightKingdom666 Wrote: I found other instructions, the only problem is that there are two, and what's wrong with that? Well, one instruction only works for Basketball while the other works only for the three remaining sports (Volleyball, Dodgeball and Hockey), the truth is that I don't know if there is any way to merge these two instructions to make it a single code and not two.

You cannot 'make' one code using two hook instructions. It would be two ASM codes. Each code using its respective hook address.

(04-28-2023, 04:01 AM)LightKingdom666 Wrote: The instructions are these:

8135639c stw r0, 0x0224 (r5) - Basketball.

8018b300 stfs f31, 0x010C (r5) - Volleyball, Dodgeball and Hockey.

Another thing, the first instruction only uses values from 0 (Empty Bar) to 5 (Full Bar), while the second is with the other values that I published.

That first one is kinda odd that it's only for 0 or 5. There is definitely an instruction that exists for the other values in basketball, you just have to find it.

(04-28-2023, 04:01 AM)LightKingdom666 Wrote: And wouldn't there be some way to start with a full bar from the beginning? (I mean that you don't have to throw the ball to fill it up, and also that when you do the special attack it never empties).

Yes its possible but more difficult. You would need to find the right spot in Dynamic Memory to set a Memory BP, and once the game writes Zero to it (right when the game/match first loads), the BP will be hit. This already is tough to do. Another thing is that the Zero write may be part of a universal Memset function. This function will be used for a slew of other things that need to be zero'd out. So writing a C2 ASM code using a hook address within this Memset function will not make a usable code.

The approach would be find the spot(s) in Dynamic memory that keep track of the Bar value. Set a BP on it, and restart the game/match. Since it's dynamic memory, this probably won't work. As the game will probably 'choose' a new spot in memory for the Bar value to go to after every new game/match.

(04-28-2023, 04:01 AM)LightKingdom666 Wrote: I'm also having problems with the GVRs (to be able to choose between the blue or red team), since I tried to create both codes this way, but it didn't work, I don't know if it's because I'm structuring it wrong or if the record is wrong:

Code:
cmpwi r28, 0x0 #Team Value
bne jump_code

li r0, 0x5 #Bar Value

jump_code:
stw r0, 0x0224 (r5)

Code:
cmpwi r31, 0x0 #Team Value
bne jump_code

lis r12, 0x3F80 #Bar Value
stw r12, 0x010C (r5)

jump_code:
lfs f31, 0x010C (r5)

You have the right idea. It's possible that you may have the wrong GVR or the values for Blue vs Red aren't what you assume to be. Your example codes are fundamentally correct from an Assembly standpoint.

Part of me wants to get this game, and directly help you with this (i.e. Discord call), but unfortunately I simple don't have the free time.

To wrap this up, even with the "bad luck" on the lack of successful codes made so far, you have made a ton of progress in the overall concepts of making ASM codes. Some games are just "tougher" to make codes for. This may be one of them.
Reply


Forum Jump:


Users browsing this thread: 4 Guest(s)