I've been making a Mega Man clone/engine based on TASVideos's Rockman Data page (specifically the first game). As the page doesn't cover everything, I've done some reverse engineering myself using FCEUX and its memory inspection tools. Using those, I've discovered possible errors in TASVideos's documentation.
The problem is that I'm not sure whether the errors I found are actually errors, because the game behaves weirdly. I think it's possible that I'm getting the wrong idea because of how frame advancing works in emulators.
I first thought this when verifying collisions while Mega Man is jumping upwards. When Mega Man bumps his head into a platform, his Y speed to a constant. According to the documentation, it's −0x00.C0, but my testing reveals it's actually −0x00.40. But that's not the problem. The problem is that this value seems to be set one frame before the collision occurs. Looking at the memory values, the next frame actually adds the Y speed from before the constant was set.
There are other inconsistencies.
If I press the jump button and advance a frame, Mega Man's Y speed is set to 0x04.DF as expected. However, his Y coordinate doesn't change until the next frame. Then another frame later his sprite finally changes to the jumping one.
When I let go of the D-pad, Mega Man's X speed isn't set to 0x00.80 in the next frame, but only in the frame after that. This makes his deceleration take one more frame than is expected from the documentation (though strictly speaking what it says isn't wrong here).
So, it's like there's a delay, which may be a result of when the emulator decides to pause between frames.
It may also be related to how I expect the game to behave. I expect the game to first check for input, then adjust velocity based on that, then update the coordinate data, and finally draw.
Can someone enlighten me?
The problem is that I'm not sure whether the errors I found are actually errors, because the game behaves weirdly. I think it's possible that I'm getting the wrong idea because of how frame advancing works in emulators.
I first thought this when verifying collisions while Mega Man is jumping upwards. When Mega Man bumps his head into a platform, his Y speed to a constant. According to the documentation, it's −0x00.C0, but my testing reveals it's actually −0x00.40. But that's not the problem. The problem is that this value seems to be set one frame before the collision occurs. Looking at the memory values, the next frame actually adds the Y speed from before the constant was set.
There are other inconsistencies.
If I press the jump button and advance a frame, Mega Man's Y speed is set to 0x04.DF as expected. However, his Y coordinate doesn't change until the next frame. Then another frame later his sprite finally changes to the jumping one.
When I let go of the D-pad, Mega Man's X speed isn't set to 0x00.80 in the next frame, but only in the frame after that. This makes his deceleration take one more frame than is expected from the documentation (though strictly speaking what it says isn't wrong here).
So, it's like there's a delay, which may be a result of when the emulator decides to pause between frames.
It may also be related to how I expect the game to behave. I expect the game to first check for input, then adjust velocity based on that, then update the coordinate data, and finally draw.
Can someone enlighten me?