diff options
author | Jaroslav Hensl <jara@hensl.cz> | 2023-07-08 14:49:17 +0200 |
---|---|---|
committer | Jaroslav Hensl <jara@hensl.cz> | 2023-07-08 14:49:17 +0200 |
commit | 5c960bb64ec38204536dc3fb52a347d229a6768b (patch) | |
tree | 8d757c7dbd782ef77e4a7e5aeb67c8aeab885994 | |
parent | 12c9ac987f950e36f70c10769d9f37c2a26dbf4c (diff) | |
download | vmdisp9x-5c960bb64ec38204536dc3fb52a347d229a6768b.tar.gz |
resolutions above FullHD + VRAM limitation + SVGA reduce artefacts
-rw-r--r-- | control.c | 2 | ||||
-rw-r--r-- | dibcall.c | 10 | ||||
-rw-r--r-- | enable.c | 5 | ||||
-rw-r--r-- | makefile | 2 | ||||
-rw-r--r-- | minidrv.h | 7 | ||||
-rw-r--r-- | modes.c | 61 | ||||
-rw-r--r-- | vmdisp9x.inf | 98 |
7 files changed, 167 insertions, 18 deletions
@@ -551,7 +551,7 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function, {
#ifdef SVGA
longRECT __far *lpRECT = lpInput;
- SVGA_Update(lpRECT->left, lpRECT->top, lpRECT->right - lpRECT->left, lpRECT->bottom - lpRECT->top);
+ SVGA_UpdateRect(lpRECT->left, lpRECT->top, lpRECT->right - lpRECT->left, lpRECT->bottom - lpRECT->top);
#endif
}
#ifdef SVGA
@@ -82,15 +82,7 @@ void update_cursor() LONG w = cursorW;
LONG h = cursorH;
- if(x < 0) x = 0;
- if(y < 0) y = 0;
- if(x+w > wScreenX) w = wScreenX - x;
- if(y+h > wScreenY) y = wScreenY - h;
-
- if(w > 0 && h > 0)
- {
- SVGA_Update(x, y, w, h);
- }
+ SVGA_UpdateRect(x, y, w, h);
}
}
# endif
@@ -166,10 +166,7 @@ VOID WINAPI __loadds SVGA_DIB_BeginAccess( LPPDEVICE lpDevice, WORD wLeft, WORD VOID WINAPI __loadds SVGA_DIB_EndAccess( LPPDEVICE lpDevice, WORD wFlags )
{
DIB_EndAccess(lpDevice, wFlags);
- if(wBpp == 32)
- {
- SVGA_Update(updateX, updateY, updateW, updateH);
- }
+ SVGA_UpdateRect(updateX, updateY, updateW, updateH);
}
#endif
@@ -8,7 +8,7 @@ OBJS = dibthunk.obj dibcall.obj enable.obj init.obj palette.obj & INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
-VER_BUILD = 5
+VER_BUILD = 9
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD) -DCAP_R5G6B5_ALWAYS_WRONG
@@ -142,3 +142,10 @@ extern void CallVDD( unsigned Function ); /* DirectDraw support */
BOOL DDCreateDriverObject(int bReset);
+/* 9x VRAM limit */
+#define MAX_VRAM 0x8000000UL /* 128 MB */
+
+#ifdef SVGA
+#define SVGA_PARTIAL_UPDATE_MAX 16
+extern void SVGA_UpdateRect(LONG x, LONG y, LONG w, LONG h);
+#endif
@@ -46,8 +46,11 @@ THE SOFTWARE. #include <stdlib.h> /* abs */
/* Somewhat arbitrary max resolution. */
-#define RES_MAX_X (5 * 1024)
-#define RES_MAX_Y (5 * 768)
+//#define RES_MAX_X (5 * 1024)
+//#define RES_MAX_Y (5 * 768)
+#define RES_MAX_X 5120
+#define RES_MAX_Y 4096
+/* ^ JH: 5K in 5:4 */
WORD wScreenX = 0;
WORD wScreenY = 0;
@@ -193,6 +196,7 @@ static int IsModeOK( WORD wXRes, WORD wYRes, WORD wBpp ) return 0;
}
+ /* some implementations not support 8 and 16 bpp */
if(gSVGA.only32bit && wBpp != 32)
{
return 0;
@@ -204,6 +208,16 @@ static int IsModeOK( WORD wXRes, WORD wYRes, WORD wBpp ) if( dwModeMem > dwVideoMemorySize )
return( 0 );
+#ifdef SVGA
+ /* even if SVGA support other bpp, they are not usable
+ if they're larger than traceable size */
+ if(wBpp != 32)
+ {
+ if(dwModeMem > SVGA_FB_MAX_TRACEABLE_SIZE)
+ return 0;
+ }
+#endif
+
return( 1 );
}
@@ -296,6 +310,41 @@ static BOOL SVGA_hasAccelScreen() return FALSE;
}
+static DWORD SVGA_partial_update_cnt = 0;
+
+/* Update screen rect if its relevant */
+extern void __loadds SVGA_UpdateRect(LONG x, LONG y, LONG w, LONG h)
+{
+ /* SVGA commands works only for 32 bpp surfaces */
+ if(wBpp != 32)
+ {
+ return;
+ }
+
+ if(SVGA_partial_update_cnt++ > SVGA_PARTIAL_UPDATE_MAX)
+ {
+ SVGA_Update(0, 0, wScreenX, wScreenY);
+ SVGA_partial_update_cnt = 0;
+ return;
+ }
+
+ if(x < 0) x = 0;
+ if(y < 0) y = 0;
+ if(x+w > wScreenX) w = wScreenX - x;
+ if(y+h > wScreenY) y = wScreenY - h;
+
+ if(w > 0 && h > 0)
+ {
+ SVGA_Update(x, y, w, h);
+ }
+
+ /* test if it's full update */
+ if(x == 0 && y == 0 && w == wScreenX && h == wScreenY)
+ {
+ SVGA_partial_update_cnt = 0;
+ }
+}
+
/* Initialize SVGA structure and map FIFO to memory */
static int __loadds SVGA_full_init()
{
@@ -458,7 +507,7 @@ int PhysicalEnable( void ) return 0;
}
- dwVideoMemorySize = SVGA_ReadReg(SVGA_REG_VRAM_SIZE);
+ dwVideoMemorySize = SVGA_ReadReg(SVGA_REG_VRAM_SIZE);
dwPhysVRAM = SVGA_ReadReg(SVGA_REG_FB_START);
#else
int iChipID;
@@ -474,6 +523,12 @@ int PhysicalEnable( void ) dwPhysVRAM = BOXV_get_lfb_base( 0 );
# endif
#endif
+ /* limit vram size */
+ if(dwVideoMemorySize > MAX_VRAM)
+ {
+ dwVideoMemorySize = MAX_VRAM;
+ }
+
dbg_printf( "PhysicalEnable: Hardware detected, dwVideoMemorySize=%lX dwPhysVRAM=%lX\n", dwVideoMemorySize, dwPhysVRAM );
}
diff --git a/vmdisp9x.inf b/vmdisp9x.inf index 18982c0..5274eb5 100644 --- a/vmdisp9x.inf +++ b/vmdisp9x.inf @@ -209,6 +209,104 @@ HKR,"MODES\32\1920,1200" [DX.addReg]
;wined3d:HKLM,System\CurrentControlSet\Control\SessionManager\KnownDLLs,DDRAW,2,"ddrawme.dll"
+[VM.QXGA]
+HKR,"MODES\8\2048,1080"
+HKR,"MODES\24\2048,1080"
+HKR,"MODES\32\2048,1080"
+HKR,"MODES\8\2048,1536"
+HKR,"MODES\24\2048,1536"
+HKR,"MODES\32\2048,1536"
+HKR,"MODES\8\2048,1152"
+HKR,"MODES\24\2048,1152"
+HKR,"MODES\32\2048,1152"
+
+[VM.WQHD]
+HKR,"MODES\8\1920,1440"
+HKR,"MODES\24\1920,1440"
+HKR,"MODES\32\1920,1440"
+HKR,"MODES\8\2160,1440"
+HKR,"MODES\24\2160,1440"
+HKR,"MODES\32\2160,1440"
+HKR,"MODES\8\2304,1440"
+HKR,"MODES\24\2304,1440"
+HKR,"MODES\32\2304,1440"
+HKR,"MODES\8\2560,1440"
+HKR,"MODES\24\2560,1440"
+HKR,"MODES\32\2560,1440"
+HKR,"MODES\8\2880,1440"
+HKR,"MODES\24\2880,1440"
+HKR,"MODES\32\2880,1440"
+HKR,"MODES\8\2960,1440"
+HKR,"MODES\24\2960,1440"
+HKR,"MODES\32\2960,1440"
+HKR,"MODES\8\3040,1440"
+HKR,"MODES\24\3040,1440"
+HKR,"MODES\32\3040,1440"
+HKR,"MODES\8\3120,1440"
+HKR,"MODES\24\3120,1440"
+HKR,"MODES\32\3120,1440"
+HKR,"MODES\8\3200,1440"
+HKR,"MODES\24\3200,1440"
+HKR,"MODES\32\3200,1440"
+HKR,"MODES\8\3440,1440"
+HKR,"MODES\24\3440,1440"
+HKR,"MODES\32\3440,1440"
+HKR,"MODES\8\5120,1440"
+HKR,"MODES\24\5120,1440"
+HKR,"MODES\32\5120,1440"
+
+[VM.UHD]
+HKR,"MODES\8\3840,2160"
+HKR,"MODES\24\3840,2160"
+HKR,"MODES\32\3840,2160"
+HKR,"MODES\8\4096,2560"
+HKR,"MODES\24\4096,2560"
+HKR,"MODES\32\4096,2560"
+HKR,"MODES\8\4096,2304"
+HKR,"MODES\24\4096,2304"
+HKR,"MODES\32\4096,2304"
+HKR,"MODES\8\3840,2400"
+HKR,"MODES\24\3840,2400"
+HKR,"MODES\32\3840,2400"
+HKR,"MODES\8\3840,1920"
+HKR,"MODES\24\3840,1920"
+HKR,"MODES\32\3840,1920"
+HKR,"MODES\8\3840,1600"
+HKR,"MODES\24\3840,1600"
+HKR,"MODES\32\3840,1600"
+HKR,"MODES\8\3840,1080"
+HKR,"MODES\24\3840,1080"
+HKR,"MODES\32\3840,1080"
+
+[VM.R5K]
+HKR,"MODES\8\5120,1440"
+HKR,"MODES\24\5120,1440"
+HKR,"MODES\32\5120,1440"
+HKR,"MODES\8\5120,2160"
+HKR,"MODES\24\5120,2160"
+HKR,"MODES\32\5120,2160"
+HKR,"MODES\8\5120,2560"
+HKR,"MODES\24\5120,2560"
+HKR,"MODES\32\5120,2560"
+HKR,"MODES\8\4800,2700"
+HKR,"MODES\24\4800,2700"
+HKR,"MODES\32\4800,2700"
+HKR,"MODES\8\5120,2700"
+HKR,"MODES\24\5120,2700"
+HKR,"MODES\32\5120,2700"
+HKR,"MODES\8\5120,2880"
+HKR,"MODES\24\5120,2880"
+HKR,"MODES\32\5120,2880"
+HKR,"MODES\8\5120,3200"
+HKR,"MODES\24\5120,3200"
+HKR,"MODES\32\5120,3200"
+HKR,"MODES\8\5120,3840"
+HKR,"MODES\24\5120,3840"
+HKR,"MODES\32\5120,3840"
+HKR,"MODES\8\5120,4096"
+HKR,"MODES\24\5120,4096"
+HKR,"MODES\32\5120,4096"
+
[Strings]
Mfg="VirtualBox"
VBoxVideoVGA.DeviceDesc="VBox VGA PCI Adapter"
|