From ebc95ab27e5833a51e64cb98cd0b45a2e849ac38 Mon Sep 17 00:00:00 2001 From: Ulf Wohlers Date: Sun, 22 Dec 2002 17:03:29 +0000 Subject: [PATCH] INT10 tells mouse about resolution change Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@598 --- src/ints/int10_modes.cpp | 3 +++ src/ints/mouse.cpp | 12 +++++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/ints/int10_modes.cpp b/src/ints/int10_modes.cpp index d7a05802..1f578972 100644 --- a/src/ints/int10_modes.cpp +++ b/src/ints/int10_modes.cpp @@ -20,6 +20,7 @@ #include "mem.h" #include "inout.h" #include "int10.h" +#include "mouse.h" //TODO Maybe also add PCJR Video Modes could be nice :) //TODO include some credits to bochs/plex86 bios i used for info/tables @@ -409,6 +410,8 @@ void INT10_SetVideoMode(Bit8u mode) { INT10_SetActivePage(0); /* Set some interrupt vectors */ RealSetVec(0x43,int10_romarea.font_8_first); + /* Tell mouse resolution change */ + Mouse_SetResolution(vga_modes[line].swidth,vga_modes[line].sheight); }; void INT10_SetGfxControllerToDefault() diff --git a/src/ints/mouse.cpp b/src/ints/mouse.cpp index 0a962314..8d88ec49 100644 --- a/src/ints/mouse.cpp +++ b/src/ints/mouse.cpp @@ -388,14 +388,20 @@ static void SetMickeyPixelRate(Bit16s px, Bit16s py) } }; -static void mouse_reset(void) { +void Mouse_SetResolution(Bit16u width, Bit16u height) +{ + mouse.max_x = width-1; + mouse.max_y = height-1; +}; + +static void mouse_reset(void) +{ WriteMouseIntVector(); real_writed(0,(0x74<<2),CALLBACK_RealPointer(call_int74)); mouse.shown=-1; mouse.min_x=0; - mouse.max_x=639; mouse.min_y=0; - mouse.max_y=199; + // Dont set max coordinates here. it is done by SetResolution! mouse.x=0; // civ wont work otherwise mouse.y=100; mouse.events=0;