VOGONS


DOSBox ReelMagic Fork

Topic actions

First post, by jrdennisoss

User metadata
Rank Newbie
Rank
Newbie

Hey Guys,

We have been working on a ReelMagic DOSBox emulator. The current status is that it can run Return To Zork decently. A complete play-through of RTZ yields a few acceptable glitches here and there, but for the most part, it's not bad. There are several bugfixes in the works as well as work to generalize the emulator so that it is compatible with other DOS ReelMagic games of that time. TBD WIN 3.x support.

The code repo can be found here: https://github.com/jrdennisoss/dosboxrm
Currently a Windows release binary (tested on win10) is available if you don't wanna compile it yourself: https://github.com/jrdennisoss/dosboxrm/releases

(Note: compilation instructions are no different than stock DOSBox)

Would love to contribute this back to the DOSBox project, however I'm not quite sure how that process works or if the DOSBox team would want this as part of the core codebase, especially considering that this modifies the way video output works as it needs to mix two outputs into a single picture: VGA and MPEG. (or at the very least have a serious discussion about architecture) If anyone has any insight or could point us to in the right direction on this that would be appreciated. I'm assuming posting to this forum is a step in the right direction. 😀

Here are some screenshots of this thing in action:

Attachments

  • screenshot4.png
    Filename
    screenshot4.png
    File size
    9.46 KiB
    Views
    6367 views
    File comment
    Loading the emulated FMPDRV.EXE file
    File license
    GPL-2.0-or-later
  • screenshot3.png
    Filename
    screenshot3.png
    File size
    154.58 KiB
    Views
    6368 views
    File comment
    Return to Zork ReelMagic Version Running in DOSBox
    File license
    Fair use/fair dealing exception
  • screenshot2.png
    Filename
    screenshot2.png
    File size
    161.81 KiB
    Views
    6368 views
    File comment
    Return to Zork ReelMagic Version Running in DOSBox
    File license
    Fair use/fair dealing exception
  • screenshot1.png
    Filename
    screenshot1.png
    File size
    45.07 KiB
    Views
    6368 views
    File comment
    Sigma Designs Logo Running in SPLAYER.EXE in DOSBox
    File license
    Fair use/fair dealing exception

Reply 4 of 172, by jrdennisoss

User metadata
Rank Newbie
Rank
Newbie
jmarsh wrote on 2022-03-01, 04:31:

Have you considered basing it on DOSBox's current SVN code?

Yeah I was on fence about using the SVN trunk when starting this adventure, however I decided to go with the 0.74-3 latest release tag for first whack at this as it seemed like the release tag would be a more stable starting point. Especially considering the Herculean effort this turned out to be. 😀 Now that we have something that is in a mostly working state, it definitely would be worthwhile at some point soon to look at re-basing this onto the trunk.

Reply 5 of 172, by Uka

User metadata
Rank Member
Rank
Member

Tried a few ReelMagic games:
"Return to Zork" and "Man Enough" seem to work! Although there are no subtitles displayed in videos for some reason.

"Flash Traffic" and "The Horde" launch fine, but no video is seen.
And "Crime Patrol", "Drug Wars" etc. do not recognize the card.

"Space Ace" launches, but the video is not correct.

Attachments

Reply 6 of 172, by jrdennisoss

User metadata
Rank Newbie
Rank
Newbie
Uka wrote on 2022-03-01, 16:50:

Tried a few ReelMagic games:
"Return to Zork" and "Man Enough" seem to work! Although there are no subtitles displayed in videos for some reason.

Awesome! We haven't actually tested "Man Enough" yet but that's pretty cool it works!

"Flash Traffic" and "The Horde" launch fine, but no video is seen.
And "Crime Patrol", "Drug Wars" etc. do not recognize the card.

We haven't yet tried those games either, but they are definitely on the test to-do list as well. 😀 You might be able to get the game to start by manually loading the driver by doing a "Z:\FMPDRV.EXE" before starting the game. There is also a dosbox.conf parameter that can be set to force FMPDRV.EXE to always be there: Setting "alwaysresident=true" under the "[reelmagic]" section in your dosbox.conf file may also work.

"Space Ace" launches, but the video is not correct.

