Codes
WiiRd forum
March 29, 2024, 11:16:57 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome on the new server

Update 4.3 - do NOT update!
Gecko 1.9.3.1
Should I get a USB Gecko, I wanna hack?
How do I use my USB Gecko
Where can I get WiiRd?
 
   Home   CODE DATABASE GAMEHACKING Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Help with else/end if  (Read 2763 times)
schmake
Hacker
Newbie
*****

Karma: 14
Posts: 22


« on: August 07, 2008, 03:12:17 AM »

Hi Guys, I am having trouble understanding the code types documentation.  What I'd like to do is rather than after the first conditional have code execution set to false, I'd like to have another conditional or an elseif?

Here is an example of what I'm trying to do:

Code:

* 48000000 80CC1824 //load into pointer
* 4A100000 FFFFFFD8 //set pointer to -28
* DE000000 80008180 //check pointer
* 30000000 0000000A //check value = 10
* 14000004 00000001 //write 1
* 283CC200 00000182 //16 bit check IF 803CC200 = 0x0182
* 14000000 00000005 //write 5
end if/else if?? new check
* 283CC200 00000184 //16 bit check IF 803CC200 = 0x0184
* 14000000 0000000A //write 10
end if/else if?? new check
* 283CC200 00000181 //16 bit check IF 803CC200 = 0x0181
* 14000000 00000007 //write 7
* E0000000 80008000 //full terminator


Hopefully that makes sense.
I was looking at the Return/Goto (6610XXXX) but couldn't get it to work Sad

Any help would be much appreciated
Logged
schmake
Hacker
Newbie
*****

Karma: 14
Posts: 22


« Reply #1 on: August 07, 2008, 09:28:47 AM »

Code:

* 48000000 80CC1824 //load into pointer
* 4A100000 FFFFFFD8 //set pointer to - 0x28
* DE000000 80008180 //check pointer
* 30000000 0000000A //check value = 10
* 14000004 00000001 //write 1
* 283CC200 00000182 //16 bit check IF 803CC200 = 0x0182
* 14000000 00000005 //write 5
* E2000001 00000000 //endifs
* 283CC200 00000184 //16 bit check IF 803CC200 = 0x0184
* 14000000 0000000A //write 10
* E2000001 00000000 //endifs
* 283CC200 00000181 //16 bit check IF 803CC200 = 0x0181
* 14000000 00000007 //write 7
* E0000000 80008000 //full terminator


I've implemented E2000001 00000000 but it still seems clunky, is this the best way to write what I'm trying to do? :confused
Logged
James0x57
Database Admin
Leader
Legendary Member
*****

Karma: 70
Posts: 1546

Gamertag: James0x57


WWW
« Reply #2 on: August 07, 2008, 09:37:48 AM »

If the Return/Goto stuff worked that would be ideal for this. I haven't tested them myself yet so I can't show you how to use them.

However, I'll show you how to do it with other codetypes. Smiley

From what I gathered, this is the structure you're going for:
Code:
Load Pointer
if( pointer valid )
{
if( [pointer]==0xA ) //check value = 10
{
14000004 00000001 //write 1
if( [283CC200]==0x182 ) //16 bit check IF 803CC200 = 0x0182
{
14000000 00000005 //write 5
}
else if( [283CC200]==0x184 ) //16 bit check IF 803CC200 = 0x0184
{
14000000 0000000A //write 10
}
else if( [283CC200]==0x181 ) //16 bit check IF 803CC200 = 0x0181
{
14000000 00000007 //write 7
}
}
}

I'll show you how to do else if for that ^
If that's not quite correct, just let me know and I'll make the appropriate changes. Smiley

There IS an end if +else codetype but I've never used it.. This is what it would look like using that (As far as I can tell!):
* 48000000 80CC1824 //load into pointer
* 4A100000 FFFFFFD8 //set pointer to -28
* DE000000 80008180 //check pointer
* 30000000 0000000A //check value = 10
* 14000004 00000001 //write 1
* 283CC200 00000182 //16 bit check IF 803CC200 = 0x0182
* 14000000 00000005 //write 5
# E2100001 00000000 //end 1 if, don't change ba and po, inverse code execution (else)
* 283CC200 00000184 //16 bit check IF 803CC200 = 0x0184
* 14000000 0000000A //write 10
# E2100001 00000000 //end 1 if, don't change ba and po, inverse code execution (else)
* 283CC200 00000181 //16 bit check IF 803CC200 = 0x0181
* 14000000 00000007 //write 7
* E0000000 80008000 //full terminator

I have a really strong feeling that the else lines right there ^ should NOT be applying an endif... so instead, they would need to look like this: E2100000 00000000
I don't know though Wink


If you test that last one out there, please let me know how it seems to work. Smiley
Logged


