Removed several unused files.
This commit is contained in:
parent
455f56573e
commit
78cdb29e7a
12 changed files with 1 additions and 2835 deletions
|
@ -1,147 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 1995, 1996 Microsoft Corporation. All Rights Reserved.
|
||||
*
|
||||
* File: d3dmacs.h
|
||||
*
|
||||
* Useful macros for generating execute buffers. Consult the D3D sample
|
||||
* code for examples of their usage.
|
||||
*
|
||||
* Use OP_NOP to QWORD align triangle and line instructions.
|
||||
*/
|
||||
|
||||
#ifndef __D3DMACS_H__
|
||||
#define __D3DMACS_H__
|
||||
|
||||
#undef RELEASE
|
||||
|
||||
#ifndef __cplusplus
|
||||
#define MAKE_MATRIX(lpDev, handle, data) \
|
||||
if (lpDev->lpVtbl->CreateMatrix(lpDev, &handle) != D3D_OK) \
|
||||
return FALSE; \
|
||||
if (lpDev->lpVtbl->SetMatrix(lpDev, handle, &data) != D3D_OK) \
|
||||
return FALSE
|
||||
#define RELEASE(x) if (x != NULL) {x->lpVtbl->Release(x); x = NULL;}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define MAKE_MATRIX(lpDev, handle, data) \
|
||||
if (lpDev->CreateMatrix(&handle) != D3D_OK) \
|
||||
return FALSE; \
|
||||
if (lpDev->SetMatrix(handle, &data) != D3D_OK) \
|
||||
return FALSE
|
||||
#define RELEASE(x) if (x != NULL) {x->Release(); x = NULL;}
|
||||
#endif
|
||||
|
||||
#define PUTD3DINSTRUCTION(op, sz, cnt, ptr) \
|
||||
((LPD3DINSTRUCTION) ptr)->bOpcode = op; \
|
||||
((LPD3DINSTRUCTION) ptr)->bSize = sz; \
|
||||
((LPD3DINSTRUCTION) ptr)->wCount = cnt; \
|
||||
ptr = (void *)(((LPD3DINSTRUCTION) ptr) + 1)
|
||||
|
||||
#define VERTEX_DATA(loc, cnt, ptr) \
|
||||
if ((ptr) != (loc)) memcpy((ptr), (loc), sizeof(D3DVERTEX) * (cnt)); \
|
||||
ptr = (void *)(((LPD3DVERTEX) (ptr)) + (cnt))
|
||||
|
||||
// OP_MATRIX_MULTIPLY size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_MATRIX_MULTIPLY(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_MATRIXMULTIPLY, sizeof(D3DMATRIXMULTIPLY), cnt, ptr)
|
||||
|
||||
// MATRIX_MULTIPLY_DATA size: 12 (sizeof MATRIXMULTIPLY)
|
||||
#define MATRIX_MULTIPLY_DATA(src1, src2, dest, ptr) \
|
||||
((LPD3DMATRIXMULTIPLY) ptr)->hSrcMatrix1 = src1; \
|
||||
((LPD3DMATRIXMULTIPLY) ptr)->hSrcMatrix2 = src2; \
|
||||
((LPD3DMATRIXMULTIPLY) ptr)->hDestMatrix = dest; \
|
||||
ptr = (void *)(((LPD3DMATRIXMULTIPLY) ptr) + 1)
|
||||
|
||||
// OP_STATE_LIGHT size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_STATE_LIGHT(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_STATELIGHT, sizeof(D3DSTATE), cnt, ptr)
|
||||
|
||||
// OP_STATE_TRANSFORM size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_STATE_TRANSFORM(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_STATETRANSFORM, sizeof(D3DSTATE), cnt, ptr)
|
||||
|
||||
// OP_STATE_RENDER size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_STATE_RENDER(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_STATERENDER, sizeof(D3DSTATE), cnt, ptr)
|
||||
|
||||
// STATE_DATA size: 8 (sizeof D3DSTATE)
|
||||
#define STATE_DATA(type, arg, ptr) \
|
||||
((LPD3DSTATE) ptr)->drstRenderStateType = (D3DRENDERSTATETYPE)type; \
|
||||
((LPD3DSTATE) ptr)->dwArg[0] = arg; \
|
||||
ptr = (void *)(((LPD3DSTATE) ptr) + 1)
|
||||
|
||||
// OP_PROCESS_VERTICES size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_PROCESS_VERTICES(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_PROCESSVERTICES, sizeof(D3DPROCESSVERTICES), cnt, ptr)
|
||||
|
||||
// PROCESSVERTICES_DATA size: 16 (sizeof D3DPROCESSVERTICES)
|
||||
#define PROCESSVERTICES_DATA(flgs, strt, cnt, ptr) \
|
||||
((LPD3DPROCESSVERTICES) ptr)->dwFlags = flgs; \
|
||||
((LPD3DPROCESSVERTICES) ptr)->wStart = strt; \
|
||||
((LPD3DPROCESSVERTICES) ptr)->wDest = strt; \
|
||||
((LPD3DPROCESSVERTICES) ptr)->dwCount = cnt; \
|
||||
((LPD3DPROCESSVERTICES) ptr)->dwReserved = 0; \
|
||||
ptr = (void *)(((LPD3DPROCESSVERTICES) ptr) + 1)
|
||||
|
||||
// OP_TRIANGLE_LIST size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_TRIANGLE_LIST(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_TRIANGLE, sizeof(D3DTRIANGLE), cnt, ptr)
|
||||
|
||||
#define TRIANGLE_LIST_DATA(loc, count, ptr) \
|
||||
if ((ptr) != (loc)) memcpy((ptr), (loc), sizeof(D3DTRIANGLE) * (count)); \
|
||||
ptr = (void *)(((LPD3DTRIANGLE) (ptr)) + (count))
|
||||
|
||||
// OP_LINE_LIST size: 4 (sizeof D3DINSTRUCTION)
|
||||
#define OP_LINE_LIST(cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_LINE, sizeof(D3DLINE), cnt, ptr)
|
||||
|
||||
#define LINE_LIST_DATA(loc, count, ptr) \
|
||||
if ((ptr) != (loc)) memcpy((ptr), (loc), sizeof(D3DLINE) * (count)); \
|
||||
ptr = (void *)(((LPD3DLINE) (ptr)) + (count))
|
||||
|
||||
// OP_POINT_LIST size: 8 (sizeof D3DINSTRUCTION + sizeof D3DPOINT)
|
||||
#define OP_POINT_LIST(first, cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_POINT, sizeof(D3DPOINT), 1, ptr); \
|
||||
((LPD3DPOINT)(ptr))->wCount = cnt; \
|
||||
((LPD3DPOINT)(ptr))->wFirst = first; \
|
||||
ptr = (void*)(((LPD3DPOINT)(ptr)) + 1)
|
||||
|
||||
// OP_SPAN_LIST size: 8 (sizeof D3DINSTRUCTION + sizeof D3DSPAN)
|
||||
#define OP_SPAN_LIST(first, cnt, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_SPAN, sizeof(D3DSPAN), 1, ptr); \
|
||||
((LPD3DSPAN)(ptr))->wCount = cnt; \
|
||||
((LPD3DSPAN)(ptr))->wFirst = first; \
|
||||
ptr = (void*)(((LPD3DSPAN)(ptr)) + 1)
|
||||
|
||||
// OP_BRANCH_FORWARD size: 18 (sizeof D3DINSTRUCTION + sizeof D3DBRANCH)
|
||||
#define OP_BRANCH_FORWARD(tmask, tvalue, tnegate, toffset, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_BRANCHFORWARD, sizeof(D3DBRANCH), 1, ptr); \
|
||||
((LPD3DBRANCH) ptr)->dwMask = tmask; \
|
||||
((LPD3DBRANCH) ptr)->dwValue = tvalue; \
|
||||
((LPD3DBRANCH) ptr)->bNegate = tnegate; \
|
||||
((LPD3DBRANCH) ptr)->dwOffset = toffset; \
|
||||
ptr = (void *)(((LPD3DBRANCH) (ptr)) + 1)
|
||||
|
||||
// OP_SET_STATUS size: 20 (sizeof D3DINSTRUCTION + sizeof D3DSTATUS)
|
||||
#define OP_SET_STATUS(flags, status, _x1, _y1, _x2, _y2, ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_SETSTATUS, sizeof(D3DSTATUS), 1, ptr); \
|
||||
((LPD3DSTATUS)(ptr))->dwFlags = flags; \
|
||||
((LPD3DSTATUS)(ptr))->dwStatus = status; \
|
||||
((LPD3DSTATUS)(ptr))->drExtent.x1 = _x1; \
|
||||
((LPD3DSTATUS)(ptr))->drExtent.y1 = _y1; \
|
||||
((LPD3DSTATUS)(ptr))->drExtent.x2 = _x2; \
|
||||
((LPD3DSTATUS)(ptr))->drExtent.y2 = _y2; \
|
||||
ptr = (void *)(((LPD3DSTATUS) (ptr)) + 1)
|
||||
|
||||
// OP_NOP size: 4
|
||||
#define OP_NOP(ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_TRIANGLE, sizeof(D3DTRIANGLE), 0, ptr)
|
||||
|
||||
#define OP_EXIT(ptr) \
|
||||
PUTD3DINSTRUCTION(D3DOP_EXIT, 0, 0, ptr)
|
||||
|
||||
#define QWORD_ALIGNED(ptr) \
|
||||
!(0x00000007L & (ULONG)(ptr))
|
||||
|
||||
#endif // __D3DMACS_H__
|
|
@ -1,64 +0,0 @@
|
|||
/* pentime.h */
|
||||
extern unsigned long int rdtsc_lo(void);
|
||||
extern unsigned long int rdtsc_hi(void);
|
||||
extern unsigned long int rdtsc_mid(void);
|
||||
|
||||
#define ProfileStart() \
|
||||
{ \
|
||||
int time = rdtsc_lo();
|
||||
#define ProfileStop(x) \
|
||||
textprint("%s %d\n",x,rdtsc_lo()-time); \
|
||||
}
|
||||
|
||||
#pragma aux rdtsc_lo = \
|
||||
"db 0fh, 31h" \
|
||||
value [eax] \
|
||||
modify [edx];
|
||||
|
||||
#pragma aux rdtsc_hi = \
|
||||
"db 0fh, 31h" \
|
||||
value [edx] \
|
||||
modify [eax];
|
||||
|
||||
#pragma aux rdtsc_mid = \
|
||||
"db 0fh, 31h" \
|
||||
"shr eax, 10h" \
|
||||
"shl edx, 10h" \
|
||||
"add eax, edx" \
|
||||
value [eax] \
|
||||
modify [edx];
|
||||
|
||||
/* Test to see if we have a Pentium or not. Note that this test is reliable
|
||||
* enough for a tools project (where we can put in an overide switch) but not
|
||||
* for a released product.
|
||||
*/
|
||||
extern unsigned char Pentium(void);
|
||||
#pragma aux Pentium = \
|
||||
"pushfd" \
|
||||
"pop eax" \
|
||||
"or eax, 00200000h" \
|
||||
"push eax" \
|
||||
"popfd" \
|
||||
"pushfd" \
|
||||
"pop eax" \
|
||||
"mov ecx, eax" \
|
||||
"and eax, 00200000h" \
|
||||
"cmp eax, 0" \
|
||||
"je not_Pentium" \
|
||||
"mov eax, ecx" \
|
||||
"and eax, 0ffdfffffh" \
|
||||
"push eax" \
|
||||
"popfd" \
|
||||
"pushfd" \
|
||||
"pop eax" \
|
||||
"and eax, 00200000h" \
|
||||
"cmp eax, 0" \
|
||||
"jne not_Pentium" \
|
||||
"is_Pentium: mov al, 1" \
|
||||
"jmp finish" \
|
||||
"not_Pentium: mov al, 0" \
|
||||
"finish: nop" \
|
||||
value [al] \
|
||||
modify [eax ecx]
|
||||
|
||||
|
File diff suppressed because it is too large
Load diff
|
@ -1,33 +0,0 @@
|
|||
#include <windows.h>
|
||||
|
||||
#include "vramtime.h"
|
||||
|
||||
static DWORD transition_times_matrix[][VWS_MAXSTATES] =
|
||||
{
|
||||
/* from DDRELEASE */
|
||||
{ 0, 20, 0, 100, 100 },
|
||||
/* from D3DTEXRELEASE */
|
||||
{ 20, 0, 100, 100, 100 },
|
||||
/* from DDCREATE */
|
||||
{ 0, 100, 0, 20, 100 },
|
||||
/* from D3DTEXCREATE */
|
||||
{ 20, 100, 20, 20, 100 },
|
||||
/* from UNKNOWN */
|
||||
{ 100, 100, 100, 100, 100 }
|
||||
};
|
||||
|
||||
|
||||
void WaitForVRamReady(VRAM_WAIT_STATE vws)
|
||||
{
|
||||
static DWORD old_time = 0;
|
||||
static VRAM_WAIT_STATE old_vws = VWS_UNKNOWN;
|
||||
|
||||
DWORD new_time;
|
||||
|
||||
if (0==old_time) old_time = timeGetTime();
|
||||
|
||||
do new_time = timeGetTime(); while (new_time - old_time < transition_times_matrix[old_vws][vws]);
|
||||
|
||||
old_time = new_time;
|
||||
old_vws = vws;
|
||||
}
|
|
@ -1,25 +0,0 @@
|
|||
#ifndef _included_vramtime_h_
|
||||
#define _included_vramtime_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum VramWaitState
|
||||
{
|
||||
VWS_DDRELEASE,
|
||||
VWS_D3DTEXRELEASE,
|
||||
VWS_DDCREATE,
|
||||
VWS_D3DTEXCREATE,
|
||||
VWS_UNKNOWN,
|
||||
VWS_MAXSTATES
|
||||
|
||||
} VRAM_WAIT_STATE;
|
||||
|
||||
void WaitForVRamReady(VRAM_WAIT_STATE);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ! _included_vramtime_h_ */
|
|
@ -1,164 +0,0 @@
|
|||
/****************************************************************************
|
||||
* *
|
||||
* ZMOUSE.H -- Include file for IntelliMouse(tm) 1.0 *
|
||||
* *
|
||||
* NOTE: Zmouse.h contains #defines required when providing IntelliMouse *
|
||||
* wheel support for Windows95 and NT3.51. Wheel is supported *
|
||||
* natively in WinNT4.0, please refer to the NT4.0 SDK for more info *
|
||||
* on providing support for IntelliMouse in NT4.0. *
|
||||
* *
|
||||
* Copyright (c) 1983-1996, Microsoft Corp. All rights reserved. *
|
||||
* *
|
||||
\***************************************************************************/
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Client Appplication (API) Defines for Wheel rolling
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
// Apps need to call RegisterWindowMessage using the #define below to
|
||||
// get the message number that is sent to the foreground window
|
||||
// when a wheel roll occurs
|
||||
|
||||
#ifdef UNICODE
|
||||
#define MSH_MOUSEWHEEL L"MSWHEEL_ROLLMSG"
|
||||
#else
|
||||
#define MSH_MOUSEWHEEL "MSWHEEL_ROLLMSG"
|
||||
#endif
|
||||
// wParam = wheel rotation expressed in multiples of WHEEL_DELTA
|
||||
// lParam is the mouse coordinates
|
||||
|
||||
#define WHEEL_DELTA 120 // Default value for rolling one notch
|
||||
|
||||
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
#define WM_MOUSEWHEEL (WM_MOUSELAST+1) // message that will be supported
|
||||
// by the OS
|
||||
#endif
|
||||
|
||||
|
||||
/**************************************************************************
|
||||
Client Appplication (API) Defines for
|
||||
* determining if wheel support active
|
||||
* determining # of Scroll Lines
|
||||
***************************************************************************/
|
||||
|
||||
// Class name for MSWHEEL.EXE's invisible window
|
||||
// use FindWindow to get hwnd to MSWHEEL
|
||||
#ifdef UNICODE
|
||||
#define MOUSEZ_CLASSNAME L"MouseZ" // wheel window class
|
||||
#define MOUSEZ_TITLE L"Magellan MSWHEEL" // wheel window title
|
||||
#else
|
||||
#define MOUSEZ_CLASSNAME "MouseZ" // wheel window class
|
||||
#define MOUSEZ_TITLE "Magellan MSWHEEL" // wheel window title
|
||||
#endif
|
||||
|
||||
#define MSH_WHEELMODULE_CLASS (MOUSEZ_CLASSNAME)
|
||||
#define MSH_WHEELMODULE_TITLE (MOUSEZ_TITLE)
|
||||
|
||||
// Apps need to call RegisterWindowMessage using the #defines
|
||||
// below to get the message numbers for:
|
||||
// 1) the message that can be sent to the MSWHEEL window to
|
||||
// query if wheel support is active (MSH_WHEELSUPPORT)>
|
||||
// 2) the message to query for the number of scroll lines
|
||||
// (MSH_SCROLL_LINES)
|
||||
//
|
||||
// To send a message to MSWheel window, use FindWindow with the #defines
|
||||
// for CLASS and TITLE above. If FindWindow fails to find the MSWHEEL
|
||||
// window or the return from SendMessage is false, then Wheel support
|
||||
// is not currently available.
|
||||
|
||||
#ifdef UNICODE
|
||||
#define MSH_WHEELSUPPORT L"MSH_WHEELSUPPORT_MSG" // name of msg to send
|
||||
// to query for wheel support
|
||||
#else
|
||||
#define MSH_WHEELSUPPORT "MSH_WHEELSUPPORT_MSG" // name of msg to send
|
||||
// to query for wheel support
|
||||
#endif
|
||||
|
||||
// MSH_WHEELSUPPORT
|
||||
// wParam - not used
|
||||
// lParam - not used
|
||||
// returns BOOL - TRUE if wheel support is active, FALSE otherwise
|
||||
|
||||
|
||||
#ifdef UNICODE
|
||||
#define MSH_SCROLL_LINES L"MSH_SCROLL_LINES_MSG"
|
||||
#else
|
||||
#define MSH_SCROLL_LINES "MSH_SCROLL_LINES_MSG"
|
||||
#endif
|
||||
|
||||
// MSH_SCROLL_LINES
|
||||
// wParam - not used
|
||||
// lParam - not used
|
||||
// returns int - number of lines to scroll on a wheel roll
|
||||
|
||||
#ifndef WHEEL_PAGESCROLL
|
||||
#define WHEEL_PAGESCROLL (UINT_MAX) // signifies to scroll a page, also
|
||||
// defined in winuser.h in the
|
||||
// NT4.0 SDK
|
||||
#endif
|
||||
|
||||
#ifndef SPI_SETWHEELSCROLLLINES
|
||||
#define SPI_SETWHEELSCROLLLINES 105 // Also defined in winuser.h in the
|
||||
// NT4.0 SDK, please see the NT4.0 SDK
|
||||
// documentation for NT4.0 implementation
|
||||
// specifics.
|
||||
// For Win95 and WinNT3.51,
|
||||
// Mswheel broadcasts the message
|
||||
// WM_SETTINGCHANGE (equivalent to
|
||||
// WM_WININICHANGE) when the scroll
|
||||
// lines has changed. Applications
|
||||
// will recieve the WM_SETTINGCHANGE
|
||||
// message with the wParam set to
|
||||
// SPI_SETWHEELSCROLLLINES. When
|
||||
// this message is recieved the application
|
||||
// should query Mswheel for the new
|
||||
// setting.
|
||||
#endif
|
||||
|
||||
|
||||
/*********************************************************************
|
||||
* INLINE FUNCTION: HwndMsWheel
|
||||
* Purpose : Get a reference to MSWheel Window, the registered messages,
|
||||
* wheel support active setting, and number of scrollLines
|
||||
* Params : PUINT puiMsh_MsgMouseWheel - address of UINT to contain returned registered wheel message
|
||||
* PUINT puiMsh_Msg3DSupport - address of UINT to contain wheel support registered message
|
||||
* PUINT puiMsh_MsgScrollLines - address of UINT to contain Scroll lines registered message
|
||||
* PBOOL pf3DSupport - address of BOOL to contain returned flag for wheel support active
|
||||
* PINT piScrollLines - address of int to contain returned scroll lines
|
||||
* Returns : HWND handle to the MsWheel window
|
||||
* Note : The return value for pf3DSupport and piScrollLines is dependant
|
||||
* on the POINT32 module. If POINT32 module is not running then
|
||||
* the values returned for these parameters will be
|
||||
* FALSE and 3, respectively.
|
||||
*********************************************************************/
|
||||
__inline HWND HwndMSWheel(
|
||||
PUINT puiMsh_MsgMouseWheel,
|
||||
PUINT puiMsh_Msg3DSupport,
|
||||
PUINT puiMsh_MsgScrollLines,
|
||||
PBOOL pf3DSupport,
|
||||
PINT piScrollLines
|
||||
)
|
||||
{
|
||||
HWND hdlMsWheel;
|
||||
|
||||
hdlMsWheel = FindWindow(MSH_WHEELMODULE_CLASS, MSH_WHEELMODULE_TITLE);
|
||||
|
||||
*puiMsh_MsgMouseWheel = RegisterWindowMessage(MSH_MOUSEWHEEL);
|
||||
*puiMsh_Msg3DSupport = RegisterWindowMessage(MSH_WHEELSUPPORT);
|
||||
*puiMsh_MsgScrollLines = RegisterWindowMessage(MSH_SCROLL_LINES);
|
||||
|
||||
if (*puiMsh_Msg3DSupport)
|
||||
*pf3DSupport = (BOOL)SendMessage(hdlMsWheel, *puiMsh_Msg3DSupport, 0, 0);
|
||||
else
|
||||
*pf3DSupport = FALSE; // default to FALSE
|
||||
|
||||
if (*puiMsh_MsgScrollLines)
|
||||
*piScrollLines = (int)SendMessage(hdlMsWheel, *puiMsh_MsgScrollLines, 0, 0);
|
||||
else
|
||||
*piScrollLines = 3; // default
|
||||
|
||||
return(hdlMsWheel);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue