1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_02_54_src

Former-commit-id: e2b4f337b42715b91998e03b806274b81ea37f67
This commit is contained in:
gho tik 2014-01-19 11:38:43 -05:00 committed by Refael ACkermann
parent a17992ec84
commit 69f263988a
45 changed files with 5113 additions and 836 deletions

118
Include/3DFX.H Normal file
View File

@ -0,0 +1,118 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Revision: 9 $
** $Date: 12/23/97 9:57a $
*/
#ifndef __3DFX_H__
#define __3DFX_H__
/*
** basic data types
*/
typedef unsigned char FxU8;
typedef signed char FxI8;
typedef unsigned short FxU16;
typedef signed short FxI16;
typedef signed long FxI32;
typedef unsigned long FxU32;
typedef int FxBool;
typedef float FxFloat;
typedef double FxDouble;
/*
** color types
*/
typedef unsigned long FxColor_t;
typedef struct { float r, g, b, a; } FxColor4;
/*
** fundamental types
*/
#define FXTRUE 1
#define FXFALSE 0
/*
** helper macros
*/
#define FXUNUSED( a ) ((void)(a))
#define FXBIT( i ) ( 1L << (i) )
/*
** export macros
*/
#if defined(__MSC__)
# if defined (MSVC16)
# define FX_ENTRY
# define FX_CALL
# else
# define FX_ENTRY extern
# define FX_CALL __stdcall
# endif
#elif defined(__WATCOMC__)
# define FX_ENTRY extern
# define FX_CALL __stdcall
#elif defined (__IBMC__) || defined (__IBMCPP__)
/* IBM Visual Age C/C++: */
# define FX_ENTRY extern
# define FX_CALL __stdcall
#elif defined(__DJGPP__)
# define FX_ENTRY extern
# define FX_CALL
#elif defined(__unix__)
# define FX_ENTRY extern
# define FX_CALL
#elif defined(__MWERKS__)
# if macintosh
# define FX_ENTRY extern
# define FX_CALL
# else /* !macintosh */
# error "Unknown MetroWerks target platform"
# endif /* !macintosh */
#else
# warning define FX_ENTRY & FX_CALL for your compiler
# define FX_ENTRY extern
# define FX_CALL
#endif
/*
** x86 compiler specific stuff
*/
#if defined(__BORLANDC_)
# define REALMODE
# define REGW( a, b ) ((a).x.b)
# define REGB( a, b ) ((a).h.b)
# define INT86( a, b, c ) int86(a,b,c)
# define INT86X( a, b, c, d ) int86x(a,b,c,d)
# define RM_SEG( a ) FP_SEG( a )
# define RM_OFF( a ) FP_OFF( a )
#elif defined(__WATCOMC__)
# undef FP_SEG
# undef FP_OFF
# define REGW( a, b ) ((a).w.b)
# define REGB( a, b ) ((a).h.b)
# define INT86( a, b, c ) int386(a,b,c)
# define INT86X( a, b, c, d ) int386x(a,b,c,d)
# define RM_SEG( a ) ( ( ( ( FxU32 ) (a) ) & 0x000F0000 ) >> 4 )
# define RM_OFF( a ) ( ( FxU16 ) (a) )
#endif
#endif /* !__3DFX_H__ */

125
Include/FXDLL.H Normal file
View File

@ -0,0 +1,125 @@
/*
** Copyright (c) 1995, 1996, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Revision: 9 $
** $Date: 7/24/98 1:37p $
*/
/* preprocessor defines for libraries to support DLL creation */
/* in header file, use FX_ENTRY return-type FX_CALL function-name ( ... ) */
/* in source file, use FX_EXPORT return-type FX_CSTYLE function-name (... ) */
/* in source file, set FX_DLL_DEFINITION, include this file, then include
header file for library. */
/* we need to use two macros per declaration/definition because MSVC
requires __stdcall and __declspec( dllexport ) be in different parts
of the prototype! */
/* I use two sets in case we need to control declarations and definitions
differently. If it turns out we don't, it should be easy to do a search
and replace to eliminate one set */
/* NOTE: this header file may be included more than once, and FX_DLL_DEFINITION
may have changed, so we do not protect this with an #fndef __FXDLL_H__
statement like we normally would. */
#ifdef FX_ENTRY
#undef FX_ENTRY
#endif
#ifdef FX_CALL
#undef FX_CALL
#endif
#ifdef FX_EXPORT
#undef FX_EXPORT
#endif
#ifdef FX_CSTYLE
#undef FX_CSTYLE
#endif
#if defined(FX_DLL_DEFINITION)
#if defined(FX_DLL_ENABLE)
#if defined(__MSC__)
#ifndef KERNEL
#define FX_ENTRY __declspec( dllexport )
#define FX_EXPORT __declspec( dllexport )
#else
#define FX_ENTRY
#define FX_EXPORT
#endif /* #ifndef KERNEL */
#define FX_CALL __stdcall
#define FX_CSTYLE __stdcall
#elif defined(__WATCOMC__)
#define FX_ENTRY
#define FX_CALL __stdcall __export
#define FX_EXPORT
#define FX_CSTYLE __stdcall __export
#else /* compiler */
#error define FX_ENTRY,FX_CALL & FX_EXPORT,FX_CSTYLE for your compiler
#endif /* compiler */
#else /* FX_DLL_ENABLE */
#define FX_ENTRY
#define FX_CALL __stdcall
#define FX_EXPORT
#define FX_CSTYLE __stdcall
#endif /* FX_DLL_ENABLE */
#else /* FX_DLL_DEFINITION */
#define FX_ENTRY extern
#define FX_CALL __stdcall
#endif /* FX_DLL_DEFINITION */
/*
* We don't want any of this DLL junk for DJGPP or UNIX
* so undo what is done above.
*/
#if defined(__DJGPP__) || defined(__unix__)
#ifdef FX_CALL
#undef FX_CALL
#endif
#ifdef FX_CSTYLE
#undef FX_CSTYLE
#endif
#ifdef FX_EXPORT
#undef FX_EXPORT
#endif
#ifdef FX_ENTRY
#undef FX_ENTRY
#endif
#define FX_CALL
#define FX_CSTYLE
#define FX_EXPORT
#define FX_ENTRY
#endif
#if defined (MSVC16)
#undef FX_CALL
#define FX_CALL
#endif

30
Include/FXGLOB.H Normal file
View File

@ -0,0 +1,30 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $ Revision: $
** $ Date: $
**
*/
#ifndef _FXGLOB_H_
#define _FXGLOB_H_
void fxGlobify( int *argc, char ***argv );
#endif

50
Include/FXOS.H Normal file
View File

@ -0,0 +1,50 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $ Revision: $
** $ Date: $
**
*/
#ifndef _FXOS_H_
#define _FXOS_H_
#include <stdio.h>
# ifdef __cplusplus
extern "C" {
# endif
# ifdef WIN32
void sleep(int secs);
#define gethostname fxGethostname
int gethostname(char *name, int namelen);
# endif
float fxTime(void);
float timer(int flag);
FILE *fxFopenPath(const char *filename, const char *mode,
const char *path, const char **pprefix);
# ifdef __cplusplus
}
# endif
#endif

111
Include/SST1VID.H Normal file
View File

@ -0,0 +1,111 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Header: /devel/cvg/incsrc/SST1VID.H 6 7/24/98 1:41p Hohn $
** $Log: /devel/cvg/incsrc/SST1VID.H $
**
** 6 7/24/98 1:41p Hohn
**
** 5 3/10/98 2:33p Psmith
** separating cvg tree from h3/h4 trees
*
* 4 9/09/97 7:35p Sellers
* Added 400x300 resolution
*
* 3 8/24/97 9:31a Sellers
* moved new video timing to sst1vid.h
* redefined 1600x1280 to be 1600x1200
*
* 2 6/05/97 11:14p Pgj
*
* 5 7/24/96 3:43p Sellers
* added 512x384 @ 60 Hz for arcade monitors
* added 512x256 @ 60 Hz for arcade monitors
*
* 4 7/18/96 10:58a Sellers
* fixed FT and TF clock delay values for lower frequencies with
* .5/.5 combos
*
* 3 6/18/96 6:54p Sellers
* added sst1InitShutdownSli() to fix Glide Splash screen problems with
* SLI
*
* 2 6/13/96 7:45p Sellers
* added "voodoo.ini" support
* added DirectX support
* misc cleanup
*
* 2 6/11/96 1:43p Sellers
* added support for 60, 75, 85, and 120 Hz refresh rates for "most"
* resolutions
*
* 1 5/08/96 5:43p Paik
* Video definitions
*/
#ifndef __SST1VID_H__
#define __SST1VID_H__
#ifdef __cplusplus
extern "C" {
#endif
/* Video defines */
typedef FxI32 GrScreenRefresh_t;
#define GR_REFRESH_60Hz 0x0
#define GR_REFRESH_70Hz 0x1
#define GR_REFRESH_72Hz 0x2
#define GR_REFRESH_75Hz 0x3
#define GR_REFRESH_80Hz 0x4
#define GR_REFRESH_90Hz 0x5
#define GR_REFRESH_100Hz 0x6
#define GR_REFRESH_85Hz 0x7
#define GR_REFRESH_120Hz 0x8
#define GR_REFRESH_NONE 0xff
typedef FxI32 GrScreenResolution_t;
#define GR_RESOLUTION_320x200 0x0
#define GR_RESOLUTION_320x240 0x1
#define GR_RESOLUTION_400x256 0x2
#define GR_RESOLUTION_512x384 0x3
#define GR_RESOLUTION_640x200 0x4
#define GR_RESOLUTION_640x350 0x5
#define GR_RESOLUTION_640x400 0x6
#define GR_RESOLUTION_640x480 0x7
#define GR_RESOLUTION_800x600 0x8
#define GR_RESOLUTION_960x720 0x9
#define GR_RESOLUTION_856x480 0xa
#define GR_RESOLUTION_512x256 0xb
#define GR_RESOLUTION_1024x768 0xC
#define GR_RESOLUTION_1280x1024 0xD
#define GR_RESOLUTION_1600x1200 0xE
#define GR_RESOLUTION_400x300 0xF
#define GR_RESOLUTION_NONE 0xff
#ifdef GR_RESOLUTION_MAX
#undef GR_RESOLUTION_MAX
#endif
#ifdef GR_RESOLUTION_MIN
#undef GR_RESOLUTION_MIN
#endif
#define GR_RESOLUTION_MIN GR_RESOLUTION_320x200
#define GR_RESOLUTION_MAX GR_RESOLUTION_1600x1200
#ifdef __cplusplus
}
#endif
#endif /* __SST1VID_H__ */

View File

@ -92,7 +92,7 @@
#define EMULATEREGISTRY 0x00000400 // Emulate registry api to read extra keys
#define CDROMDRIVETYPE 0x00000800 // Pretends that GetDriveType() always returns DRIVE_CDROM
#define NOWINDOWMOVE 0x00001000 // Do not try to update window position & size on D3D rendering
#define DISABLEHAL 0x00002000 // Disable HAL support (IID_IDirect3DHALDevice)
#define DISABLEHAL 0x00002000 // Disable HAL support (IID_IDirect3DHALDevice) - no longer used
#define LOCKSYSCOLORS 0x00004000 // Lock Sys Colors changes by SetSysColors() call
#define GDIEMULATEDC 0x00008000 // Map GDI/user32 calls to primary to a memory surface to be stretch-blitted to the primary
#define FULLSCREENONLY 0x00010000 // assume that the program is always in fullscreen mode
@ -127,6 +127,7 @@
#define INTERCEPTRDTSC 0x00000800 // Intercapts RDTSC opcodes to hook at assembly level
#define LIMITSCREENRES 0x00001000 // Limit available screen resolution up to defined maximum
#define NOFILLRECT 0x00002000 // Suppress FillRect calls
#define HOOKGLIDE 0x00004000 // Hook glide calls
// logging Tflags DWORD:
#define OUTTRACE 0x00000001 // enables tracing to dxwnd.log in general

917
Include/glide.h Normal file
View File

@ -0,0 +1,917 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
*/
/*
** GLIDE.H
**
** The following #defines are relevant when using Glide:
**
** One of the following "platform constants" must be defined during
** compilation:
**
** __DOS__ Defined for 32-bit DOS applications
** __WIN32__ Defined for 32-bit Windows applications
** __sparc__ Defined for Sun Solaris/SunOS
** __linux__ Defined for Linux applications
** __IRIX__ Defined for SGI Irix applications
**
*/
#ifndef __GLIDE_H__
#define __GLIDE_H__
#include <3dfx.h>
#include <glidesys.h>
#include <sst1vid.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
** -----------------------------------------------------------------------
** TYPE DEFINITIONS
** -----------------------------------------------------------------------
*/
typedef FxU32 GrColor_t;
typedef FxU8 GrAlpha_t;
typedef FxU32 GrMipMapId_t;
typedef FxU8 GrFog_t;
typedef FxU32 GrContext_t;
typedef int (__stdcall *GrProc)();
/*
** -----------------------------------------------------------------------
** CONSTANTS AND TYPES
** -----------------------------------------------------------------------
*/
#define GR_NULL_MIPMAP_HANDLE ((GrMipMapId_t) -1)
#define GR_MIPMAPLEVELMASK_EVEN FXBIT(0)
#define GR_MIPMAPLEVELMASK_ODD FXBIT(1)
#define GR_MIPMAPLEVELMASK_BOTH (GR_MIPMAPLEVELMASK_EVEN | GR_MIPMAPLEVELMASK_ODD )
#define GR_LODBIAS_BILINEAR 0.5
#define GR_LODBIAS_TRILINEAR 0.0
typedef FxI32 GrChipID_t;
#define GR_TMU0 0x0
#define GR_TMU1 0x1
#define GR_TMU2 0x2
#define GR_FBI 0x0
typedef FxI32 GrCombineFunction_t;
#define GR_COMBINE_FUNCTION_ZERO 0x0
#define GR_COMBINE_FUNCTION_NONE GR_COMBINE_FUNCTION_ZERO
#define GR_COMBINE_FUNCTION_LOCAL 0x1
#define GR_COMBINE_FUNCTION_LOCAL_ALPHA 0x2
#define GR_COMBINE_FUNCTION_SCALE_OTHER 0x3
#define GR_COMBINE_FUNCTION_BLEND_OTHER GR_COMBINE_FUNCTION_SCALE_OTHER
#define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL 0x4
#define GR_COMBINE_FUNCTION_SCALE_OTHER_ADD_LOCAL_ALPHA 0x5
#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL 0x6
#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL 0x7
#define GR_COMBINE_FUNCTION_BLEND GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL
#define GR_COMBINE_FUNCTION_SCALE_OTHER_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x8
#define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL 0x9
#define GR_COMBINE_FUNCTION_BLEND_LOCAL GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL
#define GR_COMBINE_FUNCTION_SCALE_MINUS_LOCAL_ADD_LOCAL_ALPHA 0x10
typedef FxI32 GrCombineFactor_t;
#define GR_COMBINE_FACTOR_ZERO 0x0
#define GR_COMBINE_FACTOR_NONE GR_COMBINE_FACTOR_ZERO
#define GR_COMBINE_FACTOR_LOCAL 0x1
#define GR_COMBINE_FACTOR_OTHER_ALPHA 0x2
#define GR_COMBINE_FACTOR_LOCAL_ALPHA 0x3
#define GR_COMBINE_FACTOR_TEXTURE_ALPHA 0x4
#define GR_COMBINE_FACTOR_TEXTURE_RGB 0x5
#define GR_COMBINE_FACTOR_DETAIL_FACTOR GR_COMBINE_FACTOR_TEXTURE_ALPHA
#define GR_COMBINE_FACTOR_LOD_FRACTION 0x5
#define GR_COMBINE_FACTOR_ONE 0x8
#define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL 0x9
#define GR_COMBINE_FACTOR_ONE_MINUS_OTHER_ALPHA 0xa
#define GR_COMBINE_FACTOR_ONE_MINUS_LOCAL_ALPHA 0xb
#define GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA 0xc
#define GR_COMBINE_FACTOR_ONE_MINUS_DETAIL_FACTOR GR_COMBINE_FACTOR_ONE_MINUS_TEXTURE_ALPHA
#define GR_COMBINE_FACTOR_ONE_MINUS_LOD_FRACTION 0xd
typedef FxI32 GrCombineLocal_t;
#define GR_COMBINE_LOCAL_ITERATED 0x0
#define GR_COMBINE_LOCAL_CONSTANT 0x1
#define GR_COMBINE_LOCAL_NONE GR_COMBINE_LOCAL_CONSTANT
#define GR_COMBINE_LOCAL_DEPTH 0x2
typedef FxI32 GrCombineOther_t;
#define GR_COMBINE_OTHER_ITERATED 0x0
#define GR_COMBINE_OTHER_TEXTURE 0x1
#define GR_COMBINE_OTHER_CONSTANT 0x2
#define GR_COMBINE_OTHER_NONE GR_COMBINE_OTHER_CONSTANT
typedef FxI32 GrAlphaSource_t;
#define GR_ALPHASOURCE_CC_ALPHA 0x0
#define GR_ALPHASOURCE_ITERATED_ALPHA 0x1
#define GR_ALPHASOURCE_TEXTURE_ALPHA 0x2
#define GR_ALPHASOURCE_TEXTURE_ALPHA_TIMES_ITERATED_ALPHA 0x3
typedef FxI32 GrColorCombineFnc_t;
#define GR_COLORCOMBINE_ZERO 0x0
#define GR_COLORCOMBINE_CCRGB 0x1
#define GR_COLORCOMBINE_ITRGB 0x2
#define GR_COLORCOMBINE_ITRGB_DELTA0 0x3
#define GR_COLORCOMBINE_DECAL_TEXTURE 0x4
#define GR_COLORCOMBINE_TEXTURE_TIMES_CCRGB 0x5
#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB 0x6
#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_DELTA0 0x7
#define GR_COLORCOMBINE_TEXTURE_TIMES_ITRGB_ADD_ALPHA 0x8
#define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA 0x9
#define GR_COLORCOMBINE_TEXTURE_TIMES_ALPHA_ADD_ITRGB 0xa
#define GR_COLORCOMBINE_TEXTURE_ADD_ITRGB 0xb
#define GR_COLORCOMBINE_TEXTURE_SUB_ITRGB 0xc
#define GR_COLORCOMBINE_CCRGB_BLEND_ITRGB_ON_TEXALPHA 0xd
#define GR_COLORCOMBINE_DIFF_SPEC_A 0xe
#define GR_COLORCOMBINE_DIFF_SPEC_B 0xf
#define GR_COLORCOMBINE_ONE 0x10
typedef FxI32 GrAlphaBlendFnc_t;
#define GR_BLEND_ZERO 0x0
#define GR_BLEND_SRC_ALPHA 0x1
#define GR_BLEND_SRC_COLOR 0x2
#define GR_BLEND_DST_COLOR GR_BLEND_SRC_COLOR
#define GR_BLEND_DST_ALPHA 0x3
#define GR_BLEND_ONE 0x4
#define GR_BLEND_ONE_MINUS_SRC_ALPHA 0x5
#define GR_BLEND_ONE_MINUS_SRC_COLOR 0x6
#define GR_BLEND_ONE_MINUS_DST_COLOR GR_BLEND_ONE_MINUS_SRC_COLOR
#define GR_BLEND_ONE_MINUS_DST_ALPHA 0x7
#define GR_BLEND_RESERVED_8 0x8
#define GR_BLEND_RESERVED_9 0x9
#define GR_BLEND_RESERVED_A 0xa
#define GR_BLEND_RESERVED_B 0xb
#define GR_BLEND_RESERVED_C 0xc
#define GR_BLEND_RESERVED_D 0xd
#define GR_BLEND_RESERVED_E 0xe
#define GR_BLEND_ALPHA_SATURATE 0xf
#define GR_BLEND_PREFOG_COLOR GR_BLEND_ALPHA_SATURATE
typedef FxI32 GrAspectRatio_t;
#define GR_ASPECT_LOG2_8x1 3 /* 8W x 1H */
#define GR_ASPECT_LOG2_4x1 2 /* 4W x 1H */
#define GR_ASPECT_LOG2_2x1 1 /* 2W x 1H */
#define GR_ASPECT_LOG2_1x1 0 /* 1W x 1H */
#define GR_ASPECT_LOG2_1x2 -1 /* 1W x 2H */
#define GR_ASPECT_LOG2_1x4 -2 /* 1W x 4H */
#define GR_ASPECT_LOG2_1x8 -3 /* 1W x 8H */
typedef FxI32 GrBuffer_t;
#define GR_BUFFER_FRONTBUFFER 0x0
#define GR_BUFFER_BACKBUFFER 0x1
#define GR_BUFFER_AUXBUFFER 0x2
#define GR_BUFFER_DEPTHBUFFER 0x3
#define GR_BUFFER_ALPHABUFFER 0x4
#define GR_BUFFER_TRIPLEBUFFER 0x5
typedef FxI32 GrChromakeyMode_t;
#define GR_CHROMAKEY_DISABLE 0x0
#define GR_CHROMAKEY_ENABLE 0x1
typedef FxI32 GrChromaRangeMode_t;
#define GR_CHROMARANGE_RGB_ALL_EXT 0x0
#define GR_CHROMARANGE_DISABLE_EXT 0x00
#define GR_CHROMARANGE_ENABLE_EXT 0x01
typedef FxI32 GrTexChromakeyMode_t;
#define GR_TEXCHROMA_DISABLE_EXT 0x0
#define GR_TEXCHROMA_ENABLE_EXT 0x1
#define GR_TEXCHROMARANGE_RGB_ALL_EXT 0x0
typedef FxI32 GrCmpFnc_t;
#define GR_CMP_NEVER 0x0
#define GR_CMP_LESS 0x1
#define GR_CMP_EQUAL 0x2
#define GR_CMP_LEQUAL 0x3
#define GR_CMP_GREATER 0x4
#define GR_CMP_NOTEQUAL 0x5
#define GR_CMP_GEQUAL 0x6
#define GR_CMP_ALWAYS 0x7
typedef FxI32 GrColorFormat_t;
#define GR_COLORFORMAT_ARGB 0x0
#define GR_COLORFORMAT_ABGR 0x1
#define GR_COLORFORMAT_RGBA 0x2
#define GR_COLORFORMAT_BGRA 0x3
typedef FxI32 GrCullMode_t;
#define GR_CULL_DISABLE 0x0
#define GR_CULL_NEGATIVE 0x1
#define GR_CULL_POSITIVE 0x2
typedef FxI32 GrDepthBufferMode_t;
#define GR_DEPTHBUFFER_DISABLE 0x0
#define GR_DEPTHBUFFER_ZBUFFER 0x1
#define GR_DEPTHBUFFER_WBUFFER 0x2
#define GR_DEPTHBUFFER_ZBUFFER_COMPARE_TO_BIAS 0x3
#define GR_DEPTHBUFFER_WBUFFER_COMPARE_TO_BIAS 0x4
typedef FxI32 GrDitherMode_t;
#define GR_DITHER_DISABLE 0x0
#define GR_DITHER_2x2 0x1
#define GR_DITHER_4x4 0x2
typedef FxI32 GrFogMode_t;
#define GR_FOG_DISABLE 0x0
#define GR_FOG_WITH_TABLE_ON_FOGCOORD_EXT 0x1
#define GR_FOG_WITH_TABLE_ON_Q 0x2
#define GR_FOG_WITH_TABLE_ON_W GR_FOG_WITH_TABLE_ON_Q
#define GR_FOG_WITH_ITERATED_Z 0x3
#define GR_FOG_MULT2 0x100
#define GR_FOG_ADD2 0x200
typedef FxU32 GrLock_t;
#define GR_LFB_READ_ONLY 0x00
#define GR_LFB_WRITE_ONLY 0x01
#define GR_LFB_IDLE 0x00
#define GR_LFB_NOIDLE 0x10
typedef FxI32 GrLfbBypassMode_t;
#define GR_LFBBYPASS_DISABLE 0x0
#define GR_LFBBYPASS_ENABLE 0x1
typedef FxI32 GrLfbWriteMode_t;
#define GR_LFBWRITEMODE_565 0x0 /* RGB:RGB */
#define GR_LFBWRITEMODE_555 0x1 /* RGB:RGB */
#define GR_LFBWRITEMODE_1555 0x2 /* ARGB:ARGB */
#define GR_LFBWRITEMODE_RESERVED1 0x3
#define GR_LFBWRITEMODE_888 0x4 /* RGB */
#define GR_LFBWRITEMODE_8888 0x5 /* ARGB */
#define GR_LFBWRITEMODE_RESERVED2 0x6
#define GR_LFBWRITEMODE_RESERVED3 0x7
#define GR_LFBWRITEMODE_RESERVED4 0x8
#define GR_LFBWRITEMODE_RESERVED5 0x9
#define GR_LFBWRITEMODE_RESERVED6 0xa
#define GR_LFBWRITEMODE_RESERVED7 0xb
#define GR_LFBWRITEMODE_565_DEPTH 0xc /* RGB:DEPTH */
#define GR_LFBWRITEMODE_555_DEPTH 0xd /* RGB:DEPTH */
#define GR_LFBWRITEMODE_1555_DEPTH 0xe /* ARGB:DEPTH */
#define GR_LFBWRITEMODE_ZA16 0xf /* DEPTH:DEPTH */
#define GR_LFBWRITEMODE_ANY 0xFF
typedef FxI32 GrOriginLocation_t;
#define GR_ORIGIN_UPPER_LEFT 0x0
#define GR_ORIGIN_LOWER_LEFT 0x1
#define GR_ORIGIN_ANY 0xFF
typedef struct {
int size;
void *lfbPtr;
FxU32 strideInBytes;
GrLfbWriteMode_t writeMode;
GrOriginLocation_t origin;
} GrLfbInfo_t;
typedef FxI32 GrLOD_t;
#define GR_LOD_LOG2_256 0x8
#define GR_LOD_LOG2_128 0x7
#define GR_LOD_LOG2_64 0x6
#define GR_LOD_LOG2_32 0x5
#define GR_LOD_LOG2_16 0x4
#define GR_LOD_LOG2_8 0x3
#define GR_LOD_LOG2_4 0x2
#define GR_LOD_LOG2_2 0x1
#define GR_LOD_LOG2_1 0x0
typedef FxI32 GrMipMapMode_t;
#define GR_MIPMAP_DISABLE 0x0 /* no mip mapping */
#define GR_MIPMAP_NEAREST 0x1 /* use nearest mipmap */
#define GR_MIPMAP_NEAREST_DITHER 0x2 /* GR_MIPMAP_NEAREST + LOD dith */
typedef FxI32 GrSmoothingMode_t;
#define GR_SMOOTHING_DISABLE 0x0
#define GR_SMOOTHING_ENABLE 0x1
typedef FxI32 GrTextureClampMode_t;
#define GR_TEXTURECLAMP_WRAP 0x0
#define GR_TEXTURECLAMP_CLAMP 0x1
#define GR_TEXTURECLAMP_MIRROR_EXT 0x2
typedef FxI32 GrTextureCombineFnc_t;
#define GR_TEXTURECOMBINE_ZERO 0x0 /* texout = 0 */
#define GR_TEXTURECOMBINE_DECAL 0x1 /* texout = texthis */
#define GR_TEXTURECOMBINE_OTHER 0x2 /* this TMU in passthru mode */
#define GR_TEXTURECOMBINE_ADD 0x3 /* tout = tthis + t(this+1) */
#define GR_TEXTURECOMBINE_MULTIPLY 0x4 /* texout = tthis * t(this+1) */
#define GR_TEXTURECOMBINE_SUBTRACT 0x5 /* Sutract from upstream TMU */
#define GR_TEXTURECOMBINE_DETAIL 0x6 /* detail--detail on tthis */
#define GR_TEXTURECOMBINE_DETAIL_OTHER 0x7 /* detail--detail on tthis+1 */
#define GR_TEXTURECOMBINE_TRILINEAR_ODD 0x8 /* trilinear--odd levels tthis*/
#define GR_TEXTURECOMBINE_TRILINEAR_EVEN 0x9 /*trilinear--even levels tthis*/
#define GR_TEXTURECOMBINE_ONE 0xa /* texout = 0xFFFFFFFF */
typedef FxI32 GrTextureFilterMode_t;
#define GR_TEXTUREFILTER_POINT_SAMPLED 0x0
#define GR_TEXTUREFILTER_BILINEAR 0x1
typedef FxI32 GrTextureFormat_t;
#define GR_TEXFMT_8BIT 0x0
#define GR_TEXFMT_RGB_332 GR_TEXFMT_8BIT
#define GR_TEXFMT_YIQ_422 0x1
#define GR_TEXFMT_ALPHA_8 0x2 /* (0..0xFF) alpha */
#define GR_TEXFMT_INTENSITY_8 0x3 /* (0..0xFF) intensity */
#define GR_TEXFMT_ALPHA_INTENSITY_44 0x4
#define GR_TEXFMT_P_8 0x5 /* 8-bit palette */
#define GR_TEXFMT_RSVD0 0x6
#define GR_TEXFMT_RSVD1 0x7
#define GR_TEXFMT_16BIT 0x8
#define GR_TEXFMT_ARGB_8332 GR_TEXFMT_16BIT
#define GR_TEXFMT_AYIQ_8422 0x9
#define GR_TEXFMT_RGB_565 0xa
#define GR_TEXFMT_ARGB_1555 0xb
#define GR_TEXFMT_ARGB_4444 0xc
#define GR_TEXFMT_ALPHA_INTENSITY_88 0xd
#define GR_TEXFMT_AP_88 0xe /* 8-bit alpha 8-bit palette */
#define GR_TEXFMT_RSVD2 0xf
typedef FxU32 GrTexTable_t;
#define GR_TEXTABLE_NCC0 0x0
#define GR_TEXTABLE_NCC1 0x1
#define GR_TEXTABLE_PALETTE 0x2
#define GR_TEXTABLE_PALETTE_6666_EXT 0x3
typedef FxU32 GrNCCTable_t;
#define GR_NCCTABLE_NCC0 0x0
#define GR_NCCTABLE_NCC1 0x1
typedef FxU32 GrTexBaseRange_t;
#define GR_TEXBASE_256 0x3
#define GR_TEXBASE_128 0x2
#define GR_TEXBASE_64 0x1
#define GR_TEXBASE_32_TO_1 0x0
typedef FxU32 GrEnableMode_t;
#define GR_MODE_DISABLE 0x0
#define GR_MODE_ENABLE 0x1
#define GR_AA_ORDERED 0x01
#define GR_ALLOW_MIPMAP_DITHER 0x02
#define GR_PASSTHRU 0x03
#define GR_SHAMELESS_PLUG 0x04
#define GR_VIDEO_SMOOTHING 0x05
typedef FxU32 GrCoordinateSpaceMode_t;
#define GR_WINDOW_COORDS 0x00
#define GR_CLIP_COORDS 0x01
/* Types of data in strips */
#define GR_FLOAT 0
#define GR_U8 1
/* Parameters for strips */
#define GR_PARAM_XY 0x01
#define GR_PARAM_Z 0x02
#define GR_PARAM_W 0x03
#define GR_PARAM_Q 0x04
#define GR_PARAM_FOG_EXT 0x05
#define GR_PARAM_A 0x10
#define GR_PARAM_RGB 0x20
#define GR_PARAM_PARGB 0x30
#define GR_PARAM_ST0 0x40
#define GR_PARAM_ST1 GR_PARAM_ST0+1
#define GR_PARAM_ST2 GR_PARAM_ST0+2
#define GR_PARAM_Q0 0x50
#define GR_PARAM_Q1 GR_PARAM_Q0+1
#define GR_PARAM_Q2 GR_PARAM_Q0+2
#define GR_PARAM_DISABLE 0x00
#define GR_PARAM_ENABLE 0x01
/*
** grDrawVertexArray/grDrawVertexArrayContiguous primitive type
*/
#define GR_POINTS 0
#define GR_LINE_STRIP 1
#define GR_LINES 2
#define GR_POLYGON 3
#define GR_TRIANGLE_STRIP 4
#define GR_TRIANGLE_FAN 5
#define GR_TRIANGLES 6
#define GR_TRIANGLE_STRIP_CONTINUE 7
#define GR_TRIANGLE_FAN_CONTINUE 8
/*
** grGet/grReset types
*/
#define GR_BITS_DEPTH 0x01
#define GR_BITS_RGBA 0x02
#define GR_FIFO_FULLNESS 0x03
#define GR_FOG_TABLE_ENTRIES 0x04
#define GR_GAMMA_TABLE_ENTRIES 0x05
#define GR_GLIDE_STATE_SIZE 0x06
#define GR_GLIDE_VERTEXLAYOUT_SIZE 0x07
#define GR_IS_BUSY 0x08
#define GR_LFB_PIXEL_PIPE 0x09
#define GR_MAX_TEXTURE_SIZE 0x0a
#define GR_MAX_TEXTURE_ASPECT_RATIO 0x0b
#define GR_MEMORY_FB 0x0c
#define GR_MEMORY_TMU 0x0d
#define GR_MEMORY_UMA 0x0e
#define GR_NUM_BOARDS 0x0f
#define GR_NON_POWER_OF_TWO_TEXTURES 0x10
#define GR_NUM_FB 0x11
#define GR_NUM_SWAP_HISTORY_BUFFER 0x12
#define GR_NUM_TMU 0x13
#define GR_PENDING_BUFFERSWAPS 0x14
#define GR_REVISION_FB 0x15
#define GR_REVISION_TMU 0x16
#define GR_STATS_LINES 0x17 /* grGet/grReset */
#define GR_STATS_PIXELS_AFUNC_FAIL 0x18
#define GR_STATS_PIXELS_CHROMA_FAIL 0x19
#define GR_STATS_PIXELS_DEPTHFUNC_FAIL 0x1a
#define GR_STATS_PIXELS_IN 0x1b
#define GR_STATS_PIXELS_OUT 0x1c
#define GR_STATS_PIXELS 0x1d /* grReset */
#define GR_STATS_POINTS 0x1e /* grGet/grReset */
#define GR_STATS_TRIANGLES_IN 0x1f
#define GR_STATS_TRIANGLES_OUT 0x20
#define GR_STATS_TRIANGLES 0x21 /* grReset */
#define GR_SWAP_HISTORY 0x22
#define GR_SUPPORTS_PASSTHRU 0x23
#define GR_TEXTURE_ALIGN 0x24
#define GR_VIDEO_POSITION 0x25
#define GR_VIEWPORT 0x26
#define GR_WDEPTH_MIN_MAX 0x27
#define GR_ZDEPTH_MIN_MAX 0x28
#define GR_VERTEX_PARAMETER 0x29
#define GR_BITS_GAMMA 0x2a
/*
** grGetString types
*/
#define GR_EXTENSION 0xa0
#define GR_HARDWARE 0xa1
#define GR_RENDERER 0xa2
#define GR_VENDOR 0xa3
#define GR_VERSION 0xa4
/*
** -----------------------------------------------------------------------
** STRUCTURES
** -----------------------------------------------------------------------
*/
typedef struct {
GrLOD_t smallLodLog2;
GrLOD_t largeLodLog2;
GrAspectRatio_t aspectRatioLog2;
GrTextureFormat_t format;
void *data;
} GrTexInfo;
typedef struct GrSstPerfStats_s {
FxU32 pixelsIn; /* # pixels processed (minus buffer clears) */
FxU32 chromaFail; /* # pixels not drawn due to chroma key */
FxU32 zFuncFail; /* # pixels not drawn due to Z comparison */
FxU32 aFuncFail; /* # pixels not drawn due to alpha comparison */
FxU32 pixelsOut; /* # pixels drawn (including buffer clears) */
} GrSstPerfStats_t;
typedef struct {
GrScreenResolution_t resolution;
GrScreenRefresh_t refresh;
int numColorBuffers;
int numAuxBuffers;
} GrResolution;
typedef GrResolution GlideResolution;
#define GR_QUERY_ANY ((FxU32)(~0))
typedef FxU32 GrLfbSrcFmt_t;
#define GR_LFB_SRC_FMT_565 0x00
#define GR_LFB_SRC_FMT_555 0x01
#define GR_LFB_SRC_FMT_1555 0x02
#define GR_LFB_SRC_FMT_888 0x04
#define GR_LFB_SRC_FMT_8888 0x05
#define GR_LFB_SRC_FMT_565_DEPTH 0x0c
#define GR_LFB_SRC_FMT_555_DEPTH 0x0d
#define GR_LFB_SRC_FMT_1555_DEPTH 0x0e
#define GR_LFB_SRC_FMT_ZA16 0x0f
#define GR_LFB_SRC_FMT_RLE16 0x80
#ifdef H3D
#define GR_HINT_H3DENABLE 4
#undef GR_HINTTYPE_MAX
#define GR_HINTTYPE_MAX 4
#endif
/*
** -----------------------------------------------------------------------
** FUNCTION PROTOTYPES
** -----------------------------------------------------------------------
*/
#ifndef FX_GLIDE_NO_FUNC_PROTO
/*
** rendering functions
*/
FX_ENTRY void FX_CALL
grDrawPoint( const void *pt );
FX_ENTRY void FX_CALL
grDrawLine( const void *v1, const void *v2 );
FX_ENTRY void FX_CALL
grDrawTriangle( const void *a, const void *b, const void *c );
FX_ENTRY void FX_CALL
grVertexLayout(FxU32 param, FxI32 offset, FxU32 mode);
FX_ENTRY void FX_CALL
grDrawVertexArray(FxU32 mode, FxU32 Count, void *pointers);
FX_ENTRY void FX_CALL
grDrawVertexArrayContiguous(FxU32 mode, FxU32 Count, void *pointers, FxU32 stride);
/*
** Antialiasing Functions
*/
FX_ENTRY void FX_CALL
grAADrawTriangle(
const void *a, const void *b, const void *c,
FxBool ab_antialias, FxBool bc_antialias, FxBool ca_antialias
);
/*
** buffer management
*/
FX_ENTRY void FX_CALL
grBufferClear( GrColor_t color, GrAlpha_t alpha, FxU32 depth );
FX_ENTRY void FX_CALL
grBufferSwap( FxU32 swap_interval );
FX_ENTRY void FX_CALL
grRenderBuffer( GrBuffer_t buffer );
/*
** error management
*/
typedef void (*GrErrorCallbackFnc_t)( const char *string, FxBool fatal );
FX_ENTRY void FX_CALL
grErrorSetCallback( GrErrorCallbackFnc_t fnc );
/*
** SST routines
*/
FX_ENTRY void FX_CALL
grFinish(void);
FX_ENTRY void FX_CALL
grFlush(void);
FX_ENTRY GrContext_t FX_CALL
grSstWinOpen(
FxU32 hWnd,
GrScreenResolution_t screen_resolution,
GrScreenRefresh_t refresh_rate,
GrColorFormat_t color_format,
GrOriginLocation_t origin_location,
int nColBuffers,
int nAuxBuffers);
FX_ENTRY FxBool FX_CALL
grSstWinClose( GrContext_t context );
FX_ENTRY FxBool FX_CALL
grSelectContext( GrContext_t context );
FX_ENTRY void FX_CALL
grSstOrigin(GrOriginLocation_t origin);
FX_ENTRY void FX_CALL
grSstSelect( int which_sst );
/*
** Glide configuration and special effect maintenance functions
*/
FX_ENTRY void FX_CALL
grAlphaBlendFunction(
GrAlphaBlendFnc_t rgb_sf, GrAlphaBlendFnc_t rgb_df,
GrAlphaBlendFnc_t alpha_sf, GrAlphaBlendFnc_t alpha_df
);
FX_ENTRY void FX_CALL
grAlphaCombine(
GrCombineFunction_t function, GrCombineFactor_t factor,
GrCombineLocal_t local, GrCombineOther_t other,
FxBool invert
);
FX_ENTRY void FX_CALL
grAlphaControlsITRGBLighting( FxBool enable );
FX_ENTRY void FX_CALL
grAlphaTestFunction( GrCmpFnc_t function );
FX_ENTRY void FX_CALL
grAlphaTestReferenceValue( GrAlpha_t value );
FX_ENTRY void FX_CALL
grChromakeyMode( GrChromakeyMode_t mode );
FX_ENTRY void FX_CALL
grChromakeyValue( GrColor_t value );
FX_ENTRY void FX_CALL
grClipWindow( FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy );
FX_ENTRY void FX_CALL
grColorCombine(
GrCombineFunction_t function, GrCombineFactor_t factor,
GrCombineLocal_t local, GrCombineOther_t other,
FxBool invert );
FX_ENTRY void FX_CALL
grColorMask( FxBool rgb, FxBool a );
FX_ENTRY void FX_CALL
grCullMode( GrCullMode_t mode );
FX_ENTRY void FX_CALL
grConstantColorValue( GrColor_t value );
FX_ENTRY void FX_CALL
grDepthBiasLevel( FxI32 level );
FX_ENTRY void FX_CALL
grDepthBufferFunction( GrCmpFnc_t function );
FX_ENTRY void FX_CALL
grDepthBufferMode( GrDepthBufferMode_t mode );
FX_ENTRY void FX_CALL
grDepthMask( FxBool mask );
FX_ENTRY void FX_CALL
grDisableAllEffects( void );
FX_ENTRY void FX_CALL
grDitherMode( GrDitherMode_t mode );
FX_ENTRY void FX_CALL
grFogColorValue( GrColor_t fogcolor );
FX_ENTRY void FX_CALL
grFogMode( GrFogMode_t mode );
FX_ENTRY void FX_CALL
grFogTable( const GrFog_t ft[] );
FX_ENTRY void FX_CALL
grLoadGammaTable( FxU32 nentries, FxU32 *red, FxU32 *green, FxU32 *blue);
FX_ENTRY void FX_CALL
grSplash(float x, float y, float width, float height, FxU32 frame);
FX_ENTRY FxU32 FX_CALL
grGet( FxU32 pname, FxU32 plength, FxI32 *params );
FX_ENTRY const char * FX_CALL
grGetString( FxU32 pname );
FX_ENTRY FxI32 FX_CALL
grQueryResolutions( const GrResolution *resTemplate, GrResolution *output );
FX_ENTRY FxBool FX_CALL
grReset( FxU32 what );
FX_ENTRY GrProc FX_CALL
grGetProcAddress( char *procName );
FX_ENTRY void FX_CALL
grEnable( GrEnableMode_t mode );
FX_ENTRY void FX_CALL
grDisable( GrEnableMode_t mode );
FX_ENTRY void FX_CALL
grCoordinateSpace( GrCoordinateSpaceMode_t mode );
FX_ENTRY void FX_CALL
grDepthRange( FxFloat n, FxFloat f );
FX_ENTRY void FX_CALL
grViewport( FxI32 x, FxI32 y, FxI32 width, FxI32 height );
/*
** texture mapping control functions
*/
FX_ENTRY FxU32 FX_CALL
grTexCalcMemRequired(
GrLOD_t lodmin, GrLOD_t lodmax,
GrAspectRatio_t aspect, GrTextureFormat_t fmt);
FX_ENTRY FxU32 FX_CALL
grTexTextureMemRequired( FxU32 evenOdd,
GrTexInfo *info );
FX_ENTRY FxU32 FX_CALL
grTexMinAddress( GrChipID_t tmu );
FX_ENTRY FxU32 FX_CALL
grTexMaxAddress( GrChipID_t tmu );
FX_ENTRY void FX_CALL
grTexNCCTable( GrNCCTable_t table );
FX_ENTRY void FX_CALL
grTexSource( GrChipID_t tmu,
FxU32 startAddress,
FxU32 evenOdd,
GrTexInfo *info );
FX_ENTRY void FX_CALL
grTexClampMode(
GrChipID_t tmu,
GrTextureClampMode_t s_clampmode,
GrTextureClampMode_t t_clampmode
);
FX_ENTRY void FX_CALL
grTexCombine(
GrChipID_t tmu,
GrCombineFunction_t rgb_function,
GrCombineFactor_t rgb_factor,
GrCombineFunction_t alpha_function,
GrCombineFactor_t alpha_factor,
FxBool rgb_invert,
FxBool alpha_invert
);
FX_ENTRY void FX_CALL
grTexDetailControl(
GrChipID_t tmu,
int lod_bias,
FxU8 detail_scale,
float detail_max
);
FX_ENTRY void FX_CALL
grTexFilterMode(
GrChipID_t tmu,
GrTextureFilterMode_t minfilter_mode,
GrTextureFilterMode_t magfilter_mode
);
FX_ENTRY void FX_CALL
grTexLodBiasValue(GrChipID_t tmu, float bias );
FX_ENTRY void FX_CALL
grTexDownloadMipMap( GrChipID_t tmu,
FxU32 startAddress,
FxU32 evenOdd,
GrTexInfo *info );
FX_ENTRY void FX_CALL
grTexDownloadMipMapLevel( GrChipID_t tmu,
FxU32 startAddress,
GrLOD_t thisLod,
GrLOD_t largeLod,
GrAspectRatio_t aspectRatio,
GrTextureFormat_t format,
FxU32 evenOdd,
void *data );
FX_ENTRY FxBool FX_CALL
grTexDownloadMipMapLevelPartial( GrChipID_t tmu,
FxU32 startAddress,
GrLOD_t thisLod,
GrLOD_t largeLod,
GrAspectRatio_t aspectRatio,
GrTextureFormat_t format,
FxU32 evenOdd,
void *data,
int start,
int end );
FX_ENTRY void FX_CALL
grTexDownloadTable( GrTexTable_t type,
void *data );
FX_ENTRY void FX_CALL
grTexDownloadTablePartial( GrTexTable_t type,
void *data,
int start,
int end );
FX_ENTRY void FX_CALL
grTexMipMapMode( GrChipID_t tmu,
GrMipMapMode_t mode,
FxBool lodBlend );
FX_ENTRY void FX_CALL
grTexMultibase( GrChipID_t tmu,
FxBool enable );
FX_ENTRY void FX_CALL
grTexMultibaseAddress( GrChipID_t tmu,
GrTexBaseRange_t range,
FxU32 startAddress,
FxU32 evenOdd,
GrTexInfo *info );
/*
** linear frame buffer functions
*/
FX_ENTRY FxBool FX_CALL
grLfbLock( GrLock_t type, GrBuffer_t buffer, GrLfbWriteMode_t writeMode,
GrOriginLocation_t origin, FxBool pixelPipeline,
GrLfbInfo_t *info );
FX_ENTRY FxBool FX_CALL
grLfbUnlock( GrLock_t type, GrBuffer_t buffer );
FX_ENTRY void FX_CALL
grLfbConstantAlpha( GrAlpha_t alpha );
FX_ENTRY void FX_CALL
grLfbConstantDepth( FxU32 depth );
FX_ENTRY void FX_CALL
grLfbWriteColorSwizzle(FxBool swizzleBytes, FxBool swapWords);
FX_ENTRY void FX_CALL
grLfbWriteColorFormat(GrColorFormat_t colorFormat);
FX_ENTRY FxBool FX_CALL
grLfbWriteRegion( GrBuffer_t dst_buffer,
FxU32 dst_x, FxU32 dst_y,
GrLfbSrcFmt_t src_format,
FxU32 src_width, FxU32 src_height,
FxBool pixelPipeline,
FxI32 src_stride, void *src_data );
FX_ENTRY FxBool FX_CALL
grLfbReadRegion( GrBuffer_t src_buffer,
FxU32 src_x, FxU32 src_y,
FxU32 src_width, FxU32 src_height,
FxU32 dst_stride, void *dst_data );
/*
** glide management functions
*/
FX_ENTRY void FX_CALL
grGlideInit( void );
FX_ENTRY void FX_CALL
grGlideShutdown( void );
FX_ENTRY void FX_CALL
grGlideGetState( void *state );
FX_ENTRY void FX_CALL
grGlideSetState( const void *state );
FX_ENTRY void FX_CALL
grGlideGetVertexLayout( void *layout );
FX_ENTRY void FX_CALL
grGlideSetVertexLayout( const void *layout );
#endif /* FX_GLIDE_NO_FUNC_PROTO */
#ifdef __cplusplus
}
#endif
#include <glideutl.h>
#endif /* __GLIDE_H__ */

