Coding Questions and other Quandaries
#81
What version of Dolphin are you using? And how are you applying the cheats in Dolphin? Some of the odd issues you are describing such as "corrupted my cheat manager code file" is something I've never seen or heard of before.

Btw it looks like you can change all those string writes to 6 serial writes and a couple of misc RAM writes for the rest of the code's contents.
Reply
#82
Stop the presses!!!
I tried it out on the Wii, Like you said, and the simple button activator works. Yay!!!!!

28401C28 00000010

Lesson learned.

But there is still fun to be had.
Since there a lot more items that can fill the item slots, besides what I've programmed in,
it might be neat to create a button code, that takes say, the first slot, and lets you scroll through all the other available items than it's initially programmed with.

Was very happy to see that work on the Wii.
Glad I haven't seen this, "it don't work in dolphin, but works on the Wii," often.
Reply
#83
Yep that can it actually be quite common. Dolphin emulates Broadway but its not perfect. For example, it will jack up the cache from time to time. Also Dolphin does 'bare minimum' emulation of IOS. Thus, many hardware specific registers aren't even emulated at all. It's not a big deal, as most issues have a work-around.
Reply
#84
I'm using 5.0-11380. Is there a better one you'd recommend?

I have a question regarding Gecko registers and pointer use.
Referencing the Pokemon code above, I want add another button activator to cycle through the different items.
Is it necessary to add it to that code, with

E0000000 00000000 or E0000000 80008000

in between, or can/should it be it's own separate code?

Also, let's say I set the pointer with the above code, will other new separate codes I add, have the ability to reference the pointer set up in the first code, using pointer referencing Gecko code types?

Thanks!!!!!!!!
Reply
#85
(01-02-2022, 04:32 PM)Hackwiz Wrote: I'm using 5.0-11380. Is there a better one you'd recommend?

No that's an ok version. How are you actually applying the cheats in Dolphin?

(01-02-2022, 04:32 PM)Hackwiz Wrote: I have a question regarding Gecko registers and pointer use.
Referencing the Pokemon code above, I want add another button activator to cycle through the different items.
Is it necessary to add it to that code, with

E0000000 00000000 or E0000000 80008000

in between, or can/should it be it's own separate code?

Also, let's say I set the pointer with the above code, will other new separate codes I add, have the ability to reference the pointer set up in the first code, using pointer referencing Gecko code types?

Thanks!!!!!!!!

To understand the Gecko Documentation better, it actually helps to say out loud what each codetype does as you are scrolling down your code reading the Gecko Codetypes. Sounds silly, but it helped me when I was a beginner.

Code:
Full Terminator
E0000000 XXXXYYYY

Clears the code execution status.
If XXXX<>0, ba = 0xXXXX0000
If YYYY<>0, po = 0xYYYY0000

"Clears the code execution status" simply means that this codetype Ends all current If-Statements (i.e. 16-bit for controller line). At the start of any GCT, the BA (base address) and PO (pointer) start as both 0x800000000. You would use 'E0000000 00000000' to end If-Statement(s) but any modifications to ba and po are kept intact. The use of 'E0000000 80008000' resets ba and po to the Code Handler's default values (0x80000000).

So in conclusion, if you use the Halfway Terminator (E0000000 00000000), codes underneath it can reference an earlier established pointer (that was established above the Halfway Terminator).

I would highly advise getting better at Assembly and getting more intuitive with it instead of 'defaulting' to using Gecko Codetypes. Most Codetypes really only exist because many beginners back in the day (2008 - 2010) didn't want to learn Assembly. Well written Assembly code(s) (C0 and/or C2) will 99% of the time be more optimized compared to the same code(s) that is 'clobbered' together with various Gecko Codetypes.
Reply
#86
"How are you actually applying the cheats in Dolphin?"

Saving them in the Gecko folder in the cheat manager. Using the activate/deactivate button. And then of course, button activators therein.

"Clears the code execution status" simply means that this codetype Ends all current If-Statements (i.e. 16-bit for controller line). At the start of any GCT, the BA (base address) and PO (pointer) start as both 0x800000000. You would use 'E0000000 00000000' to end If-Statement(s) but any modifications to ba and po are kept intact. The use of 'E0000000 80008000' resets ba and po to the Code Handler's default values (0x80000000)."

I get that. Let me rephrase my question:

Let's say, like I said above, that I save my pokemon full menues code, in the Gecko folder (has its own Activate/deactivate button).

This code establishes a pointer.

Now a little down the road, I find another code, (unrelated to the menu code), that I would like to add to the Gecko folder. With that new code, would I be able to use the
pointer established in the first code if need be?? Hope that makes more sense.

"I would highly advise getting better at Assembly and getting more intuitive with it instead of 'defaulting' to using Gecko Codetypes. Most Codetypes really only exist because many beginners back in the day (2008 - 2010) didn't want to learn Assembly. Well written Assembly code(s) (C0 and/or C2) will 99% of the time be more optimized compared to the same code(s) that is 'clobbered' together with various Gecko Codetypes."

Oh yeah!

I'm getting better at it, can't you tell from the Pokemon code LOL!!

I scored a nice victory yesterday hacking "Alien Hominid (USA) GCN"

