captainys / TOWNSEMU

FM Towns Emulator "Tsugaru"
BSD 3-Clause "New" or "Revised" License
247 stars 18 forks source link

Emulator hangs when install Windows 95 #83

Open OldMadMan opened 1 year ago

OldMadMan commented 1 year ago

I fully understand that Windows 95 is far more complex than Windows 3.x, maybe you can check the problems described below when have time in the future :)

I ran the Windows 95 Setup from CD under DOS 5.0. everything works fine at first, but during the phase of detecting the system's hardware configuration, the emulator freezes and reports the following error code:

VM Aborted! Device:486DX Reason:Clocks-Passed is not set. Towns TIME (Nano-Seconds): 680986509050 CS:EIP=1E1F:00000134 LINEAR:0098BD94 EFLAGS=00003202 CPL=03 EAX=00000000 EBX=00002BC8 ECX=00003206 EDX=0000AC7E ESI=000004A6 EDI=00000007 EBP=0000AC80 ESP=0000AC80 CS=1E1F(LIN:0098BC60) DS=1E9F(LIN:00800440) ES=1E9F(LIN:00800440) FS=0000(LIN:00000200) GS=0000(LIN:00016750) SS=1367(LIN:005F8AE0) CR0=80000001 CR1=00000000 CR2=00000000 CR3=0034A000 CF0 PF0 AF0 ZF0 SF0 TF0 IF1 DF0 OF0 IOPL03 NT0 RF0 VM0 AC0 Default Operand Size=16 Default Address Size=16 Stack Address Size=16 SS+00000000:86 AC 0C 01 5F 1E 98 AC 13 17 47 1E C8 2B 9F 1E SS+00000010:07 00 CA 24 9F 1E 01 00 A4 AC AE 1B 47 1E 9F 1E 1E1F:00000134 9BDBE1 FWAIT ?FPUINSTDB E1 REG=04

Deleted 1 dialogs scheduled for deletion.