146
Include/glidesys.h Normal file
View File

@ -0,0 +1,146 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
n** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Header: /devel/cvg/glide3/src/glidesys.h 3 7/24/98 1:41p Hohn $
** $Log: /devel/cvg/glide3/src/glidesys.h $
**
** 3 7/24/98 1:41p Hohn
**
** 2 6/15/98 10:50a Peter
** made csim compile time option
*
* 1 1/16/98 4:29p Atai
* create glide 3 src
*
* 10 12/09/97 12:20p Peter
* mac glide port
*
* 9 11/04/97 4:00p Dow
* Banshee Mods
*
* 8 8/18/97 3:52p Peter
* pre-hw arrival fixes/cleanup
*
* 7 6/02/97 4:09p Peter
* Compile w/ gcc for Dural
*
* 6 5/27/97 1:16p Peter
* Basic cvg, w/o cmd fifo stuff.
*
* 5 5/21/97 6:05a Peter
*/
#ifndef __GLIDESYS_H__
#define __GLIDESYS_H__
/*
n** -----------------------------------------------------------------------
** COMPILER/ENVIRONMENT CONFIGURATION
** -----------------------------------------------------------------------
*/
/* Endianness is stored in bits [30:31] */
#define GLIDE_ENDIAN_SHIFT 30
#define GLIDE_ENDIAN_LITTLE (0x1 << GLIDE_ENDIAN_SHIFT)
#define GLIDE_ENDIAN_BIG (0x2 << GLIDE_ENDIAN_SHIFT)
/* OS is stored in bits [0:6] */
#define GLIDE_OS_SHIFT 0
#define GLIDE_OS_UNIX 0x1
#define GLIDE_OS_DOS32 0x2
#define GLIDE_OS_WIN32 0x4
#define GLIDE_OS_MACOS 0x8
#define GLIDE_OS_OS2 0x10
#define GLIDE_OS_OTHER 0x40 /* For Proprietary Arcade HW */
/* Sim vs. Hardware is stored in bits [7:8] */
#define GLIDE_SST_SHIFT 7
#define GLIDE_SST_SIM (0x1 << GLIDE_SST_SHIFT)
#define GLIDE_SST_HW (0x2 << GLIDE_SST_SHIFT)
/* Hardware Type is stored in bits [9:13] */
#define GLIDE_HW_SHIFT 9
#define GLIDE_HW_SST1 (0x1 << GLIDE_HW_SHIFT)
#define GLIDE_HW_SST96 (0x2 << GLIDE_HW_SHIFT)
#define GLIDE_HW_H3 (0x4 << GLIDE_HW_SHIFT)
#define GLIDE_HW_SST2 (0x8 << GLIDE_HW_SHIFT)
#define GLIDE_HW_CVG (0x10 << GLIDE_HW_SHIFT)
/*
** Make sure we handle all instances of WIN32
*/
#ifndef __WIN32__
# if defined (_WIN32) || defined (WIN32) || defined(__NT__)
# define __WIN32__
# endif
#endif
/* We need two checks on the OS: one for endian, the other for OS */
/* Check for endianness */
#if defined(__IRIX__) || defined(__sparc__) || defined(MACOS)
# define GLIDE_ENDIAN GLIDE_ENDIAN_BIG
#else
# define GLIDE_ENDIAN GLIDE_ENDIAN_LITTLE
#endif
/* Check for OS */
#if defined(__IRIX__) || defined(__sparc__) || defined(__linux__)
# define GLIDE_OS GLIDE_OS_UNIX
#elif defined(__DOS__)
# define GLIDE_OS GLIDE_OS_DOS32
#elif defined(__WIN32__)
# define GLIDE_OS GLIDE_OS_WIN32
#elif defined(macintosh)
# define GLIDE_OS GLIDE_OS_MACOS
#else
#error "Unknown OS"
#endif
/* Check for Simulator vs. Hardware */
#if HAL_CSIM || HWC_CSIM
# define GLIDE_SST GLIDE_SST_SIM
#else
# define GLIDE_SST GLIDE_SST_HW
#endif
/* Check for type of hardware */
#ifdef SST96
# define GLIDE_HW GLIDE_HW_SST96
#elif defined(H3)
# define GLIDE_HW GLIDE_HW_H3
#elif defined(SST2)
# define GLIDE_HW GLIDE_HW_SST2
#elif defined(CVG)
# define GLIDE_HW GLIDE_HW_CVG
#else /* Default to SST1 */
# define GLIDE_HW GLIDE_HW_SST1
#endif
#define GLIDE_PLATFORM (GLIDE_ENDIAN | GLIDE_OS | GLIDE_SST | GLIDE_HW)
/*
** Control the number of TMUs
*/
#ifndef GLIDE_NUM_TMU
# define GLIDE_NUM_TMU 2
#endif
#if ((GLIDE_NUM_TMU < 0) && (GLIDE_NUM_TMU > 3))
# error "GLIDE_NUM_TMU set to an invalid value"
#endif
#endif /* __GLIDESYS_H__ */