I started trying to hack infinite grenades/lives codes a couple years ago. This always ended in frustration and game crashes, because of incorrect ASM.
Are you ready for a laugh??
I was under the misguided assumption that the line of code that bp's set on those things, broke on, were ONLY used for writing to those things.

i.e. stw r0, 0x016C (r31)

I had no idea that (r31) could be any number of addresses and used for just as many functions in the game.

Using the compare and branch techniques you've shown me, I was able to hack both in about 30 minutes:

Infinite grenades:

lis r12, 0xFFFF
ori r12, r12, 0xFFFF
cmpw r12, r31
bne- not_grenade
li r31, 0x0

not_grenade:
add r0, r0, r31

And Infinite Lives:

cmpwi r19, 0x3F #ASM 0x3F consistently in r19 when losing a life.
bne- not_lives
li r3, 0x5

not_lives:
stw r3, 0x8 (r30)

They work great on the Wii. Good thing too, because this game is insanely hard.

I'm getting there.
Reply
#87
On post #80 you mentioned about your cheat file being corrupted. I can't think of a way of how that is possible. Dolphin takes the codes from the Cheat Manager, makes a GCT with it, and dumps it to memory.

---

I just thought you were trying Gecko code types before trying an ASM approach. You are learning really fast. Much faster than me when I had to learn all this Assembly stuff. It took me ages to understand the basics like branches (lmao). In short time, you will be better than me at making ASM codes.

--

In regards to your pointer question. If you set/create the pointer via Gecko code types, the pointer can remain intact between separate codes if PO is not reset. If you set/create the pointer via ASM, you will have to use something like EVA to be able to reference that pointer in a separate code.

--

On your grenade code, -1 is within the 16 bit signed range. Therefore you don't need lis & ori.

cmpwi r31, -1

--

It's awesome to see you tackle all these different Wii and GC games. That motivates my lazy ass to make codes again, lul.
Reply
#88
"On your grenade code, -1 is within the 16 bit signed range. Therefore you don't need lis & ori.

cmpwi r31, -1"

Brilliant!!!!!

"It's awesome to see you tackle all these different Wii and GC games. That motivates my lazy ass to make codes again, lul."

If you want a game to make chop suey out of, may I suggest "Cocoto Kart Racer - (USA) Wii"?

This game is a blatant Mario Kart Wii ripoff. Being that you guys have shredded MKW, maybe this game will use the same style of programming, and MKW codes could be adapted to that game.

I have hacked a few codes for the game. One that allows you to keep your current weapon/powerup, or change it using using Wiimote motions for activating/deactivating,
instead of button activators, (who has time to punch in the melody to Funky Town on the Wiimote while racing Smile ).

The Gecko/ASM is terribly elementary. Since I've learned A LOT in the last month or so, I plan on revisiting that code to make it work the way I intended it to.

One of the codes I revisited last night was being able to choose racers that are locked (until you beat certain races), at the racer select screen.
Using the methods described at: https://tcrf.net/Help:Contents/Finding_C..._and_areas

I am able to force the cursor to select the locked characters. However, this is somehow effecting the next operation. Kart selection, which is on the same screen.
You are unable to move through the selection of karts.
I need another holiday weekend (already) to observe what is going on more closely.

I'm sure I'll have some questions once I figure out what's what.

Here's the weapon/powerup code I referenced earlier with notes:

Infinite Ammo/Power-ups (Note)

2C1ADB68 0000BF70
C2054774 00000001
38030000 00000000
C2058FA8 00000001
38000003 00000000
C2058FAC 00000002
38000003 901E0154
60000000 00000000
C2055750 00000001
380000XX 00000000
E0000000 00000000
2C1ADB68 00003F70
2E1ADB68 00004000
C2054774 00000001
3803FFFF 00000000
C2058FA8 00000001
38000001 00000000
C2058FAC 00000001
901E0154 00000000
C2055750 00000001
38000000 00000000
E0000000 80008000

(Note)
Roll the Wiimote 90 degrees to the right (CW), to activate. You'll be given a quantity of 3 on weapons/power-ups that normally only give you 1 upon pick-up. This effects the other racers also. If you lose your current weapon/power-up, you'll automatically be given the item XX you choose to put in the modifier. If they receive XX = 06 – Red Fairy/Storm Angel, or you set this value in the code, it results in a cluster funk, with all of the racers being hit by lightning. Roll the Wiimote 90 degrees to the left (CCW), to deactivate the code if this happens. Or if you want to change weapons/power-ups, deactivate the code to use up the currently held item, then reactivate to get a new weapon/power-up. Don’t activate code until you’re at the starting line.

XX – Weapon/Power-up Modifier

01 – Mosquito Fork/Dart
02 – Fireball/Piranha
03 – Turbo
04 – Invincibility
05 – Blue Fairy/Storm Angel
06 – Red Fairy/Storm Angel
07 – Fireball/Explosive Cloud
08 – Tomato
09 – Sticky Lava Ball/Paralyzing Ice

Obviously there is some problems with the code, (don't want the other racers to have unlimited ammo or weapon/powerup choice like you do).
Now that I know more about compare and branch operations, I should be able to revise it the way it should be.

Have a great day!
Reply
#89
Do you have a Discord?
Reply
#90
(01-09-2022, 01:04 AM)Vega Wrote: Do you have a Discord?

Huh???

I just looked it up. No I don't.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)