VOGONS


Reply 20 of 42, by GloriousCow

User metadata
Rank Member
Rank
Member
xsaveopt wrote on 2025-02-01, 14:08:

Yes, I can see from the emulator's side that it is resetting the mouse and then reading a few bytes including the 'M' identification byte.

But I must be seriously misunderstanding what mice were supported by the early Windows versions because I can't even get a serial mouse to work under Bochs. So I'm just going to trash it all and implement a PS/2 mouse instead, which hopefully will work better.

I guarantee you Win 2.0 supports a serial mouse. One of the first things I did when I got mouse working was play reversi.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 22 of 42, by xsaveopt

User metadata
Rank Newbie
Rank
Newbie
GloriousCow wrote on 2025-02-01, 14:06:

You can see if you go to martypc.net that the ctmouse driver loads and detects a mouse. You could try that.

Indeed, it seems that cutemouse does work.

I have now implemented a Logitech BusMouse (because PS/2 re-uses PPI ports and I didn't want to risk breaking GLaBIOS somehow), and it works under DOS. In Windows 3.0 however, I cannot see the mouse on the screen but clicking does open things.

Is the cursor by any chance drawn using a dedicated CGA or CRT register that I should have implemented?

Reply 23 of 42, by GloriousCow

User metadata
Rank Member
Rank
Member
xsaveopt wrote on 2025-02-01, 15:51:

Is the cursor by any chance drawn using a dedicated CGA or CRT register that I should have implemented?

Nope, CGA doesn't know anything about mouse cursors. That's peculiar. You tried PC Paintbrush yet?

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 24 of 42, by xsaveopt

User metadata
Rank Newbie
Rank
Newbie
GloriousCow wrote on 2025-02-01, 17:13:
xsaveopt wrote on 2025-02-01, 15:51:

Is the cursor by any chance drawn using a dedicated CGA or CRT register that I should have implemented?

Nope, CGA doesn't know anything about mouse cursors. That's peculiar. You tried PC Paintbrush yet?

PC paintbrush seems to expect a functioning x87 coprocessor, which I unfortunately have not implemented yet.

I can run Windows' paintbrush, but it's quite hard to use since the cursor is not visible:

win3_paintbrush.png
Filename
win3_paintbrush.png
File size
16.22 KiB
Views
475 views
File license
CC-BY-4.0

Reply 25 of 42, by GloriousCow

User metadata
Rank Member
Rank
Member
xsaveopt wrote on 2025-02-01, 17:45:

PC paintbrush seems to expect a functioning x87 coprocessor, which I unfortunately have not implemented yet.

what gives you that impression? I certainly don't have an x87...

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 26 of 42, by xsaveopt

User metadata
Rank Newbie
Rank
Newbie
GloriousCow wrote on 2025-02-01, 19:16:

what gives you that impression? I certainly don't have an x87...

When I try to run PBSETUP (from PC Paintbrush 3.77) it tries to execute the FCOM instruction, which I haven't implemented yet.

Reply 27 of 42, by Jo22

User metadata
Rank l33t++
Rank
l33t++
GloriousCow wrote on 2025-02-01, 14:11:
xsaveopt wrote on 2025-02-01, 14:08:

Yes, I can see from the emulator's side that it is resetting the mouse and then reading a few bytes including the 'M' identification byte.

But I must be seriously misunderstanding what mice were supported by the early Windows versions because I can't even get a serial mouse to work under Bochs. So I'm just going to trash it all and implement a PS/2 mouse instead, which hopefully will work better.

I guarantee you Win 2.0 supports a serial mouse. One of the first things I did when I got mouse working was play reversi.

I second this.

In addition, I read on the internet that the Windows 2.x PS/2 mouse driver had been used to retrofit Windows 1.x with PS/2 support..

I've attached some pictures of my own copy of Windows 2.03, hope that's okay.

The mouse (Sigma mouse) is a serial mouse that's MS Mouse compatible, though it also has a switch on underside.
It works so far with Windows, GEM, GeoWorks Ensemble and MS Mouse driver 6.24.

I do have to happen that setup around right now because I'm tinkering with a Commodore PC10 (4,77 MHz XT) right now and I just had my own issues with Windows 2.03 a few days ago.

I even went so far and asked for help at Forum64, a forum of Commodore experts.

The issue back then wasn't mouse related, though.
It rather was about an Aztech SB 2 clone that caused Windows 2.x to hang. Very strange.
A real SB 2.0 CT1350B didn't cause the issue. In another PC, a Siemens-Nixdorf model M35 (4,77 MHz XT), the Aztech SB 2 clone didn't hang Windows 2.x at all.

I even copied both Windows 2.x Installations back and forth, but the issue remained. Both have a NEC V20 processor, as well.

So yeah, I suppose Windows 2.x has quite some more surprises left for us. 😀

Attachments

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 28 of 42, by Jo22

User metadata
Rank l33t++
Rank
l33t++
xsaveopt wrote on 2025-02-01, 19:50:
GloriousCow wrote on 2025-02-01, 19:16:

what gives you that impression? I certainly don't have an x87...

When I try to run PBSETUP (from PC Paintbrush 3.77) it tries to execute the FCOM instruction, which I haven't implemented yet.

Oh, I can explain! Windows 2x uses WIN87EM.EXE if an application uses FPU.
It should be in Windows directory or application directory. It's not part of Windows installation, though.

WIN87EM.EXE is like win87em.dll in modern Windows.
It manages context-switching for FPU/applications and can both emulate/virtualize an 8087 FPU (AFAIK).

Edit: I've attached a copy of WIN87EM.EXE, along with a mandelbrot set generator.

Edit: I forgot to mention. WIN87EM can also be loaded at run time by adding it to WIN.INI (load=win87em.exe).
The downside is that it may consume a bit of conventional memory that could be used otherwise.

Attachments

  • Filename
    win87em.zip
    File size
    22.92 KiB
    Downloads
    3 downloads
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 29 of 42, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi. Here's also my old copy of MS Mouse 6.24BZ that I've used for ages. It's from 1988 or 1989.
So far, it worked with about any mouse/application I've tried.
Windows doesn't use it, but it won't take any harm from it either.

Attachments

  • Filename
    ms_mouse_624bz.zip
    File size
    11.71 KiB
    Downloads
    6 downloads
    File comment
    DOS mouse driver
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 30 of 42, by GloriousCow

User metadata
Rank Member
Rank
Member
Jo22 wrote on 2025-02-01, 19:59:

When I try to run PBSETUP (from PC Paintbrush 3.77) it tries to execute the FCOM instruction, which I haven't implemented yet.

lots of things can probe the FPU. FDISK in DOS 3.30 does for some reason. If you don't have one installed all that happens is an ESC opcode gets execute and the CPU continues, unless WAIT gets executed. The fact that you even know FCOM was in there somewhere makes me think that you're triggering a halt on ESC? If so, try taking that out. Just do a dummy fetch of an EA operand and keep going.

MartyPC: A cycle-accurate IBM PC/XT emulator | https://github.com/dbalsom/martypc

Reply 31 of 42, by xsaveopt

User metadata
Rank Newbie
Rank
Newbie
GloriousCow wrote on 2025-02-01, 21:00:

lots of things can probe the FPU. FDISK in DOS 3.30 does for some reason. If you don't have one installed all that happens is an ESC opcode gets execute and the CPU continues, unless WAIT gets executed. The fact that you even know FCOM was in there somewhere makes me think that you're triggering a halt on ESC? If so, try taking that out. Just do a dummy fetch of an EA operand and keep going.

I can't even decode the instruction yet, and for now I'm just aborting emulation when I encounter an unknown instruction. But even if I add only the specific instructions it encounters it still doesn't work for some reason.

I also tried running DeluxePaint 2 and it worked perfectly, including mouse:

Filename
deluxepaint.png
File size
10.11 KiB
Downloads
No downloads
File license
CC-BY-4.0

So it seems like it really is only Windows where the mouse cursor isn't drawn for some reason.

Reply 32 of 42, by superfury

User metadata
Rank l33t++
Rank
l33t++

Perhaps a video card MMU issue? Usually things like mouse rendering uses XOR write modes etc. from what I remember.
At least on the EGA/VGA.
Or perhaps an issue with algorithmic x86 instructions (resulting flags and/or results) otherwise?

Edit: While googling it, I also found:
https://learn.microsoft.com/en-us/previ ... dfrom=MSDN
Once again, perhaps XOR-related (a flag that affects rendering the mouse cursor being flipped).

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 33 of 42, by xsaveopt

User metadata
Rank Newbie
Rank
Newbie
superfury wrote on 2025-02-02, 11:16:
Perhaps a video card MMU issue? Usually things like mouse rendering uses XOR write modes etc. from what I remember. At least on […]
Show full quote

Perhaps a video card MMU issue? Usually things like mouse rendering uses XOR write modes etc. from what I remember.
At least on the EGA/VGA.
Or perhaps an issue with algorithmic x86 instructions (resulting flags and/or results) otherwise?

Edit: While googling it, I also found:
https://learn.microsoft.com/en-us/previ ... dfrom=MSDN
Once again, perhaps XOR-related (a flag that affects rendering the mouse cursor being flipped).

I'm just doing CGA for now, so presumably Windows is just software-rendering the cursor itself. I've tested my implementation against GloriousCow's single-step tests, so all flags (except for the undefined flags) should behave correctly.

Reply 34 of 42, by superfury

User metadata
Rank l33t++
Rank
l33t++
xsaveopt wrote on 2025-02-02, 15:21:
superfury wrote on 2025-02-02, 11:16:
Perhaps a video card MMU issue? Usually things like mouse rendering uses XOR write modes etc. from what I remember. At least on […]
Show full quote

Perhaps a video card MMU issue? Usually things like mouse rendering uses XOR write modes etc. from what I remember.
At least on the EGA/VGA.
Or perhaps an issue with algorithmic x86 instructions (resulting flags and/or results) otherwise?

Edit: While googling it, I also found:
https://learn.microsoft.com/en-us/previ ... dfrom=MSDN
Once again, perhaps XOR-related (a flag that affects rendering the mouse cursor being flipped).

I'm just doing CGA for now, so presumably Windows is just software-rendering the cursor itself. I've tested my implementation against GloriousCow's single-step tests, so all flags (except for the undefined flags) should behave correctly.

Afaik if it's software-rendering the mouse cursor (the same with MS-DOS text screens in graphics mode) it renders it using some kind of XOR operation (like VGA's XOR). That way it blits it onto the screen.
Also, apparently, it can be disabled for screen captures (clearly noticed on Windows 2000 or XP I linked to). It might be that that flag is never set (or cleared) properly.
The CGA doesn't have anything like XOR blitting like EGA/VGA has, or does it? I can't remember.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 35 of 42, by Jo22