Yeah I had a feeling there would be more problems with MPEG decode. While inspecting a handful of MPEG files from several ReelMagic games, we discovered that most of these are not in spec with the ISO/IEC 11172-2 (MPEG-1) standard. To make this just work for Return to Zork and Lord of the Rings, I put in a workaround which pre-scans the ReelMagic-specific MPEG files looking for an "f_code" value that I just slam into the decoder statically, which surprising seems to work pretty well for most ReelMagic encoded videos. We are currently working on figuring out the algorithm for properly handling on a per-picture basis which should fix issues like this. Thanks the heads up on this as it gives us a known bad reference to test and fix with.

Thanks for letting us know about these issues! 😀

Reply 7 of 172, by Uka

User metadata
Rank Member
Rank
Member
jrdennisoss wrote on 2022-03-01, 17:38:

Awesome! We haven't actually tested "Man Enough" yet but that's pretty cool it works!

Thanks for your great work!
Well, I have only tested the very beginning of it - and it is not possible to complete it anyway as the disk 2 of 3 has not yet been dumped...
And do you know why the subtitles are not showing up here and in "Return to Zork"?

jrdennisoss wrote on 2022-03-01, 17:38:

You might be able to get the game to start by manually loading the driver by doing a "Z:\FMPDRV.EXE" before starting the game. There is also a dosbox.conf parameter that can be set to force FMPDRV.EXE to always be there: Setting "alwaysresident=true" under the "[reelmagic]" section in your dosbox.conf file may also work.

Sadly that does not work...
And what does "#vgadup5hack" setting mean? It is not fully implemented yet?

jrdennisoss wrote on 2022-03-01, 17:38:

To make this just work for Return to Zork and Lord of the Rings, I put in a workaround which pre-scans the ReelMagic-specific MPEG files looking for an "f_code" value that I just slam into the decoder statically, which surprising seems to work pretty well for most ReelMagic encoded videos. We are currently working on figuring out the algorithm for properly handling on a per-picture basis which should fix issues like this.

Does "The Lord of the Rings" work for you?
It does not for me: starting a new game shows the video, but then it freezes in the middle. And starting the demo crashed the game saying there is an error in opening the movie.

I have also tried "Dragon's Lair": it launches fine, but for some reason only the end game videos appear. As if I just die all the time and nothing else 😀

Attachments

Reply 8 of 172, by Bobbytoz

User metadata
Rank Newbie
Rank
Newbie

Hello!

Great news! Good job!

Driver 1.11 TESTFMP.EXE

The Horde (- PC RealMagic MPEG DEMO CD_ [MPG](best quality) [MPEG1 Video 352x240x29.97fps 1150kbps])
file.php?mode=view&id=131653

The Horde (- PC RealMagic THE HORDE CD _ [MPG](normal quality) [MPEG1 Video 352x240x12fps 1015kbps])
file.php?mode=view&id=131654

DOWNLOAD VIDEO SAMPLES: https://www38.zippyshare.com/v/fzwlt40W/file.html

