Clone wiki

ToejamAndEarlDisassembly / Current Focus

I try to stay focused, I really do! But with so many interesting things to investigate in game it can be hard to do so!

Here are some of the areas I am particularly interested in at the moment and actively finding out more about.

Rocket Skates

How is it decided which present Rocket Skates is?

Like all presents the graphic that is used for Rocket Skates is decided when the game first loads. This is random on both fixed world and random (although on fixed world you can be guaranteed you'll find Rocket Skates in the same place every time, just with a random graphic each time).

You can find the code that handles this at $00014248 with the label SetupPresentIdentities.

It happens again during the Randomizer present which fires at $00009660 with the label PresentSelection but I've not got that mapped out as well.

What sets the duration of Rocket Skates?

Initially Rocket Skates get the full duration of $03E8 (1000 dec) set at $000172E6 with the label SetBasePresentTimer, however, this then gets halved over at $00017322 with the label SetTimerRocketSkates. Poor Rocket Skates!

This is one of the stranger bits of code in that it uses some sort of offset table to decide where to jump to in the code. I don't fully understand the reasoning behind this yet but I believe it is because the first 8 presents (Icarus Wings, Spring Shoes, Innertube, Tomatoes, Sling Shot, Rocket Skates,Rose Bushes, Super Hitops - which are all the 'equipables') all have unique timer setting code. If the present number is greater than $07 it skips this offset table jump (and there is another way it can be skipped before this greater than $07 check but I haven't documented it yet).

How much faster do Rocket Skates make you?

The standard moving speed for Toejam is $0140 on the X axis (left and right) and $0140 on the Y axis (up and down) (or $00F0 on each if travelling diagonals which is 3/4 speed).

With Rocket Skates equipped this jumps to $0600 on the X axis and $0480 on the Y (at $00011866). However it doesn't stop there, for 2 frames the rate on the X axis increases by $80, first to $0680, then to $0700 (at $0000E454) before returning to $0600. Y does the same to $0500, then $0580 (at $0000E4A4) before returning to $0480.

(Depending on how well the X/Y position update and speed update are in sync it may be possible to change speed several times before its effect on position is reflected.)

So, Rocket Skates are faster when moving left and right than they are up and down, and are 5 times (avg) faster on the X axis and 4 times faster on the Y.

This effect is the same whether moving on land or on water.

How do Rocket Skates keep you floating on water?

Yet to be figured out.

Why can't you stand still with Rocket Skates on?

Yet to be figured out.

Why can't you enter the elevator with Rocket Skates on?

Yet to be figured out. (Likely related to the PRESENT_FLAGS)

Why can't you open the inventory with Rocket Skates on?

Had a break through on this one! Over at $00000A04 which is now labelled AllButB you can see the instructions that performs an ANDI against the current player input with $EF which just so happens to be every bit flag EXCEPT the B button. This AND is performed if CheckAllButB says it should be and the 2 things it checks there are: is the player splatted or are any of the flags in $00FFA2AC set when compared against $07800000.

It isn't entirely clear what $00FFA2AC is but I've labelled it as PRESENT_FLAGS for now since that seems accurate.

If you set the ANDI to compare against $FF (i.e. everything) then it'll let you press B with Rocket Skates on and you can even go on to open presents (with some interesting results!)

Drive-by Boombox'ing anyone??

How can Rocket Skates be togglable with the A button (like Super HiTops)?

Yet to be figured out.

User Input

How does the game decided what to do when a given button is pressed?

The game makes use of P1_PROCESSED_INPUT (at $00FF801E) and P1_PREV_PROCESSED_INPUT (at $00FF8020) which are populated in GetPlayerInput. Then at many places throughout the code it checks what the values are in these addresses and takes action (or not) based on them.

In Game Map

How does the game draw the characters, ship piece and elevator on the map?

Yet to be figured out.

Could more items, such as presents, enemies and perhaps even Santa! be added?

Yet to be figured out.


How is the range of the Hula Girl calculated?

Turns out the Hula girls allure works in a square, not a circle as I first suspected.

If you are not more than $64 (100 dec) away on the X axis or $4B (75 dec) away on the Y axis then you run the risk of being captivated by and joining in in her hip swaying dance!

See the label HulaAbilityCheck in Earthlings.X68 for the full code.

Button mashing may help speed up the counter for how long you dance for. See CheckHula in InputProcessing.X68.