There are several programming mechanisms for dealing with Moonjump,
the more common being a fixed acceleration (gravity), where the velocity (or let say speed) decreases from a positive number to a negative number
Here is the simplest example. It uses sign 32-bit integer for storing the speed
Concept:
When jump button is pressed, the speed variable will set to a initial value, e.g. 500,
and the player will start jumping upward.
Then this value is decreasing continuously until it reach 0 (or the case of the user release the jump button),
As this moment, the height of actor reaches the topest point, and the direction changes to downward
However, this speed value will continue to decrease even if it becomes a negative number,
until the actor touch the ground.
What we can do is finding a positive value when the actor jumps up
and then finding a negative value when the actor drops down
First of all, I will add the freezing code by EdizonSE and change the pausing keys
Here are the codes to freeze the game
[Freeze Game (L)]
80000040 FF000000 20000000
[Resume Game (R)]
80000080 FF100000 20000000
Then, start a jump and pause the game when the player drop down
View attachment 301078
Since the actor is dropping down, I expect the value of speed is between -10000 and 0,
but I will not use -1, 0, 1 since there are so many such values in the memory
So, I use [A..B] range search (type sign 32) from -10000 to -2
View attachment 301081
The result will not get too many candidates
View attachment 301082
Then, go back to the game, and prepare another jump for second search.
Freeze the game immediately after pressing jump
View attachment 301083
Now, search with positive range, I used 2 .. 10000 this time
View attachment 301084
Nice, there is only 1 result!
View attachment 301085
Make a test to check whether this value is correct. I'll freeze this candidates by pressing X
View attachment 301090
Then go back to the game, try jumping again
View attachment 301086
Fine, it works as expected.
Now, press + and give the cheat a name,
Moonjump
The address was added to bookmark. We can press L to check it.
View attachment 301091
Now, press ZL+A, a new Cheats was added,
Then, press R3 (right stick) to add an activate button for it, I use X, (
X for moonjump, B for normal jump)
Finally, Press ZL+L3 to write back the code to cheat file.
View attachment 301095
That is.
View attachment 301094
Note:
in many case the value of speed uses float 32,
you may search with 0.01 to 10000.0 and -10000.0 to -0.01
the searching method is the same. just the type is need to change to f32
and Edizon SE is the best tool for making cheat currently