The game does not play video(((

Attachments

  • M02.png
    Filename
    M02.png
    File size
    166.66 KiB
    Views
    6193 views
    File license
    Public domain
  • M01.png
    Filename
    M01.png
    File size
    173.02 KiB
    Views
    6193 views
    File license
    Public domain

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Games used to be better!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply 9 of 172, by Bobbytoz

User metadata
Rank Newbie
Rank
Newbie

On real hardware RealMagic XCard PCI
Similarly...

MPEG1 Video 29.97fps 1150kbps (works!)
MPEG1 Video 12fps 1015kbps (Frame failures)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Games used to be better!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply 10 of 172, by Bobbytoz

User metadata
Rank Newbie
Rank
Newbie

jrdennisoss

Why are you using the driver v.1.11 and not 2.01F ?

Is there a technical reason for this?

I tried to run The Horde game with different versions of drivers (1.10 - 2.01F), does not run the video

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Games used to be better!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply 11 of 172, by Uka

User metadata
Rank Member
Rank
Member
Bobbytoz wrote on 2022-03-01, 19:06:

On real hardware RealMagic XCard PCI

That's not a 'real' hardware 😀
REALMagic PCI cards can not (and were not supposed to) play RM MPEG1-games.

Reply 12 of 172, by jrdennisoss

User metadata
Rank Newbie
Rank
Newbie
Uka wrote on 2022-03-01, 18:24:

and it is not possible to complete it anyway as the disk 2 of 3 has not yet been dumped...

bummer 🙁

And do you know why the subtitles are not showing up here and in "Return to Zork"?

I'm glad you brought this up because to be honest, subtitles was something I didn't even think about. I didn't even know RTZ had subtitles. Can you tell me where in "Return to Zork" or "Man Enough" you expect to see the subtitles or how to enable?

Yesterday we just received an actual ReelMagic ISA card and are currently working on getting this setup in an old PC so that we can peek/poke at the real deal. The DOSBox debugger and Ghidra are great tools to help figure this stuff out, but can also be very time consuming to hammer out large features like this. 😀 Once we put the game in a PC with the real ReelMagic card and get the subtitles to come out, likely we can narrow down the issue and get it fixed/implemented in the emulator.

One of the items on the current TODO list is to better understand how the driver -> game callback events works, as well as fill in the gaps for some of the driver calls I just guessed at. I've only implemented one of the callbacks ("media closed" I think?) and I suspect more are needed to address some of Return to Zork's (+ other games) glitches. Currently, the only status the emulator tells the game is if the MPEG video is playing or not, and the picture size. I'm pretty sure there is a mechanism which is supposed to provide things like video play position. Something like that could certainly impact the game's ability to overlay subtitles as it would need to know when the right time / video position is to display the text.

I'm 90% sure that subtitles would be located in the game as opposed to the MPEG file because from what I can tell, the CL450 (MPEG chip on the ReelMagic board) does not have any support for decoding and displaying some format of subtitles. I don't think MPEG-1 supports this either, although I suppose one could mux in a proprietary data/text stream of some sort. I've worked with CEA 608 (line 21) and 708 (digital) closed-captioning/subtitle standards in past lives, but AFAIK, only MPEG-2 or higher supports this. If there are indeed subtitles embedded in the MPEG files as opposed to the game, it may take some time to implement that feature as that requires finding a font to use, and rendering the font and text to the correct screen positions.

Sadly that does not work...

Well was worth a shot 😀 Good to know as it gives us a known bad point of test to investigate.

And what does "#vgadup5hack" setting mean? It is not fully implemented yet?

In a nutshell, if this parameter is false or unset, MPEG quality is likely sacrificed in favor of the original VGA signal quality. If this parameter is true, then likely you will have better MPEG video quality, at a very slight sacrifice of VGA quality. I think the best answer here for what to use is to try it and see which mode you prefer better.

In more detail: Setting "vgadup5hack=true" will duplicate every 5th VGA (vertical) line. For example, if the game calls for a VGA resolution of 320x200, the output resolution will be stretched to 320x240, which yields a 4:3 aspect ratio. This is certainly not the best way to solve this problem, but I put it in as a quick and dirty hack because most of the MPEG video assets I have analyzed so far have a 4:3 aspect ratio (or close to), and I wanted a way to get the full MPEG quality/experience for games like Return to Zork and Lord of the Rings which call for a "classical" VGA/DOS aspect ratio.

I made sure to explicitly call it a "hack" because something like this (and just the video mixing in general 😀 ) should probably be done in an OpenGL shader or similar layer to properly implement image mixing and scaling.

There was a gap in implementation (especially with the Lord of the Ring videos) where it would just paint a red picture, but I recently pushed a code change that should allow the "dup5 hack" to work with all video sizes. So as of the current main branch it should be fully implemented.

Does "The Lord of the Rings" work for you?

No not quite yet, but it is currently a work-in-progress as I am actively testing this game at the moment with the emulator. I think that likely it will be supported soon as I have a good idea what the current problems (emulated driver API limitations) are on this one. One issue is the stop command is not properly implemented and the "FMPOpen Error Code: 0" you get I think is a relative path the emulator is not currently handling. Both should be fairly easy to fix.

I have also tried "Dragon's Lair": it launches fine, but for some reason only the end game videos appear. As if I just die all the time and nothing else

Good to know. Thanks for another good data point 😀

Reply 13 of 172, by jrdennisoss

User metadata
Rank Newbie
Rank
Newbie
Bobbytoz wrote on 2022-03-01, 20:02:

jrdennisoss

Why are you using the driver v.1.11 and not 2.01F ?

Is there a technical reason for this?

We started with driver 1.11 as that was a good/small starting point, as well as that was the version Return to Zork used. The initial goal was to get Return to Zork working just to see if we could do this, then build up from there. Since we mostly accomplished that (to be honest I was doubtful for a while there 😀 ), now I think we are in a good place to get this project to support more driver versions / more ReelMagic games.

BTW thanks for the data point on The Hord demo vs real. 😀

Reply 14 of 172, by Uka

User metadata
Rank Member
Rank
Member
jrdennisoss wrote on 2022-03-02, 04:43:

Can you tell me where in "Return to Zork" or "Man Enough" you expect to see the subtitles or how to enable?

Sorry, my mistake. I must have confused "Man Enough" with "Flash Traffic" - there are no subtitles in the first scenes of "Man Enough" for some reason, even on the real hardware (must be an original bug). They do appear later 😀
And there are no actual subtitles for the videos in "Return to Zork" either.
So everything seems to be fine!
I have also noticed that the photo screens in "Man Enough" splash too quickly - had to reduce the CPU cycles from 15000 to about 3000-4000.

jrdennisoss wrote on 2022-03-02, 04:43:

Yesterday we just received an actual ReelMagic ISA card and are currently working on getting this setup in an old PC so that we can peek/poke at the real deal.

Congratulations 😀
Is it the original ReelMagic / ReelMagic Lite?
Please mind that there were several models with different drivers. The original ReelMagic / ReelMagic Lite (with feature connector) is the only type of cards where "Return to Zork" works fine. It has glitches on later cards with 8-pin pass-through outer cable (REALmagic Maxima, REALmagic Maxima Pro, REALmagic Ultra), and the latest ISA card (REALmagic Ultra II / NetStream 1, with 9-pin pass-through outer cable) has some problems with other games as well (while PCI cards do not work with any of them at all, of course).

Attachments

Reply 15 of 172, by KainXVIII

User metadata
Rank Member
Rank
Member

Step-by-step instruction how to run ReelMagic games would be helpful! Do i need to install RM drivers first? Where to get them and which version is better?
PS - what i tried: launсhed RTZ - nothing happened; tried to install RM drivers - hardware is not detected 🙃

Reply 16 of 172, by Bobbytoz

User metadata
Rank Newbie
Rank
Newbie
Uka wrote on 2022-03-02, 03:29:
Bobbytoz wrote on 2022-03-01, 19:06:

On real hardware RealMagic XCard PCI

That's not a 'real' hardware 😀
REALMagic PCI cards can not (and were not supposed to) play RM MPEG1-games.

I thought there was backward compatibility...
But I was wrong.
It doesn't bother me)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Games used to be better!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply 17 of 172, by Uka

User metadata
Rank Member
Rank
Member
KainXVIII wrote on 2022-03-02, 07:27:

Step-by-step instruction how to run ReelMagic games would be helpful! Do i need to install RM drivers first? Where to get them and which version is better?
PS - what i tried: launсhed RTZ - nothing happened; tried to install RM drivers - hardware is not detected 🙃

You do not need to install the drivers - they are already present in dosbox.exe!
Just mount the disk and install the game - everything worked fine for me.

Reply 18 of 172, by Bobbytoz

User metadata
Rank Newbie
Rank
Newbie
KainXVIII wrote on 2022-03-02, 07:27:

Step-by-step instruction how to run ReelMagic games would be helpful! Do i need to install RM drivers first?

file.php?mode=view&id=131704

Drivers do not need to be installed...

But here is the driver archive https://archive.org/details/sigma-design-drivers

Attachments

  • RUN HORDE.png
    Filename
    RUN HORDE.png
    File size
    11.51 KiB
    Views
    6046 views
    File license
    Fair use/fair dealing exception

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Games used to be better!
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Reply 19 of 172, by KainXVIII

User metadata
Rank Member
Rank
Member
Uka wrote on 2022-03-02, 11:46:
KainXVIII wrote on 2022-03-02, 07:27:

Step-by-step instruction how to run ReelMagic games would be helpful! Do i need to install RM drivers first? Where to get them and which version is better?
PS - what i tried: launсhed RTZ - nothing happened; tried to install RM drivers - hardware is not detected 🙃

You do not need to install the drivers - they are already present in dosbox.exe!
Just mount the disk and install the game - everything worked fine for me.

This is what i did for the first time: installed RTZ, launched RTZ.bat and nothing happened, not even an error log.
Maybe something from autoexec conflicts, dos navigator or something else 🤣?

[autoexec]
# Lines in this section will be run at startup.
# You can put your MOUNT lines here.

mount c d:\
mount d e:\ -t cdrom
c:
cd dn
dn

PS - its actually Dos Navigator, if i quit it - game loads, never had this issue before in dosbox *shrugs*