OYXP$Q0WW~EO(TWE$I466LM

captainys commented 1 year ago

Thank you for the report! DB E1 looks to be FNDISI, which is an legacy instruction from 8087 and should be taken as NOP. I made that change and pushed the code. Probably that instruction will pass.

OldMadMan commented 1 year ago

Your change did allow the Setup to complete the hardware detection, but then I ran into a new problem. After copying the files and system restarted, just before the Setup is about to do follow-up work (such as installing the start menu items), the system crashes with a blue screen, error code is shown in the figure below:

94C3FRBB %J3C W%KDU@@N6

But Tsugaru itself was not stuck, and it's status output CLI window has no error report.

I think this problem may not be easy to troubleshoot the cause.

captainys commented 1 year ago

I guess this one needs more work. I'll work on Windows 95 eventually.

OldMadMan commented 1 year ago

I tried newest version, now after restart the screen just shows a bunch of noise, which made it impossible for me to confirm the status of the Setup. %F}P@W4R4`O5KY} 6US9%IO

OldMadMan commented 9 months ago

After my constant attempts, I found that the problem of garbled screen display mentioned above can be solved by selecting the graphics card type as "medium resolution xx" during the system installation process.

The problem now is that during the post-installation configuration phase, an EXPLORER error will be prompted. After clicking "Ignore", a dialog box as shown in the figure will pop up, prompting an error related to DDEML.DLL.

23f2f0f2e9e4b5d27434af5c67c94cba

OldMadMan commented 8 months ago

I compiled and tried newest (2024-01-11) source code and ran Windows 95 again. After the 95 logo boot screen, emulator hangs, and CUI shows these error details:

VM Aborted! Device:486DX Reason:DMAC: ADIR bit not supported. Towns TIME (Nano-Seconds): 22355138800 CS:EIP=0028:C101E063 LINEAR:C101E063 EFLAGS=00003002 CPL=00 EAX=000000FD EBX=C15200E8 ECX=000004D7 EDX=000000AA ESI=C13BD9E4 EDI=C13BDA90 EBP=C13D5BE8 ESP=C13D5BB8 CS=0028(LIN:00000000) DS=0030(LIN:00000000) ES=0030(LIN:00000000) FS=0030(LIN:00000000) GS=0030(LIN:00000000) SS=0030(LIN:00000000) CR0=8000000B CR1=00000000 CR2=000C8F8C CR3=00429000 CF0 PF0 AF0 ZF0 SF0 TF0 IF0 DF0 OF0 IOPL03 NT0 RF0 VM0 AC0 Default Operand Size=32 Default Address Size=32 Stack Address Size=32 SS+00000000:EA 1F 3F C1 AA 00 00 00 FD 00 00 00 90 DA 3B C1 SS+00000010:E4 D9 3B C1 E8 00 52 C1 D7 04 00 00 0F D9 3B C1 0028:C101E063 C20800 RET 0008H

captainys commented 8 months ago

I've just fixed a major implementation error in my CPU. I hope it at least pushes Windows 95 farther into the boot process.

OldMadMan commented 8 months ago

I've just fixed a major implementation error in my CPU. I hope it at least pushes Windows 95 farther into the boot process.

Thank you very much for your willingness to help me solve my problem!

I just compiled your latest code and unfortunately the problem still exists.

CUI log shows:

CDROM Command FF function unknown. Currently just returns error status. VM Aborted! Device:486DX Reason:DMAC: ADIR bit not supported. Towns TIME (Nano-Seconds): 38225898675 CS:EIP=0028:C101E063 LINEAR:C101E063 EFLAGS=00003002 CPL=00 EAX=000000FD EBX=C15200E8 ECX=000004D7 EDX=000000AA ESI=C13BD9E4 EDI=C13BDA90 EBP=C13D5BE8 ESP=C13D5BB8 CS=0028(LIN:00000000) DS=0030(LIN:00000000) ES=0030(LIN:00000000) FS=0030(LIN:00000000) GS=0030(LIN:00000000) SS=0030(LIN:00000000) CR0=8000000B CR1=00000000 CR2=000C8F8C CR3=00429000 CF0 PF0 AF0 ZF0 SF0 TF0 IF0 DF0 OF0 IOPL03 NT0 RF0 VM0 AC0 Default Operand Size=32 Default Address Size=32 Stack Address Size=32 SS+00000000:EA 1F 3F C1 AA 00 00 00 FD 00 00 00 90 DA 3B C1 SS+00000010:E4 D9 3B C1 E8 00 52 C1 D7 04 00 00 0F D9 3B C1 0028:C101E063 C20800 RET 0008H

But the good news is: if choose to enter safe mode when the system starts, Windows95 will be able to boot to the desktop! You did a great job! :)

00

captainys commented 8 months ago

OK. I've fixed the ADIR problem. I have also fixed the SCSI implementation problem.

With these fixes, I can install and run Windows 95 with -NOHIGHRES option. Windows 95 is switching to the High-Resolution CRTC in a way we don't know yet (and need to explore).

Mouse is not integrated, so you need to use gamepad or keyboard emulation, but I guess you already figured it.

But, it is very close to fully support Windows 95! ... Well, at least to the start.

OldMadMan commented 8 months ago

OK. I've fixed the ADIR problem. I have also fixed the SCSI implementation problem.

With these fixes, I can install and run Windows 95 with -NOHIGHRES option. Windows 95 is switching to the High-Resolution CRTC in a way we don't know yet (and need to explore).

Mouse is not integrated, so you need to use gamepad or keyboard emulation, but I guess you already figured it.

But, it is very close to fully support Windows 95! ... Well, at least to the start.

Please allow me to once again express my gratitude to you for this truly monumental moment :)

I wonder if you can add a checkbox switch for -NOHIGHRES in the GUI in future updates, which would make it more convenient for users.

Thank you so much!

bcc2528 commented 8 months ago

High-res CRTC (and high-res PCM) is implemented in MA and later models, so i think better add to enabled it if the Model setting in GUI is MA or later.

自分も動作確認が行えました。対応ありがとうございます。 WinQuakeが動けば津軽でWolfenstein 3D・DOOM・Quakeのid SoftwareクラシックFPS三部作が遊べる状態になりますね(意味があるかは置いといて)。 WinQuakeを動かそうとしたのですが、FLDENV DWORD PTRの実装がまだ、それを実装したところDCF9 FDIVR(m64real) ECXで止まりました。 自分のFLDENVの実装方法が悪いのか(オペランドサイズで14・28分取得のどちらか判定してRestoreEnvでストア)よくわかってません。 winquake

bcc2528 commented 8 months ago

FLDENV・FIADD m32int・FSUBR STi ST・FDIV STi ST・FDIVR ST STi の5命令追加でWinQuakeのデモが完走出来ました。 quake_1 キーボード操作が↓キーしか反応しないのと、マウスクリックするとエラー落ちしてしまう問題がありますが。TOWNS版Win95固有の問題かもしれません。