143
Include/glideutl.h Normal file
View File

@ -0,0 +1,143 @@
/*
** Copyright (c) 1995, 3Dfx Interactive, Inc.
** All Rights Reserved.
**
** This is UNPUBLISHED PROPRIETARY SOURCE CODE of 3Dfx Interactive, Inc.;
** the contents of this file may not be disclosed to third parties, copied or
** duplicated in any form, in whole or in part, without the prior written
** permission of 3Dfx Interactive, Inc.
**
** RESTRICTED RIGHTS LEGEND:
** Use, duplication or disclosure by the Government is subject to restrictions
** as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
** and Computer Software clause at DFARS 252.227-7013, and/or in similar or
** successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
** rights reserved under the Copyright Laws of the United States.
**
** $Header: /devel/cvg/glide3/src/glideutl.h 4 7/24/98 1:41p Hohn $
** $Log: /devel/cvg/glide3/src/glideutl.h $
**
** 4 7/24/98 1:41p Hohn
**
** 3 1/30/98 4:27p Atai
** gufog* prototype
**
** 1 1/29/98 4:00p Atai
*
* 1 1/16/98 4:29p Atai
* create glide 3 src
*
* 11 1/07/98 11:18a Atai
* remove GrMipMapInfo and GrGC.mm_table in glide3
*
* 10 1/06/98 6:47p Atai
* undo grSplash and remove gu routines
*
* 9 1/05/98 6:04p Atai
* move 3df gu related data structure from glide.h to glideutl.h
*
* 8 12/18/97 2:13p Peter
* fogTable cataclysm
*
* 7 12/15/97 5:52p Atai
* disable obsolete glide2 api for glide3
*
* 6 8/14/97 5:32p Pgj
* remove dead code per GMT
*
* 5 6/12/97 5:19p Pgj
* Fix bug 578
*
* 4 3/05/97 9:36p Jdt
* Removed guFbWriteRegion added guEncodeRLE16
*
* 3 1/16/97 3:45p Dow
* Embedded fn protos in ifndef FX_GLIDE_NO_FUNC_PROTO
*/
/* Glide Utility routines */
#ifndef __GLIDEUTL_H__
#define __GLIDEUTL_H__
#ifdef __cplusplus
extern "C" {
#endif
/*
** 3DF texture file structs
*/
typedef struct
{
FxU32 width, height;
int small_lod, large_lod;
GrAspectRatio_t aspect_ratio;
GrTextureFormat_t format;
} Gu3dfHeader;
typedef struct
{
FxU8 yRGB[16];
FxI16 iRGB[4][3];
FxI16 qRGB[4][3];
FxU32 packed_data[12];
} GuNccTable;
typedef struct {
FxU32 data[256];
} GuTexPalette;
typedef union {
GuNccTable nccTable;
GuTexPalette palette;
} GuTexTable;
typedef struct
{
Gu3dfHeader header;
GuTexTable table;
void *data;
FxU32 mem_required; /* memory required for mip map in bytes. */
} Gu3dfInfo;
#ifndef FX_GLIDE_NO_FUNC_PROTO
/*
** Gamma functions
*/
FX_ENTRY void FX_CALL
guGammaCorrectionRGB( FxFloat red, FxFloat green, FxFloat blue );
/*
** fog stuff
*/
FX_ENTRY float FX_CALL
guFogTableIndexToW( int i );
FX_ENTRY void FX_CALL
guFogGenerateExp( GrFog_t *fogtable, float density );
FX_ENTRY void FX_CALL
guFogGenerateExp2( GrFog_t *fogtable, float density );
FX_ENTRY void FX_CALL
guFogGenerateLinear(GrFog_t *fogtable,
float nearZ, float farZ );
/*
** hi-level texture manipulation tools.
*/
FX_ENTRY FxBool FX_CALL
gu3dfGetInfo( const char *filename, Gu3dfInfo *info );
FX_ENTRY FxBool FX_CALL
gu3dfLoad( const char *filename, Gu3dfInfo *data );
#endif /* FX_GLIDE_NO_FUNC_PROTO */
#ifdef __cplusplus
}
#endif
#endif /* __GLIDEUTL_H__ */

