I did some quite extensive analysis of how the game physics works for this game some months ago. Thanks to this I was able to improve:
*The first room by 9 frames.
*The second room by 5 frames.
When you move diagonally, you accelerate faster than when you go horizontally, up until your X speed is 26.
Here's the movie file.
I also made comments on how X movement works, hopefully you can get something out of them.
X movement:
[x] means the value of RAM address x.
:= means "is defined as"
Useful RAM addresses:
[0390] = X pixel speed := x1
[0380] = X subpixel speed := x2
X speed = xs:= 256*x1+x2
[0031] = direction.
[0031] = 2 if moving right
[0031] = 1 if moving left
Assuming you're standing still and start holding down right.
When you start accelerating (i.e. The first frame xs>0) depends on
[0400] = start accelerator := a1
If a1>=192, you start accelerating immediately
In practice, a1 is either 144 or 208.
It is set to 144 if you stop from going left, i e when [0031] goes from 2 to 0.
It is set to 208 if you've recently moved right, i e when [0031] goes from 1 to 0.
Another important RAM address is [0036]. It is your X acceleration.
[0038] is an in game timer. [0036] increases only when [0038] is odd.
Assume you have X speed S1 on frame F and you can accelerate. Assume [0036]=A1 and [0038]=T.
Assume that your Y speed on frame F is Sy. We want the X speed S2 on frame F+1.
Let d1 be your direction on frame F, and d2 your direction on frame F+1. direction = [0031]
Let A2 be the value of [0036] on frame F+1. d1 is your direction on frame F, and d2 on frame F+1.
The following pseudo-code will give the answer:
You press right+B on frame F:
Set T1=mod(T,2)
If T1==1 then A2=A1 end
If S1<512 and T1==0 and Sy<A1 and A1<31>A1 and S1>=338 and A1>=1 then A2=A1-1 end
S2=MIN(512,S1+A2)
You press right+down+B on frame F:
Set T1=mod(T,2)
If T1==1 then A2=A1
elseif T1==0 and S1<=361 and d1==d2 then A2=A1+2
else A2=A1+1 end
S2=MIN(362,S1+A2)
I want to improve the published run sometime in the future, but I have a lot of other projects going on right now so this will have to wait. I welcome anyone else who wants to try this!