News:

Don't forget to visit the main site! There's lots of helpful docs, patches, and more!

Main Menu

[M1] Fixed morphball collision bug! Solved and ready to go!

Started by Stinktier, July 17, 2014, 02:21:41 PM

Previous topic - Next topic

Stinktier

Problem when vanilla nestroid meets combo blocks where the lower row of tiles is solid, and the upper row has air properties:
[spoiler]

[/spoiler]

If you un-morph, you glitch through. In all other circumstances i've tested, it works but not under this certain condition (ie. when the engine checks if there's solidity above samus when unmorphing, a process that consists of two separate subroutines).

Solution.
Tested (though not extensively so) and working:
Find string AD0103186908 in the ROM and replace $08 with $00.

Explaination.
The value you're editing is the amount which the first subroutine tells the processor to add to a value called ObjRadY (that's short for player object's vertical "radius", or even better explained, offset from the object's center y position. In other words, it's the upper hit box collision border). This is standard procedure when samus is in idle/running/rolling mode but shouldn't really be when the game checks for the possibility to unmorph, since the collision detector already adds the radius before checking. In other words: the original code adds the radius constant twice to the radius variable which leads to trouble.

Note that this new decrement of the yRad (or rather, non-increment of the same) means  no change to the morph ball's hit box vs enemies or when simply rolling about, as it is only called exactly when you un-morph and nowhere else.

Since i encountered no reason for the constant to be there in the first place, i suspect it's just something the programmers at nintendo happened to look over as it didn't affect their blocky 128kb level design. Anyhow, now you can fix it and bring a whole new level of detail safely to your hack.

This is the snippet of ASM from the disassembly representing what happens in the subroutine.

lda ObjRadY       
   clc      
   adc #$08      
   sta ObjRadY   
   jsr CheckMoveUp



This is where you edit the constant if you prefer disassembling and reassembling the whole thing over directly hex editing. You could just aswell swap the critical part with NOP instructions if you'd want to.

Bon apetit.