1840
Include/sst1init.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:03271f56101f397e9d6ffc4c966d04af5ae7a94e2dfd2df958d185363586a74a
size 446976
oid sha256:f5ca6f4d3ce49c5e35b6ced416a8e48d7948813d8994ff1fefcb656817359bb8
size 448512

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:8621dc8cebb19d5e945aeba4932dff40115f73c88209fe39e4388bef4822f621
oid sha256:6b5fbb1db51dc2da5ddf88d048bb24471391cc9f1ff80e96a27c916198cc6f4b
size 535040

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,26 @@
[target]
title0=Black Moon Chronicles
path0=D:\Games\Black Moon Chronicles\Lune noire\Engine.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=134234146
flagg0=1207959568
flagh0=32788
flagi0=4
tflag0=6211
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=Dark Vengeance
path0=D:\Games\dark_vengeance\dv.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=136314915
flagg0=1476395008
flagh0=65556
flagi0=4
tflag0=2049
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=Duke Nukem - Manhattan Project (D3D8)
path0=D:\Games\Duke Nukem - Manhattan Project\prism3d.exe
module0=p3shared
opengllib0=
ver0=8
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=4
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=KKND Xtreme
path0=D:\Games\KKNDXtreme\KKND.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=134234146
flagg0=1207959552
flagh0=20
flagi0=4
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=Millennium Racer Y2K fighters
path0=D:\Games\Millennium Racer\MRacer.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=671105056
flagg0=1476395024
flagh0=20
flagi0=4
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=O.R.B. Offword Rescue Base
path0=D:\Games\O.R.B\orb.exe
module0=
opengllib0=
ver0=0
coord0=2
flag0=134234144
flagg0=1207959568
flagh0=20
flagi0=4
tflag0=6163
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=Port Royale 2
path0=D:\Games\Port Royale 2\PR2.exe
module0=
opengllib0=
ver0=8
coord0=0
flag0=671096866
flagg0=1207959552
flagh0=65556
flagi0=4
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=Project Eden
path0=D:\Games\Project Eden\Eden.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=134217763
flagg0=1207959552
flagh0=20
flagi0=4
tflag0=64
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -0,0 +1,26 @@
[target]
title0=State of War Warmonger
path0=D:\Games\State of War Warmonger\State of War - Warmonger.exe
module0=
opengllib0=
ver0=0
coord0=0
flag0=134234210
flagg0=134217728
flagh0=532
flagi0=4
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1

View File

@ -366,3 +366,14 @@ fixed window move/resize when message processing is enabled: coordinates outside
expanded timer processing to include user32 Set/KillTimer - in "Aaron Hall's Dungeon Odissey"
fixed possible recursion while hooking child window procedure identical to parent's one
fixed gdi emulation on top of ddraw surface, enough to play "Sid Meyer's Civilization III".
v2.02.54
fixed a bug in d3d GetAvailableVidMem that was causing too many troubles...
fixed a bug in Suppress IME option
fixed a bug in handled library list, possibly affecting d3d/d3d7 games
avoid fixing window style for non-desktop windows (fixed a Port Royale 2 bug)
eliminated "Disable HAL support", no longer necessary
some incomplete work on gdi game handling
added preliminary, incomplete (not working) glide handling

View File

@ -1,19 +0,0 @@
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "proxydll", "proxydll.vcproj", "{02EB97D5-B1C5-411E-8274-83A95985DE6F}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
Release|Win32 = Release|Win32
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Debug|Win32.ActiveCfg = Debug|Win32
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Debug|Win32.Build.0 = Debug|Win32
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Release|Win32.ActiveCfg = Release|Win32
{02EB97D5-B1C5-411E-8274-83A95985DE6F}.Release|Win32.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal

View File

