From 641160f569d18f58ef2ced43dca2e811711e18b5 Mon Sep 17 00:00:00 2001 From: Peter Veenstra Date: Sun, 31 Jan 2010 15:02:41 +0000 Subject: [PATCH] Add basic granularity support. (ripsaw, rc1) Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@3541 --- src/ints/mouse.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index 8ea01c71..4cfe2d09 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -51,7 +51,7 @@ struct button_event { #define QUEUE_SIZE 32 #define MOUSE_BUTTONS 3 #define MOUSE_IRQ 12 -#define POS_X (Bit16s)(mouse.x) +#define POS_X ((Bit16s)(mouse.x) & mouse.granMask) #define POS_Y (Bit16s)(mouse.y) #define CURSORX 16 @@ -126,6 +126,7 @@ static struct { bool timer_in_progress; bool in_UIR; Bit8u mode; + Bit16s granMask; } mouse; bool Mouse_SetPS2State(bool use) { @@ -626,6 +627,7 @@ void Mouse_NewVideoMode(void) { mouse.max_x = 639; mouse.min_x = 0; mouse.min_y = 0; + mouse.granMask = (mode == 0x0d || mode == 0x13) ? 0xfffe : 0xffff; mouse.events = 0; mouse.timer_in_progress = false;