aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaroslav Hensl <jara@hensl.cz>2024-04-11 21:30:14 +0200
committerJaroslav Hensl <jara@hensl.cz>2024-04-11 21:30:14 +0200
commit15354cd08b184ebc79c55a0858e7772648c69608 (patch)
tree86cb803d53964a3bfe787e5bfbf2323cc9e4039e
parenta41d03c8271a61367ff1825229b1ac90eef313b3 (diff)
downloadvmdisp9x-1.2024.0.46.tar.gz
VIDEOPARAMETERS supportv1.2024.0.46
-rw-r--r--control.c166
-rw-r--r--ddk/tvout.h90
-rw-r--r--makefile2
3 files changed, 257 insertions, 1 deletions
diff --git a/control.c b/control.c
index 9929cc3..2828820 100644
--- a/control.c
+++ b/control.c
@@ -33,6 +33,8 @@ THE SOFTWARE.
#include <wchar.h> /* wchar_t */
#include <string.h> /* _fmemset */
+#include "tvout.h" /* VIDEOPARAMETERS */
+
#include "version.h"
#include "3d_accel.h"
@@ -109,6 +111,36 @@ const static opengl_icd_t vmwsvga_icd = {
"VMWSVGA"
};
+/* VIDEOPARAMETERS */
+static VIDEOPARAMETERS_t tvsetup = {
+ {0x02C62061UL, 0x1097, 0x11d1, 0x92, 0x0F, 0x00, 0xA0, 0x24, 0xDF, 0x15, 0x6E},
+ 0, // dwOffset;
+ 0, // dwCommand;
+ 0, // dwFlags;
+ VP_MODE_WIN_GRAPHICS, // dwMode;
+ VP_TV_STANDARD_WIN_VGA, // dwTVStandard;
+ VP_MODE_WIN_GRAPHICS | VP_MODE_TV_PLAYBACK, // dwAvailableModes;
+ VP_TV_STANDARD_NTSC_M | VP_TV_STANDARD_NTSC_M_J | VP_TV_STANDARD_PAL_B | VP_TV_STANDARD_PAL_D | VP_TV_STANDARD_PAL_H | VP_TV_STANDARD_PAL_I | VP_TV_STANDARD_PAL_M | VP_TV_STANDARD_PAL_N |
+ VP_TV_STANDARD_SECAM_B | VP_TV_STANDARD_SECAM_D | VP_TV_STANDARD_SECAM_G | VP_TV_STANDARD_SECAM_H | VP_TV_STANDARD_SECAM_K | VP_TV_STANDARD_SECAM_K1 | VP_TV_STANDARD_SECAM_L |
+ VP_TV_STANDARD_WIN_VGA | VP_TV_STANDARD_NTSC_433 | VP_TV_STANDARD_PAL_G | VP_TV_STANDARD_PAL_60 | VP_TV_STANDARD_SECAM_L1, // dwAvailableTVStandard;
+ 0, // dwFlickerFilter;
+ 0, // dwOverScanX;
+ 0, // dwOVerScanY;
+ 1000, // dwMaxUnscaledX;
+ 1000, // dwMaxUnscaledY;
+ 0, // dwPositionX;
+ 0, // dwPositionY;
+ 100, // dwBrightness;
+ 100, // dwContrast;
+ 0, // dwCPType;
+ 0, // dwCPCommand;
+ VP_TV_STANDARD_NTSC_M | VP_TV_STANDARD_NTSC_M_J | VP_TV_STANDARD_PAL_B | VP_TV_STANDARD_PAL_D | VP_TV_STANDARD_PAL_H | VP_TV_STANDARD_PAL_I | VP_TV_STANDARD_PAL_M | VP_TV_STANDARD_PAL_N |
+ VP_TV_STANDARD_SECAM_B | VP_TV_STANDARD_SECAM_D | VP_TV_STANDARD_SECAM_G | VP_TV_STANDARD_SECAM_H | VP_TV_STANDARD_SECAM_K | VP_TV_STANDARD_SECAM_K1 | VP_TV_STANDARD_SECAM_L |
+ VP_TV_STANDARD_NTSC_433 | VP_TV_STANDARD_PAL_G | VP_TV_STANDARD_PAL_60 | VP_TV_STANDARD_SECAM_L1, // dwCPStandard;
+ 0, // dwCPKey;
+ 0, // bCP_APSTriggerBits
+};
+
#pragma code_seg( _INIT )
/**
@@ -138,6 +170,10 @@ const static opengl_icd_t vmwsvga_icd = {
* removed all VMWare SVGA II commands from here and move to VXD driver
* you can use DeviceIoControl to call them
*
+ * 2024-II:
+ * added VIDEOPARAMETERS support, mostly for DVD programs that want somehow
+ * control TV out (usually disabled it).
+ *
**/
LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function,
LPVOID lpInput, LPVOID lpOutput)
@@ -155,6 +191,7 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function,
case OPENGL_GETINFO:
case OP_FBHDA_SETUP:
case MOUSETRAILS:
+ case VIDEOPARAMETERS:
rc = 1;
break;
case DCICOMMAND:
@@ -278,6 +315,135 @@ LONG WINAPI __loadds Control(LPVOID lpDevice, UINT function,
rc = 1;
}
+ else if(function == VIDEOPARAMETERS)
+ {
+ VIDEOPARAMETERS_t __far *vps = ((VIDEOPARAMETERS_t __far *)lpInput);
+ rc = 0;
+
+ if(vps->dwCommand == VP_COMMAND_GET)
+ {
+ DWORD checkMask = vps->dwFlags & (VP_FLAGS_TV_MODE | VP_FLAGS_TV_STANDARD | VP_FLAGS_FLICKER | VP_FLAGS_OVERSCAN | VP_FLAGS_MAX_UNSCALED |
+ VP_FLAGS_POSITION | VP_FLAGS_BRIGHTNESS | VP_FLAGS_CONTRAST | VP_FLAGS_COPYPROTECT);
+
+ if(checkMask == vps->dwFlags)
+ {
+ if(vps->dwFlags & VP_FLAGS_TV_MODE)
+ {
+ vps->dwMode = tvsetup.dwMode;
+ vps->dwAvailableModes = tvsetup.dwAvailableModes;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_TV_STANDARD)
+ {
+ vps->dwTVStandard = tvsetup.dwTVStandard;
+ vps->dwAvailableTVStandard = tvsetup.dwAvailableTVStandard;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_FLICKER)
+ vps->dwFlickerFilter = tvsetup.dwFlickerFilter;
+
+ if(vps->dwFlags & VP_FLAGS_OVERSCAN)
+ {
+ vps->dwOverScanX = tvsetup.dwOverScanX;
+ vps->dwOverScanY = tvsetup.dwOverScanY;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_MAX_UNSCALED)
+ {
+ vps->dwMaxUnscaledX = tvsetup.dwMaxUnscaledX;
+ vps->dwMaxUnscaledY = tvsetup.dwMaxUnscaledY;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_POSITION)
+ {
+ vps->dwPositionX = tvsetup.dwPositionX;
+ vps->dwPositionY = tvsetup.dwPositionY;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_BRIGHTNESS)
+ vps->dwBrightness = tvsetup.dwBrightness;
+
+ if(vps->dwFlags & VP_FLAGS_CONTRAST)
+ vps->dwContrast = tvsetup.dwContrast;
+
+
+ if(vps->dwFlags & VP_FLAGS_COPYPROTECT)
+ {
+ vps->dwCPType = tvsetup.dwCPType;
+ vps->dwCPStandard = tvsetup.dwCPStandard;
+ vps->bCP_APSTriggerBits = tvsetup.bCP_APSTriggerBits;
+ }
+
+ rc = 1;
+ }
+ }
+ else if(vps->dwCommand == VP_COMMAND_SET)
+ {
+ rc = 1;
+
+ if(vps->dwFlags & VP_FLAGS_TV_MODE)
+ tvsetup.dwMode = vps->dwMode;
+
+ if(vps->dwFlags & VP_FLAGS_TV_STANDARD)
+ tvsetup.dwTVStandard = vps->dwTVStandard;
+
+ if(vps->dwFlags & VP_FLAGS_FLICKER)
+ tvsetup.dwFlickerFilter = vps->dwFlickerFilter;
+
+ if(vps->dwFlags & VP_FLAGS_OVERSCAN)
+ {
+ tvsetup.dwOverScanX = vps->dwOverScanX;
+ tvsetup.dwOverScanY = vps->dwOverScanY;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_POSITION)
+ {
+ tvsetup.dwPositionX = vps->dwPositionX;
+ tvsetup.dwPositionY = vps->dwPositionY;
+ }
+
+ if(vps->dwFlags & VP_FLAGS_BRIGHTNESS)
+ tvsetup.dwBrightness = vps->dwBrightness;
+
+ if(vps->dwFlags & VP_FLAGS_CONTRAST)
+ tvsetup.dwContrast = vps->dwContrast;
+
+ if(vps->dwFlags & VP_FLAGS_COPYPROTECT)
+ {
+ switch(vps->dwCPCommand)
+ {
+ case VP_CP_CMD_ACTIVATE:
+ tvsetup.dwCPCommand = VP_CP_CMD_ACTIVATE;
+ tvsetup.dwCPType = vps->dwCPType;
+ tvsetup.dwCPKey = vps->dwCPKey;
+ tvsetup.bCP_APSTriggerBits = vps->bCP_APSTriggerBits;
+ break;
+ case VP_CP_CMD_DEACTIVATE:
+ case VP_CP_CMD_CHANGE:
+ if(tvsetup.dwCPCommand == VP_CP_CMD_ACTIVATE)
+ {
+ if(tvsetup.dwCPKey != vps->dwCPKey)
+ {
+ rc = -1;
+ }
+ else
+ {
+ tvsetup.dwCPCommand = tvsetup.dwCPCommand;
+ }
+ }
+ break;
+ default:
+ rc = 0;
+ break;
+ }
+ }
+ }
+
+ if(rc < 0) /* return RC and don't pass to DIB */
+ {
+ return rc;
+ }
+ }
/* if command accepted, return */
if(rc >= 0)
diff --git a/ddk/tvout.h b/ddk/tvout.h
new file mode 100644
index 0000000..3bea528
--- /dev/null
+++ b/ddk/tvout.h
@@ -0,0 +1,90 @@
+/* Windows 98 Display Driver Interface */
+
+#define VIDEOPARAMETERS 3077
+
+typedef struct _TVGUID {
+ unsigned long Data1;
+ unsigned short Data2;
+ unsigned short Data3;
+ unsigned char Data4[8];
+};
+
+typedef struct _VIDEOPARAMETERS {
+ struct _TVGUID Guid;
+ DWORD dwOffset;
+ DWORD dwCommand;
+ DWORD dwFlags;
+ DWORD dwMode;
+ DWORD dwTVStandard;
+ DWORD dwAvailableModes;
+ DWORD dwAvailableTVStandard;
+ DWORD dwFlickerFilter;
+ DWORD dwOverScanX;
+ DWORD dwOverScanY;
+ DWORD dwMaxUnscaledX;
+ DWORD dwMaxUnscaledY;
+ DWORD dwPositionX;
+ DWORD dwPositionY;
+ DWORD dwBrightness;
+ DWORD dwContrast;
+ DWORD dwCPType;
+ DWORD dwCPCommand;
+ DWORD dwCPStandard;
+ DWORD dwCPKey;
+ BYTE bCP_APSTriggerBits;
+ BYTE bOEMCopyProtection[256];
+} VIDEOPARAMETERS_t;
+
+#define VP_COMMAND_GET 0x0001 // return capabilities.
+ // return dwFlags = 0 if
+ // not supported.
+#define VP_COMMAND_SET 0x0002 // parameters set.
+
+#define VP_FLAGS_TV_MODE 0x0001
+#define VP_FLAGS_TV_STANDARD 0x0002
+#define VP_FLAGS_FLICKER 0x0004
+#define VP_FLAGS_OVERSCAN 0x0008
+#define VP_FLAGS_MAX_UNSCALED 0x0010 // do not use on SET
+#define VP_FLAGS_POSITION 0x0020
+#define VP_FLAGS_BRIGHTNESS 0x0040
+#define VP_FLAGS_CONTRAST 0x0080
+#define VP_FLAGS_COPYPROTECT 0x0100
+
+#define VP_MODE_WIN_GRAPHICS 0x0001 // the display is
+ // optimized for Windows
+ // FlickerFilter on and
+ // OverScan off
+#define VP_MODE_TV_PLAYBACK 0x0002 // optimize for TV video
+ // playback:
+ // FlickerFilter off and
+ // OverScan on
+
+#define VP_TV_STANDARD_NTSC_M 0x0001 // 75 IRE Setup
+#define VP_TV_STANDARD_NTSC_M_J 0x0002 // Japan, 0 IRE Setup
+#define VP_TV_STANDARD_PAL_B 0x0004
+#define VP_TV_STANDARD_PAL_D 0x0008
+#define VP_TV_STANDARD_PAL_H 0x0010
+#define VP_TV_STANDARD_PAL_I 0x0020
+#define VP_TV_STANDARD_PAL_M 0x0040
+#define VP_TV_STANDARD_PAL_N 0x0080
+#define VP_TV_STANDARD_SECAM_B 0x0100
+#define VP_TV_STANDARD_SECAM_D 0x0200
+#define VP_TV_STANDARD_SECAM_G 0x0400
+#define VP_TV_STANDARD_SECAM_H 0x0800
+#define VP_TV_STANDARD_SECAM_K 0x1000
+#define VP_TV_STANDARD_SECAM_K1 0x2000
+#define VP_TV_STANDARD_SECAM_L 0x4000
+#define VP_TV_STANDARD_WIN_VGA 0x8000 // the display can do VGA graphics
+#define VP_TV_STANDARD_NTSC_433 0x00010000
+#define VP_TV_STANDARD_PAL_G 0x00020000
+#define VP_TV_STANDARD_PAL_60 0x00040000
+#define VP_TV_STANDARD_SECAM_L1 0x00080000
+
+#define CP_TYPE_APS_TRIGGER 0x0001 // DVD trigger bits only
+#define CP_TYPE_MACROVISION 0x0002
+
+#define VP_CP_CMD_ACTIVATE 0x0001 // CP command type
+#define VP_CP_CMD_DEACTIVATE 0x0002
+#define VP_CP_CMD_CHANGE 0x0004
+
+
diff --git a/makefile b/makefile
index 27b74bb..657ddfe 100644
--- a/makefile
+++ b/makefile
@@ -11,7 +11,7 @@ OBJS += &
INCS = -I$(%WATCOM)\h\win -Iddk -Ivmware
-VER_BUILD = 44
+VER_BUILD = 45
FLAGS = -DDRV_VER_BUILD=$(VER_BUILD)