I need some help on asm

Started by Crapulecorp, April 29, 2011, 12:59:03 AM

Previous topic - Next topic

Crapulecorp

#15
So i try to make the second code

801B9A58

lwz r12,-4(r6)
cmpwi r12,6      
beq- _PLAYER  
li r12,0  
b _END  
_PLAYER:
lis r12,0x3F80  
_END:
stw r12,0(r6)

i get

C21B9A58 00000004
8186FFFC 2C0C0006
4182000C 39800000
48000008 3D803F80
91860000 00000000

The code works i can have special everytime and no the enemy.
I see that the both jauge are always empty maybe i made a mistake but i have a problem the code is working on arcade mode but not in world tour.
just the jauge are empty in world tour but the first code

Power Jauge always full
C21436AC 00000002
3D803F80 919F0004
60000000 00000000
C21B9A58 00000002
3D803F80 91860000
60000000 00000000

Works on arcade and world tour mode but you know that player and enemy has full jauge with this one.

dcx2

I was afraid of that...

My guess is that 0(r31) is not 6 for the World Tour.

Repeat the Step Log process for World Tour.  Breakpoint tab - Step Log - Execute on address   801430A8:835F0000   lwz   r26,0(r31)    - Set many times

If you watch carefully, you may be able to tell which address is the player, if you notice when the breakpoint hits your power bar.

The Step Log will tell us what values 0(r31) might be.

dcx2

Also

You may have noticed that you can't turn these cheats off once you turn them on.  C2 codes change the game, and it needs to be changed back to normal.  I made "GCT Code Undo" to do that.

Original Instruction - 801B9A58: D0260000 stfs f1,0(r6)

##801B9A58 D0260000
C21B9A58 00000004
8186FFFC 2C0C0006
4182000C 39800000
48000008 3D803F80
91860000 00000000

When you click "Send Codes", the ## line is ignored.

When you click "Disable Codes", the ## line will poke the address (801B9A58) with the value (D0260000), which will change the game back to normal.  Double check the address (801B9A58) in Disassembly; it should be stfs.

Crapulecorp

thanks again for everything dcx2


I repeat the "Step Log" for World Tour in the Breakpoint tab on address   801430A8:835F0000   lwz   r26,0(r31)   

I get this :

801430A8:  835F0000   lwz   r26,0(r31)   r26 = 80655DA8   r31 = 8079D928   [8079D928] = 00000007 Player

801430A8:  835F0000   lwz   r26,0(r31)   r26 = 80655DA8   r31 = 8077C0F0   [8077C0F0] = 0000000B Enemy

So for 801436AC

lwz r12,0(r31)
cmpwi r12,7     
beq- _PLAYER 
li r12,0 
b _END 
_PLAYER:
lis r12,0x3F80 
_END:
lwz r12,0(r31)

i get

C21436AC 00000004
819F0000 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000

and for 801B9A58

lwz r12,-4(r6)
cmpwi r12,7     
beq- _PLAYER 
li r12,0 
b _END 
_PLAYER:
lis r12,0x3F80 
_END:
stw r12,0(r6)

i get

C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

and i add the original instruction for the two codes

World Tour Mode Power Jauge
801436AC D03F0004
C21436AC 00000004
819F0000 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
801B9A58 D0260000
C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

So they can be turn off.

And I made the arcade mode code too :

Arcade Mode Power Jauge
801436AC D03F0004
C21436AC 00000004
819F0000 2C0C0006
4182000C 39800000
48000008 3D803F80
919F0004 00000000
801B9A58 D0260000
C21B9A58 00000004
8186FFFC 2C0C0006
4182000C 39800000
48000008 3D803F80
91860000 00000000

I have a question can i add

for 801436AC

lwz r12,0(r31)
cmpwi r12,6
cmpwi r12,7
     
beq- _PLAYER 
li r12,0 
b _END 
_PLAYER:
lis r12,0x3F80 
_END:
lwz r12,0(r31)

for having the code working for the two modes (Arcade and World Tour) ?

Thanks again to you Dcx2 you helped me a lot.

dcx2

#19
I applaud your effort!  You are not a noob.

---

##801436AC D03F0004
C21436AC 00000004
819F0000 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
##801B9A58 D0260000
C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

Be careful with the ##.  Only Gecko.NET recognizes it.  Everything else (WiiRDGUI, ASMWiiRD, PyiiASMH, Gecko OS) will be confused.  It is only for hackers, and only for the GCT Tab of Gecko.NET; it allows us to turn codes off.  When you publish the code for cheaters (on the forum; on GeckoCodes), do not include the ## line.  Cheaters cannot turn codes off with ##.

