WiiRd forum

Wii & Gamecube Hacking => Wii Game hacking help => Topic started by: trackme on December 27, 2010, 03:29:32 PM

Title: Pause the game X seconds?
Post by: trackme on December 27, 2010, 03:29:32 PM
Hi. I want to try to pause the game X seconds... like a debugger pause.
I think it's impossible do a pause with a button activator and then resume the game with same button activator.
I can be able to set a loop with asm instructions and button activator but then I don't find the way to restore the game.

The question is easy, if is possible to do a loop, wait X seconds (or X instructions) and then resume the game. I don't know how do it.

Thanks
Title: Re: Pause the game X seconds?
Post by: dcx2 on December 27, 2010, 05:38:21 PM
You could repeatedly loop and subtract from some large value, terminating the loop when it reaches 0.

There's no way to use button activators to do this.  The game needs to "read" the buttons periodically, and if you're spinning in a loop, no one will read the buttons.

This may or may not help you, but Gecko.NET has a feature that can slow the game down to a specific FPS.  The Slow checkbox on the About tab can be used to go from about 15 FPS down to 0.1 FPS.
Title: Re: Pause the game X seconds?
Post by: Bully@Wiiplaza on December 27, 2010, 07:37:54 PM
how would the loop code template look like (for example?)
Title: Re: Pause the game X seconds?
Post by: megazig on December 27, 2010, 07:43:00 PM
you could also write a small piece of code checking the PPCs time reg for a sleep result
Title: Re: Pause the game X seconds?
Post by: Nutmeg on December 28, 2010, 08:52:17 PM
It may be possible, using the C0 codetype.

Set a code something like this:

28XXXXXX YYYYYYYY
C00000000 00000000Z
Set endless loop here however, constantly load the button activator into a register, and use a cmpwi and a beq- to branch out of the loop again.

Any comments?  Would this work?
Title: Re: Pause the game X seconds?
Post by: Romaap on December 28, 2010, 10:03:02 PM
Quote from: Nutmeg on December 28, 2010, 08:52:17 PM
It may be possible, using the C0 codetype.

Set a code something like this:

28XXXXXX YYYYYYYY
C00000000 00000000Z
Set endless loop here however, constantly load the button activator into a register, and use a cmpwi and a beq- to branch out of the loop again.

Any comments?  Would this work?
Wouldn't work, the game needs to execute the subroutine which gets the wiimote's data.
So this endless loop really is endless because the paddata stays the same.

Unless you find a way to branch to that subroutine this will not work.
Title: Re: Pause the game X seconds?
Post by: trackme on December 28, 2010, 11:43:04 PM
Quote from: megazig on December 27, 2010, 07:43:00 PM
you could also write a small piece of code checking the PPCs time reg for a sleep result

Interesting but If I do a branche with a loop I couldn't be able to check ppc time reg.. or yes?

Maybe the post by dcx2 is the best solution. Do a X operation until X = Y, Z times.
Although I don't know what flops have wii ppc. Try and test :)

Thanks to all
Title: Re: Pause the game X seconds?
Post by: dcx2 on December 29, 2010, 03:56:19 AM
FLOPS is the wrong unit of performance.  FLOP = FLoating point OPeration.

I think you actually meant MIPS = Millions of Instructions Per Second.
Title: Re: Pause the game X seconds?
Post by: trackme on December 30, 2010, 05:47:54 PM
Maybe :$ xD I confused Mips with the cpu  arquitecture.

thanks :)