aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2024-08-19 21:11:37 +0200
committerJaroslav Hensl <jara@hensl.cz>2024-08-19 21:11:37 +0200
commit9bbfec33c0344a80fccee0b25a0887f22e2d9a73 (patch)
tree6a12e0053b52b5f71dcbc227a670e796635ce3d9
parent6e547655ca3c97f57c876d349b92ee1b9b6daa5b (diff)
downloadvmdisp9x-9bbfec33c0344a80fccee0b25a0887f22e2d9a73.tar.gz
overlays + hw mouse + VMM header update
-rw-r--r--vmdisp9x.inf1
-rw-r--r--vmm.h99
-rw-r--r--vxd_main.c73
-rw-r--r--vxd_svga.c267
-rw-r--r--vxd_svga_mem.c14
-rw-r--r--vxd_svga_mouse.c14
-rw-r--r--vxd_vbe.c16
7 files changed, 423 insertions, 61 deletions
diff --git a/vmdisp9x.inf b/vmdisp9x.inf
index 90aea55..8ca6bb2 100644
--- a/vmdisp9x.inf
+++ b/vmdisp9x.inf
@@ -399,5 +399,6 @@ QemuStd.DeviceDesc="QEMU STD VGA PCI Adapter"
QemuQXL.DeviceDesc="QEMU QXL VGA PCI Adapter"
[VM.regextra]
+HKLM,Software\vmdisp9x,OVERLAY_1_SIZE,,8
; extra registry section for installers (eg. SoftGPU)
; please do not add any other section below these lines!
diff --git a/vmm.h b/vmm.h
index 87d7e67..effe3df 100644
--- a/vmm.h
+++ b/vmm.h
@@ -67,6 +67,7 @@ typedef struct tagVxD_Desc_Block
} DDB ;
#pragma pack(pop)
+//#define DDK_VERSION 0x300
//#define DDK_VERSION 0x30A
#define DDK_VERSION 0x400
//#define DDK_VERSION 0x40A
@@ -196,6 +197,8 @@ typedef struct tagVxD_Desc_Block
#define Power_Event 0x001A
+#define Sys_Dynamic_Device_Init 0x001B
+#define Sys_Dynamic_Device_Exit 0x001C
/*
* Macro to call VXD service
@@ -1132,6 +1135,8 @@ typedef struct tagCRS_32
*****************************************************************************/
#define P_SIZE 0x1000 /* page size */
+#define P_SHIFT 12
+#define _PAGE(_addr) ((_addr) >> P_SHIFT)
/******************************************************************************
*
@@ -1236,4 +1241,98 @@ struct DIOCParams
#define DIOC_OPEN DIOC_GETVERSION
#define DIOC_CLOSEHANDLE -1
+/*
+ * Data structure for Hook_Invalid_Page_Fault handlers.
+ *
+ * This is the structure of the "invalid page fault information"
+ * which is pointed to by EDI when Invalid page fault hookers
+ * are called.
+ *
+ * Page faults can occur on a VM which is not current by touching the VM at
+ * its high linear address. In this case, IPF_FaultingVM may not be the
+ * current VM, it will be set to the VM whos high linear address was touched.
+ */
+
+typedef struct IPF_Data
+{
+ ULONG IPF_LinAddr; /* CR2 address of fault */
+ ULONG IPF_MapPageNum; /* Possible converted page # of fault */
+ ULONG IPF_PTEEntry; /* Contents of PTE that faulted */
+ ULONG IPF_FaultingVM; /* May not = Current VM (IPF_V86PgH set) */
+ ULONG IPF_Flags; /* Flags */
+} IPF_Data_t;
+
+/*
+ *
+ * Install_Exception_Handler data structure
+ *
+ */
+
+struct Exception_Handler_Struc
+{
+ ULONG EH_Reserved;
+ ULONG EH_Start_EIP;
+ ULONG EH_End_EIP;
+ ULONG EH_Handler;
+};
+
+/*
+ * Flags passed in new memory manager functions
+ */
+
+/* PageReserve arena values */
+#define PR_PRIVATE 0x80000400 /* anywhere in private arena */
+#define PR_SHARED 0x80060000 /* anywhere in shared arena */
+#define PR_SYSTEM 0x80080000 /* anywhere in system arena */
+
+/* PageReserve flags */
+#define PR_FIXED 0x00000008 /* don't move during PageReAllocate */
+#define PR_4MEG 0x00000001 /* allocate on 4mb boundary */
+#define PR_STATIC 0x00000010 /* see PageReserve documentation */
+
+/* PageCommit default pager handle values */
+#define PD_ZEROINIT 0x00000001 /* swappable zero-initialized pages */
+#define PD_NOINIT 0x00000002 /* swappable uninitialized pages */
+#define PD_FIXEDZERO 0x00000003 /* fixed zero-initialized pages */
+#define PD_FIXED 0x00000004 /* fixed uninitialized pages */
+
+/* PageCommit flags */
+#define PC_FIXED 0x00000008 /* pages are permanently locked */
+#define PC_LOCKED 0x00000080 /* pages are made present and locked*/
+#define PC_LOCKEDIFDP 0x00000100 /* pages are locked if swap via DOS */
+#define PC_WRITEABLE 0x00020000 /* make the pages writeable */
+#define PC_USER 0x00040000 /* make the pages ring 3 accessible */
+#define PC_INCR 0x40000000 /* increment "pagerdata" each page */
+#define PC_PRESENT 0x80000000 /* make pages initially present */
+#define PC_STATIC 0x20000000 /* allow commit in PR_STATIC object */
+#define PC_DIRTY 0x08000000 /* make pages initially dirty */
+
+/* PageCommitContig additional flags */
+#define PCC_ZEROINIT 0x00000001 /* zero-initialize new pages */
+#define PCC_NOLIN 0x10000000 /* don't map to any linear address */
+
+/*
+ * Structure and flags for PageQuery
+ */
+#ifndef _WINNT_
+typedef struct _MEMORY_BASIC_INFORMATION
+{
+ ULONG mbi_BaseAddress;
+ ULONG mbi_AllocationBase;
+ ULONG mbi_AllocationProtect;
+ ULONG mbi_RegionSize;
+ ULONG mbi_State;
+ ULONG mbi_Protect;
+ ULONG mbi_Type;
+} MEMORY_BASIC_INFORMATION, *PMEMORY_BASIC_INFORMATION;
+
+#define PAGE_NOACCESS 0x01
+#define PAGE_READONLY 0x02
+#define PAGE_READWRITE 0x04
+#define MEM_COMMIT 0x1000
+#define MEM_RESERVE 0x2000
+#define MEM_FREE 0x10000
+#define MEM_PRIVATE 0x20000
+#endif /* _WINNT_ */
+
#endif /* __VMM_H__INCLUDED__ */
diff --git a/vxd_main.c b/vxd_main.c
index c73dc2a..b4ca31f 100644
--- a/vxd_main.c
+++ b/vxd_main.c
@@ -62,6 +62,9 @@ void __stdcall Device_Dynamic_Init_proc(DWORD VM);
void __stdcall Device_Exit_proc(DWORD VM);
void __stdcall Device_Init_Complete(DWORD VM);
+#define SERVICE_TABLE_CNT (FBHDA__OVERLAY_UNLOCK+1)
+extern DWORD service_table[SERVICE_TABLE_CNT];
+
/*
VXD structure
this variable must be in first address in code segment.
@@ -82,8 +85,8 @@ DDB VXD_DDB = {
NULL,// CS:IP of API entry point
NULL,// CS:IP of API entry point
NULL,// Reference data from real mode
- NULL,// Pointer to service table
- NULL,// Number of services
+ (DWORD)&service_table,// Pointer to service table
+ SERVICE_TABLE_CNT,// Number of services
NULL, // DDB_Win32_Service_Table
'Prev', //NULL, // prev
sizeof(DDB),
@@ -416,7 +419,9 @@ static void configure_FBHDA()
fbhda = FBHDA_setup();
if(fbhda)
- {
+ {
+ DWORD size_mb;
+
RegReadConf(HKEY_LOCAL_MACHINE, reg_path, "FORCE_SOFTWARE", &force_sw);
RegReadConf(HKEY_LOCAL_MACHINE, reg_path, "FORCE_QEMU3DFX", &force_qemu3dfx);
@@ -436,10 +441,10 @@ static void configure_FBHDA()
*ptr = '\0';
strcat(buf, "_SIZE");
- fbhda->overlays[i].size = 0;
-
- RegReadConf(HKEY_LOCAL_MACHINE, reg_path, buf, &fbhda->overlays[i].size);
-
+ size_mb = 0;
+ RegReadConf(HKEY_LOCAL_MACHINE, reg_path, buf, &size_mb);
+ fbhda->overlays[i].size = size_mb*(1024*1024);
+
if(fbhda->overlays[i].size > 0)
{
fbhda->overlays_size += fbhda->overlays[i].size;
@@ -450,7 +455,7 @@ static void configure_FBHDA()
fbhda->overlays[i].ptr = 0;
}
- dbg_printf("Overlay #%d: %ld\n", fbhda->overlays[i].size);
+ dbg_printf("Overlay #%ld: %ld\n", i, fbhda->overlays[i].size);
}
if(force_sw)
@@ -575,11 +580,19 @@ DWORD __stdcall Device_IO_Control_proc(DWORD vmhandle, struct DIOCParams *params
outBuf[0] = FBHDA_palette_get(inBuf[0]);
rc = 0;
break;
-#ifdef SVGA
case OP_FBHDA_OVERLAY_SETUP:
- //outBuf[0] = FBHDA_overlay_setup(inBuf[0], inBuf[1], inBuf[2], inBuf[3]);
+ outBuf[0] = FBHDA_overlay_setup(inBuf[0], inBuf[1], inBuf[2], inBuf[3]);
rc = 0;
break;
+ case OP_FBHDA_OVERLAY_LOCK:
+ FBHDA_overlay_lock(inBuf[0], inBuf[1], inBuf[2], inBuf[3]);
+ rc = 0;
+ break;
+ case OP_FBHDA_OVERLAY_UNLOCK:
+ FBHDA_overlay_unlock(inBuf[0]);
+ rc = 0;
+ break;
+#ifdef SVGA
case OP_SVGA_VALID:
outBuf[0] = SVGA_valid();
rc = 0;
@@ -730,3 +743,43 @@ void Device_Exit_proc(DWORD VM)
// TODO: free memory
}
+
+static DWORD __stdcall service_get_ver()
+{
+ return API_3DACCEL_VER;
+}
+
+static FBHDA_t *__stdcall service_setup()
+{
+ return FBHDA_setup();
+}
+
+static DWORD __stdcall service_overlay_setup(DWORD overlay, DWORD width, DWORD height, DWORD bpp)
+{
+ return FBHDA_overlay_setup(overlay, width, height, bpp);
+}
+
+static void __stdcall service_overlay_lock(DWORD left, DWORD top, DWORD right, DWORD bottom)
+{
+ FBHDA_overlay_lock(left, top, right, bottom);
+}
+
+static void __stdcall service_overlay_unlock(DWORD flags)
+{
+ FBHDA_overlay_unlock(flags);
+}
+
+DWORD service_table[SERVICE_TABLE_CNT] = {
+ (DWORD)&service_get_ver, // 0
+ (DWORD)&service_setup, // 1
+ 0, // 2
+ 0, // 3
+ 0, // 4
+ 0, // 5
+ 0, // 6
+ 0, // 7
+ 0, // 8
+ (DWORD)&service_overlay_setup, // 9
+ (DWORD)&service_overlay_lock, // 10
+ (DWORD)&service_overlay_unlock, // 11
+};
diff --git a/vxd_svga.c b/vxd_svga.c
index 4fad1bb..1244788 100644
--- a/vxd_svga.c
+++ b/vxd_svga.c
@@ -83,6 +83,7 @@ void *cmdbuf = NULL;
void *ctlbuf = NULL;
DWORD async_mobs = 1;
+DWORD hw_cursor = 0;
/* vxd_mouse.vxd */
BOOL mouse_get_rect(DWORD *ptr_left, DWORD *ptr_top,
@@ -94,10 +95,8 @@ BOOL mouse_get_rect(DWORD *ptr_left, DWORD *ptr_top,
* strings
*/
static char SVGA_conf_path[] = "Software\\VMWSVGA";
-/*
static char SVGA_conf_hw_cursor[] = "HWCursor";
- ^ removed, use screen target + ST_CURSOR
-*/
+/* ^ recovered */
static char SVGA_conf_vram_limit[] = "VRAMLimit";
static char SVGA_conf_rgb565bug[] = "RGB565bug";
static char SVGA_conf_cb[] = "CommandBuffers";
@@ -108,6 +107,16 @@ static char SVGA_vxd_name[] = "vmwsmini.vxd";
static char SVGA_conf_disable_multisample[] = "NoMultisample";
static char SVGA_conf_async_mobs[] = "AsyncMOBs";
+typedef struct _svga_saved_state_t
+{
+ BOOL enabled;
+ DWORD width;
+ DWORD height;
+ DWORD bpp;
+} svga_saved_state_t;
+
+static svga_saved_state_t svga_saved_state = {FALSE};
+
/**
* Notify virtual HW that is some work to do
**/
@@ -401,6 +410,7 @@ BOOL SVGA_init_hw()
RegReadConf(HKEY_LOCAL_MACHINE, SVGA_conf_path, SVGA_conf_disable_multisample, &disable_multisample);
RegReadConf(HKEY_LOCAL_MACHINE, SVGA_conf_path, SVGA_conf_async_mobs, &async_mobs);
+ RegReadConf(HKEY_LOCAL_MACHINE, SVGA_conf_path, SVGA_conf_hw_cursor, &hw_cursor);
if(async_mobs < 1)
async_mobs = 1;
@@ -639,7 +649,7 @@ BOOL SVGA3D_Init(void)
DWORD SVGA_pitch(DWORD width, DWORD bpp)
{
DWORD bp = (bpp + 7) / 8;
- return (bp * width + 3) & 0xFFFFFFFCUL;
+ return (bp * width + 15) & 0xFFFFFFF0UL;
}
static DWORD SVGA_DT_stride(DWORD w, DWORD h)
@@ -679,13 +689,14 @@ static void SVGA_defineScreen(DWORD w, DWORD h, DWORD bpp, DWORD offset)
submit_cmdbuf(cmdoff, SVGA_CB_SYNC|SVGA_CB_FORCE_FIFO, 0);
}
-static void SVGA_FillGMRFB(SVGAFifoCmdDefineGMRFB *fbgmr)
+static void SVGA_FillGMRFB(SVGAFifoCmdDefineGMRFB *fbgmr,
+ DWORD offset, DWORD pitch, DWORD bpp)
{
fbgmr->ptr.gmrId = SVGA_GMR_FRAMEBUFFER;
- fbgmr->ptr.offset = hda->surface;
- fbgmr->bytesPerLine = hda->pitch;
- fbgmr->format.colorDepth = hda->bpp;
- if(hda->bpp >= 24)
+ fbgmr->ptr.offset = offset;
+ fbgmr->bytesPerLine = pitch;
+ fbgmr->format.colorDepth = bpp;
+ if(bpp >= 24)
{
fbgmr->format.bitsPerPixel = 32;
fbgmr->format.colorDepth = 24;
@@ -707,11 +718,10 @@ static void SVGA_DefineGMRFB()
wait_for_cmdbuf();
gmrfb = SVGA_cmd_ptr(cmdbuf, &cmd_offset, SVGA_CMD_DEFINE_GMRFB, sizeof(SVGAFifoCmdDefineGMRFB));
- SVGA_FillGMRFB(gmrfb);
+ SVGA_FillGMRFB(gmrfb, hda->surface, hda->pitch, hda->bpp);
submit_cmdbuf(cmd_offset, 0, 0);
dbg_printf("SVGA_DefineGMRFB: %ld\n", hda->surface);
-
}
/**
@@ -749,29 +759,8 @@ BOOL SVGA_validmode(DWORD w, DWORD h, DWORD bpp)
return FALSE;
}
-/**
- * Set display mode
- *
- **/
-BOOL SVGA_setmode(DWORD w, DWORD h, DWORD bpp)
+static void SVGA_setmode_phy(DWORD w, DWORD h, DWORD bpp)
{
- BOOL has3D;
- if(!SVGA_validmode(w, h, bpp))
- {
- return FALSE;
- }
-
- /* free chached regions */
- /*
- SVGA_flushcache();
- ^JH: no alloc/free operations here (don't know why,
- but when VXD si called from 16 bits, these
- operations are bit unstable)
- */
-
- mouse_invalidate();
- FBHDA_access_begin(0);
-
//SVGA_OTable_unload(); // unload otables
/* Make sure, that we drain full FIFO */
@@ -832,10 +821,47 @@ BOOL SVGA_setmode(DWORD w, DWORD h, DWORD bpp)
/* start command buffer context 0 */
SVGA_CB_start();
- has3D = SVGA3D_Init();
SVGA_Sync();
-
SVGA_Flush_CB();
+}
+
+/**
+ * Set display mode
+ *
+ **/
+BOOL SVGA_setmode(DWORD w, DWORD h, DWORD bpp)
+{
+ BOOL has3D;
+ if(!SVGA_validmode(w, h, bpp))
+ {
+ return FALSE;
+ }
+
+ svga_saved_state.width = w;
+ svga_saved_state.height = h;
+ svga_saved_state.bpp = bpp;
+ svga_saved_state.enabled = TRUE;
+
+ /* when on overlay silently eat change mode requests */
+ if(hda->overlay > 0)
+ {
+ return TRUE;
+ }
+
+ /* free chached regions */
+ /*
+ SVGA_flushcache();
+ ^JH: no alloc/free operations here (don't know why,
+ but when VXD si called from 16 bits, these
+ operations are bit unstable)
+ */
+
+ mouse_invalidate();
+ FBHDA_access_begin(0);
+
+ SVGA_setmode_phy(w, h, bpp);
+
+ has3D = SVGA3D_Init();
hda->flags &= ~((DWORD)FB_SUPPORT_FLIPING);
@@ -1028,6 +1054,8 @@ void SVGA_HW_enable()
SVGA_WriteReg(SVGA_REG_ENABLE, TRUE);
SVGA_CB_start();
+
+ svga_saved_state.enabled = TRUE;
}
}
@@ -1038,6 +1066,8 @@ void SVGA_HW_disable()
SVGA_CB_stop();
SVGA_Disable();
+
+ svga_saved_state.enabled = FALSE;
}
BOOL SVGA_valid()
@@ -1048,6 +1078,18 @@ BOOL SVGA_valid()
BOOL FBHDA_swap(DWORD offset)
{
BOOL rc = FALSE;
+
+ if(hda->overlay > 0)
+ {
+ /* on overlay emulate behaviour */
+ if(offset >= hda->system_surface && hda->bpp > 8)
+ {
+ hda->surface = offset;
+ return TRUE;
+ }
+ return FALSE;
+ }
+
if(offset >= hda->system_surface) /* DON'T touch surface 0 */
{
FBHDA_access_begin(0);
@@ -1055,6 +1097,7 @@ BOOL FBHDA_swap(DWORD offset)
{
SVGA_DefineGMRFB();
hda->surface = offset;
+ rc = TRUE;
}
FBHDA_access_end(0);
}
@@ -1137,6 +1180,11 @@ static inline void check_dirty()
void FBHDA_access_rect(DWORD left, DWORD top, DWORD right, DWORD bottom)
{
+ if(hda->overlay > 0)
+ {
+ return;
+ }
+
Wait_Semaphore(hda_sem, 0);
/* dbg_printf("FBHDA_access_rect(%ld, %ld, %ld, %ld)\n",
@@ -1182,6 +1230,11 @@ void FBHDA_access_rect(DWORD left, DWORD top, DWORD right, DWORD bottom)
void FBHDA_access_begin(DWORD flags)
{
+ if(hda->overlay > 0)
+ {
+ return;
+ }
+
if(flags & (FBHDA_ACCESS_RAW_BUFFERING | FBHDA_ACCESS_MOUSE_MOVE))
{
Wait_Semaphore(hda_sem, 0);
@@ -1222,6 +1275,11 @@ void FBHDA_access_begin(DWORD flags)
void FBHDA_access_end(DWORD flags)
{
+ if(hda->overlay > 0)
+ {
+ return;
+ }
+
Wait_Semaphore(hda_sem, 0);
if(flags & FBHDA_ACCESS_MOUSE_MOVE)
@@ -1349,3 +1407,142 @@ DWORD FBHDA_palette_get(unsigned char index)
(SVGA_ReadReg(sIndex+2) & 0xFF);
}
}
+
+static DWORD ov_width = 0;
+static DWORD ov_height = 0;
+static DWORD ov_pitch = 0;
+static DWORD ov_bpp = 0;
+
+DWORD FBHDA_overlay_setup(DWORD overlay, DWORD width, DWORD height, DWORD bpp)
+{
+ dbg_printf("FBHDA_overlay_setup: %ld\n", overlay);
+
+ if(overlay >= FBHA_OVERLAYS_MAX)
+ return 0;
+
+ if(overlay == 0)
+ {
+ /* restore */
+ SVGA_setmode_phy(svga_saved_state.width, svga_saved_state.height, svga_saved_state.bpp);
+ SVGA_DefineGMRFB();
+
+ hda->overlay = 0;
+
+ if(!svga_saved_state.enabled)
+ {
+ SVGA_Disable();
+ }
+ else
+ {
+ /* redraw framebuffer */
+ FBHDA_access_begin(0);
+ FBHDA_access_end(0);
+ }
+
+ return hda->pitch;
+ }
+ else
+ {
+ if(bpp == 32)
+ {
+ SVGAFifoCmdDefineGMRFB *gmrfb;
+ DWORD cmd_offset = 0;
+
+ DWORD pitch = SVGA_pitch(width, bpp);
+ DWORD offset = ((BYTE*)hda->overlays[overlay].ptr) - ((BYTE*)hda->vram_pm32);
+ DWORD stride = pitch*height;
+
+ if(hda->overlays[overlay].size > stride)
+ {
+ hda->overlay = overlay;
+ SVGA_setmode_phy(width, height, bpp);
+
+ wait_for_cmdbuf();
+ gmrfb = SVGA_cmd_ptr(cmdbuf, &cmd_offset, SVGA_CMD_DEFINE_GMRFB, sizeof(SVGAFifoCmdDefineGMRFB));
+ SVGA_FillGMRFB(gmrfb, offset, pitch, bpp);
+ submit_cmdbuf(cmd_offset, SVGA_CB_SYNC, 0);
+
+ ov_width = width;
+ ov_height = height;
+ ov_pitch = pitch;
+ ov_bpp = bpp;
+
+ /* clear screen */
+ FBHDA_overlay_lock(0, 0, width, height);
+ memset(hda->overlays[overlay].ptr, 0, stride);
+ FBHDA_overlay_unlock(0);
+
+ return pitch;
+ }
+ } // bpp == 32
+ } // overlay > 0
+
+ return 0;
+}
+
+static int overlay_lock_cnt = 0;
+static DWORD ov_rect_left = 0;
+static DWORD ov_rect_top = 0;
+static DWORD ov_rect_right = 0;
+static DWORD ov_rect_bottom = 0;
+
+void FBHDA_overlay_lock(DWORD left, DWORD top, DWORD right, DWORD bottom)
+{
+ if(hda->overlay == 0) return;
+
+ if(overlay_lock_cnt++ == 0)
+ {
+ ov_rect_left = left;
+ ov_rect_top = top;
+ ov_rect_right = right;
+ ov_rect_bottom = bottom;
+ }
+ else
+ {
+ if(left < ov_rect_left) ov_rect_left = left;
+
+ if(top < ov_rect_top) ov_rect_top = top;
+
+ if(right > ov_rect_right) ov_rect_right = right;
+
+ if(bottom > ov_rect_bottom) ov_rect_bottom = bottom;
+
+ }
+
+ if(ov_rect_right > ov_width) ov_rect_right = ov_width;
+
+ if(ov_rect_bottom > ov_height) ov_rect_right = ov_height;
+}
+
+void FBHDA_overlay_unlock(DWORD flags)
+{
+ if(hda->overlay == 0) return;
+
+ if(--overlay_lock_cnt <= 0)
+ {
+ if(ov_rect_left < ov_rect_right && ov_rect_top < ov_rect_bottom)
+ {
+ SVGAFifoCmdBlitGMRFBToScreen *gmrblit;
+ DWORD cmd_offset = 0;
+
+ wait_for_cmdbuf();
+ gmrblit = SVGA_cmd_ptr(cmdbuf, &cmd_offset, SVGA_CMD_BLIT_GMRFB_TO_SCREEN, sizeof(SVGAFifoCmdBlitGMRFBToScreen));
+
+ gmrblit->srcOrigin.x = ov_rect_left;
+ gmrblit->srcOrigin.y = ov_rect_top;
+ gmrblit->destRect.left = ov_rect_left;
+ gmrblit->destRect.top = ov_rect_top;
+ gmrblit->destRect.right = ov_rect_right;
+ gmrblit->destRect.bottom = ov_rect_bottom;
+
+ gmrblit->destScreenId = 0;
+
+ submit_cmdbuf(cmd_offset, SVGA_CB_UPDATE, 0);
+ }
+
+ if(overlay_lock_cnt < 0)
+ {
+ overlay_lock_cnt = 0;
+ }
+ }
+}
diff --git a/vxd_svga_mem.c b/vxd_svga_mem.c
index 8476353..727ced7 100644
--- a/vxd_svga_mem.c
+++ b/vxd_svga_mem.c
@@ -109,23 +109,23 @@ extern LONG fb_lock_cnt;
extern BOOL gb_support;
-
/**
* Return PPN (physical page number) to virtual address
*
**/
+
static DWORD getPPN(DWORD virtualaddr)
{
DWORD phy = 0;
- _CopyPageTable(virtualaddr/P_SIZE, 1, &phy, 0);
- return phy/P_SIZE;
+ _CopyPageTable(_PAGE(virtualaddr), 1, &phy, 0);
+ return _PAGE(phy);
}
/**
* Return PPN for pointer
*
**/
-static DWORD getPtrPPN(void *ptr)
+static inline DWORD getPtrPPN(void *ptr)
{
return getPPN((DWORD)ptr);
}
@@ -681,7 +681,7 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
if(laddr)
{
desc = (SVGAGuestMemDescriptor*)laddr;
- desc->ppn = (phy/P_SIZE)+1;
+ desc->ppn = _PAGE(phy)+1;
desc->numPages = nPages;
desc++;
desc->ppn = 0;
@@ -689,9 +689,9 @@ BOOL SVGA_region_create(SVGA_region_info_t *rinfo)
rinfo->address = (void*)(laddr+P_SIZE);
rinfo->region_address = 0;
- rinfo->region_ppn = (phy/P_SIZE);
+ rinfo->region_ppn = _PAGE(phy);
rinfo->mob_address = 0;
- rinfo->mob_ppn = (phy/P_SIZE)+1;
+ rinfo->mob_ppn = _PAGE(phy)+1;
rinfo->mob_pt_depth = SVGA3D_MOBFMT_RANGE;
//dbg_printf(dbg_region_simple, laddr, rinfo->address);
diff --git a/vxd_svga_mouse.c b/vxd_svga_mouse.c
index 7769c49..8f373df 100644
--- a/vxd_svga_mouse.c
+++ b/vxd_svga_mouse.c
@@ -45,6 +45,7 @@ THE SOFTWARE.
#include "vxd_strings.h"
extern FBHDA_t *hda;
+extern DWORD hw_cursor;
static BOOL hw_cursor_valid = FALSE;
static BOOL hw_cursor_visible = FALSE;
@@ -192,19 +193,14 @@ BOOL SVGA_mouse_load()
BOOL SVGA_mouse_hw()
{
-#if 0
- if(st_used)
+ if(hw_cursor)
{
- if(st_flags & ST_CURSOR)
+ if(SVGA_HasFIFOCap(SVGA_FIFO_CAP_CURSOR_BYPASS_3))
{
- if(SVGA_HasFIFOCap(SVGA_FIFO_CAP_CURSOR_BYPASS_3))
- {
- return TRUE;
- }
+ return TRUE;
}
}
-#endif
-
+
return FALSE;
}
diff --git a/vxd_vbe.c b/vxd_vbe.c
index 9fe6673..bf4cf3f 100644
--- a/vxd_vbe.c
+++ b/vxd_vbe.c
@@ -336,3 +336,19 @@ void FBHDA_access_end(DWORD flags)
//Signal_Semaphore(hda_sem);
}
+
+DWORD FBHDA_overlay_setup(DWORD overlay, DWORD width, DWORD height, DWORD bpp)
+{
+ return 0;
+}
+
+void FBHDA_overlay_lock(DWORD left, DWORD top, DWORD right, DWORD bottom)
+{
+
+}
+
+void FBHDA_overlay_unlock(DWORD flags)
+{
+
+}
+