Permalink
Browse files

INT 33: The code (inherited from SVN) rounds the returned mouse posit…

…ion to the text cell corner in text modes. Add option to disable this rounding and return mouse position in full integer coordinate resolution
  • Loading branch information...
joncampbell123 committed Aug 15, 2018
1 parent 7dfdca2 commit 4522938f0c8e248a84d021eb09b4eeac12150f26
Showing with 13 additions and 0 deletions.
  1. +5 −0 src/dosbox.cpp
  2. +8 −0 src/ints/mouse.cpp
View
@@ -2565,6 +2565,11 @@ void DOSBOX_SetupConfigSections(void) {
Pbool = secprop->Add_bool("int33",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable INT 33H (mouse) support.");
Pbool = secprop->Add_bool("int33 disable cell granularity",Property::Changeable::WhenIdle,false);
Pbool->Set_help("If set, the mouse pointer position is reported at full precision (as if 640x200 coordinates) in all modes.\n"
"If not set, the mouse pointer position is rounded to the top-left corner of a character cell in text modes.\n"
"This option is OFF by default.");
Pbool = secprop->Add_bool("int 13 extensions",Property::Changeable::WhenIdle,true);
Pbool->Set_help("Enable INT 13h extensions (functions 0x40-0x48). You will need this enabled if the virtual hard drive image is 8.4GB or larger.");
View
@@ -53,6 +53,7 @@ void KEYBOARD_AUX_Event(float x,float y,Bitu buttons,int scrollwheel);
bool en_int33=false;
bool en_bios_ps2mouse=false;
bool cell_granularity_disable=false;
void DisableINT33() {
if (en_int33) {
@@ -877,6 +878,11 @@ void Mouse_NewVideoMode(void) {
mouse.min_x = 0;
mouse.min_y = 0;
if (cell_granularity_disable) {
mouse.gran_x = (Bit16s)0xffff;
mouse.gran_y = (Bit16s)0xffff;
}
mouse.events = 0;
mouse.timer_in_progress = false;
PIC_RemoveEvents(MOUSE_Limit_Events);
@@ -1385,6 +1391,8 @@ void MOUSE_Startup(Section *sec) {
en_int33=section->Get_bool("int33");
if (!en_int33) return;
cell_granularity_disable=section->Get_bool("int33 disable cell granularity");
LOG(LOG_KEYBOARD,LOG_NORMAL)("INT 33H emulation enabled");
// Callback for mouse interrupt 0x33

0 comments on commit 4522938

Please sign in to comment.