⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 nonsefns.h

📁 epson公司的一个关于s1d13706的低层驱动程序
💻 H
字号:
/*
**===========================================================================
**  NONSEFNS.H - Function prototypes for non-seXXX functions.
**               That is - prototypes for HAL private functions.
**---------------------------------------------------------------------------
** Copyright (c) 2000, 2001 Epson Research and Development, Inc.
** All Rights Reserved.
**===========================================================================
*/

#ifndef _NONSEFNS_H_
#define _NONSEFNS_H_

#include "hal.h"


// Display Buffer Size is 80K bytes
#define DISPLAY_BUFFER_SIZE    0x14000

/* 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 _Pixel1bpp(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 _Line1bpp(DWORD StartLinearAddress, int BytesPerScanline, long x1, long y1, long x2, long y2, 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);

int _AutoAllocSurface(unsigned DisplayMode);

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(BYTE *pLut, int count);
extern void _WriteLutEntry(int index, BYTE *pColor);

extern void _ProgramClock(DWORD value);
extern void _SetSubWinCoordinates(DWORD x1, DWORD y1, DWORD x2, DWORD y2);

extern void _GetMclkAndPclk(DWORD *mclk, DWORD *pclk);
extern void _UpdateHardwareDisplaySwapping(void);

/*--------------------------- Malloc Support ------------------------------*/

DWORD seVmemAlloc(DWORD size);
BOOL  seVmemFree(DWORD address);

/*-------------------------------------------------------------------------*/

#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

#ifndef INTEL_DOS
#define SWAP(a) (_swapbytes(&(a),sizeof(a)))

void _swapbytes(void *ptr, int size);
#endif

/*-------------------------------------------------------------------------*/

extern DWORD _MemorySize;
extern BOOL _EndianReverseDisplayBytes;
extern BOOL _EndianReverseRegisterBytes;
extern BOOL _AllowHardwareDisplaySwapping;
extern BOOL _OnValidBppAllowHardwareDisplaySwapping;
extern volatile DWORD _RegLinearAddress;
extern volatile DWORD _DispLinearAddress;
extern void (*pLcdPowerDelayMsg)(BOOL activate, DWORD time);
extern void (*pLcdPowersaveDelayMsg)(BOOL enable, DWORD time);
extern int _ThreadPriorityNestCount;

/*-------------------------------------------------------------------------*/

#pragma pack(1)

/*-------------------------------------------------------------------------*/

typedef struct
{
   unsigned DisplayMode;    /* MAIN_WIN or SUB_WIN */
   unsigned xOffset;        /* Starting horizontal position (to align dword start position registers) */
   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 */
} PACKED _SURFACE_STRUCT;


extern _SURFACE_STRUCT _MainWinSurface, _SubWinSurface;
extern _SURFACE_STRUCT *_ActiveImageSurface;

void _PanScroll(DWORD x, DWORD y, BOOL UseDelay, _SURFACE_STRUCT *pSurface);
unsigned _FixWidthForOffsetRegisters(unsigned width, unsigned bpp, _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 _VClkBits[MAX_FREQ_INDEX];
extern _defFreq _MClkBits[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 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;

/*-------------------------------------------------------------------------*/

// Store sub-window start and end positions

typedef struct
   {
   DWORD x1, y1, x2, y2;
   } _SubWinDef;

extern _SubWinDef _SubWin;

/*-------------------------------------------------------------------------*/

#endif      /* _NONSEFNS_H_ */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -