SCARZIP (SCARZ Information Pane)
Sonic Stadium
Green Hill Zone


THE 10 CULTMANDMENTS | THE IDIOT'S GUIDE TO POSTING AT SCARZ
Sonic Online
Sonic Dimension


Welcome Guest ( Log In | Register )

9 Pages V   1 2 3 > »   
Reply to this topicStart new topic
> Why does the PC version of Sonic CD not work?, In Windows XP
Korama
post Feb 19 2004, 12:49 AM
Post #1


keep running

Group Icon

Group: CulT Member
Posts: 186
Joined: 22-August 03
Member No.: 274
Gender: Male



Well, I now know the answer to that question. :P
This recent topic motivated me to investigate the issue.

If you like, you can download and try my experimental fix.

You'll need the DINO2D.DLL and DMIX.DLL libraries, of course (can be found on the CD). Put them into Sonic CD's folder, where SONICCD.EXE is, but WINDOWS or WINDOWS\system32 will work, too. Furthermore, the Microsoft command line utility "expand.exe" is required, it's a standard program and located in WINDOWS\system32, so you probably don't have to worry about it.

Sonic CD must be run in a 256 color video mode (change compatibility settings). Trying to run the game in full screen mode will make it crash, but apart from that it should be playable. :)

Let me know if the fix works for you.
Later/tomorrow I'll explain in detail what it does, I'm too tired now.
Go to the top of the page
 
+Quote Post
Sonic Power
post Feb 19 2004, 03:19 AM
Post #2

2 emeralds

Group Icon

Group: CulT Member
Posts: 290
Joined: 4-January 04
Member No.: 1,339
Gender: Male
Country: United States



Anybody have the ISO? :D

Now, I want to have the ISO (not for Genesis, already have that) but just for something to keep in my growing Sonic PC collection.


--------------------
In times of optimism and war spirit, the wise grunt says, "WE'RE ALL GOING TO DIE!!!!! RUN!!!!!!!"
Go to the top of the page
 
+Quote Post
RyogaMasaki
post Feb 19 2004, 03:30 AM
Post #3


GUESS WHO'S BACK, BACK AGAIN

Group Icon

Group: CulT Member
Posts: 877
Joined: 22-August 03
Member No.: 264
Gender: Male



QUOTE(Sonic Power @ Feb 19 2004, 12:19 AM)
Anybody have the ISO?  :D

Now, I want to have the ISO (not for Genesis, already have that) but just for something to keep in my growing Sonic PC collection.

Dude, you can get a double pack of it and Sonic & Knux collection (the two greatest Sonic game evar) at Walmart for $5 (or your respective convenience cheapo market and currency per your country).


--------------------
Go to the top of the page
 
+Quote Post
rika_chou
post Feb 19 2004, 05:34 AM
Post #4


^________^

Group Icon

Group: CulT Family
Posts: 1,918
Joined: 21-August 03
Member No.: 257
Gender: Female
Country: United States



Holy crap, it works! This is quite an achievement. Good job. Pin plz.

Edit: Hmmm, it seems when I click on "new game" it crashes. I also get the message "There is a problem with your media device, make sure it is working properly"

This post has been edited by rika_chou: Feb 19 2004, 05:41 AM
Go to the top of the page
 
+Quote Post
SSJP
post Feb 19 2004, 06:17 AM
Post #5


HAS DS, erm... SSUK = Lurker now. =/

Group Icon

Group: CulT Member DX
Posts: 2,028
Joined: 21-August 03
Member No.: 144
Gender: Pie



awww, bollocks. =/ I knew I should have got Sonic CD a while ago. Only £5 too. Oh well, I can just import a $5 for something like £2.90 anyway. =P


--------------------
ONOZ NUKED
Go to the top of the page
 
+Quote Post
Chibs
post Feb 19 2004, 06:59 AM
Post #6


tastes so fresh

Group Icon

Group: CulT Posse
Posts: 1,321
Joined: 21-August 03
Member No.: 51
Gender: Male



I'll have to try this when I come home. If it works, you a'get a Chibscake.


--------------------
IPB Image
Going to update one of these days.

IPB Image
Go to the top of the page
 
+Quote Post
Korama
post Feb 19 2004, 08:06 AM
Post #7


keep running

Group Icon

Group: CulT Member
Posts: 186
Joined: 22-August 03
Member No.: 274
Gender: Male



I've tested it some more, and unfortunately there seem to be other Windows XP compatibility issues. When I start Sonic CD, it runs fine for a few minutes, and then suddenly the framerate, or rather screen update frequency, goes down to a crawl, making it unplayable.


Anyway, the reason why Sonic CD immediately crashed on Win XP is almost ridiculously simple: it couldn't read its compressed data files!

I tracked the memory access violation down to "_tleSetData@8" in DINO2D.DLL, called by Sonic CD's OPENING.DLL. That function associates bitmap data with a tile object, and after a while it occured to me that it doesn't work because invalid bitmap data is passed to it.
As you probably know, Sonic CD has several compressed data files (all those filenames ending with an underscore, eg. "OPENINGS.CM_"). SONICCD.EXE and several of its DLLs use the standard Windows library "LZ32.DLL" to decompress and read those files. Only four functions are imported from it: LZOpenFileA, LZClose, LZRead and LZInit. Now, for whatever reason, those calls fail with the Windows XP LZ32.DLL. Making the game use Windows 95's LZ32.DLL is out of question, because that one uses several undocumented kernel functions - from Windows 95's kernel32.dll, that is.
So the solution I chose was to write my own version of LZ32.DLL which works like Sonic CD expects to. However, I didn't implement all functions of the regular LZ32.DLL, just those that Sonic CD uses. Neither does my DLL do any decompression on its own. Whenever Sonic CD opens a compressed file with LZOpenFileA, my DLL uses the "expand.exe" utility to completely decompress the requested file into your PC's temporary directory. My implementations of LZRead and LZClose then simply call the regular Windows ReadFile and CloseHandle functions, performed on the decompressed temp file. So, my DLL is just a quick and dirty hack, there's definitely room for improvements, eg. make a DLL that doesn't rely on expand.exe and deletes the temporary files when LZClose is called.

Since LZ32.DLL is a standard Windows library, it's a bad idea to overwrite it with my "fake" version (Windows XP's system file protection wouldn't simply allow it anyway). And if my LZ32.DLL is placed in Sonic CD's folder, the game will still use the real version from WINDOWS\system32. So, in order to make the game use my DLL, my fix program puts it into Sonic CD's folder, renamed to LZXX.DLL, and patches all Sonic CD components accordingly.


As for why full screen mode doesn't work, I found this in the FAQ on Intel's old RDX website:
QUOTE
Q. Does RDX use any VGA function directly?
A. {snip} If you want to run Sonic, then it is right. RDX is talking to the video card directly to get MODEX. If you are running the SpriteSample, then your assumption is wrong. This sample uses FX_FULL_SCREEN to access the display through DirectDraw.

The only other API function which causes us to bypass DirectDraw* is devSetPalette to set all 256 colors.

So, Sonic CD seems to directly access the video hardware to setup the "MODEX" full screen mode. But direct hardware accesses by ordinary programs in Windows XP are a no-no.


If anyone wants to take it from here and implement a better LZ32.DLL/LZXX.DLL or fix some other issues of Sonic CD, then please do so. :)
Maybe I'll give it a try when I have more time again.

This post has been edited by Korama: Feb 19 2004, 08:12 AM
Go to the top of the page
 
+Quote Post
TychoSD
post Feb 19 2004, 10:59 AM
Post #8


Formerly Spindash54

Group Icon

Group: Unwanted
Posts: 1,691
Joined: 21-August 03
From: Someplace
Member No.: 180
Gender: Male



how many times have i said to everyone what happens if you just keep giving the game the files it asks for.

i know it wont run completely, but it runs...


--------------------
I LIKE COCK IN THE HOLE WHERE I POOP CAUSE I AM A BUTRAMMING HOMOFAG BUTTHUMP FUCKER POOPY FUCK
Go to the top of the page
 
+Quote Post
Korama
post Feb 19 2004, 12:07 PM
Post #9


keep running

Group Icon

Group: CulT Member
Posts: 186
Joined: 22-August 03
Member No.: 274
Gender: Male



QUOTE(Spindash54 @ Feb 19 2004, 07:59 AM)
how many times have i said to everyone what happens if you just keep giving the game the files it asks for.


You are kind of right, but Sonic CD doesn't ask for LZ32.DLL and it's impossible to give it a working one short of programming one yourself.


Some news: I used the task manager (Ctrl+Alt+Delete) to observe SONICCD.EXE's stats while it was running. It's no wonder that the game slows down to a crawl after a while, there's a severe GDI leak in it somewhere! Sonic CD keeps allocating GDI objects (pens, fonts, etc., mainly bitmaps, I guess) and doesn't free them again.
Go to the top of the page
 
+Quote Post
Rolken
post Feb 19 2004, 12:28 PM
Post #10


100% Genuine Red X - Accept No Imitation

Group Icon

Group: CulT Member
Posts: 219
Joined: 13-October 03
From: Provo, UT
Member No.: 756
Gender: Male



QUOTE(rika_chou @ Feb 19 2004, 03:34 AM)
Hmmm, it seems when I click on "new game" it crashes.

I also get this problem. Something related to dmix.dll.
Go to the top of the page
 
+Quote Post
Korama
post Feb 19 2004, 07:19 PM
Post #11


keep running

Group Icon

Group: CulT Member
Posts: 186
Joined: 22-August 03
Member No.: 274
Gender: Male



UPDATE!

Please try this new version if you had no luck with the old one.

I found and fixed the big GDI leak.
Cause: Sonic CD was allocating dozens of DC handles per second without freeing them again (SUB_00406255 called GetDC to obtain a HDC for the main window, but it did not call ReleaseDC to clean up).
Solution: remove the call to GetDC in SUB_00406255 and modify the code so that the variable at memory location 00433218 is used instead. This variable stores a handle to the main window's DC. It's allocated on the application's WM_CREATE event and released on the WM_DESTROY event, so it should be perfectly okay to use.

That was a pretty bad oversight by the Sonic CD programmers. I wonder how the game could work in Windows 95 with a leak like that.
Anyway, Sonic CD still piles up GDI objects without freeing them again (if you'd like to see for yourself but don't know how, read here, for example). But at a much slower rate, so you'll have to run the game for a long time until those minor leaks will cause problems.
For me, the game works more or less flawlessly now in windowed mode. I hope it will for you, too. :)

This post has been edited by Korama: Feb 19 2004, 07:21 PM
Go to the top of the page
 
+Quote Post
Neko Kit Su
post Feb 19 2004, 07:27 PM
Post #12

4 emeralds

Group Icon

Group: CulT Member
Posts: 483
Joined: 21-August 03
Member No.: 220
Gender: Female



I'm a bit afraid to try it.... is it dangerous? o.o?

(Yes, I know I'm probably gonna be made laughed at for that....)

This post has been edited by Neko Kit Su: Feb 19 2004, 07:28 PM


--------------------
QUOTE
When a person on a board says to you "You are a stinkin n00b," you DON'T respond with "Oh yeaah!"
Go to the top of the page
 
+Quote Post
Korama
post Feb 19 2004, 07:50 PM
Post #13


keep running

Group Icon

Group: CulT Member
Posts: 186
Joined: 22-August 03
Member No.: 274
Gender: Male



QUOTE(Neko Kit Su @ Feb 19 2004, 04:27 PM)
I'm a bit afraid to try it.... is it dangerous? o.o?

(Yes, I know I'm probably gonna be made laughed at for that....)


Well, there's always a risk that programs do something that they are not supposed to. But I tried my best to keep my patch program as error-free as possible, so it should be quite safe to use. ;)

As I said, it works for me. And I'd really like to hear from others if this fix makes Sonic CD playable in XP on their system, too.
Go to the top of the page
 
+Quote Post
F-Man
post Feb 19 2004, 11:17 PM
Post #14

5 emeralds

Group Icon

Group: CulT Member
Posts: 532
Joined: 21-August 03
From: Québec
Member No.: 112
Gender: Male
Country: Canada



It crashed after I selected New Game, just like it happened to Rika. =/
Go to the top of the page
 
+Quote Post
CrimsonNugget
post Feb 19 2004, 11:25 PM
Post #15

Guests






Is this the Dino version, or is it the DirectX version?
Go to the top of the page
 
+Quote Post
TychoSD
post Feb 19 2004, 11:33 PM
Post #16


Formerly Spindash54

Group Icon

Group: Unwanted
Posts: 1,691
Joined: 21-August 03
From: Someplace
Member No.: 180
Gender: Male



QUOTE(CrimsonNugget @ Feb 19 2004, 11:25 PM)
Is this the Dino version, or is it the DirectX version?

the retail dino version is what we're talking about.

the files the game asks for are all on the cd.


--------------------
I LIKE COCK IN THE HOLE WHERE I POOP CAUSE I AM A BUTRAMMING HOMOFAG BUTTHUMP FUCKER POOPY FUCK
Go to the top of the page
 
+Quote Post
Korama
post Feb 19 2004, 11:39 PM
Post #17


keep running

Group Icon

Group: CulT Member
Posts: 186
Joined: 22-August 03
Member No.: 274
Gender: Male



QUOTE(CrimsonNugget @ Feb 19 2004, 08:25 PM)
Is this the Dino version, or is it the DirectX version?


Yeah, good question. I was working with a retail version of Sonic CD, so I guess it's the newer DirectX version (which still uses the DINO dll, by the way).


Weird that the game crashes for some of you when selecting New Game. Could anyone upload the SONICCD.EXE for me so that I can take a look at it?


QUOTE
the files the game asks for are all on the cd.


That's right, and the latest version of my program. Has the required DINO2D.DLL and DMIX.DLL files built in, in two different versions, and can extract them to your Sonic CD folder.

This post has been edited by Korama: Feb 19 2004, 11:41 PM
Go to the top of the page
 
+Quote Post
Stoko
post Feb 20 2004, 07:18 AM
Post #18


^WE LOST A GREAT MAN

Group Icon

Group: CulT Posse
Posts: 3,070
Joined: 21-August 03
Member No.: 102
Gender: Not Telling
Country: United Kingdom



QUOTE(Spindash54 @ Feb 20 2004, 04:33 AM)
QUOTE(CrimsonNugget @ Feb 19 2004, 11:25 PM)
Is this the Dino version, or is it the DirectX version?

the retail dino version is what we're talking about.

the files the game asks for are all on the cd.

The retail version was the Direct X version.

Also, this rocks, total pinnage.


--------------------


CODE
[23:52:06] <Overlord> MOVE OUT OF THE FUCKING PARKING SPACE
[23:52:11] <Overlord> I HAVE A MONSTER DELOREAN
[23:52:13] <Overlord> GRRRRRRRR
Go to the top of the page
 
+Quote Post
Nemesis
post Feb 20 2004, 07:58 AM
Post #19


There's no such thing as 2

Group Icon

Group: CulT Family
Posts: 957
Joined: 20-August 03
From: Sydney, Australia
Member No.: 4
Gender: Male



I don't get it. With such a big resource leak, how come it runs fine on the win9x line? Was windows doing some undocumented slight of hand to prevent the problem becoming visible?

Oh, and I nearly forgot, awesome work man. You'll make a lot of people happy with this.

This post has been edited by Nemesis: Feb 20 2004, 08:02 AM


--------------------
Go to the top of the page
 
+Quote Post
RAMPKORV
post Feb 20 2004, 09:18 AM
Post #20


RAMPKORV has returned.

Group Icon

Group: Unwanted
Posts: 358
Joined: 22-August 03
From: Sweden
Member No.: 286
Gender: Male



QUOTE(RyogaMasaki @ Feb 19 2004, 12:30 AM)
QUOTE(Sonic Power @ Feb 19 2004, 12:19 AM)
Anybody have the ISO?  :D

Now, I want to have the ISO (not for Genesis, already have that) but just for something to keep in my growing Sonic PC collection.

Dude, you can get a double pack of it and Sonic & Knux collection (the two greatest Sonic game evar) at Walmart for $5 (or your respective convenience cheapo market and currency per your country).

Not really. I haven't seen it being sold since the year after it was released.


--------------------

I'M A FUCKING FAGGOT WHO RIGS POLLS (AND FUCKS UP WHILE DOING IT). I WIPE MY ASS WITH POTATO SKINS

Go to the top of the page
 
+Quote Post

1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:
9 Pages V   1 2 3 > » 
Start new topic

 

Lo-Fi Version Time is now: 23rd August 2017 - 10:43 AM