---

A C2 "hooks" the game.  Hook in the sense of fishing.  You can only have one "hook" active per address.
World Tour Mode Power Jauge
C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

Arcade Mode Power Jauge
C21B9A58 00000004
8186FFFC 2C0C0006
4182000C 39800000
48000008 3D803F80
91860000 00000000

Whichever hook is last will work, the other will not.  So if the codes are applied in this order, Arcade Mode will work, but World Tour will not.

---

Quotelwz r12,0(r31)
cmpwi r12,6
cmpwi r12,7     
beq- _PLAYER 
li r12,0 
b _END 
_PLAYER:
lis r12,0x3F80 
_END:
lwz r12,0(r31)

This is a good try!  You are very close.  This is what you want.

lwz r12,0(r31)
cmpwi r12,6
beq- _PLAYER 
cmpwi r12,7     
beq- _PLAYER 
li r12,0 
b _END 
_PLAYER:
lis r12,0x3F80 
_END:
stw r12,4(r31)

---

I will try to explain the CPU a bit.  This may be difficult to understand.

When a CPU compares one value to another, it sets the Condition Register (CR).  The CR records whether the comparison is less than, equal, or greater than.  This tells the next ASM the result of the compare.

cmpwi r12,6  # compare r12 to 6.  if r12 < 6, make CR less than.  if r12 == 6, CR equal.  if r12 > 6, CR greater than
beq- _PLAYER # if the CR is equal, branch execution to the _PLAYER label, skipping over everything in between

Do you see now why your initial suggestion would not work?

cmpwi r12,6  # if r12 is 6, CR equal
cmpwi r12,7  # if r12 is 6, CR less than
beq- _PLAYER # if CR less than, this will not branch!

Therefore, you must do each test one at a time.  Each compare will have its own conditional branch (branch that uses Condition Register CR) [examples of other conditional branches: blt (branch less than), ble (branch less than or equal), bgt (branch greater than), bne (branch not equal), and so on]

---

Here is something to try.  After you Send Codes, set an execute breakpoint on the address.  For example 801B9A58.  You will see "b 0x8000XXXX" instruction.  Now click "Step Into".  The processor will execute just the b instruction and then stop again.  It should take you to the lwz r12,0(r31) of your code!

Press "Step Into" again, and it will go forward one instruction to cmpwi r12,6.  Look carefully at the CR.  Then press "Step Into" again.  It will go to the beq- _PLAYER, and the CR will change a little bit because of the cmpwi.  Also, the "Show Mem" button will say "Taken" if the conditional branch is true, or "Not Taken" if it is false.

Keep pressing "Step Into" and you will watch your code work.

Crapulecorp

Thanks again for everything dcx2.

So i tried for 801436AC

lwz r12,0(r31)
cmpwi r12,6
beq- _PLAYER 
cmpwi r12,7     
beq- _PLAYER
li r12,0
b _END
_PLAYER:
lis r12,0x3F80
_END:
lwz r12,0(r31)

Like you said it doesnt work and crash the wii when the jauge will increase.

So i have some questions :

- Therefore, you must do each test one at a time.  Each compare will have its own conditional branch (branch that uses Condition Register CR) [examples of other conditional branches: blt (branch less than), ble (branch less than or equal), bgt (branch greater than), bne (branch not equal), and so on]

May i test :

[spoiler]C21B9A58 00000004
8186FFFC 2C0C0006
4182000C 39800000
48000008 3D803F80
91860000 00000000

and

C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

[/spoiler]or [spoiler]
C21436AC 00000004
819F0000 2C0C0006
4182000C 39800000
48000008 3D803F80
919F0004 00000000
C21B9A58 00000004
8186FFFC 2C0C0006
4182000C 39800000
48000008 3D803F80
91860000 00000000

and

C21436AC 00000004
819F0000 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000[/spoiler]

-  I send this code[spoiler]C21B9A58 00000004
8186FFFC 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000[/spoiler]And execute breakpoint on the address.
I click "Step Into"
I look carefully at the CR and i saw 26200882, 46200882 and 8620082.

