Sonic R 004801d9 error hack
NOTICE: This tutorial is now obsolete. Please patch your 1998 version of Sonic R using the patcher available at https://forums.sonicretro.org/index.p... for an optimal experience.
Patched file released (by a visitor) (LINK TAKEN DOWN DUE TO FBI SEIZURE OF HOST)
IDA Pro Freeware version: http://www.hex-rays.com/products/ida/... (no longer available, sorry)
I'm no longer supporting this hack at this time, and have re-opened comments to be posted immediately. If you can work out a better way, please discuss it.
See bottom of description for a possible patch:
If you try running Sonic R on a high end PC, you might get the error "The program encountered a problem at address 004801d9 and cannot continue"
People have proposed different methods of fixing the problem:
Set Windows 95 or 98/Me compatibility mode.
Find sonicr.exe in explorer and keep hitting enter until it runs.
Copy files manually to the hard drive and try running sonicr.exe.
None of these methods worked for my computer. I even tried running Sonic R in a Windows 98 virtual machine, and the same error came up.
Turns out at 004801d9 is the opcode "idiv ecx" and at addresses 00480184 and 004801a0 are calls to timeGetTime() which gets the system time in milliseconds.
The function here makes multiple calls to timeGetTime(), with delay loops in between, and uses the average of the results to calculate CPU speed.
If the results of the timeGetTime() calls subtracts to zero, such as will be caused by a 2.86 GHz Core 2 Quad Q9550, the code will try dividing by said result (zero) and throw an exception.
By setting a breakpoint at the second timeGetTime() call (at address 00480184) a delay is artificially produced which allows the game to run without error.
Patch (IDA Pro DIF format) Cut and paste below:
This difference file is created by The Interactive Disassembler
sonicr.exe
00070584: 2E B8
00070585: FF 31
00070586: 15 00
00070587: 8C 00
00070588: 05 00
00070589: 95 90
0007058A: 00 90
000705A0: 2E B8
000705A1: FF 01
000705A2: 15 00
000705A3: 8C 00
000705A4: 05 00
000705A5: 95 90
000705A6: 00 90
Other Videos By soundspark
Other Statistics
Sonic R Statistics For soundspark
There are 56,667 views in 2 videos for Sonic R. Less than an hour worth of Sonic R videos were uploaded to his channel, roughly 2.90% of the content that soundspark has uploaded to YouTube.