Actions

SCHG How-to Talk

Fix Sonic 2's buggy spindash code and add spindash speeds

From Sonic Retro

...This isn't a bug. This guide's making a big deal about an optimisation:

"In Sonic 2 and Sonic 3 & Knuckles, the spindash counter uses a word value for what's referenced in the spindash speed table as one byte and there's several instances where both word and byte values are used."

Yes...? When the counter is incremented or decremented it's done so as a word. When it's read, for indexing into the Spin Dash speed table, it's done as a byte. It's just a smarter way than reading a word, and then shifting out the lower eight bytes.

"Also, every time a button is pressed, the spindash counter value increases by 2 instead of 1 causing some spindash speeds to be unused."

Uhhh... that's bullshit. Yes, reving increases it by two, but how do you think the counter winds down? Those values aren't unused.

"Due to the word and byte value confusion, the counter goes down rapidly to 0 making the top possible speed of the spindash unobtainable."

Again, wrong. The top speed is reachable with frame-perfect timing. Even then, that has nothing to do with this 'word and byte value confusion'.

"This can cause some problems during game play, most notably how when charging a spindash with the buggy code on EHZ 2 at the start of the level and going as fast as possible with the code when discharged will cause Sonic to collide with the piranha badnik on the bridge near the start of the level and die."

Nope. That's a completely-unrelated issue involving level->object collision. The game's full of them. The way this guide 'fixes' it is by butchering the Spin Dash so much that it uses a different speed, which just happens to avoid triggering the issue.

"Fixing the code will increase the speed that Sonic can reach while spindashing and the revving down of the spindash will stop, allowing for less frantic button pressing to reach the top speed and the spindash will never have to be re-recharged while in the spindash position."

...So now this "bugfix" guide is deliberately changing design choices? Looking at the code, it doesn't even do ``that`` properly: the 'lsr.w #5' used to decrement the counter is still there, but because the maximum value the counter will now ever reach is 8, it only ever subtracts 0 from it. And the guide calls this a feature?

I think this guide's doing a lot more harm than good. Can it be erased, or something? Clownacy (talk) 17:13, 7 October 2017 (CDT)