joncampbell123 / dosbox-x

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

PC-98 Mouse emulation issues #4680

Closed sdsnatcher closed 9 months ago

sdsnatcher commented 9 months ago

Describe the bug

When the Falcom Character CG app is run, two different types of issues happen, depending on the mouse driver used.

Case-1: If dosbox-x boots its own internal HDD and uses its own mouse driver:

Case-2: If dosbox-x boots from the floppy disk image and uses the MS-DOS 3.10 and supplied MOUSE.SYS driver:

Note: I tested the case-2 with the Neko Project II emulator, and the mouse worked just fine.

Falcom Character CG [PC98].zip

Steps to reproduce the behaviour

Case-1: Internal mouse driver

  1. Boot dosbox-x in PC-98 mode without any floppy disks
  2. Insert FCCG_SYS.FDI on drive A:
  3. On the DOS prompt, type the following commands:
    A:
    FPG

Case-2: MS-DOS 3.10 and its MOUSE.SYS driver

  1. Boot dosbox-x in PC-98 mode
  2. Select the menu option Drive->A->Boot from disk image
  3. Select the FCCG_SYS.FDI disk image
  4. Press ENTER when the date and time is requested
  5. On the DOS prompt, type the following command:
    FPG

Expected behavior

The mouse should work correctly on both cases:

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

macOS 12.7.1

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

https://github.com/joncampbell123/dosbox-x/actions/runs/7191033384

Used configuration

Default configuration file, with only machine=pc98 changed.

Output log

No response

Additional information

No response

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

Code of Conduct & Contributing Guidelines

maron2000 commented 9 months ago

At least booted MS-DOS seems to work. Are you sure that you enabled mouse capture? DOSBox-X requires to capture mouse as well as np2 forks, you can find it in the Main dropdown menu and its shortcut key.

Without booting, it seems there is a problem with the mouse driver, and need to use a external driver dedicated for PC-98. I tried this one, but maybe NEC genuine MOUSE.COM may work. https://www.vector.co.jp/soft/dl/dos/util/se015186.html However, I see some glitches in the text screen. falcomcg

sdsnatcher commented 9 months ago

At least booted MS-DOS seems to work. Are you sure that you enabled mouse capture?

I wasn't aware that it needed to be captured. Then it worked when booting the MS-DOS. Thanks for the tip!

Without booting, it seems there is a problem with the mouse driver, and need to use a external driver dedicated for PC-98

Following this tip, I went after mouse drivers for the PC-98. I tested himouse, ozmouse, gsmdv and even found the original Microsoft mouse driver for the PC-98.

nanshiki commented 9 months ago

Try incorporating the MOUSE.SYS that exists in FCCG_SYS.FDI with the device command. > device mouse.sys

The reason why the coordinates are displayed in the wrong place may be due to the PC-98 specific behavior that the text is displayed in the lower right corner of the screen but does not scroll. This should be fixed in #4700.

sdsnatcher commented 9 months ago

Using the DEVICE.COM command to load the MOUSE.SYS did function as a workaround, thanks! I wasn't aware of this command.

The root of the problem seems to be that there are two different mouse APIs for the PC-98: one by NEC and another by Microsoft, but dosbox-x built-in mouse driver seems to support only the Microsoft API.

joncampbell123 commented 9 months ago

Using the DEVICE.COM command to load the MOUSE.SYS did function as a workaround, thanks! I wasn't aware of this command.

The root of the problem seems to be that there are two different mouse APIs for the PC-98: one by NEC and another by Microsoft, but dosbox-x built-in mouse driver seems to support only the Microsoft API.

Is the NEC API documented anywhere? Perhaps DOSBox-X should implement it.

maron2000 commented 9 months ago

Explanation of NEC API should be included in the MS-DOS Programmer's Reference manual. Maybe I can find it in my bookshelf but not sure.

nanshiki commented 9 months ago

In the case of the NEC version of MOUSE.SYS, the cursor is drawn in only one plane and is displayed using XOR without masking. The cursor size is also large (16x32). cursor You can see that the green monochromatic area overlapping with the background graphic is inverted. Also, there are various button-related differences with int 33h. I found this in the PC-9801 Programmer's Bible, so I extracted only the parts that differ from the Microsoft version and converted them to text. mousej.txt The translated version is also available. mousee.txt

nanshiki commented 9 months ago

@sdsnatcher Supported by #4712. In [pc98] of dosbox-x.conf pc-98 nec mouse function=true Add the following. Or on command line. > pc98util /nec Set in NEC mouse function.

In addition, > pc98util /ms Set the Microsoft mouse function.

sdsnatcher commented 9 months ago

@nanshiki

This worked perfectly, thank you!