From 36420ef44a6a7ff20498d32a556851c0ac566654 Mon Sep 17 00:00:00 2001 From: Jukka Heinonen Date: Mon, 20 Sep 2004 19:11:30 +0000 Subject: [PATCH] Added support for int33 show/hide mouse cursor calls. --- dlls/winedos/int33.c | 18 ++++++++++++++++-- dlls/winedos/vga.c | 32 ++++++++++++++++++++++++++++++++ dlls/winedos/vga.h | 1 + 3 files changed, 49 insertions(+), 2 deletions(-) diff --git a/dlls/winedos/int33.c b/dlls/winedos/int33.c index fc2c6bef5ad..b0de443f69a 100644 --- a/dlls/winedos/int33.c +++ b/dlls/winedos/int33.c @@ -40,6 +40,7 @@ static struct FARPROC16 callback; WORD callmask; WORD VMPratio, HMPratio, oldx, oldy; + WORD hide_count; } mouse_info; @@ -58,6 +59,10 @@ static void INT33_ResetMouse( CONTEXT86 *context ) mouse_info.HMPratio = 8; mouse_info.VMPratio = 16; + /* Hide the mouse cursor */ + mouse_info.hide_count = 1; + VGA_ShowMouse( FALSE ); + if (context) { SET_AX( context, 0xFFFF ); /* driver installed */ @@ -81,11 +86,20 @@ void WINAPI DOSVM_Int33Handler( CONTEXT86 *context ) break; case 0x0001: - FIXME("Show mouse cursor\n"); + TRACE("Show mouse cursor, old hide count: %d\n", + mouse_info.hide_count); + if (mouse_info.hide_count >= 1) + mouse_info.hide_count--; + if (!mouse_info.hide_count) + VGA_ShowMouse( TRUE ); break; case 0x0002: - FIXME("Hide mouse cursor\n"); + TRACE("Hide mouse cursor, old hide count: %d\n", + mouse_info.hide_count); + if(!mouse_info.hide_count) + VGA_ShowMouse( FALSE ); + mouse_info.hide_count++; break; case 0x0003: diff --git a/dlls/winedos/vga.c b/dlls/winedos/vga.c index 00e2718992a..46d8651ffe3 100644 --- a/dlls/winedos/vga.c +++ b/dlls/winedos/vga.c @@ -653,6 +653,38 @@ int VGA_GetWindowStart() return vga_fb_window; } + +/********************************************************************** + * VGA_DoShowMouse + * + * Callback for VGA_ShowMouse. + */ +static WINAPI void VGA_DoShowMouse( ULONG_PTR show ) +{ + INT rv; + + do + { + rv = ShowCursor( show ); + } + while( show ? (rv < 0) : (rv >= 0) ); +} + + +/********************************************************************** + * VGA_ShowMouse + * + * If argument is TRUE, unconditionally show mouse cursor. + * If argument is FALSE, unconditionally hide mouse cursor. + * This only works in graphics mode. + */ +void VGA_ShowMouse( BOOL show ) +{ + if (lpddraw) + MZ_RunInThread( VGA_DoShowMouse, (ULONG_PTR)show ); +} + + /*** TEXT MODE ***/ /* prepare the text mode video memory copy that is used to only diff --git a/dlls/winedos/vga.h b/dlls/winedos/vga.h index fb3b7d3b22a..f820c2479b0 100644 --- a/dlls/winedos/vga.h +++ b/dlls/winedos/vga.h @@ -40,6 +40,7 @@ LPSTR VGA_Lock(unsigned*Pitch,unsigned*Height,unsigned*Width,unsigned*Depth); void VGA_Unlock(void); void VGA_SetWindowStart(int start); int VGA_GetWindowStart(); +void VGA_ShowMouse(BOOL show); /* text mode */ void VGA_InitAlphaMode(unsigned*Xres,unsigned*Yres);