EDIT: a lot of people have found this before, but never understand well
Ok, I found a beautiful thing. First, look at this gif:
Basically, the
cape interaction acts really weird when layer 2 or 3 moves.
I found this by accident in this room, when heading to Morton to check another completely different thing (SMW basic day), almost as this gif above. I killed both dry bones and I was "wut........" (wasn't using the
script). Then I found that the cape interaction (that yellow box) "virtually" moves as the layer 2/3 moves, BUT it only interacts (kill sprite or hit block) if the game is frozen. The "close-range" capespin still works normally.
I made some gifs that you can directly see in
this album, but I'll explain each of them now. Please see each gif carefully:
-If you take a flower when capespinning, the interaction may
go slow, or
go really fast. Note the increase of the Interaction x value, in yellow on the left;
-The same occurs when you
die capespinning (by time limit and maybe insta-kill block);
-You can even hit (multiple hit, if slow) blocks away from Mario, as
here, I got 6 feathers from one block;
-When layer 2 moves vertically, happens the same, you may get
slow or
fast (cute trick). Note the difference in the Interaction y value increase between both cases;
-Here you can see exactly
how it virtually moves, opposite to the layer 2 movement;
-If Mario stands on the moving layer,
clearly you see how the game is doing this, by "adapting" the cape interaction to a fixed position;
-The same happens if there's layer 3, but here is even more weird, because the
virtual cape interaction is looping exactly between the middle of the 2nd screen and the middle of the 3rd screen (Layer 3 is the running water), so Mario can be in the end of the level capespinning, but the virtual cape will always be there;
-As layer 2, with layer 3
you can kill sprites away from you.
Enough gifs, let's head to the science behind it.
For some bizarre reason,
the value of the cape interaction in levels that there's layer 2 or 3 moving is discounted by the layer relative position. In other words, the addresses $7E:0026 and $7E:0028 (Layer 2 or 3 relative x and y position, respectively) are the key. So, as you can see in the gifs, the virtual cape moves exactly as the 2nd layer moves, but in the opposite direction. The reason it's the opposite way I guess is because the 2nd layer coordinates are inverted. You can clearly see that by watching the 2nd layer x speed ($7E:144A), that is negative when going to the right.
Now you may ask why sometimes the interaction box goes slow and sometimes goes fast when the game is frozen.
The cape interaction takes the 2nd layer relative position as a speed (not the 2nd layer speed), as you can see in the image (3 consecutive frames on the right):
So in Morton's pre-boss room, for example, if you want the slow effect, you should wait until the layer 2 is on the right (the value -1 on the image is the extreme right), and vice-versa.
Also, you can see in "normal levels" (like YI2) that there's a 2nd layer relative position value (not zero), BUT there's no 2nd layer speed. So my final theory is:
the cape interaction directly uses the 2nd layer relative position ONLY WHEN there's 2nd layer speed.
EDIT: just for curiosity, the Layer 3 relative position is (0, 0) in Mario's position.
Conclusion: did someone purposely code this?
EDIT: Kaizoman (
Thomas) checked the code, "they completely stop processing Mario when the game is frozen, which includes the code that figures out where capespin goes, but the code that adds layer 2's position to the capespin's for interaction runs separately so it keeps getting added".
Anyway, it's now a new thing to use on kaizo/puzzle hacks
(and maaaybe the description of the addresses in the RAM Map could be edited)
Glitch hunter, RAM eater, pseudo-TASer.
Scripts, documentations, and misc:
SMW stuff on Github,
YI stuff on Github,
The Flintstones stuff on Github
Stuff and me:
YouTube,
Twitter