Posted May 15, 2018
Hi all,
Recently I've played doom/doom2 in dosbox, and vertical mouse movement is really painful. I've heard about novert, but it doesn't convince me. Also, some older games has different vertical/horizontal sensitivity (like classic shadow warrior). So I checked dosbox sources and prepared patch for separate vertical/horizontal mouse sensitivity in config.
Now in [sld] section in config You should use xsensitivity/ysensitivity for horizontal and vertical mouse sensitivity, and to disable vertical mouse movement just set ysensitivity to zero.
Link to instructions how to build dosbox:
dosbox.com/wiki/Building_DOSBox_with_MinGW
<< I cannot paste full link (I'm new user and there are some security stuff)>>
And patch below (I can't attach it to post - it seems only images works as attachments, and as I see it's missing formatting now):
Index: src/gui/sdlmain.cpp
===================================================================
--- src/gui/sdlmain.cpp (wersja 1)
+++ src/gui/sdlmain.cpp (wersja 2)
@@ -210,7 +210,8 @@
bool autoenable;
bool requestlock;
bool locked;
- Bitu sensitivity;
+ Bitu x_sensitivity;
+ Bitu y_sensitivity;
} mouse;
SDL_Rect updateRects[1024];
Bitu num_joysticks;
@@ -1088,7 +1089,8 @@
sdl.mouse.autoenable=section->Get_bool("autolock");
if (!sdl.mouse.autoenable) SDL_ShowCursor(SDL_DISABLE);
sdl.mouse.autolock=false;
- sdl.mouse.sensitivity=section->Get_int("sensitivity");
+ sdl.mouse.x_sensitivity=section->Get_int("xsensitivity");
+ sdl.mouse.y_sensitivity=section->Get_int("ysensitivity");
std::string output=section->Get_string("output");
/* Setup Mouse correctly if fullscreen */
@@ -1256,10 +1258,10 @@
static void HandleMouseMotion(SDL_MouseMotionEvent * motion) {
if (sdl.mouse.locked || !sdl.mouse.autoenable)
- Mouse_CursorMoved((float)motion->xrel*sdl.mouse.sensitivity/100.0f,
- (float)motion->yrel*sdl.mouse.sensitivity/100.0f,
- (float)(motion->x-sdl.clip.x)/(sdl.clip.w-1)*sdl.mouse.sensitivity/100.0f,
- (float)(motion->y-sdl.clip.y)/(sdl.clip.h-1)*sdl.mouse.sensitivity/100.0f,
+ Mouse_CursorMoved((float)motion->xrel*sdl.mouse.x_sensitivity/100.0f,
+ (float)motion->yrel*sdl.mouse.y_sensitivity/100.0f,
+ (float)(motion->x-sdl.clip.x)/(sdl.clip.w-1)*sdl.mouse.x_sensitivity/100.0f,
+ (float)(motion->y-sdl.clip.y)/(sdl.clip.h-1)*sdl.mouse.y_sensitivity/100.0f,
sdl.mouse.locked);
}
@@ -1495,10 +1497,14 @@
Pbool = sdl_sec->Add_bool("autolock",Property::Changeable::Always,true);
Pbool->Set_help("Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock)");
- Pint = sdl_sec->Add_int("sensitivity",Property::Changeable::Always,100);
- Pint->SetMinMax(1,1000);
- Pint->Set_help("Mouse sensitivity.");
+ Pint = sdl_sec->Add_int("xsensitivity",Property::Changeable::Always,100);
+ Pint->SetMinMax(0,1000);
+ Pint->Set_help("Mouse horizontal sensitivity.");
+ Pint = sdl_sec->Add_int("ysensitivity",Property::Changeable::Always,100);
+ Pint->SetMinMax(0,1000);
+ Pint->Set_help("Mouse vertical sensitivity.");
+
Pbool = sdl_sec->Add_bool("waitonerror",Property::Changeable::Always, true);
Pbool->Set_help("Wait before closing the console if dosbox has an error.");
Recently I've played doom/doom2 in dosbox, and vertical mouse movement is really painful. I've heard about novert, but it doesn't convince me. Also, some older games has different vertical/horizontal sensitivity (like classic shadow warrior). So I checked dosbox sources and prepared patch for separate vertical/horizontal mouse sensitivity in config.
Now in [sld] section in config You should use xsensitivity/ysensitivity for horizontal and vertical mouse sensitivity, and to disable vertical mouse movement just set ysensitivity to zero.
Link to instructions how to build dosbox:
dosbox.com/wiki/Building_DOSBox_with_MinGW
<< I cannot paste full link (I'm new user and there are some security stuff)>>
And patch below (I can't attach it to post - it seems only images works as attachments, and as I see it's missing formatting now):
Index: src/gui/sdlmain.cpp
===================================================================
--- src/gui/sdlmain.cpp (wersja 1)
+++ src/gui/sdlmain.cpp (wersja 2)
@@ -210,7 +210,8 @@
bool autoenable;
bool requestlock;
bool locked;
- Bitu sensitivity;
+ Bitu x_sensitivity;
+ Bitu y_sensitivity;
} mouse;
SDL_Rect updateRects[1024];
Bitu num_joysticks;
@@ -1088,7 +1089,8 @@
sdl.mouse.autoenable=section->Get_bool("autolock");
if (!sdl.mouse.autoenable) SDL_ShowCursor(SDL_DISABLE);
sdl.mouse.autolock=false;
- sdl.mouse.sensitivity=section->Get_int("sensitivity");
+ sdl.mouse.x_sensitivity=section->Get_int("xsensitivity");
+ sdl.mouse.y_sensitivity=section->Get_int("ysensitivity");
std::string output=section->Get_string("output");
/* Setup Mouse correctly if fullscreen */
@@ -1256,10 +1258,10 @@
static void HandleMouseMotion(SDL_MouseMotionEvent * motion) {
if (sdl.mouse.locked || !sdl.mouse.autoenable)
- Mouse_CursorMoved((float)motion->xrel*sdl.mouse.sensitivity/100.0f,
- (float)motion->yrel*sdl.mouse.sensitivity/100.0f,
- (float)(motion->x-sdl.clip.x)/(sdl.clip.w-1)*sdl.mouse.sensitivity/100.0f,
- (float)(motion->y-sdl.clip.y)/(sdl.clip.h-1)*sdl.mouse.sensitivity/100.0f,
+ Mouse_CursorMoved((float)motion->xrel*sdl.mouse.x_sensitivity/100.0f,
+ (float)motion->yrel*sdl.mouse.y_sensitivity/100.0f,
+ (float)(motion->x-sdl.clip.x)/(sdl.clip.w-1)*sdl.mouse.x_sensitivity/100.0f,
+ (float)(motion->y-sdl.clip.y)/(sdl.clip.h-1)*sdl.mouse.y_sensitivity/100.0f,
sdl.mouse.locked);
}
@@ -1495,10 +1497,14 @@
Pbool = sdl_sec->Add_bool("autolock",Property::Changeable::Always,true);
Pbool->Set_help("Mouse will automatically lock, if you click on the screen. (Press CTRL-F10 to unlock)");
- Pint = sdl_sec->Add_int("sensitivity",Property::Changeable::Always,100);
- Pint->SetMinMax(1,1000);
- Pint->Set_help("Mouse sensitivity.");
+ Pint = sdl_sec->Add_int("xsensitivity",Property::Changeable::Always,100);
+ Pint->SetMinMax(0,1000);
+ Pint->Set_help("Mouse horizontal sensitivity.");
+ Pint = sdl_sec->Add_int("ysensitivity",Property::Changeable::Always,100);
+ Pint->SetMinMax(0,1000);
+ Pint->Set_help("Mouse vertical sensitivity.");
+
Pbool = sdl_sec->Add_bool("waitonerror",Property::Changeable::Always, true);
Pbool->Set_help("Wait before closing the console if dosbox has an error.");
Post edited May 15, 2018 by K00B