Can we find a solution for this?

Started by Apache81, April 26, 2010, 02:42:49 PM

Previous topic - Next topic

Apache81

I thought about making some codes like this:
if (buttonPressed) {
  if (!check) {
     doSomething;
     check = true;
  } // if
} else {
  check = false;
} // if-else

where check could be a gecko register value... but if the registers values will be resetted every frame there are no possibilities to make such a code.   :(

Any idea?


All my codes are made to work with Gecko, Coverfloader and WiiFlow... not sure about others !!!

Skiller

Quote from: Apache81 on April 26, 2010, 02:42:49 PM
I thought about making some codes like this:
if (buttonPressed) {
  if (!check) {
     doSomething;
     check = true;
  } // if
} else {
  check = false;
} // if-else

where check could be a gecko register value... but if the registers values will be resetted every frame there are no possibilities to make such a code.   :(

Any idea?

the ROller codes i did for Monster hunter Fix this kinda thing but its done in a long way

THis part Frints the No Crash Value 01000001
lis r3,-32768
lwz r20,12052(r3)
cmpwi r20,0
bne- 0x10
lis r20,256
ori r20,r20,1
stw r20,12052(r3)

THis is setting up the Button Activators
lis r3,-32667
ori r3,r3,38416
lbz r21,8(r3)
cmpwi r21,32
beq- 0x20
cmpwi r21,16
beq- 0x18
cmpwi r21,8
beq- 0x10
cmpwi r21,4
beq- 0x08
b 0xAC

If button activators are ture it goes into this section
lis r3,-32768
lwz r20,12048(r3)
addi r0,r20,1
stw r0,12048(r3)
cmpwi r0,0x30
bne- 0x94
cmpwi r21,32
beq- 0x1C
cmpwi r21,16
beq- 0x30
cmpwi r21,8
beq- 0x60
cmpwi r21,4
beq- 0x3C

The section has a Timer that prints to 80002F00 Section and it Checks the value to make sure its 0x30 Befor it checks the Padd addresses again to jump to the Corasponding Addi or subi . This is set up for 4 diffrent buttons to set it up for 1 it be much shorter .


Addi/Subi section

lbz r21,12052(r3)
addi r0,r21,1
cmpwi r0,16
beq- 0x0C
stb r0,12052(r3)
stb r0,0(r24)
b 0x54
lbz r21,12052(r3)
subi r0,r21,1
cmpwi r0,0
beq- 0x0C
stb r0,12052(r3)
stb r0,0(r24)
b 0x38
lhz r21,12054(r3)
addi r0,r21,1
cmpwi r0,200
beq- 0x0C
sth r0,12054(r3)
sth r0,2(r24)
b 0x1C
lhz r21,12054(r3)
subi r0,r21,1
cmpwi r0,0
beq- 0x0C
sth r0,12054(r3)
sth r0,2(r24)
stw r31,12048(r3)
lbz r3,0(r24)
nop

dcx2

Quote from: Apache81 on April 26, 2010, 02:42:49 PM
I thought about making some codes like this:
if (buttonPressed) {
  if (!check) {
     doSomething;
     check = true;
  } // if
} else {
  check = false;
} // if-else

where check could be a gecko register value... but if the registers values will be resetted every frame there are no possibilities to make such a code.   :(

Any idea?

1) It looks like you want to "one shot" a button press.  For example, let's say doSomething; adds $1 to your money.  If you press a button to activate that code, you get $1 for each frame that the button is held down.  A "one shot" would add $1 only once, each time the button is pressed.  If my assumption is correct, you need no trickery, just add 4 to your button address instead.  The two 32-bit words after the button states (buttons + 0) is the "button edges", which are 1 for a single frame when a button is pressed (buttons + 4) or released (buttons + 8 ).

2) Gecko Registers are not cleared between frames.  I've made a few asm codes that required Gecko Registers to store data over the long term, you just need to make sure no other codes use the same Gecko Registers.

Skiller

Quote from: dcx2 on April 26, 2010, 07:39:46 PM
Quote from: Apache81 on April 26, 2010, 02:42:49 PM
I thought about making some codes like this:
if (buttonPressed) {
  if (!check) {
     doSomething;
     check = true;
  } // if
} else {
  check = false;
} // if-else

where check could be a gecko register value... but if the registers values will be resetted every frame there are no possibilities to make such a code.   :(

Any idea?

1) It looks like you want to "one shot" a button press.  For example, let's say doSomething; adds $1 to your money.  If you press a button to activate that code, you get $1 for each frame that the button is held down.  A "one shot" would add $1 only once, each time the button is pressed.  If my assumption is correct, you need no trickery, just add 4 to your button address instead.  The two 32-bit words after the button states (buttons + 0) is the "button edges", which are 1 for a single frame when a button is pressed (buttons + 4) or released (buttons + 8 ).

2) Gecko Registers are not cleared between frames.  I've made a few asm codes that required Gecko Registers to store data over the long term, you just need to make sure no other codes use the same Gecko Registers.

Even using the Edge the game counts by 8 but also the Edge Buttons are not on every Pad Address section . u need to find the ones that have the Pad Edges .
i used the Pad Edges for the monster hunter game and still had to add a Counter to it ..

Easy way to find a good spot to make any Memaddress Sub codes would be to BPR on the pad address .

Thats if the Edge Pad section does not work for the game your hacking ..

dcx2

Quote from: Skiller on April 26, 2010, 11:11:09 PMEven using the Edge the game counts by 8

Hmm...this leads me to believe that your code which is reading the pad's falling edges is running more than once per frame.  In other words, you're using an asm code like a C2 code, and the C2 address is executed multiple times per frame.

Skiller

It should only be read Every Frame.  but it could be Faster .. only way to check would be to set a counter to count how many frames pass :P

dcx2

Quote from: Skiller on April 27, 2010, 01:02:10 AMIt should only be read Every Frame.  but it could be Faster .. only way to check would be to set a counter to count how many frames pass :P

Or you could set an execute breakpoint on the C2 address and see how many times you have to hit Set Breakpoint before you see the frame change.

Skiller

Lol true with that :) did not think of that one