Mouse capture status on read

This commit is contained in:
Jonathan Campbell 2025-05-04 16:17:02 -07:00
parent 2c654343ee
commit 1a6e7c3fbe
2 changed files with 9 additions and 2 deletions

View File

@ -74,7 +74,8 @@ extern uint16_t DOSBOXID_VAR dosbox_id_baseio;
#define DOSBOX_ID_REG_USER_MOUSE_CURSOR (0x00434D55UL) /* screen coordinates, pixels */
#define DOSBOX_ID_REG_USER_MOUSE_CURSOR_NORMALIZED (0x00434D56UL) /* screen coordinates, normalized to 0...65535 for Windows 3.x */
#define DOSBOX_ID_REG_RELEASE_MOUSE_CAPTURE (0x0052434DUL)
#define DOSBOX_ID_REG_RELEASE_MOUSE_CAPTURE (0x0052434DUL) /* release mouse capture (W) / mouse capture status (R) */
# define DOSBOX_ID_REG_RELEASE_MOUSE_CAPTURE_FL_CAPTURED (0x1UL << 0UL)
#define DOSBOX_ID_CMD_GET_VGA_SIZE (0x006845C0UL)

View File

@ -777,6 +777,12 @@ void dosbox_integration_trigger_read() {
dosbox_int_register = Mixer_MIXQ();
break;
case DOSBOX_ID_REG_RELEASE_MOUSE_CAPTURE: /* release mouse capture 'MCR' / mouse capture status */
dosbox_int_register = 0;
if (sdl.mouse.locked)
dosbox_int_register |= DOSBOX_ID_REG_RELEASE_MOUSE_CAPTURE_FL_CAPTURED;
break;
case 0x4B6F4400: // DOS kernel status
dosbox_int_register = dos_kernel_disabled ? 0: 1;
break;
@ -947,7 +953,7 @@ void dosbox_integration_trigger_write() {
dosbox_int_debug_out.clear();
break;
case 0x52434D: /* release mouse capture 'MCR' */
case DOSBOX_ID_REG_RELEASE_MOUSE_CAPTURE: /* release mouse capture 'MCR' */
void GFX_ReleaseMouse(void);
GFX_ReleaseMouse();
break;