📄 driver.h
字号:
/*
* $Workfile: driver.h $
* $Revision: 2 $
* $Date: 4/07/00 9:10a $
* $Modtime: 4/07/00 9:01a $
* $Author: Sarma $
*
* DESCRIPTION: Main header file for the National display driver.
*
* Copyright (c) 1998 National Semiconductor Corporation.
* All Rights Reserved.
*
* This software is the confidential and proprietary information of National
* Semiconductor Corporation. ("Confidential Information").
* You shall not disclose such Confidential Information and shall use it only
* in accordance with the terms of the license agreement you entered into
* with National Semiconductor Corporation.
* This code is supplied as is.
*
*/
/*
*$Log: /CE/Platform/Nsc/Drivers/Video/gxvideo/ddraw/driver.h $
*
* 2 4/07/00 9:10a Sarma
* Removed Cyrix Corporation from the legal/confidentail information. Also
* added for files not containing this info.
*
*$History: driver.h $
*
* ***************** Version 2 *****************
* User: Sarma Date: 4/07/00 Time: 9:10a
* Updated in $/CE/Platform/Nsc/Drivers/Video/gxvideo/ddraw
* Removed Cyrix Corporation from the legal/confidentail information. Also
* added for files not containing this info.
*
*/
/* INCLUDE FILES */
#ifdef DD_SUPPORT
/* DirectDraw Stuff */
#define DIRECTDRAW_DLLNAME "GXDRAW.DLL"
#define DDMINI_VERSION 0x0100
#ifndef _WIN32
#define NOUSER
#define NOGDI
#define NOGDIOBJ
#define NOGDICAPMASKS
#include "win16.h"
#define NOPTRC
#define PTTYPE POINT
#include "gdidefs.inc"
#include "dibeng.inc"
typedef struct tagPALETTEENTRY FAR* LPPALETTEENTRY;
typedef struct tagRGNDATA FAR* LPRGNDATA;
#endif
#include "windows.h" /* Windows structures and definitions */
#include "ddrawi.h"
#ifndef _WIN32
#include "minivdd.h" /* Structures for VDD interface */
#include "dibfctn.h" /* Declarations of DIB routines */
#include "profile.h" /* Display driver profiling constants */
#endif
#include "escape.h" /* Display driver escape constants */
#include "gxdefs.h" /* GX hardware definitions */
#include "gxmacro.h" /* Display driver macros */
#include "cognac.h" /* Cognac hardware definitions */
#ifdef DEBUG
extern void __cdecl DPF(LPSTR szFormat, ...);
#define BREAK() DebugBreak();
#else
#define DPF 1 ? (void)0 : (void)
#define BREAK()
#endif
/*-------------*/
/* CONSTANTS */
/*-------------*/
/* VERSION NUMBER TO REPORT TO "DRVCTL95" APPLICATION */
#define CYRIX_DRIVER_VERSION 0x0001000C // Cyrix version number
/* OFFSET TO START OF DISPLAY DRIVER SCRATCHPAD IN THE L1 CACHE */
#define SCRATCHPAD_BASE 0x0E60 // L1 scratchpad base offset
#define SPAD_FP_ENABLE 0x0ECE // copy of CRTC 50h (SoftVGA sets)
#define SPAD_FP_RESOLUTION 0x0ECF // copy of CRTC 52h (SoftVGA sets)
#define SPAD_BUSY_FLAG 0x0ED0 // Save to disk busy flag
/* NUMBER OF RESOLUTIONS SUPPORTED */
#define GX_NUM_MODES 18 // number of resolutions supported
/* SoftVGA comm via PCI config space. */
#define SOFT_VGA_PCI_FB_BASE 0x80009410
#define SOFT_VGA_PCI_FB_SIZE 0x80009440
#define SOFT_VGA_PCI_DISABLE 0x80009444
/* VALUES FOR "GXflags" */
#define GX_FRAMEBUFFER_8BPP 0x0001 // framebuffer is 8BPP format
#define GX_SOFTWARE_CURSOR 0x0002 // see explanation in "cursor.c"
#define GX_DIB_CURSOR 0x0004 // see explanation in "cursor.c"
#define GX_MOUSE_TRAILS 0x0008 // see explanation in "cursor.c"
#define GX_PUNT_CURSOR 0x0010 // see explanation in "cursor.c"
#define GX_SYS_NO_32BPP 0x0020 // System cannot use 32 BPP mode
#define GX_SYS_TV_APPLET 0x0040 // System uses TV control applet for 7002
#define GX_SYS_DAC16 0x0080 // System allows 16-bit bus to DAC
#define GX_SYS_BAD_ENCODER 0x0100 // System uses AIT1108
#define GX_SYS_TV_APPLET2 0x0200 // System uses TV control applet for 7001
#define GX_SYS_TV_APPLET3 0x0400 // System uses TV control applet for 7003
#define GX_VSAII 0x0800 // VSA II present
/* RASTER OPERATION FLAGS (FOR ROP3FLAGS TABLE) */
#define GX_ROP_DST 0x01 // ROP3 requires destination
#define GX_ROP_SRC 0x02 // ROP3 requires source
#define GX_ROP_PAT 0x04 // ROP3 requires pattern
/* SOFTVGA DEFINITIONS */
#define CRTC_INDEX 0x03D4 // CRTC index
#define SOFTVGA_INDEX 0x03D4 // CRTC index
#define CRTC_DATA 0x03D5 // CRTC data
#define SOFTVGA_DATA 0x03D5 // CRTC data
#define INPUT_STAT_1 0x03DA
#define SOFTVGA_EXT_REG_LOCK 0x0030 // port for Extended Register Lock
#define SOFTVGA_VERSION 0x0031 // port for SoftVGA version number
#define SOFTVGA_CUR_START_LOW 0x0034
#define SOFTVGA_CUR_START_HIGH 0x0035
#define SOFTVGA_CUR_START_EXT 0x0036
#define SOFTVGA_OSM_OFFSET 0x003C
#define SOFTVGA_OSM_SIZE 0x003D
#define EXTENDED_START_ADDRESS 0x0044
#define DISPLAY_COMPRESSION 0x0049 // display controller compression
#define CURSOR_CONTROL 0x004A
#define FP_ENABLE 0x0050
#define FP_RESOLUTION 0x0052
#define SOFTVGA_UNLOCK_1 0x0057 // first unlock value
#define SOFTVGA_UNLOCK_2 0x004C // second unlock value
#define CRTC_HORZ_TOTAL 0x0000
#define CRTC_HORZ_RETR_END 0x0005
#define CRTC_VERT_TOTAL 0x0006
#define CRTC_START_ADDR_HIGH 0x000C
#define CRTC_START_ADDR_LOW 0x000D
#define CRTC_VERT_RETR_END 0x0011
#define FPE_PANEL_ENABLED 0x01
/* Blt Buffer defines */
#define BB0_BASE 0xFFFFFF0C
#define BB1_BASE 0xFFFFFF1C
#define BLIT_BUFFER_0_8BPP 0x0800
#define BLIT_BUFFER_1_8BPP 0x0B30
#define BLIT_BUFFER_0_16BPP 0x0400
#define BLIT_BUFFER_1_16BPP 0x0930
#define FIRST_VESA_MODE 0x100
#define LAST_VESA_MODE 0x150
typedef unsigned long FIXEDPOINT; // 16.16
#ifndef _WIN32
typedef void (_pascal BITBLT_FUNCTION)(
void far *bitbltargs,
WORD blit_mode);
BITBLT_FUNCTION
GxColorToScreen,
GxMonoToScreen,
GxColorPatternBlit2;
typedef BITBLT_FUNCTION *BITBLT_FPTR;
#endif
#pragma pack(4)
typedef struct tagVIDEODATA
{
DWORD XPos;
DWORD YPos;
DWORD XSize;
DWORD YSize;
DWORD XScale;
DWORD YScale;
DWORD Offset;
DWORD Pitch;
DWORD XClip;
} VIDEODATA;
typedef struct tagDDRAWDATA
{
#ifdef _WIN32
DWORD lpPDevice;
#else
DIBENGINE FAR * lpPDevice;
#endif
DWORD FbLinear;
DWORD RegLinear;
DWORD VidLinear;
WORD hTiming;
WORD vTiming;
WORD MaxBufferPixels;
WORD BB1Base;
DWORD VideoBase; // base of video memory.
DWORD VideoHeapBase; // start of video heap.
DWORD VideoHeapEnd; // end of video heap.
DWORD fReset;
DWORD dwWidth;
DWORD dwHeight;
LONG lPitch;
DWORD dwBpp;
DWORD dwRefreshRate;
DWORD dwDirectDrawVersion;
WORD GXflags;
WORD CPUSpeed;
WORD wPanX;
WORD wPanY;
VIDEODATA Video;
SYSINFO1 SysInfo1;
DWORD CPUClockMult;
DWORD ProcessorID;
DDHALDDRAWFNS HALCallbacks;
DDHALINFO HALInfo;
DDHAL_DDCALLBACKS DDCallbacks;
DDHAL_DDSURFACECALLBACKS DDSurfaceCallbacks;
DDHAL_DDPALETTECALLBACKS DDPaletteCallbacks;
VIDMEM vidMem[1];
} DDRAWDATA;
#pragma pack()
typedef struct tagMODEINFOBLOCK
{
unsigned short ModeAttributes;
unsigned char WinAAttributes;
unsigned char WinBAttributes;
unsigned short WinGranularity;
unsigned short WinSize;
unsigned short WinASegment;
unsigned short WinBSegment;
unsigned char far * WinFuncPtr;
unsigned short BytesPerScanLine;
unsigned short XResolution;
unsigned short YResolution;
unsigned char XCharSize;
unsigned char YCharSize;
unsigned char NumberOfPlanes;
unsigned char BitsPerPixel;
unsigned char NumberOfBanks;
unsigned char MemoryModel;
unsigned char BankSize;
unsigned char NumberOfImagePages;
unsigned char Reserved;
unsigned char RedMaskSize;
unsigned char RedFieldPosition;
unsigned char GreenMaskSize;
unsigned char GreenFieldPosition;
unsigned char BlueMaskSize;
unsigned char BlueFieldPosition;
unsigned char RsvdMaskSize;
unsigned char RsvdFieldPosition;
unsigned char DirectColorModeInfo;
unsigned char far * PhysBasePtr;
unsigned char far * OffScreenMemOffset;
unsigned short OffScreenMemSize;
unsigned char Remainder[206];
} MODEINFOBLOCK;
/*--------------------*/
/* GLOBAL VARIABLES */
/*--------------------*/
#include "globals.h"
/* DRIVER FUNCTION DECLARATIONS */
extern short xres_data[GX_NUM_MODES];
extern short yres_data[GX_NUM_MODES];
extern char bpp_data[GX_NUM_MODES];
extern short delta_data[GX_NUM_MODES];
#ifndef _WIN32
int far _pascal GetPrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR);
unsigned int far _pascal GetPrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
// ROUTINES IN "CURSOR.C"
void disable_gx_cursor();
void gx_set_cursor(LPCURSORSHAPE lpCursorShape);
VOID FAR PASCAL EXPORT SetCursor(LPCURSORSHAPE lpCursorShape);
VOID FAR PASCAL EXPORT MoveCursor(WORD absX, WORD absY);
// ROUTINES IN "OVERLAY.C"
VOID UpdateOverlay(DWORD PanX, DWORD PanY);
VOID UpdateOverlayPosition(VOID);
VOID OverlayOff(VOID);
// ROUTINES IN "GXCODE.C"
int gx_enable(void);
void gx_set_vga_mode(void);
/* ROUTINES IN "MAPA.ASM" */
unsigned char MemoryRead8(unsigned long offset, unsigned short segment);
unsigned short MemoryRead16(unsigned long offset, unsigned short segment);
unsigned long MemoryRead32(unsigned long offset, unsigned short segment);
void MemoryWrite8(unsigned long offset, unsigned short segment, unsigned char data);
void MemoryWrite16(unsigned long offset, unsigned short segment, unsigned short data);
void MemoryWrite32(unsigned long offset, unsigned short segment, unsigned long data);
void execute_cpu_write(unsigned long address, unsigned long data);
void execute_wait_pending(unsigned short selector);
void WritePCIReg(unsigned long reg, unsigned long value);
unsigned long ReadPCIReg(unsigned long reg);
void OutPort(int port, int value);
int InPort(int port);
/* ROUTINES IN "ENABLE.C" */
extern BOOL FAR PASCAL thk_ThunkConnect16( LPSTR pszDll16, LPSTR pszDll32, WORD hInst, DWORD dwReason);
DWORD FAR PASCAL Connect(DWORD DDrawData);
/* ROUTINES IN "PALETTE.C" */
void set_initial_palette();
void gx_load_palette();
BOOL FAR PASCAL SetVideoPalette(BYTE FAR *RedGamma, BYTE FAR *GreenGamma, BYTE FAR *BlueGamma);
/* ROUTINES IN "WIN95A.ASM" */
void win95_get_vdd_entry_point(void);
void win95_say_howdy_to_vdd(void);
void win95_say_howdy_to_minivdd(void);
int win95_get_selectors /* Return of zero indicates error */
(
unsigned short * frame_buffer_selector,
unsigned short * register_selector,
unsigned long * frame_buffer_linear,
unsigned long * register_linear
);
int win95_minivdd_query(unsigned long *version);
void win95_driver_register();
void win95_save_driver_state();
int win95_get_display_info(DISPLAYINFO far *display_info);
unsigned long win98_vdd_open_device(unsigned char far *device_name);
unsigned long win98_vdd_close_device();
unsigned long win98_vdd_control_device(unsigned long mode);
/* ROUTINES IN "REGISTRY.C" */
BOOL SetTVRegistryData(TVSTATE far * TVStateReg);
BOOL GetTVRegistryData(TVSTATE far * TVStateReg);
BOOL GetGammaRegistryData(GAMMASTATE far * GammaStateReg);
BOOL SetGammaRegistryData(GAMMASTATE far * GammaStateReg);
BOOL GetSysInfoRegistryData(SYSINFO1 far * SysInfo1);
BOOL SetSysInfoRegistryData(SYSINFO1 far * SysInfo1);
/* ROUTINES IN "TV.C" */
BOOL SetTVData(TVSTATE far * TVStateReg);
BOOL GetTVData(TVSTATE far * TVStateReg);
#else /* _WIN32 */
#endif /* _WIN32 */
/* END OF FILE */
#endif //DD_SUPPORT
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -