Implement update region in mouse driver; only text modes for now. Fixes mouse pointer problems in Microsoft Programmer's Library.
Imported-from: https://svn.code.sf.net/p/dosbox/code-0/dosbox/trunk@4062
This commit is contained in:
parent
e24b034d20
commit
29bb526d20
1 changed files with 15 additions and 11 deletions
|
@ -113,8 +113,8 @@ static struct {
|
|||
Bit16u dspeed_val;
|
||||
float senv_x;
|
||||
float senv_y;
|
||||
Bit16u updateRegion_x[2];
|
||||
Bit16u updateRegion_y[2];
|
||||
Bit16s updateRegion_x[2];
|
||||
Bit16s updateRegion_y[2];
|
||||
Bit16u doubleSpeedThreshold;
|
||||
Bit16u language;
|
||||
Bit16u cursorType;
|
||||
|
@ -251,6 +251,11 @@ void DrawCursorText() {
|
|||
// Restore Background
|
||||
RestoreCursorBackgroundText();
|
||||
|
||||
// Check if cursor in update region
|
||||
if ((POS_Y <= mouse.updateRegion_y[1]) && (POS_Y >= mouse.updateRegion_y[0]) &&
|
||||
(POS_X <= mouse.updateRegion_x[1]) && (POS_X >= mouse.updateRegion_x[0])) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Save Background
|
||||
mouse.backposx = POS_X>>3;
|
||||
|
@ -674,10 +679,7 @@ void Mouse_AfterNewVideoMode(bool setmode) {
|
|||
mouse.language = 0;
|
||||
mouse.page = 0;
|
||||
mouse.doubleSpeedThreshold = 64;
|
||||
mouse.updateRegion_x[0] = 1;
|
||||
mouse.updateRegion_y[0] = 1;
|
||||
mouse.updateRegion_x[1] = 1;
|
||||
mouse.updateRegion_y[1] = 1;
|
||||
mouse.updateRegion_y[1] = -1; //offscreen
|
||||
mouse.cursorType = 0; //Test
|
||||
mouse.enabled=true;
|
||||
|
||||
|
@ -716,6 +718,7 @@ static Bitu INT33_Handler(void) {
|
|||
break;
|
||||
case 0x01: /* Show Mouse */
|
||||
if(mouse.hidden) mouse.hidden--;
|
||||
mouse.updateRegion_y[1] = -1; //offscreen
|
||||
Mouse_AutoLock(true);
|
||||
DrawCursor();
|
||||
break;
|
||||
|
@ -838,11 +841,12 @@ static Bitu INT33_Handler(void) {
|
|||
case 0x0f: /* Define mickey/pixel rate */
|
||||
Mouse_SetMickeyPixelRate(reg_cx,reg_dx);
|
||||
break;
|
||||
case 0x10: /* Define screen region for updating */
|
||||
mouse.updateRegion_x[0]=reg_cx;
|
||||
mouse.updateRegion_y[0]=reg_dx;
|
||||
mouse.updateRegion_x[1]=reg_si;
|
||||
mouse.updateRegion_y[1]=reg_di;
|
||||
case 0x10: /* Define screen region for updating */
|
||||
mouse.updateRegion_x[0]=(Bit16s)reg_cx;
|
||||
mouse.updateRegion_y[0]=(Bit16s)reg_dx;
|
||||
mouse.updateRegion_x[1]=(Bit16s)reg_si;
|
||||
mouse.updateRegion_y[1]=(Bit16s)reg_di;
|
||||
DrawCursor();
|
||||
break;
|
||||
case 0x11: /* Get number of buttons */
|
||||
reg_ax=0xffff;
|
||||
|
|
Loading…
Add table
Reference in a new issue