@ -1627,13 +1627,25 @@ HRESULT WINAPI extQueryInterfaceS(void *lpdds, REFIID riid, LPVOID *obp)
break;
case 0x84e63de0:
OutTraceDW("QueryInterface: IID_IDirect3DHALDevice\n");
#ifdef COMMENTED_OUT
if (dxw.dwFlags3 & DISABLEHAL){ // IID_IDirect3DHALDevice - Dark Vengeance
// this is odd: this piece of code returns the very same error code returned by the actual
// QueryInterface call, but avoid a memory corruption and makes the game working....
// there must be something wrong behind it.
// SEEMS FIXED NOW, NO MORE CRASHES, THIS OPTION IS USELESS
OutTraceDW("QueryInterface: suppress IID_IDirect3DHALDevice interface res=DDERR_GENERIC\n");
return DDERR_GENERIC;
//GUID IID_IDirect3DRGBDevice = {0xA4665C60,0x2673,0x11CF,0xA3,0x1A,0x00,0xAA,0x00,0xB9,0x33,0x56};
//res = (*pQueryInterfaceS)(lpdds, IID_IDirect3DRGBDevice, obp);
//OutTraceDW("QueryInterface: redirect IID_IDirect3DHALDevice to RGB interface res=%x(%s)\n", res, ExplainDDError(res));
//return res;
//return DD_OK;
}
#endif
break;
case 0xA4665C60: // IID_IDirect3DRGBDevice
OutTraceDW("QueryInterface: IID_IDirect3DRGBDevice\n");
@ -3724,6 +3736,23 @@ HRESULT WINAPI myEnumModesFilter(LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpConte
}
}
if(dxw.dwFlags4 & LIMITSCREENRES){
#define HUGE 100000
DWORD maxw, maxh;
switch(dxw.MaxScreenRes){
case DXW_NO_LIMIT: maxw=HUGE; maxh=HUGE; break;
case DXW_LIMIT_320x200: maxw=320; maxh=200; break;
case DXW_LIMIT_640x480: maxw=640; maxh=480; break;
case DXW_LIMIT_800x600: maxw=800; maxh=600; break;
case DXW_LIMIT_1024x768: maxw=1024; maxh=768; break;
case DXW_LIMIT_1280x960: maxw=1280; maxh=960; break;
}
if((lpDDSurfaceDesc->dwWidth > maxw) || (lpDDSurfaceDesc->dwHeight > maxh)){
OutTraceDW("EnumDisplaySettings: hide device mode=(%d,%d)\n", maxw, maxh);
return DDENUMRET_OK;
}
}
// tricky part: in 16BPP color depth let the callback believe that the pixel encoding
// is actually the one implemented in the emulation routines.
// should it fix also the other color depths?
@ -4428,6 +4457,7 @@ HRESULT WINAPI extDirectDrawEnumerateEx(LPDDENUMCALLBACKEX lpCallback, LPVOID lp
else
ret=(*pDirectDrawEnumerateEx)(lpCallback, lpContext, dwFlags);
if(ret) OutTraceE("DirectDrawEnumerateEx: ERROR res=%x(%s)\n", ret, ExplainDDError(ret));
if(dxw.dwFlags1 & SUPPRESSDXERRORS) ret=0;
return ret;
}
@ -4461,11 +4491,14 @@ HRESULT WINAPI extDDGetGammaRamp(LPDIRECTDRAWSURFACE lpdds, DWORD dwFlags, LPDDG
}
else {
OutTraceDW("GetAvailableVidMem(D): DDSCaps=%x(%s) Total=%x Free=%x\n",
*lpDDSCaps, ExplainDDSCaps(lpDDSCaps->dwCaps), *lpdwTotal, *lpdwFree);
*lpDDSCaps, ExplainDDSCaps(lpDDSCaps->dwCaps), lpdwTotal?*lpdwTotal:0, lpdwFree?*lpdwFree:0);
if(dxw.dwFlags2 & LIMITRESOURCES){ // check for memory value overflow - see "Mageslayer" and "Take no Prisoners"
DWORD dwLocalTotal;
const DWORD dwMaxMem = 0x7FFFF000;
if(lpdwTotal == NULL) lpdwTotal = &dwLocalTotal; // point to usable memory....
if(lpdwTotal == NULL) {
lpdwTotal = &dwLocalTotal; // point to usable memory....
res=(*pGetAvailableVidMem)(lpdd, lpDDSCaps, lpdwTotal, lpdwFree); // do it again to get total memory
}
if(*lpdwTotal > dwMaxMem){
if(lpdwFree != NULL){
DWORD dwDiff = *lpdwTotal - *lpdwFree;

View File

@ -10,6 +10,7 @@
#include "dxwcore.hpp"
#include "dxhook.h"
#include "glhook.h"
#include "glidehook.h"
#include "msvfwhook.h"
#define DXWDECLARATIONS 1
#include "syslibs.h"
@ -59,7 +60,7 @@ static char *Flag3Names[32]={
"FORCEHOOKOPENGL", "MARKBLIT", "HOOKDLLS", "SUPPRESSD3DEXT",
"HOOKENABLED", "FIXD3DFRAME", "FORCE16BPP", "BLACKWHITE",
"SAVECAPS", "SINGLEPROCAFFINITY", "EMULATEREGISTRY", "CDROMDRIVETYPE",
"NOWINDOWMOVE", "DISABLEHAL", "LOCKSYSCOLORS", "GDIEMULATEDC",
"NOWINDOWMOVE", "--DISABLEHAL--", "LOCKSYSCOLORS", "GDIEMULATEDC",
"FULLSCREENONLY", "FONTBYPASS", "YUV2RGB", "RGB2YUV",
"BUFFEREDIOFIX", "FILTERMESSAGES", "PEEKALLMESSAGES", "SURFACEWARN",
"ANALYTICMODE", "FORCESHEL", "CAPMASK", "COLORFIX",
@ -70,7 +71,7 @@ static char *Flag4Names[32]={
"NOALPHACHANNEL", "SUPPRESSCHILD", "FIXREFCOUNTER", "SHOWTIMESTRETCH",
"ZBUFFERCLEAN", "ZBUFFER0CLEAN", "ZBUFFERALWAYS", "DISABLEFOGGING",
"NOPOWER2FIX", "NOPERFCOUNTER", "ADDPROXYLIBS", "INTERCEPTRDTSC",
"LIMITSCREENRES", "NOFILLRECT", "", "",
"LIMITSCREENRES", "NOFILLRECT", "HOOKGLIDE", "",
"", "", "", "",
"", "", "", "",
"", "", "", "",
@ -162,9 +163,11 @@ static void SuppressIMEWindow()
ImmDisableIME_Type pImmDisableIME;
HMODULE ImmLib;
ImmLib=(*pLoadLibraryA)("Imm32");
pImmDisableIME=(ImmDisableIME_Type)(*pGetProcAddress)(ImmLib,"ImmDisableIME");
(*pImmDisableIME)(-1);
CloseHandle(ImmLib);
if(ImmLib){
pImmDisableIME=(ImmDisableIME_Type)(*pGetProcAddress)(ImmLib,"ImmDisableIME");
if(pImmDisableIME)(*pImmDisableIME)(-1);
FreeLibrary(ImmLib);
}
}
void HookDlls(HMODULE module)
@ -1279,6 +1282,7 @@ void HookModule(HMODULE base, int dxversion)
HookDirect3D(base, dxversion);
HookDirect3D7(base, dxversion);
if(dxw.dwFlags2 & HOOKOPENGL) HookOpenGLLibs(base, dxw.CustomOpenGLLib);
if(dxw.dwFlags4 & HOOKGLIDE) HookGlideLibs(base);
if((dxw.dwFlags3 & EMULATEREGISTRY) || (dxw.dwTFlags & OUTREGISTRY)) HookAdvApi32(base);
HookMSV4WLibs(base); // -- used by Aliens & Amazons demo: what for?
}

View File

@ -33,6 +33,7 @@ extern FARPROC Remap_WinMM_ProcAddress(LPCSTR, HMODULE);
extern FARPROC Remap_ImeLib_ProcAddress(LPCSTR, HMODULE);
extern FARPROC Remap_vfw_ProcAddress(LPCSTR, HMODULE);
extern FARPROC Remap_AdvApi32_ProcAddress(LPCSTR, HMODULE);
extern FARPROC Remap_Glide_ProcAddress(LPCSTR, HMODULE);
typedef struct {
char *APIName;

View File

@ -1203,9 +1203,11 @@ int dxwCore::GetDLLIndex(char *lpFileName)
"tapi32",
"netapi32",
"wintrust",
"advapi32",
"d3dim",
"d3dim700",
// "+glide",
// "+glide2x",
// "+glide3x",
NULL
};
@ -1308,6 +1310,16 @@ HDC dxwCore::AcquireEmulatedDC(HWND hwnd)
return AcquireEmulatedDC(wdc);
}
HDC dxwCore::AcquireEmulatedDC(LPDIRECTDRAWSURFACE lpdds)
{
HDC ddc;
typedef HRESULT (WINAPI *GetDC_Type) (LPDIRECTDRAWSURFACE, HDC FAR *);
extern GetDC_Type pGetDC;
if((*pGetDC)(lpdds, &ddc))
OutTraceE("GetDC: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
return AcquireEmulatedDC(ddc);
}
HDC dxwCore::AcquireEmulatedDC(HDC wdc)
{
RealHDC=wdc;
@ -1453,3 +1465,21 @@ void dxwCore::RenewTimers()
break;
}
}
BOOL dxwCore::CheckScreenResolution(unsigned int w, unsigned int h)
{
#define HUGE 100000
if(dxw.dwFlags4 & LIMITSCREENRES){
DWORD maxw, maxh;
switch(MaxScreenRes){
case DXW_NO_LIMIT: maxw=HUGE; maxh=HUGE; break;
case DXW_LIMIT_320x200: maxw=320; maxh=200; break;
case DXW_LIMIT_640x480: maxw=640; maxh=480; break;
case DXW_LIMIT_800x600: maxw=800; maxh=600; break;
case DXW_LIMIT_1024x768: maxw=1024; maxh=768; break;
case DXW_LIMIT_1280x960: maxw=1280; maxh=960; break;
}
if((w > maxw) || (h > maxh)) return FALSE;
}
return TRUE;
}

View File

@ -100,6 +100,7 @@ public: // methods
void FixWindowFrame(HWND);
HDC AcquireEmulatedDC(HWND);
HDC AcquireEmulatedDC(HDC);
HDC AcquireEmulatedDC(LPDIRECTDRAWSURFACE);
BOOL ReleaseEmulatedDC(HWND);
BOOL IsVirtual(HDC);
void ResetEmulatedDC();
@ -110,6 +111,7 @@ public: // methods
void PopTimer(UINT);
void PopTimer(HWND, UINT_PTR);
void RenewTimers();
BOOL CheckScreenResolution(unsigned int, unsigned int);
public: // simple data variables
DDPIXELFORMAT ActualPixelFormat;
@ -177,7 +179,7 @@ typedef enum {
SYSLIBIDX_DIRECT3D9,
SYSLIBIDX_DIRECT3D10,
SYSLIBIDX_DIRECT3D10_1,
SYSLIBIDX_DIRECT2D11,
SYSLIBIDX_DIRECT3D11,
SYSLIBIDX_OPENGL,
SYSLIBIDX_MSVFW,
SYSLIBIDX_SMACK,
@ -197,5 +199,9 @@ typedef enum {
SYSLIBIDX_WINTRUST,
SYSLIBIDX_DIRECT3D,
SYSLIBIDX_DIRECT3D700,
// SYSLIBIDX_GLIDE,
// SYSLIBIDX_GLIDE2X,
// SYSLIBIDX_GLIDE3X,
SYSLIBIDX_MAX }
enum_syslibraries;

View File

@ -24,7 +24,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "dxwnd.h"
#include "dxwcore.hpp"
#define VERSION "2.02.53"
#define VERSION "2.02.54"
#define DDTHREADLOCK 1

Binary file not shown.

View File

@ -332,6 +332,10 @@
RelativePath=".\gdi32.cpp"
>
</File>
<File
RelativePath=".\glide.cpp"
>
</File>
<File
RelativePath="hd3d.cpp"
>
@ -425,6 +429,10 @@
RelativePath=".\glhook.h"
>
</File>
<File
RelativePath=".\glidehook.h"
>
</File>
<File
RelativePath=".\hddraw.h"
>

View File

@ -629,7 +629,7 @@ HDC WINAPI extDDCreateCompatibleDC(HDC hdc)
res=(*pGetDC)(dxw.lpDDSPrimHDC, &PrimHDC);
if(res) OutTraceE("GDI.CreateCompatibleDC ERROR: GetDC lpdds=%x err=%d(%s) at %d\n", dxw.lpDDSPrimHDC, res, ExplainDDError(res), __LINE__);
}
OutTraceDW("GDI.CreateCompatibleDC: duplicating screen HDC lpDDSPrimHDC=%x SrcHdc=%x\n", dxw.lpDDSPrimHDC, PrimHDC);
OutTraceDW("GDI.CreateCompatibleDC: duplicating primary surface HDC lpDDSPrimHDC=%x SrcHdc=%x\n", dxw.lpDDSPrimHDC, PrimHDC);
RetHdc=(*pGDICreateCompatibleDC)(PrimHDC);
}
else
@ -654,7 +654,6 @@ BOOL WINAPI extDDDeleteDC(HDC hdc)
return res;
}
#if 1
static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
{
HDC hdc;
@ -700,42 +699,6 @@ static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
OutTraceE("%s: ERROR err=%d at %d\n", api, GetLastError, __LINE__);
return(hdc);
}
#else
HDC hPrimaryDC=NULL;
static HDC WINAPI winDDGetDC(HWND hwnd, char *api)
{
HDC hdc;
//HRESULT res;
//extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
OutTraceDW("%s: hwnd=%x\n", api, hwnd);
//dxw.ResetPrimarySurface();
//dxw.SetPrimarySurface();
if(dxw.IsRealDesktop(hwnd) && dxw.IsFullScreen()){
LPDIRECTDRAWSURFACE lpPrim;
HDC PrimDC;
lpPrim=dxw.GetPrimarySurface();
(*pGetDC)(lpPrim, &PrimDC);
hdc=(*pGDICreateCompatibleDC)(PrimDC);
(*pReleaseDC)(lpPrim, PrimDC);
OutTraceDW("%s: returning DDRAW DC handle hwnd=%x hdc=%x\n", api, hwnd, hdc);
hPrimaryDC=hdc;
return hdc;
}
else {
hdc=(*pGDIGetDC)(hwnd ? hwnd : dxw.GethWnd());
OutTraceDW("%s: returning window DC handle hwnd=%x hdc=%x\n", api, hwnd, hdc);
//PrimHDC=NULL;
}
if(hdc)
OutTraceDW("%s: hwnd=%x hdc=%x\n", api, hwnd, hdc);
else
OutTraceE("%s: ERROR err=%d at %d\n", api, GetLastError, __LINE__);
return(hdc);
}
#endif
HDC WINAPI extDDCreateDC(LPSTR Driver, LPSTR Device, LPSTR Output, CONST DEVMODE *InitData)
{
@ -807,9 +770,8 @@ BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHe
OutTraceDW("GDI.BitBlt(PRIMARY): HDC=%x nXDest=%d nYDest=%d nWidth=%d nHeight=%d hdcSrc=%x nXSrc=%d nYSrc=%d dwRop=%x(%s)\n",
hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop, ExplainROP(dwRop));
ret=1; // OK
ret=TRUE; // OK
//if(hdcDest==0) {
if(dxw.IsDesktop(WindowFromDC(hdcDest))) {
OutTrace("hdcDest=%x PrimHDC=%x\n", hdcDest, PrimHDC);
hdcDest=PrimHDC;
@ -822,20 +784,12 @@ BOOL WINAPI extDDBitBlt(HDC hdcDest, int nXDest, int nYDest, int nWidth, int nHe
res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
dxw.ScreenRefresh();
return ret;
}
// proxy ...
res=(*pGDIBitBlt)(hdcDest, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
if(!res) OutTraceE("GDI.BitBlt: ERROR err=%d at %d\n", GetLastError(), __LINE__);
//dxw.SetPrimarySurface();
//OutTraceDW("GDI.StretchBlt: refreshing primary surface lpdds=%x\n",dxw.lpDDSPrimHDC);
//sBlt("GDI.BitBlt", dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL, 0);
//res=(*pUnlockMethod(dxw.lpDDSPrimHDC))(dxw.lpDDSPrimHDC, NULL);
//res=(*pGDIBitBlt)(NULL, nXDest, nYDest, nWidth, nHeight, hdcSrc, nXSrc, nYSrc, dwRop);
//if(!res) ret=0;
return ret;
}

130
dll/glide.cpp Normal file
View File

@ -0,0 +1,130 @@
#define __MSC__
#include <stdio.h>
#include <stdlib.h>
#include "dxwnd.h"
#include "dxwcore.hpp"
#include "syslibs.h"
#include "dxhook.h"
#include "hddraw.h"
#include "dxhelper.h"
#include "glidehook.h"
void WINAPI extgrGlideInit(void);
void WINAPI extgrGlideShutdown(void);
void WINAPI extgrClipWindow(FxU32, FxU32, FxU32, FxU32);
GrContext_t WINAPI extgrSstWinOpen(FxU32, GrScreenResolution_t, GrScreenRefresh_t, GrColorFormat_t, GrOriginLocation_t, int, int);
FxI32 WINAPI extgrQueryResolutions (const GrResolution *, GrResolution *);
grGlideInit_Type pgrGlideInit = 0;
grGlideShutdown_Type pgrGlideShutdown = 0;
grClipWindow_Type pgrClipWindow = 0;
grSstWinOpen_Type pgrSstWinOpen = 0;
grQueryResolutions_Type pgrQueryResolutions = 0;
static HookEntry_Type Hooks[]={
{"_grGlideInit@0", (FARPROC)NULL, (FARPROC *)&pgrGlideInit, (FARPROC)extgrGlideInit},
{"_grGlideShutdown@0", (FARPROC)NULL, (FARPROC *)&pgrGlideShutdown, (FARPROC)extgrGlideShutdown},
{"_grClipWindow@16", (FARPROC)NULL, (FARPROC *)&pgrClipWindow, (FARPROC)extgrClipWindow},
{"_grSstWinOpen@28", (FARPROC)NULL, (FARPROC *)&pgrSstWinOpen, (FARPROC)extgrSstWinOpen},
{"_grQueryResolutions@8", (FARPROC)NULL, (FARPROC *)&pgrQueryResolutions, (FARPROC)extgrQueryResolutions},
{0, NULL, 0, 0} // terminator
};
FARPROC Remap_Glide_ProcAddress(LPCSTR proc, HMODULE hModule)
{
FARPROC addr;
OutTrace("Remap_Glide_ProcAddress: proc=%s\n", proc);
if(!(dxw.dwFlags4 & HOOKGLIDE)) return NULL;
if (addr=RemapLibrary(proc, hModule, Hooks)) return addr;
// NULL -> keep the original call address
return NULL;
}
void HookGlideLibs(HMODULE hModule)
{
OutTraceDW("HookGlideLibs module=%x\n", hModule);
HookLibrary(hModule, Hooks, "glide.dll");
HookLibrary(hModule, Hooks, "glide2x.dll");
HookLibrary(hModule, Hooks, "glide3x.dll");
return;
}
// static utility
static char *ExplainGlideRes(int res)
{
char *p;
switch(res){
case GR_RESOLUTION_320x200: p="320x200"; break;
case GR_RESOLUTION_320x240: p="320x240"; break;
case GR_RESOLUTION_400x256: p="400x256"; break;
case GR_RESOLUTION_512x384: p="512x384"; break;
case GR_RESOLUTION_640x200: p="640x200"; break;
case GR_RESOLUTION_640x350: p="640x350"; break;
case GR_RESOLUTION_640x400: p="640x400"; break;
case GR_RESOLUTION_640x480: p="640x480"; break;
case GR_RESOLUTION_800x600: p="800x600"; break;
case GR_RESOLUTION_960x720: p="960x720"; break;
case GR_RESOLUTION_856x480: p="856x480"; break;
case GR_RESOLUTION_512x256: p="512x256"; break;
case GR_RESOLUTION_1024x768: p="1024x768"; break;
case GR_RESOLUTION_1280x1024: p="1280x1024"; break;
case GR_RESOLUTION_1600x1200: p="1600x1200"; break;
case GR_RESOLUTION_400x300: p="400x300"; break;
case GR_RESOLUTION_NONE: p="NONE"; break;
default: p="unknown"; break;
}
return p;
}
// glide wrappers
void WINAPI extgrClipWindow(FxU32 minx, FxU32 miny, FxU32 maxx, FxU32 maxy)
{
OutTrace("grClipWindow: win=(%d,%d)-(%d,%d)\n", minx, miny, maxx, maxy);
return (*pgrClipWindow)(minx, miny, maxx, maxy);
}
GrContext_t WINAPI extgrSstWinOpen(
FxU32 hWin,
GrScreenResolution_t res,
GrScreenRefresh_t ref,
GrColorFormat_t cFormat,
GrOriginLocation_t org_loc,
int num_buffers,
int num_aux_buffers)
{
GrContext_t ret;
OutTrace("grSstWinOpen: hWin=%x res=%x(%s)\n", hWin, res, ExplainGlideRes(res));
if(dxw.IsDesktop((HWND)hWin)) hWin=(FxU32)dxw.GethWnd();
ret=(*pgrSstWinOpen)(hWin, res, ref, cFormat, org_loc, num_buffers, num_aux_buffers);
OutTrace("grSstWinOpen: ret=%x\n", ret);
return ret;
}
FxI32 WINAPI extgrQueryResolutions (const GrResolution *resTemplate, GrResolution *output)
{
FxI32 ret;
OutTrace("grQueryResolutions: resolution=%x refresh=%x numColorBuffers=%d numAuxBuffers=%d\n",
resTemplate->resolution, resTemplate->refresh, resTemplate->numColorBuffers, resTemplate->numAuxBuffers);
ret=(*pgrQueryResolutions)(resTemplate, output);
OutTrace("grQueryResolutions: res=%d\n", ret);
return ret;
}
void WINAPI extgrGlideInit(void)
{
OutTrace("grGlideInit\n");
return;
}
void WINAPI extgrGlideShutdown(void)
{
OutTrace("grGlideShutdown\n");
return;
}

14
dll/glidehook.h Normal file
View File

@ -0,0 +1,14 @@
#define __WIN32__
#define __MSC__
#include "3dfx.h"
#include "glide.h"
extern void HookGlideLibs(HMODULE);
typedef void (WINAPI *grGlideInit_Type)(void);
typedef void (WINAPI *grGlideShutdown_Type)(void);
typedef void (WINAPI *grClipWindow_Type)(FxU32, FxU32, FxU32, FxU32);
typedef GrContext_t (WINAPI *grSstWinOpen_Type)(FxU32, GrScreenResolution_t, GrScreenRefresh_t, GrColorFormat_t, GrOriginLocation_t, int, int);
typedef FxI32 (WINAPI *grQueryResolutions_Type)(const GrResolution *, GrResolution *);

View File

@ -406,7 +406,10 @@ HMODULE WINAPI LoadLibraryExWrapper(LPCTSTR lpFileName, HANDLE hFile, DWORD dwFl
if(dwFlags & (LOAD_LIBRARY_AS_DATAFILE_EXCLUSIVE|LOAD_LIBRARY_AS_DATAFILE)) return libhandle;
idx=dxw.GetDLLIndex((char *)lpFileName);
if(idx != -1) SysLibs[idx]=libhandle;
if(idx != -1) {
OutTraceDW("%s: push idx=%x library=%s hdl=%x\n", api, idx, lpFileName, libhandle);
SysLibs[idx]=libhandle;
}
// handle custom OpenGL library
if(!lstrcmpi(lpFileName,dxw.CustomOpenGLLib)){
idx=SYSLIBIDX_OPENGL;
@ -509,12 +512,17 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc)
case SYSLIBIDX_DIRECT3D10_1:
if (remap=Remap_d3d10_1_ProcAddress(proc, hModule)) return remap;
break;
case SYSLIBIDX_DIRECT2D11:
case SYSLIBIDX_DIRECT3D11:
if (remap=Remap_d3d11_ProcAddress(proc, hModule)) return remap;
break;
case SYSLIBIDX_OPENGL:
if (remap=Remap_gl_ProcAddress(proc, hModule)) return remap;
break;
// case SYSLIBIDX_GLIDE:
// case SYSLIBIDX_GLIDE2X:
// case SYSLIBIDX_GLIDE3X:
// if (remap=Remap_Glide_ProcAddress(proc, hModule)) return remap;
// break;
case SYSLIBIDX_MSVFW:
if (remap=Remap_vfw_ProcAddress(proc, hModule)) return remap;
break;
@ -534,7 +542,7 @@ FARPROC WINAPI extGetProcAddress(HMODULE hModule, LPCSTR proc)
if (remap=Remap_d3d7_ProcAddress(proc, hModule)) return remap;
break;
default:
break;
break;
}
}
else {

View File

@ -568,7 +568,8 @@ LONG WINAPI extSetWindowLong(HWND hwnd, int nIndex, LONG dwNewLong)
}
if (dxw.dwFlags1 & FIXWINFRAME){
if((nIndex==GWL_STYLE) && !(dwNewLong & WS_CHILD)){
//if((nIndex==GWL_STYLE) && !(dwNewLong & WS_CHILD)){
if((nIndex==GWL_STYLE) && !(dwNewLong & WS_CHILD) && dxw.IsDesktop(hwnd)){
OutTraceDW("SetWindowLong: GWL_STYLE %x force OVERLAPPEDWINDOW\n", dwNewLong);
dwNewLong |= WS_OVERLAPPEDWINDOW;
dwNewLong &= ~WS_CLIPSIBLINGS;
@ -1189,7 +1190,8 @@ static HWND WINAPI extCreateWindowCommon(
(*pShowWindow)(wndh, SW_SHOWNORMAL);
}
if ((dxw.dwFlags1 & FIXWINFRAME) && !(dwStyle & WS_CHILD))
//if ((dxw.dwFlags1 & FIXWINFRAME) && !(dwStyle & WS_CHILD))
if ((dxw.dwFlags1 & FIXWINFRAME) && !(dwStyle & WS_CHILD) && dxw.IsDesktop(wndh))
dxw.FixWindowFrame(wndh);
// to do: handle inner child, and leave dialogue & modal child alone!!!
@ -1686,7 +1688,6 @@ int WINAPI extGDIReleaseDC(HWND hwnd, HDC hDC)
HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
{
HDC hdc;
extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
OutTraceDW("GDI.BeginPaint: hwnd=%x lpPaint=%x FullScreen=%x\n", hwnd, lpPaint, dxw.IsFullScreen());
hdc=(*pBeginPaint)(hwnd, lpPaint);
@ -1695,12 +1696,7 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
if(!dxw.IsFullScreen()) return hdc;
// on CLIENTREMAPPING, resize the paint area to virtual screen size
if(dxw.dwFlags1 & CLIENTREMAPPING){
lpPaint->rcPaint.top=0;
lpPaint->rcPaint.left=0;
lpPaint->rcPaint.right=dxw.GetScreenWidth();
lpPaint->rcPaint.bottom=dxw.GetScreenHeight();
}
if(dxw.dwFlags1 & CLIENTREMAPPING) lpPaint->rcPaint=dxw.GetScreenRect();
if(!dxw.IsDesktop(hwnd)) return hdc;
@ -1708,7 +1704,7 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
HDC EmuHDC;
EmuHDC = dxw.AcquireEmulatedDC(hwnd);
lpPaint->hdc=EmuHDC;
dxw.MapClient(&lpPaint->rcPaint);
//dxw.MapClient(&lpPaint->rcPaint);
OutTraceDW("GDI.BeginPaint(GDIEMULATEDC): hdc=%x -> %x\n", hdc, EmuHDC);
return EmuHDC;
}
@ -1717,27 +1713,22 @@ HDC WINAPI extBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
return hdc;
}
#ifndef EXPERIMENTAL
HDC WINAPI extDDBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
{
HDC hdc;
extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
OutTraceDW("GDI.BeginPaint: hwnd=%x lpPaint=%x FullScreen=%x\n", hwnd, lpPaint, dxw.IsFullScreen());
OutTraceDW("GDI.BeginPaint: hwnd=%x%s lpPaint=%x FullScreen=%x\n",
hwnd, dxw.IsDesktop(hwnd)?"(DESKTOP)":"", lpPaint, dxw.IsFullScreen());
if(dxw.IsDesktop(hwnd)) hwnd=dxw.GethWnd();
hdc=(*pBeginPaint)(hwnd, lpPaint);
// if not in fullscreen mode, that's all!
if(!dxw.IsFullScreen()) return hdc;
// on CLIENTREMAPPING, resize the paint area to virtual screen size
if(dxw.dwFlags1 & CLIENTREMAPPING){
lpPaint->rcPaint.top=0;
lpPaint->rcPaint.left=0;
lpPaint->rcPaint.right=dxw.GetScreenWidth();
lpPaint->rcPaint.bottom=dxw.GetScreenHeight();
}
if(!dxw.IsDesktop(hwnd)) return hdc;
// on MAPGDITOPRIMARY, return the PrimHDC handle instead of the window DC
// if a primary surface has not been created yet, do it
if(!pGetDC || !dxw.lpDDSPrimHDC){
@ -1747,8 +1738,7 @@ HDC WINAPI extDDBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
LPDIRECTDRAWSURFACE lpDDS;
DDSURFACEDESC ddsd;
res=extDirectDrawCreate(0, &lpDD, NULL);
//lpDD->SetDisplayMode(dxw.GetScreenWidth(), dxw.GetScreenHeight(), NULL);
lpDD->SetCooperativeLevel(hwnd, DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE);
lpDD->SetCooperativeLevel(dxw.GethWnd(), DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE);
memset((void *)&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH;
@ -1759,61 +1749,80 @@ HDC WINAPI extDDBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
dxw.lpDDSPrimHDC = lpDDS;
OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): dd=%x ddsPrim=%x\n", lpDD, lpDDS);
}
extGetDC(dxw.lpDDSPrimHDC,&PrimHDC);
lpPaint->hdc=PrimHDC;
//dxw.MapClient(&lpPaint->rcPaint);
// resize the paint area to virtual screen size (see CivIII clipped panels...)
lpPaint->rcPaint=dxw.GetScreenRect();
OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): hdc=%x -> %x\n", hdc, PrimHDC);
return PrimHDC;
}
#else
HDC WINAPI extDDBeginPaint(HWND hwnd, LPPAINTSTRUCT lpPaint)
{
HDC hdc;
extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
OutTraceDW("GDI.BeginPaint: hwnd=%x%s lpPaint=%x FullScreen=%x\n",
hwnd, dxw.IsDesktop(hwnd)?"(DESKTOP)":"", lpPaint, dxw.IsFullScreen());
if(dxw.IsDesktop(hwnd)) hwnd=dxw.GethWnd();
hdc=(*pBeginPaint)(hwnd, lpPaint);
// if not in fullscreen mode, that's all!
if(!dxw.IsFullScreen()) return hdc;
// on MAPGDITOPRIMARY, return the PrimHDC handle instead of the window DC
// if a primary surface has not been created yet, do it
if(!pGetDC || !dxw.lpDDSPrimHDC){
extern HRESULT WINAPI extDirectDrawCreate(GUID FAR *, LPDIRECTDRAW FAR *, IUnknown FAR *);
HRESULT res;
LPDIRECTDRAW lpDD;
LPDIRECTDRAWSURFACE lpDDS;
DDSURFACEDESC ddsd;
res=extDirectDrawCreate(0, &lpDD, NULL);
lpDD->SetCooperativeLevel(dxw.GethWnd(), DDSCL_FULLSCREEN | DDSCL_EXCLUSIVE);
memset((void *)&ddsd, 0, sizeof(DDSURFACEDESC));
ddsd.dwSize = sizeof(DDSURFACEDESC);
ddsd.dwFlags = DDSD_CAPS|DDSD_HEIGHT|DDSD_WIDTH;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE;
ddsd.dwHeight = dxw.GetScreenHeight();
ddsd.dwWidth = dxw.GetScreenWidth();
res=lpDD->CreateSurface(&ddsd, &lpDDS, NULL);
dxw.lpDDSPrimHDC = lpDDS;
OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): dd=%x ddsPrim=%x\n", lpDD, lpDDS);
}
HDC EmuHDC;
EmuHDC = dxw.AcquireEmulatedDC(dxw.lpDDSPrimHDC);
lpPaint->hdc=EmuHDC;
lpPaint->rcPaint=dxw.GetScreenRect();
OutTraceDW("GDI.BeginPaint(MAPGDITOPRIMARY): hdc=%x -> %x\n", hdc, EmuHDC);
return EmuHDC;
}
#endif
BOOL WINAPI extEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint)
{
BOOL ret;
extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc);
extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx);
OutTraceDW("GDI.EndPaint: hwnd=%x lpPaint=%x lpPaint.hdc=%x\n", hwnd, lpPaint, lpPaint->hdc);
if((dxw.dwFlags3 & GDIEMULATEDC) && dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){
OutTraceDW("GDI.EndPaint(GDIEMULATEDC): hwnd=%x\n", hwnd);
ret=dxw.ReleaseEmulatedDC(hwnd);
ret=(*pEndPaint)(hwnd, lpPaint); // useful ???? seems not ....
if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__);
return ret;
}
// v2.02.53 ...
if((dxw.dwFlags1 & MAPGDITOPRIMARY) && dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){
ret=(*pEndPaint)(hwnd, lpPaint);
dxw.lpDDSPrimHDC->Unlock(NULL);
//dxw.ScreenRefresh();
extBlt(dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL);
return TRUE;
}
// proxy part ...
ret=(*pEndPaint)(hwnd, lpPaint);
OutTraceDW("GDI.EndPaint: hwnd=%x ret=%x\n", hwnd, ret);
if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__);
//return ret;
// if not in fullscreen mode, that's all!
if(!dxw.IsFullScreen()) return ret;
// v2.02.09: on MAPGDITOPRIMARY, release the PrimHDC handle
if(dxw.dwFlags1 & MAPGDITOPRIMARY) {
if(pReleaseDC && dxw.lpDDSPrimHDC){
extGetDC(dxw.lpDDSPrimHDC,&PrimHDC);
extReleaseDC(dxw.lpDDSPrimHDC, PrimHDC);
OutTraceDW("GDI.EndPaint: released hdc=%x\n", PrimHDC);
}
}
return ret;
}
#ifndef EXPERIMENTAL
BOOL WINAPI extDDEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint)
{
BOOL ret;
@ -1821,10 +1830,12 @@ BOOL WINAPI extDDEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint)
extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx);
OutTraceDW("GDI.EndPaint: hwnd=%x lpPaint=%x lpPaint.hdc=%x\n", hwnd, lpPaint, lpPaint->hdc);
OutTraceDW("GDI.EndPaint: hwnd=%x%s lpPaint=%x lpPaint.hdc=%x\n",
hwnd, dxw.IsDesktop(hwnd)?"(DESKTOP)":"", lpPaint, lpPaint->hdc);
// v2.02.53 ...
if(dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){
//if(dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){
if(dxw.IsFullScreen()){
ret=(*pEndPaint)(hwnd, lpPaint);
dxw.lpDDSPrimHDC->Unlock(NULL);
//dxw.ScreenRefresh();
@ -1838,6 +1849,40 @@ BOOL WINAPI extDDEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint)
if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__);
return ret;
}
#else
BOOL WINAPI extDDEndPaint(HWND hwnd, const PAINTSTRUCT *lpPaint)
{
BOOL ret;
extern HRESULT WINAPI extReleaseDC(LPDIRECTDRAWSURFACE lpdds, HDC FAR hdc);
extern HRESULT WINAPI extGetDC(LPDIRECTDRAWSURFACE, HDC FAR *);
extern HRESULT WINAPI extBlt(LPDIRECTDRAWSURFACE lpdds, LPRECT lpdestrect, LPDIRECTDRAWSURFACE lpddssrc, LPRECT lpsrcrect, DWORD dwflags, LPDDBLTFX lpddbltfx);
OutTraceDW("GDI.EndPaint: hwnd=%x%s lpPaint=%x lpPaint.hdc=%x\n",
hwnd, dxw.IsDesktop(hwnd)?"(DESKTOP)":"", lpPaint, lpPaint->hdc);
// v2.02.53 ...
//if(dxw.IsFullScreen() && dxw.IsDesktop(hwnd)){
if(dxw.IsFullScreen()){
RECT client;
HDC hdc;
ret=(*pEndPaint)(hwnd, lpPaint);
(*pGetDC)(dxw.lpDDSPrimHDC, &hdc);
(*pGetClientRect)(hwnd, &client);
if(!(*pGDIBitBlt)(hdc, 0, 0, client.right, client.bottom, lpPaint->hdc, 0, 0, SRCCOPY))
OutTraceE("StretchBlt: ERROR err=%d at=%d\n", GetLastError(), __LINE__);
extReleaseDC(dxw.lpDDSPrimHDC, hdc);
//dxw.ScreenRefresh();
extBlt(dxw.lpDDSPrimHDC, NULL, dxw.lpDDSPrimHDC, NULL, 0, NULL);
return TRUE;
}
// proxy part ...
ret=(*pEndPaint)(hwnd, lpPaint);
OutTraceDW("GDI.EndPaint: hwnd=%x ret=%x\n", hwnd, ret);
if(!ret) OutTraceE("GDI.EndPaint ERROR: err=%d at %d\n", GetLastError(), __LINE__);
return ret;
}
#endif
HWND WINAPI extCreateDialogIndirectParam(HINSTANCE hInstance, LPCDLGTEMPLATE lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit)
{

View File

@ -73,6 +73,8 @@
#define IDC_VIDEOTOSYSTEMMEM 1030
#define IDC_FIXTEXTOUT 1031
#define IDC_KEEPCURSORWITHIN 1032
#define IDC_FIXTEXTOUT2 1032
#define IDC_HOOKGLIDE 1032
#define IDC_USERGB565 1033
#define IDC_SUPPRESSDXERRORS 1034
#define IDC_PREVENTMAXIMIZE 1035

View File

@ -34,6 +34,9 @@ void CTabSysLibs::DoDataExchange(CDataExchange* pDX)
// OpenGL
DDX_Check(pDX, IDC_FORCEHOOKOPENGL, cTarget->m_ForceHookOpenGL);
DDX_Text(pDX, IDC_OPENGLLIB, cTarget->m_OpenGLLib);
// Glide
DDX_Check(pDX, IDC_HOOKGLIDE, cTarget->m_HookGlide);
}
BEGIN_MESSAGE_MAP(CTabSysLibs, CDialog)

