📄 nonsefns.h
字号:
/*
**===========================================================================
** NONSEFNS.H - Function prototypes for non-seXXX functions.
** That is - prototypes for HAL private functions.
**---------------------------------------------------------------------------
** Copyright (c) 1997, 1999 Epson Research and Development, Inc.
** All Rights Reserved.
**===========================================================================
*/
#ifndef _NONSEFNS_H_
#define _NONSEFNS_H_
#include "hal.h"
//
// Implement code for REG[10h] bit 0
//
#define MCLK_SOURCE_SELECT_ADJUSTMENT
/* internal */
#ifdef INTEL_W32
int _IntelGetLinAddressW32(DWORD physaddr, DWORD *linaddr);
int _IntelUnmapLinearMemory(void);
#endif
void _Swap(long *pa, long *pb);
void _Line(DWORD StartLinearAddress, int BytesPerScanline, long x1, long y1, long x2, long y2, DWORD color, void (*pSetPixel)(DWORD StartLinearAddress, int BytesPerScanline, long x, long y, DWORD color));
void _Ellipse(DWORD StartLinearAddress, int BytesPerScanline, long xc, long yc, long a0, long b0, DWORD color, void (*pSetPixel)(DWORD StartLinearAddress, int BytesPerScanline, long x, long y, DWORD color));
void _Pixel2bpp(DWORD StartLinearAddress, int BytesPerScanline, long x, long y, DWORD color);
void _Pixel4bpp(DWORD StartLinearAddress, int BytesPerScanline, long x, long y, DWORD color);
void _Pixel8bpp(DWORD StartLinearAddress, int BytesPerScanline, long x, long y, DWORD color);
void _Pixel16bpp(DWORD StartLinearAddress, int BytesPerScanline, long x, long y, DWORD color);
void _Line2bpp(DWORD StartLinearAddress, int BytesPerScanline, long x1, long y1, long x2, long y2, DWORD color);
void _Line4bpp(DWORD StartLinearAddress, int BytesPerScanline, long x1, long y1, long x2, long y2, DWORD color);
void _Line8bpp(DWORD StartLinearAddress, int BytesPerScanline, long x1, long y1, long x2, long y2, DWORD color);
void _Line16bpp(DWORD StartLinearAddress, int BytesPerScanline, long x1, long y1, long x2, long y2, DWORD color);
DWORD _InitLcdInkCursorAddress(DWORD InkCursorSize, int SelectInkCursor);
DWORD _InitCrtInkCursorAddress(DWORD InkCursorSize, int SelectInkCursor);
DWORD _InitTvInkCursorAddress(DWORD InkCursorSize, int SelectInkCursor);
DWORD _InitInkCursorAddress(DWORD InkCursorSize, int SelectInkCursor);
void _DisplayLcdFifo(BOOL activate);
void _DisplayCrtFifo(BOOL activate);
void _DisplayTvFifo(BOOL activate);
void _DisplayFifo(BOOL activate);
int _AutoAllocSurface(unsigned DisplayMode);
int _AutoAllocDualPanelBuffer(void);
DWORD _CalcDualPanelBufferSize(void);
int _AllocDualPanelBuffer(DWORD size);
int _InitPlat(void);
int _InitLinear(void);
int _ExitLinear(void);
extern volatile DWORD _RegLinearAddress;
extern volatile DWORD _DispLinearAddress;
extern int _FindReg(unsigned index, unsigned *pValue, int *iArray);
extern void _WriteLut(int DisplayMode, BYTE *pLUT, int count);
extern void _WriteLutEntry(int DisplayMode, int index, BYTE *pColor);
extern void _ProgramClock(DWORD value);
/*--------------------------- Malloc Support ------------------------------*/
DWORD seVmemAlloc(DWORD size);
BOOL seVmemFree(DWORD address);
void seVmemFreeDualPanelBuffer(void);
DWORD seVmemGetDualPanelBufferSize(void);
DWORD seVmemAllocDualPanelBuffer(DWORD size);
DWORD seVmemAllocInk(DWORD overlaysize);
DWORD seVmemAllocCursor(void);
/*-------------------------------------------------------------------------*/
#ifdef INTEL_DOS
#include <pc.h>
#include <sys/farptr.h>
extern unsigned short _selector;
#define _READXB(x) _farpeekb (_selector, (x))
#define _READXW(x) _farpeekw (_selector, (x))
#define _READXD(sourceadr) _farpeekl (_selector, (sourceadr))
#define _WRITEXD(destadr, value) _farpokel (_selector, (destadr), (value))
#define _WRITEXW(destadr, value) _farpokew (_selector, (destadr), (value))
#define _WRITEXB(destadr, value) _farpokeb (_selector, (destadr), (value))
#define _asmReadDword(x) _farpeekl (_selector, (x))
void __far __pascal _asmWriteDwords( DWORD destadr, DWORD value, DWORD length );
void __far __pascal _asmWriteWords( DWORD destadr, unsigned value, DWORD length );
void __far __pascal _asmWriteBytes( DWORD destadr, unsigned value, DWORD length );
unsigned _INITXLIB (void);
void _DEINITXLIB (void);
unsigned long _MAPIOMEM(unsigned long physaddress, unsigned long size, unsigned long *logaddress);
#endif
/*-------------------------------------------------------------------------*/
extern DWORD _MemorySize;
extern BOOL _EndianReverseBytes;
extern volatile DWORD _RegLinearAddress;
extern volatile DWORD _DispLinearAddress;
extern DWORD _AutoAllocDualPanelBufferAddr;
extern int _ThreadPriorityNestCount;
/*-------------------------------------------------------------------------*/
#pragma pack(1)
/*-------------------------------------------------------------------------*/
typedef struct
{
unsigned DisplayMode; /* LCD, CRT, TV, LCD_CRT, or LCD_TV */
unsigned VirtWidth; /* Virtual width in pixels */
unsigned VirtHeight; /* Virtual height in pixels */
DWORD LinearAddress; /* Linear address to display buffer memory as seen by host CPU */
DWORD OffsetAddress; /* Display Buffer Memory addr where 0=start of display buffer memory */
DWORD DisplayMemorySize; /* Memory available for image (excluding cursor/ink layer) */
} PACKED _SURFACE_STRUCT;
typedef struct
{
DWORD LinearAddress;
DWORD OffsetAddress;
} PACKED _INK_CURSOR_STRUCT;
extern _SURFACE_STRUCT _LcdSurface, _CrtTvSurface;
extern _SURFACE_STRUCT _LcdInkCursor, _CrtTvInkCursor;
extern _SURFACE_STRUCT *_ActiveImageSurface;
void _PanScroll(DWORD x, DWORD y, BOOL UseDelay, _SURFACE_STRUCT *pSurface);
/*--------------------- Programmable Clock Chip Support ------------------*/
#define CLK_VREG0 0x00
#define CLK_VREG1 0x01
#define CLK_VREG2 0x02
#define CLK_MREG 0x03
#define CLK_PWRDWN 0x04
#define CLK_CTRL 0x06
/*
** FEATCLK can only be used in seProgramClockChip(), argument "reg"
*/
#define FEATCLK 0x07 /* FEATCLK is not programmable */
/*
** seClockChipBits2Freq() uses 5 decimal points
*/
#define CLK_CHIP_FREQ_SCALE 100000L
typedef struct
{
char szFreq[8]; /* eg. "25.175" */
DWORD dwFreq; /* eg. 25175 */
DWORD dwProgBits; /* eg. 0x01A8BC */
} PACKED _defFreq;
extern _defFreq _ClockBits[MAX_FREQ_INDEX];
void _ClockChipBits2Freq(DWORD bits, DWORD *dwFreq);
int _ProgramClockChip(DWORD bits, int VregSelect);
int _GetClockChipBits(int FreqIndex, int reg, DWORD *bits, char **szFreq);
/*-------------------------------------------------------------------------*/
#pragma pack()
/*-------------------------------------------------------------------------*/
/*
** Definitions for _InitInkCursorAddress()
*/
enum
{
CURSOR = 0,
INK_LAYER
};
/*-------------------------------------------------------------------------*/
/*
** Definitions for HAL_MLLC.C (malloc)
*/
typedef struct _memblock
{
struct _memblock *next;
struct _memblock *prev;
DWORD size;
DWORD address;
int free;
} _MEMBLOCKST;
void _seVmemDump(char *str);
void _seVmemInit(DWORD size);
/*-------------------------------------------------------------------------*/
extern LPHAL_STRUCT _HalInfo;
/*-------------------------------------------------------------------------*/
#endif /* _NONSEFNS_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -