Sonic and Sega Retro Message Board: Sega PC Reloaded - Sonic and Sega Retro Message Board

Jump to content

Hey there, Guest!  (Log In · Register) Help
  • 6 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

Sega PC Reloaded Four old games, working still/again

#1 User is offline Korama 

  Posted 02 April 2015 - 04:56 PM

  • Posts: 272
  • Joined: 18-May 04
What is it?

I wrote a program that is an installer, launcher, and patcher for a few Sega PC
games that were originally released for Windows 95/98. The games had issues or
broke entirely on newer versions of Windows. Now they work again, with a few
minor improvements even.
So far, these games are supported:
  • Ecco the Dolphin PC
  • Sonic CD 1996
  • Sonic & Knuckles Collection
  • Sonic 3D Blast


Posted Image

Some boring technical details:
Those games use DirectDraw and 8 bit / 256 color palettized video modes. Both are
obsolete nowadays, and while the compatibility layer of Windows still supports/emulates
them, it doesn't always work for whatever reason (e.g. buggy game code).
So I wrote custom implementations of the necessary DirectDraw interfaces (IDirectDraw,
IDirectDrawSurface, etc.), and a few other Windows API functions, that either
wrap or replicate what the games expect.
That code is packaged in a "ddraw.dll" file that looks like the real one from Microsoft.
However, some of the games load ddraw.dll dynamically, after executing some "bad" code
(e.g. checking if a 256 color mode is active). That's why a launcher is necessary, it
ensures that my ddraw.dll gets loaded and run right at the start of the game, so that
it can perform the necessary patches in memory. I could also patch the files on disk,
of course, but I've decided against that. It is just too messy and gets complicated if
I need to undo or update patches. Keeping the original files unmodified on disk and
doing all the patching in RAM is the best solution.



What exactly does it change?

Many little things that I can't be bothered to write down. Some important ones:
  • Flexible window handling (free resizing, preset sizes, try Alt+0..9), quick fullscreen toggling... (all games except Ecco).
  • Music playback from file instead of CD, bass.dll and streaming plugin
    support for all kinds of formats. Custom loop points supported for ogg and flac.
  • All registry and ini file operations of the games get redirected to a single ini
    file that also holds the patcher configuration. The file is <exename>.ini, so
    if you'd like to have several configurations for a single game, just make a
    copy (or hardlink) of the exe and call it <exename>.whatever.exe (e.g. "sonic3k.2.exe").
  • Mapping joystick / gamepad POV hat / dpad to analog axes in all games.
  • Skipping annoying intro logos and videos.
  • Palette blending; mainly for Ecco, still experimental in SCD and particularly S3K.
  • Freely configurable keyboard and gamepad bindings (not fully implemented yet).
  • Midiout.dll of S&K Collection caused an access violation on termination,
    keeping sonic3k.exe in memory...
  • Diagonal key input for Sonic CD. Only worked for gamepad.
  • Savegame dialogs and several graphics modes were totally broken in Ecco.
  • and more...





Why?

Yes, I know you can emulate most of those games, and Taxman's rebuilt Sonic CD is great.
I started this project last year, specifically for Ecco PC, because unlike the Sonic games,
that game did never receive any official re-release. Yet it is pretty much
the best version of Ecco 1 available. If you're interested in that game, you can find a
great bundle here.

After that was done, I generalized the code a bit and applied it to the old
Sonic games I had lying around. It took some restructuring/refactoring, but it
worked rather well.
Also, it's not like I'm new to this. I've made Sonic CD and Ecco PC "XP ready"
a decade ago already (does anyone remember SonicCDfix? I reused some code from that.).
But the patches back then were rather simple and superficial compared to this.


Where?

Download here.

A little extra for Sonic CD 1996.
- higher quality sound effects and Xvid-encoded intro movie. The original uses Indeo, which is no longer included in Windows. All other videos use Cinepak, which is still there.

Posted Image

To do...

There are a few minor issues I still need to resolve.
Palette blending tends to get stuck in SCD and S3K; you can turn if off and on via Alt+B. Should probably also be gamma-corrected.
Key/gamepad binding needs to be finished... you can already assign various stuff to buttons in SCD,
but only by editing the ini file directly. If you go to the "[JoystickControls]" section and add "JoyButton11=menu503" and "JoyButton12=menu201", for example,
then button 11 will toggle debug mode and button 12 will toggle fullscreen (as 503 and 201 are the menu command IDs for those actions).
Some upscaling algorithms and dedithering would be nice to have, but that's a pipe dream for now.

Comments, suggestions, and bug reports are welcome.
This post has been edited by Korama: 03 April 2015 - 10:55 AM

#2 User is online Dark Sonic 

Posted 02 April 2015 - 05:17 PM

  • Posts: 10780
  • Joined: 21-April 06
  • Gender:Male
  • Project:Posting a lot (I have a lot of time at work)
  • Wiki edits:10
oooh interesting. Any plans on adding Sonic R support?

#3 User is offline Korama 

Posted 02 April 2015 - 05:31 PM

  • Posts: 272
  • Joined: 18-May 04
I've thought about Sonic R, but haven't really looked into it yet.
It's probably not going to be as easy, because it uses 3D and 16 bit video modes. It does support DirectDraw and an ugly 8 bit output mode, though. And you can get it more or less running with DxWnd, but not in fullscreen or Direct3D mode, as far as I know.

#4 User is offline Billy 

Posted 02 April 2015 - 05:48 PM

  • RIP Oderus Urungus
  • Posts: 1784
  • Joined: 24-June 05
  • Gender:Male
  • Location:Colorado, USA
  • Project:retrooftheweek.net - Give it a visit and tell me what you think!
  • Wiki edits:15
Just tested it out with my copy of S&K collection, it works really well! Have you ever looked into the Windows port of Bug? I'd love to get that game working again.

#5 User is offline Korama 

Posted 02 April 2015 - 06:11 PM

  • Posts: 272
  • Joined: 18-May 04
Thanks for the feedback!
"Bug!" should be doable. I don't have it, but a friend as mentioned it to me as another candidate before.
Do you happen to have an original CD for it? To implement the installation function, I need to know the file layout of that.

#6 User is offline Billy 

Posted 02 April 2015 - 09:56 PM

  • RIP Oderus Urungus
  • Posts: 1784
  • Joined: 24-June 05
  • Gender:Male
  • Location:Colorado, USA
  • Project:retrooftheweek.net - Give it a visit and tell me what you think!
  • Wiki edits:15
Check your PM inbox.

#7 User is offline amphobius 

Posted 03 April 2015 - 04:55 AM

  • where are the japanese shaman girls, lintahlo?
  • Posts: 2118
  • Joined: 19-February 08
  • Gender:Male
  • Location:Northern Ireland, Belfast
  • Project:life
  • Wiki edits:165
This is cool, great job, man! Gonna have to play around with this later, particularly with S3D. Would be nice to play the version I grew up playing on modern computers with it actually working and stuff haha

#8 User is offline GerbilSoft 

Posted 03 April 2015 - 06:56 AM

  • RickRotate'd.
  • Posts: 2787
  • Joined: 11-January 03
  • Gender:Male
  • Location:USA
  • Project:Gens/GS
  • Wiki edits:5,000 + one spin
Sonic R worked fine last time I tried it... on Wine, that is. S&K Collection did as well. (CD and 3D did not.)

It might be worth checking out Wine's ddraw and seeing if any of your paatches could be applied there to improve compatibility with these games.

#9 User is offline Chris Highwind 

Posted 03 April 2015 - 09:47 AM

  • Don't mess with Luigi
  • Posts: 1962
  • Joined: 30-August 08
  • Gender:Male
  • Location:Mooresville, NC
  • Project:Slacking
  • Wiki edits:13
Just ran Sonic 3D Blast and played a bit of Green Grove Zone 1, and I've gotta say, it runs way better using this tool than by itself on Windows 7. How does the music folder work, though? Is there some way to make it play on specific stages?

#10 User is offline MainMemory 

Posted 03 April 2015 - 09:49 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3956
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
I got S3D and S&KC to install fine, but when I try installing Sonic CD, it just dings when I click the "Select Folder" button in the dialog, regardless of whether I'm choosing my existing install or the CD. Even manually editing the registry doesn't work.

Also, speaking of music, would it be possible to use angryzor's bass_vgmstream.dll to play ADX/AAX/BRSTM/etc music?
This post has been edited by MainMemory: 03 April 2015 - 09:51 AM

#11 User is offline Korama 

Posted 03 April 2015 - 10:54 AM

  • Posts: 272
  • Joined: 18-May 04

View PostGerbilSoft, on 03 April 2015 - 06:56 AM, said:

Sonic R worked fine last time I tried it... on Wine, that is. S&K Collection did as well. (CD and 3D did not.)

It might be worth checking out Wine's ddraw and seeing if any of your paatches could be applied there to improve compatibility with these games.


Thanks for the suggestion. I've been told that Ecco doesn't work on Wine, with or without patches. Unfortunately I have zero experience with Wine, so I won't be contributing to the project anytime soon.
S&K collection is the least broken of the bunch, still works in Windows, too. But as I said, it doesn't terminate properly, and has an inconsistent frame rate in windowed mode.


View PostChris Highwind, on 03 April 2015 - 09:47 AM, said:

Just ran Sonic 3D Blast and played a bit of Green Grove Zone 1, and I've gotta say, it runs way better using this tool than by itself on Windows 7. How does the music folder work, though? Is there some way to make it play on specific stages?


The music folder can be anywhere, though I suggest making a "MUSIC" subfolder in the game's base folder. The files are expected to be named either "Track##.ext" or "##whatever.ext" - e.g. "Track02.mp3" or "02 Title Theme.flac". Remember that audio tracks start at number 02 for those mixed mode data + audio game CDs. For best results, get bass.dll from http://www.un4seen.com/ and put it in the game folder, or somewhere in the search path (e.g. the Windows folder). You can additionally use add-on DLLs for bass, like bassflac.dll to support even more formats. They'll be loaded automatically, if they are in the search path and if they are "stream" plugins (as opposed to effects or other types of plugins).


View PostMainMemory, on 03 April 2015 - 09:49 AM, said:

I got S3D and S&KC to install fine, but when I try installing Sonic CD, it just dings when I click the "Select Folder" button in the dialog, regardless of whether I'm choosing my existing install or the CD. Even manually editing the registry doesn't work.

Also, speaking of music, would it be possible to use angryzor's bass_vgmstream.dll to play ADX/AAX/BRSTM/etc music?

The launcher tries to verify the validity of the game folders. There isn't an error message for every circumstance, hence the "ding" warning sound. Do you perhaps have the older 16 bit version of Sonic CD (the one that came with pcm.cmp)? It's not supported, and never will be.
You can look at soniccd.exe with a hex editor, exe files start with an "MZ" DOS header, followed either by an "NE" (16 bit) or "PE" (32 & 64 bit) header.
Furthermore, if you have my old SonicCDfix patch applied (sign: there's an "lzxx.dll" file, and soniccd.exe contains the string "LZXX"), then you need to uninstall that first with the original SonicCDfix program.

I didn't know about bass_vgmstream.dll before. If it is a standard bass stream plugin, then yes, it should work.

#12 User is offline MainMemory 

Posted 03 April 2015 - 11:03 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3956
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
You probably should have mentioned that the old SCD fixes have to be removed.

But even then, there's still something it doesn't like about my copy of SCD. As I said before, even selecting the disc doesn't work. And yes, it is the 32-bit version.
This post has been edited by MainMemory: 03 April 2015 - 11:05 AM

#13 User is offline Korama 

Posted 03 April 2015 - 11:25 AM

  • Posts: 272
  • Joined: 18-May 04
Yes, I should have made that clearer. I did mention that original unmodified game files are involved, though.

Hmm, you might have a different release of SCD than I do. Could you please send me a dump of the directory structure? A simple "dir /s" should suffice.
At the moment, a valid install source for SCD needs to have "GAME" and "RDX" subfolders. "GAME" needs to contain at least one valid soniccd*.exe and at least the "TITLE" subfolder. "RDX" must have dino2d.dll and dmix.dll.
Alternatively, the "GAME" and "RDX" folders can be absent, in which case the other mentioned characteristics are expected to be all present in the selected folder.

#14 User is offline MainMemory 

Posted 03 April 2015 - 11:43 AM

  • Every day's the same old thing... Same place, different day...
  • Posts: 3956
  • Joined: 14-August 09
  • Gender:Not Telling
  • Project:SonLVL
  • Wiki edits:1,339
The disc: http://pastebin.com/x1UmGkwL
My installed copy: http://pastebin.com/SbTZ54i7

#15 User is offline Korama 

Posted 03 April 2015 - 12:41 PM

  • Posts: 272
  • Joined: 18-May 04
Thanks. My disc doesn't have that "Expert" folder, but appears to be pretty much identical otherwise.
I uploaded a new version of the launcher that should at least give you an error message. I suspect your soniccd.exe might be different, although it is the same size as mine. If you upload it, I'll take a look.
In your installed folder, the two RDX libraries dmix.dll and dino2d.dll should be placed next to soniccd.exe, otherwise everything is there.

  • 6 Pages +
  • 1
  • 2
  • 3
  • Last ►
    Locked
    Locked Forum

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users