User metadata
Rank l33t++
Rank
l33t++

Hi. Did a bit of experimentation. The mouse works in PC-Ditto from 1988.
PC-Ditto emulates a basic PC/XT compatible and a Microsoft serial mouse.

I've used PC-DOS 3.30 and a minimal installation of Windows 2.03, which works in DOSBox (machine=CGA).
Windows setup program was told to use CGA, Microsoft Bus/Serial mouse.

The graphics are glitchy, the Windows splash screen animation is broken and the MS-DOS Executive never shows up.
However, the mouse pointer is being drawn and it reacts to the mouse movement. I can do make circles, go up/down etc.

The files used are:
coura.fon, msdos.exe, uhr.exe, win200.bin, win200.ovl, win.com, win.ini
command.com, ibmdos.com, ibmbio.com

The Atari ST emulator used was Steem v3.2.
Emulated Atari ST had 4 MB of RAM, Color Display, TOS 1.04 / TOS2.06 (tried both)

Attachments

  • pcditto_win203_mouse_a.png
    Filename
    pcditto_win203_mouse_a.png
    File size
    23.68 KiB
    Views
    240 views
    File comment
    PC-Ditto boot-up
    File license
    Fair use/fair dealing exception
  • pcditto_win203_mouse_b.png
    Filename
    pcditto_win203_mouse_b.png
    File size
    23.04 KiB
    Views
    240 views
    File comment
    PC-DOS 3.30
    File license
    Fair use/fair dealing exception
  • pcditto_win203_mouse_c.png
    Filename
    pcditto_win203_mouse_c.png
    File size
    16.67 KiB
    Views
    240 views
    File comment
    Windows 2.03 splash screen
    File license
    Fair use/fair dealing exception
  • pcditto_win203_mouse_d.png
    Filename
    pcditto_win203_mouse_d.png
    File size
    14.82 KiB
    Views
    240 views
    File comment
    Windows 2.03 with moving mouse pointer
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 36 of 42, by Jo22

User metadata
Rank l33t++
Rank
l33t++

And here's the same minimal installation in DOSBox (machine=CGA).

Attachments

  • dbx_win203_mouse.png
    Filename
    dbx_win203_mouse.png
    File size
    26.2 KiB
    Views
    238 views
    File comment
    DOSBox running Windows 2.03
    File license
    Fair use/fair dealing exception

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//

Reply 37 of 42, by superfury

User metadata
Rank l33t++
Rank
l33t++

It truly sounds like there's an error in your CPU emulation then. Try looking into algorithmic instructions and otherwise perhaps (conditional) jump instructions.

Author of the UniPCemu emulator.
UniPCemu Git repository
UniPCemu for Android, Windows, PSP, Vita and Switch on itch.io

Reply 38 of 42, by xsaveopt

User metadata
Rank Newbie
Rank
Newbie
superfury wrote on 2025-02-04, 09:24:

It truly sounds like there's an error in your CPU emulation then. Try looking into algorithmic instructions and otherwise perhaps (conditional) jump instructions.

I'm verifying virtually all execution against the behavior of a real CPU. There are only a handful of instructions I can't verify (in/out, sti/cli, pushf/popf, iret, shifts, etc.). So an error in the CPU emulation seems unlikely.

Jo22 wrote on 2025-02-03, 00:54:

Hi. Did a bit of experimentation. The mouse works in PC-Ditto from 1988.
PC-Ditto emulates a basic PC/XT compatible and a Microsoft serial mouse.

Thanks for checking this! I'll try to see if I can compare I/O port reads and writes when I have some time.

Reply 39 of 42, by Jo22

User metadata
Rank l33t++
Rank
l33t++

PM sent.

"Time, it seems, doesn't flow. For some it's fast, for some it's slow.
In what to one race is no time at all, another race can rise and fall..." - The Minstrel

//My video channel//