schmake
Hacker
Newbie
*****

Karma: 14
Posts: 22


« Reply #3 on: August 07, 2008, 11:06:22 AM »

Thanks for your help James0x57, the structure that you listed above is exactly what I was aiming for.
I tried using both E2100000 and E2100001, however they didn't work.  I had to end up using the 1 end if - E2000001.  The following codes below enable me to choose using button activators what item I can use

Code:

[Select Item Mario Kart Wii Grand Prix]
* 48000000 809C22B0 //load into pointer
* DE000000 80008180 //check pointer
* 4A100000 FFFF9F5C //set pointer to - 0x60A4
  30000000 00000014 //check value = 0x14 (Nothing)
* 14000004 00000001 //write 1
* 28348200 00000181 //16 bit check IF 803CC200 = 0x0181 (A + Left)
* 14000000 0000000F //write F (Bullet Bill)
* E2000001 00000000 //1 endif
* 28348200 00000182 //16 bit check IF 803CC200 = 0x0182 (A + Right)
* 14000000 00000007 //write 7 (Blue Shell)
* E2000001 00000000 //1 endif
* 28348200 00000184 //16 bit check IF 803CC200 = 0x0184 (A + Down)
* 14000000 00000009 //write 9 (Star)
* E2000001 00000000 //1 endif
* 28348200 00000081 //16 bit check IF 803CC200 = 0x0181 (Left)
* 14000000 0000000A //write A (Gold Shroom)
* E2000001 00000000 //1 endif
* 28348200 00000082 //16 bit check IF 803CC200 = 0x0182 (Right)
* 14000004 00000003 //write 3 (3 Shells)
* 14000000 00000011 //write 11 (Red Shells Multi)
* E2000001 00000000 //1 endif
* 28348200 00000084 //16 bit check IF 803CC200 = 0x0184 (Down)
* 14000000 00000008 //write 8 (Lightning
* E0000000 80008000 //full terminator
Logged
James0x57
Database Admin
Leader
Legendary Member
*****

Karma: 70
Posts: 1546

Gamertag: James0x57


WWW
« Reply #4 on: August 07, 2008, 03:28:20 PM »

Too bad that didn't work. I still have a lot of exploring to do with these crazy cool codetypes. Tongue

To compress what you just posted, you can do this:
Code:
[Select Item Mario Kart Wii Grand Prix]
* 48000000 809C22B0 //load into pointer
* DE000000 80008180 //check pointer
* 4A100000 FFFF9F5C //set pointer to - 0x60A4
  30000000 00000014 //check value = 0x14 (Nothing)
* 14000004 00000001 //write 1
* 28348200 00000181 //16 bit check IF 803CC200 = 0x0181 (A + Left)
* 14000000 0000000F //write F (Bullet Bill)
* 28348201 00000182 //16 bit check IF 803CC200 = 0x0182 (A + Right)
* 14000000 00000007 //write 7 (Blue Shell)
* 28348201 00000184 //16 bit check IF 803CC200 = 0x0184 (A + Down)
* 14000000 00000009 //write 9 (Star)
* 28348201 00000081 //16 bit check IF 803CC200 = 0x0181 (Left)
* 14000000 0000000A //write A (Gold Shroom)
* 28348201 00000082 //16 bit check IF 803CC200 = 0x0182 (Right)
* 14000004 00000003 //write 3 (3 Shells)
* 14000000 00000011 //write 11 (Red Shells Multi)
* 28348201 00000084 //16 bit check IF 803CC200 = 0x0184 (Down)
* 14000000 00000008 //write 8 (Lightning
* E0000000 80008000 //full terminator


It's a sub-codetype for conditionals where adding 1 to the address executes an endif then the normal if.
I've tested this codetype so I know it'll work. Wink
Logged


Black_Wolf
Former PSP Hacker
Hacker
Full Member
*****

Karma: 11
Posts: 129


WWW
« Reply #5 on: August 07, 2008, 08:48:19 PM »

just out of curiousity, when you say -60A4 to the pointer, does this mean the pointer loads from an address 60A4 below what you originally specified, or is it more like, load the pointer's value, then minus 60A4 from it to reach the item address. So its like
[809C22B0] -60A4 = Item code?
Logged

schmake
Hacker
Newbie
*****

Karma: 14
Posts: 22


« Reply #6 on: August 07, 2008, 10:10:25 PM »

@James0x57  Thanks mate, I will use that, much smaller and nicer :beer

@Black_Wolf  That's exactly what it is doing
Logged
Black_Wolf
Former PSP Hacker
Hacker
Full Member
*****

Karma: 11
Posts: 129


WWW
« Reply #7 on: August 09, 2008, 07:41:04 AM »

thanks, just was lookin for a little clarification. Love the wii community, everyone answers so quick lmao.
Logged

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!