View File

@ -20,7 +20,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
: CDialog(CTargetDlg::IDD, pParent)
{
//{{AFX_DATA_INIT(CTargetDlg)
m_DXVersion = -1;
m_DXVersion = 0;
m_Coordinates = 0;
m_DxEmulationMode = 3; // default: EMULATESURFACE
m_DCEmulationMode = 0; // default: no emulation
@ -88,6 +88,7 @@ CTargetDlg::CTargetDlg(CWnd* pParent /*=NULL*/)
m_CursorClipping = FALSE;
m_VideoToSystemMem = FALSE;
m_FixTextOut = FALSE;
m_HookGlide = FALSE;
m_KeepCursorWithin = FALSE;
m_KeepCursorFixed = FALSE;
m_UseRGB565 = FALSE;

View File

@ -70,6 +70,7 @@ public:
BOOL m_CursorClipping;
BOOL m_VideoToSystemMem;
BOOL m_FixTextOut;
BOOL m_HookGlide;
BOOL m_KeepCursorWithin;
BOOL m_KeepCursorFixed;
BOOL m_UseRGB565;

Binary file not shown.

View File

@ -339,14 +339,14 @@ BEGIN
CONTROL "Suppress clipping",IDC_SUPPRESSCLIPPING,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,76,119,10
CONTROL "Palette update don't Blit",IDC_NOPALETTEUPDATE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,88,119,10
CONTROL "Set AERO compatible mode",IDC_SETCOMPATIBILITY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,100,109,12
CONTROL "Disable HAL support",IDC_DISABLEHAL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,112,109,12
CONTROL "Forces HEL ",IDC_FORCESHEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,124,109,12
CONTROL "Win7 color fix",IDC_COLORFIX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,136,109,12
CONTROL "Don't fix the Pixel Format",IDC_NOPIXELFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,148,109,12
CONTROL "Disable HAL support",IDC_DISABLEHAL,"Button",BS_AUTOCHECKBOX | NOT WS_VISIBLE | WS_DISABLED | WS_TABSTOP,118,216,109,12
CONTROL "Forces HEL ",IDC_FORCESHEL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,112,109,12
CONTROL "Win7 color fix",IDC_COLORFIX,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,124,109,12
CONTROL "Don't fix the Pixel Format",IDC_NOPIXELFORMAT,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,136,109,12
CONTROL "by default set no ALPHACHANNEL",IDC_NOALPHACHANNEL,
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,160,123,12
CONTROL "Fix ddraw ref counter",IDC_FIXREFCOUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,172,123,12
CONTROL "Add proxy libs",IDC_ADDPROXYLIBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,184,123,12
"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,148,123,12
CONTROL "Fix ddraw ref counter",IDC_FIXREFCOUNTER,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,160,123,12
CONTROL "Add proxy libs",IDC_ADDPROXYLIBS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,118,172,123,12
END
IDD_TAB_INPUT DIALOGEX 0, 0, 300, 240
@ -481,6 +481,8 @@ BEGIN
LTEXT "Custom OpenGL library",IDC_STATIC,161,43,110,9
EDITTEXT IDC_OPENGLLIB,159,55,126,14,ES_AUTOHSCROLL
CONTROL "Force Hook",IDC_FORCEHOOKOPENGL,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,162,29,115,10
GROUPBOX "Glide (3DFX)",IDC_STATIC,7,98,140,72
CONTROL "Hook Glide libs",IDC_HOOKGLIDE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,112,125,10
END
IDD_TAB_DEBUG DIALOGEX 0, 0, 300, 240

Binary file not shown.

View File

@ -196,6 +196,7 @@ static void SetTargetFromDlg(TARGETMAP *t, CTargetDlg *dlg)
if(dlg->m_CursorClipping) t->flags |= CLIPCURSOR;
if(dlg->m_VideoToSystemMem) t->flags |= SWITCHVIDEOMEMORY;
if(dlg->m_FixTextOut) t->flags |= FIXTEXTOUT;
if(dlg->m_HookGlide) t->flags4 |= HOOKGLIDE;
if(dlg->m_KeepCursorWithin) t->flags |= KEEPCURSORWITHIN;
if(dlg->m_KeepCursorFixed) t->flags2 |= KEEPCURSORFIXED;
if(dlg->m_UseRGB565) t->flags |= USERGB565;
@ -348,6 +349,7 @@ static void SetDlgFromTarget(TARGETMAP *t, CTargetDlg *dlg)
dlg->m_CursorClipping = t->flags & CLIPCURSOR ? 1 : 0;
dlg->m_VideoToSystemMem = t->flags & SWITCHVIDEOMEMORY ? 1 : 0;
dlg->m_FixTextOut = t->flags & FIXTEXTOUT ? 1 : 0;
dlg->m_HookGlide = t->flags4 & HOOKGLIDE ? 1 : 0;
dlg->m_KeepCursorWithin = t->flags & KEEPCURSORWITHIN ? 1 : 0;
dlg->m_KeepCursorFixed = t->flags2 & KEEPCURSORFIXED ? 1 : 0;
dlg->m_UseRGB565 = t->flags & USERGB565 ? 1 : 0;
@ -1142,16 +1144,17 @@ void CDxwndhostView::OnAdd()
CTargetDlg dlg;
LV_ITEM listitem;
dlg.m_DXVersion = 0;
dlg.m_Coordinates = 0;
dlg.m_MaxX = 0; //639;
dlg.m_MaxY = 0; //479;
dlg.m_DxEmulationMode = 3; // defaulting to EMULATIONMODE
//dlg.m_DXVersion = 0;
//dlg.m_Coordinates = 0;
//dlg.m_MaxX = 0; //639;
//dlg.m_MaxY = 0; //479;
//dlg.m_DxEmulationMode = 3; // defaulting to EMULATIONMODE
for(i = 0; i < MAXTARGETS; i ++) if(!TargetMaps[i].path[0]) break;
if(i>=MAXTARGETS){
MessageBoxEx(0, "Maximum entries number reached.\nDelete some entry to add a new one.", "Warning", MB_OK | MB_ICONEXCLAMATION, NULL);
return;
}
memset(&TargetMaps[i],0,sizeof(TARGETMAP)); // clean up, just in case....
if(dlg.DoModal() == IDOK && dlg.m_FilePath.GetLength()){
strncpy(TitleMaps[i].title, dlg.m_Title, 40);
SetTargetFromDlg(&TargetMaps[i], &dlg);