joncampbell123 / dosbox-x

DOSBox-X fork of the DOSBox project
GNU General Public License v2.0
2.65k stars 376 forks source link

PC-9821: System Shock black screen #4514

Open Pawlicker opened 11 months ago

Pawlicker commented 11 months ago

Describe the bug

So the port of System Shock to the NEC PC-9821 was dumped and unforuntately it does not work in either NP21w or Dosbox-X, while working on the real hardware. On DOSBox-X, audio works but nothing is displayed on the video output whatsoever.

pc98 system shock

Steps to reproduce the behaviour

Install System Shock for the PC-98 (https://archive.org/details/systemshock_202310) to a virtual HDD, and try to launch it either normally or with the shock95.bat file.

Expected behavior

system shock 98 Direct video capture from a PC-9821Xv13 https://www.youtube.com/watch?v=EFwDyfGhID4

What operating system(s) this bug have occurred on?

OpenSuse Tumbleweed

What version(s) of DOSBox-X have this bug?

Current version

Used configuration

No response

Output log

No response

Additional information

This port is finicky to get working on real HW (I mean, it is from the same people who did the PC-98 port of DOOM), it does want dos16m set and it uses mmm.exe as the mouse driver. It also requires the System Shock CD in any CD drive to seek files.

Have you checked that no similar bug report(s) exist?

Code of Conduct & Contributing Guidelines

joncampbell123 commented 11 months ago

The installer also seems to determine the default drive letter to install to using an API not yet implemented (note the @ at sign for drive letter). install_000

joncampbell123 commented 11 months ago

Ah, the HD installer insists that it install to drive A.

joncampbell123 commented 11 months ago

The game requires the 386SX style linear framebuffer just below 16MB. If you set memsize below 15MB (I'm using memsize=12) the graphics work.

DOSBox-X does not fully emulate the ISA memory hole in a way PC-98 games can pick up when memsize >= 15.

joncampbell123 commented 11 months ago

Although the intro video is jumpy as hell, so some other timing issue is there.

maron2000 commented 11 months ago

It booted fine on MS-DOS6.2 guest with 86PCM when memsize set to <=14. Intro plays not so bad.

https://github.com/joncampbell123/dosbox-x/assets/68574602/2242ef76-5e14-4595-909a-7771dfc3d3fb

On np21/w it works fine even memory size is more than 32MB (just wanted to say it works since @Pawlicker says it doesn't). systemshock_np21

joncampbell123 commented 11 months ago

I just added an option to emulate the 15MB ISA memory hole, which is now on by default for PC-98 and should allow games like this to display something even if memsize >= 15.

If I use the installer to setup the game with no music or sound, the cutscene runs fast but never skips or stutters. Hm.

joncampbell123 commented 11 months ago

The game's intro FMV appears to use IRQ 0 (PIT timer) but for whatever reason it's running the timer interrupt somewhere between 3x and 4x fast.

What doesn't help is the "Undocumented PC-98 collection vol 2" documentation for the "Timer Control Unit" seems to have gotten the BIOS data area bit backwards from bus frequency. I can see 8MHz / 4 = 2MHz and 10MHz / 4 = 5MHz / 2 = 2.5MHz but the way it's documented makes much less sense.

image

maron2000 commented 11 months ago

The input clock described in Undocumented PC-98 maybe wrong.

According to PC-9800 Technical databook Hardware edition, it is as follows.

systemclock3 systemclock

And PC9801 programmer's bible mentions the same. systemclock2

joncampbell123 commented 11 months ago

The input clock described in Undocumented PC-98 maybe wrong.

According to PC-9800 Technical databook Hardware edition, it is as follows.

systemclock3 systemclock

And PC9801 programmer's bible mentions the same. systemclock2

That's exactly what I thought. A clock divider is a lot simpler when it's divide by 2 or 4. Even if it gives the IBM PC a funny CPU clock rate like 4.77MHz. That's the only way the clocks and timer rates make sense.