Sometimes the "Show Mem" says "Not Taken" and "Taken"
So i really dont know what to do. You told me to see the conditional branch  (branch that uses Condition Register CR) [examples of other conditional branches: blt (branch less than), ble (branch less than or equal), bgt (branch greater than), bne (branch not equal), and so on.

I m really confused and really dont know what to do.Asm is too complex for me.I hope you understand what i mean.

dcx2

#21
That code should not crash.

Oh no!  I see what you did wrong.

And we have been getting it wrong for a while now.  I edited some old posts.  Sorry to cause you confusion.

801436AC

lwz r12,0(r31)
cmpwi r12,6
beq- _PLAYER 
cmpwi r12,7     
beq- _PLAYER
li r12,0
b _END
_PLAYER:
lis r12,0x3F80
_END:
stw r12,4(r31)

C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000

---

The other code

801B9A58

lwz r12,-4(r6)
cmpwi r12,6     
beq- _PLAYER 
cmpwi r12,7     
beq- _PLAYER 
li r12,0 
b _END 
_PLAYER:
lis r12,0x3F80 
_END:
stw r12,0(r6)

C21B9A58 00000005
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

---

With the "Show Mem", "Taken", "Not Taken", I wanted you to see the ASM code as it happens.  It was only a learning experience.  So that you understand how branches change which instruction will be executed next.

Crapulecorp

#22
Thanks again to you dcx2. I changed the stw r12,4(r31) and you r right i was wrong.

So i rechecked the second one  

801B9A58

lwz r12,-4(r6)
cmpwi r12,6
beq- _PLAYER
cmpwi r12,7    
beq- _PLAYER
li r12,0
b _END
_PLAYER:
lis r12,0x3F80
_END:
stw r12,0(r6)

Power Jauge (with original instruction)
801436AC D03F0004
C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
801B9A58 D0260000
C21B9A58 00000005
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

And yes now the jauge works for arcade and World Tour mode.
Thanks Again for everything you helped me a lot.You are awesome dcx2.
I made other asm codes if you have some time can you see them ?
They are working and no bug yet but if you see something wrong it would be nice to tell me.
[spoiler]
For

8011342C:  900303D4   stw   r0,980(r3)

I used Li   r0,999
Stw   r0,980(3)

I get

Stars x999 (World tour mode)(with original instruction)
8011342C 900303D4
C211342C 00000002
380003E7 900303D4
60000000 00000000
                         
                      ------------------------------------------------------------------------------------------------
For 80230380:  7FE3012E   stwx   r31,r3,r0
    8023091C : 7EE3012E   stwx   r31,r3,r0

I used lis r12,9999
ori r12,r12,9999
stwx r12,r3,r0

I get

Training Points Max (World Tour mode)(with original instruction)
80230380 7FE3012E
C2230380 00000002
3D80270F 618C270F
7D83012E 00000000
8023091C 7EE3012E
C223091C 00000002
3D80270F 618C270F
7D83012E 00000000

              --------------------------------------------------------------------------------------------------------------
For 801134FC:  900303E0   stw   r0,992(r3)

I used lis r12,0
ori r12,r12,65535
stw r12,992(r3)

I get

Stamina always full(with original instruction)
801134FC 900303E0
C21134FC 00000002
3D800000 618CFFFF
918303E0 00000000
[/spoiler]

I have a last question if i want to make an asm code with a button activator to switch the code On/Off.
I have to put the activator adress like 28XXXXXX YYYYZZZZ as usual and end ith with the terminator E0000000 80008000.
I  suppose i have to add the original instruction as anti code with a CC000000 00000000 codetype too or not ?

dcx2

#23
No, this is wrong!

You do not need ##, but it helps if you want to turn the code off.  ## is only for Gecko.NET GCT tab.  Never post the ## lines to the forum or GeckoCodes.  It may cause a crash without Gecko.NET

Example: put this in your GCT Tab.  If you use ##, you MUST include the ## at the beginning!  ## means "this is not a code.  this is undo code."  When you press "Disable Code" (on GCT Tab), it will use ## lines to turn codes off.  So the game goes back to normal without rebooting the Wii.

[spoiler]
##801436AC D03F0004
C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
##801B9A58 D0260000
C21B9A58 00000005
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000
[/spoiler]


---

You keep forgetting to delete the rest of the ## line in your ASM codes.  The Wii will think that 801436AC D03F0004 is a code!  This could cause problems for others.

http://www.geckocodes.org/index.php?arsenal=1#80

Remember, ## is undo code only for Gecko.NET GCT tab "Disable Codes".  When you post the code to the forum, remove the ## lines completely!  Cheaters cannot use ## without Gecko.NET GCT Tab.

C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000

C21B9A58 00000005
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000

---

Quotelwz r12,-4(r6) is that normal that here r12,-4(r6) "the player/enemy discriminator"

Yes.  Your original breakpoints were

801436AC:  D03F0004   stfs   f1,4(r31)
801B9A58:  D0260000   stfs   f1,0(r6)

If 4(r31) = power bar, and 0(r31) = discriminator
then 0(r6) = power bar, and -4(r6) = discriminator

discriminator is 4 bytes before power bar.  4 -> 00 -> -4.

---

Your ASM codes are good!  Only you forget to delete the ## line.

You ask about button activators.  Here is how you would button activate one Power Gauge code.  Try to do the other.  You can combine them with one 28 code.

041436AC D03F0004
28XXXXXX YYYYZZZZ
C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
E0000000 80008000

Notice!  ##801436AC D03F0004 is now 041436AC D03F0004.  041436AC D03F0004 is a real code!

What this does

04 code always writes original instruction back every time
28 code is the button activator
C2 code is the hack; it only happens if the button activator is true
E0 code terminates 28 code

So, if ZZZZ is pressed, 04 code executes, then C2 over-writes it.  The hack happens.

And, if ZZZZ is not pressed, 04 code executes, but C2 does not.  The hack does not happen.

---

EDIT:

Yes, you can use CC code to make a "toggle switch".  Without CC, the code only happens while button is pressed.  Release button, code off.  Press button, code on.  Like "SHIFT" on keyboard.

If you use CC code, press button, code on.  Release button, code stays on.  Press button again, code off.  Release button, code stays off.  Press button again, code on again.  Like "CAPS LOCK" on keyboard.

041436AC D03F0004
28XXXXXX YYYYZZZZ
CC000000 00000000
C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
E0000000 80008000

Crapulecorp

#24
Thanks again to you dcx2.

I had understood that ## is only for Gecko.NET GCT tab. I kept them for an eventual button activator.

So i m trying to make the codes with an activator :

Here is the other :

041B9A58 D0260000
C21B9A58 00000005
286CBC1A 00001001
CC000000 00000000
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000
E0000000 80008000

I have a doubt for codes with 2 adresses :
[spoiler]And the others

Stars x999 (World Tour Mode) (Push - and Up ON/OFF)
0411342C 900303D4
286CBC1A 00001008
CC000000 00000000
C211342C 00000002
380003E7 900303D4
60000000 00000000
E0000000 80008000

Stamina jauge Always Full (World Tour Mode) (Push - and Right ON/OFF)
041134FC 900303E0
286CBC1A 00001002
CC000000 00000000
C21134FC 00000002
3D800000 618CFFFF
918303E0 60000000
E0000000 80008000

I have a doubt for this :

Training Points Max (World Tour Mode)  (Push - and Down ON/OFF)
04230380 7FE3012E
0423091C 7EE3012E
286CBC1A 00001004
CC000000 00000000
C2230380 00000002
3D80270F 618C270F
7D83012E 00000000
C223091C 00000002
3D80270F 618C270F
7D83012E 00000000
E0000000 80008000

or

Training Points Max (World Tour Mode)  (Push - and Down ON/OFF)
04230380 7FE3012E
286CBC1A 00001004
CC000000 00000000
C2230380 00000002
3D80270F 618C270F
7D83012E 00000000
E0000000 80008000
0423091C 7EE3012E
286CBC1A 00001004
CC000000 00000000
C223091C 00000002
3D80270F 618C270F
7D83012E 00000000
E0000000 80008000

I have a doubt for this :

Power Jauge always Full (Push - and Left On/Off)
041436AC D03F0004
041B9A58 D0260000
286CBC1A 00001001
CC000000 00000000
C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
C21B9A58 00000005
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000
E0000000 80008000

or

Power Jauge always Full (Push - and Left On/Off)
041436AC D03F0004
286CBC1A 00001001
CC000000 00000000
C21436AC 00000005
819F0000 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
919F0004 00000000
E0000000 80008000
041B9A58 D0260000
C21B9A58 00000005
286CBC1A 00001001
CC000000 00000000
8186FFFC 2C0C0006
41820014 2C0C0007
4182000C 39800000
48000008 3D803F80
91860000 00000000
E0000000 80008000[/spoiler]

Thanks a lot for your patience and your help dcx2.

dcx2

You are welcome Crapulecorp.  I like to help others learn.

All of the codes you posted should work.  They are two ways to do the same thing.  I would prefer this type of code, because it is shorter.

[spoiler]Training Points Max (World Tour Mode)  (Push - and Down ON/OFF)
04230380 7FE3012E
0423091C 7EE3012E
286CBC1A 00001004
CC000000 00000000
C2230380 00000002
3D80270F 618C270F
7D83012E 00000000
C223091C 00000002
3D80270F 618C270F
7D83012E 00000000
E0000000 80008000[/spoiler]