aboutsummaryrefslogtreecommitdiff
path: root/dosmain.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-04-04 02:01:47 +0200
committerJavier <dev.git@javispedro.com>2022-04-04 02:01:47 +0200
commitc028004510a24480f93e57ccc6c7b64b79143aa4 (patch)
tree241923ad8287bda46a2bc9fc342b11ab319cdfd1 /dosmain.c
parent87397e96fd87a3741f63aa1e898d92fe8133a78e (diff)
downloadvbados-c028004510a24480f93e57ccc6c7b64b79143aa4.tar.gz
vbados-c028004510a24480f93e57ccc6c7b64b79143aa4.zip
fix colors in vga 256-color mode
Diffstat (limited to 'dosmain.c')
-rw-r--r--dosmain.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/dosmain.c b/dosmain.c
index 7196efa..1e0b072 100644
--- a/dosmain.c
+++ b/dosmain.c
@@ -29,17 +29,22 @@
#include "vbox.h"
#include "dostsr.h"
+static void detect_wheel(LPTSRDATA data)
+{
+ // Do a quick check for a mouse wheel here.
+ // The TSR will do its own check when it is reset anyway
+ if (data->haswheel = ps2m_detect_wheel()) {
+ printf("Wheel mouse found and enabled\n");
+ }
+}
+
static int set_wheel(LPTSRDATA data, bool enable)
{
printf("Setting wheel support to %s\n", enable ? "enabled" : "disabled");
data->usewheel = enable;
if (data->usewheel) {
- // Do a quick check for a mouse wheel here.
- // The TSR will do its own check when it is reset anyway
- if (data->haswheel = ps2m_detect_wheel()) {
- printf("Wheel mouse found and enabled\n");
- }
+ detect_wheel(data);
} else {
data->haswheel = false;
}
@@ -77,6 +82,7 @@ static int set_integration(LPTSRDATA data, bool enable)
printf("VirtualBox integration enabled\n");
data->vbavail = true;
+ data->vbhaveabs = true;
} else {
if (data->vbavail) {
vbox_set_mouse(&data->vb, false, false);
@@ -85,6 +91,7 @@ static int set_integration(LPTSRDATA data, bool enable)
printf("Disabled VirtualBox integration\n");
data->vbavail = false;
+ data->vbhaveabs = false;
} else {
printf("VirtualBox integration already disabled or not available\n");
}
@@ -118,7 +125,8 @@ static int configure_driver(LPTSRDATA data)
}
// Let's utilize the wheel by default
- set_wheel(data, true);
+ data->usewheel = true;
+ detect_wheel(data);
#if USE_VIRTUALBOX
// Assume initially that we want integration and host cursor