aboutsummaryrefslogtreecommitdiff
path: root/vbox.c
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2022-03-12 13:24:01 +0100
committerJavier <dev.git@javispedro.com>2022-03-12 13:24:01 +0100
commit0561b7fabde7a4e2a32437217f8dd85912c89c05 (patch)
treeedfc9f1388c4fb5560291027dfdeacfd57d2d46c /vbox.c
parenta5ae81421c666fe55bbd8c6272cc94da9acd830b (diff)
downloadvbados-0561b7fabde7a4e2a32437217f8dd85912c89c05.tar.gz
vbados-0561b7fabde7a4e2a32437217f8dd85912c89c05.zip
use int2f to detect fullscreen dosboxes in protected mode
Diffstat (limited to 'vbox.c')
-rw-r--r--vbox.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/vbox.c b/vbox.c
index 6278d6b..38673e0 100644
--- a/vbox.c
+++ b/vbox.c
@@ -270,8 +270,26 @@ int vbox_get_mouse(bool *abs, uint16_t *xpos, uint16_t *ypos)
#pragma code_seg ( "CALLBACKS" )
-/** This is a version of vbox_get_mouse() that does not call any other functions,
+/** This is a version of vbox_set_mouse() that does not call any other functions,
* and may be called inside an interrupt handler. */
+int vbox_set_mouse_locked(bool enable)
+{
+ VMMDevReqMouseStatus *req = pBuf;
+
+ req->header.size = sizeof(VMMDevReqMouseStatus);
+ req->header.version = VMMDEV_REQUEST_HEADER_VERSION;
+ req->header.requestType = VMMDevReq_SetMouseStatus;
+ req->header.rc = -1;
+ req->mouseFeatures = enable ? VMMDEV_MOUSE_GUEST_CAN_ABSOLUTE : 0;
+ req->pointerXPos = 0;
+ req->pointerYPos = 0;
+
+ vbox_send_request(bufdds.physicalAddress);
+
+ return req->header.rc;
+}
+
+/** Likewise for vbox_get_mouse() */
int vbox_get_mouse_locked(bool *abs, uint16_t *xpos, uint16_t *ypos)
{
VMMDevReqMouseStatus *req = pBuf;