Super Mario Galaxy 2 [SB4E01]

Started by Doom, May 23, 2010, 08:05:20 PM

Previous topic - Next topic

wiiztec

Seems I overlooked something simple, the updated code should accelerate now
If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

mothersbrain

#226
Quote from: wiiztec on June 22, 2010, 12:00:47 AM
Seems I overlooked something simple, the updated code should accelerate now

thats awesome! this accelerate really adds to the game, it makes it feel fast like super mario world. Would you be able to make a time limit code that sets the levels at 3-4 minutes? that way you have to run through the levels quickly...would really add to the challenge and fun of the game IMO


EDIT: ive Pm'ed you because ive found some interesting stuff

flashk

What about making the speedup code even faster? Would that be possible, or is this the max running speed in the game?

mkarim85

sorry for ask this but, what codes ACTUALLY works?, really works?, I've tried almost all and the most cause the game to freeze.. :(
i dont why....

mothersbrain

#229
could someone please make a code for timed levels, this game is too easy for me and i need a bigger challenge.
the monkey minigames have a timer and i think there is a normal timer in the comet for boss rush galaxy. if you could set it at 3 minutes that would be awesome.

WiiRd Gamer

Quote from: flashk on June 22, 2010, 05:50:44 AM
What about making the speedup code even faster? Would that be possible, or is this the max running speed in the game?
Is there a certian spot in the code where you can modify it to make it slower/faster? How about that?
$M@T_T$

dcx2

Here is the ZiT-modified-by-wiiztec code, with comments added by yours truly...

28750A02 FFFB0004   # if down arrow is pressed
C23AEC9C 00000003   # hook the following routine, which loads momentum from 80002FFC
3D808000 818C2FFC   # lis r12,-32768; lwz r12,12284(r12)
9181FFFC C001FFFC   # stw r12,-4(r1); lfs f0,-4(r1)
D01D0278 00000000   # stfs f0,632(r29)
26002FFC 3F800000   # if [80002FFC] < 3F800000 = 1
80000002 3F800000   # set GR2 = 3F800000
26002FFD 40000000   # else if [80002FFC] < 40000000 = 2
86900002 3A83126F   # fp add 0.001 to the value in gr2
84200002 80002FFC   # store gr2 to the address 80002FFC
E2000002 00000000   # 2 end-ifs (goes back to the "if down arrow is pressed")
2A750A02 FFFB0004   # if down arrow is not pressed
043AEC9C D01D0278   # write anti-code
80000002 3F800000   # load 3F800000 = 1 into gr2
84200002 80002FFC   # store gr2 to 80002FFC
E0000000 80008000   # terminator


The maximum speed is defined by 26002FFD 40000000, specifically the 40000000.  In floating point, this value is 2.  http://babbage.cs.qc.edu/IEEE-754/32bit.html

To pick a new maximum speed, use the complementary tool here.  http://babbage.cs.qc.edu/IEEE-754/Decimal.html

Take the hex value that tool gives you and replace the 40000000 with it.  For instance, to go faster, you can set it to 2.5 instead of 2, which is 40200000 instead of 40000000.  To go slower, you can set it to 1.5 instead of 2, which is 3FC00000 instead of 40000000.

The rate of acceleration is defined by 86900002 3A83126F.  3A83126F is floating point for 0.001.  So it takes roughly 100 frames before you go from a speed of 1 to 2.  If you want to accelerate faster, use a larger value; 0.002 = 3B03126F would take 50 frames to get up to speed, so it would accelerate twice as fast.  0.0005 = 3A03126F would accelerate half as fast.

[ as a side note, the stw/lfs to -4(r1) bothers me a little bit...if anyone has trouble with this code I can try to re-work it to avoid the -4(r1) ]

ardemii

moon jump code have little bug,if we stop to pressed A button,we cannot stop mario flight.

Crashdance22

My requests:

Some sort of object spawning code
Spawn evil Marios anytime
Disable falling deaths, as in falling into black holes
Disable warps, as in when entering or leaving an area (toggle please)

wiiztec

Quote from: dcx2 on June 24, 2010, 04:53:33 AM
[ as a side note, the stw/lfs to -4(r1) bothers me a little bit...if anyone has trouble with this code I can try to re-work it to avoid the -4(r1) ]

That's probably where on the stack the game normally reads the floating point value from, so it just overwrites that floating point before reading from it like it normally would
If there's any code at all that you want to be button activated, or even able to toggle on & off, and I have the game, just PM me and I'll make it happen

dcx2

I don't think you're right, wiiztec.  When we create a stack frame, we subtract from the stack pointer to allocate memory.  Therefore, the room we made is "above" the stack pointer, so the stack should always be accessed using positive offsets.  Accessing the stack with a negative offset is essentially touching unclaimed memory!  The compiler would not violate the PowerPC stack convention.

In theory, it shouldn't cause any problems - after all, no function has laid claim to the memory - but I can see how in extremely exotic situations this could create a problem.  It just gives me the willies to see it.

I don't know why the C2 code doesn't stw r12,632(r29) and then lfs f0,632(r29).  Then you don't need to touch the stack at all.  That unclaimed memory on the stack is only serving as an intermediary to assist with loading f0.

Slapjack

#236
Can there be a code that can force Yoshi into doing a Ground Pound?
Also a "Yoshi loads upon level start up/death" code would be nice also.

dcx2

brkirch is already working on a transformations code that includes Yoshi.

There are a bunch of other "Yoshi Ground Pound" like things that I would like to do or see done, like repeatedly wall kick off the same direction, and pounding out of a long jump, and double jumping after a side jump...things like that.  I imagine there's a "Mario Jump State" variable somewhere that determines what type of actions you're allowed to do.  I found it in the first SMG, when trying to expose the p2-super-jump.  In fact, after seeing Flying Mario, I bet the super-jump is still in there...hmm....

Recapitator

Thinking up some more code suggestions.

How bout one that makes the Cosmic Guide lady here automatically appear on every level or at least the levels she can appear on Without having to die a number of times in order to get her to show up.


And a Bronze Star star code; that turns all regular stars and green stars into bronze stars!  :D

Wiigle

I'm still looking for a "1 Purple Coin To Get A Power Star (with a button activator)"
Because in some levels when I try the 100 coins Cheat the Gold Star is not appearing.

And how about Collect 1 Silver Star to get a Gold Star? ;)

In the World S-4 there is this blue Button which speeds down the level for a few seconds.
Maybe someone could change it that the slow motion stays on all the time during that level.