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

📄 llega.asm

📁 [随书类]Dos6.0源代码
💻 ASM
📖 第 1 页 / 共 4 页
字号:
	TITLE		LLEGA - EGA screen mode support
;***
;LLEGA - EGA screen mode support
;
;	Copyright <C> 1986, Microsoft Corporation
;
;Purpose:
;	Support for EGA graphics screen modes (BIOS D,E,F,10).
;	Note that this module module contains support
;	code for all adapters capable of handling these
;	screen modes and also attempts to compensate for
;	the subtle differences in their treatment.
;
;	This module sets hooks in the mode-independent
;	modules to routines here for mode-dependent
;	graphics support.  See the mode-independent
;	modules for more precise descriptions of the
;	purposes and interfaces of these routines.
;
;	The following table summarizes the information for
;	the modes and configurations covered:
;
;    C		  |	A			     B
;    O		  |  B	T			     I
;    L		  |  I	T		 P	     T
;    O	     A	M |  O	R		 A    C      S
;  S R	     D	O |  S	I    C		 G    H      / P
;  C B	     A	N |	B    O		 E    A   P  P L
;  R U	C  R P	I |  M	U    L	 X   Y	 S    R   A  I A
;  E R	O  O T	T |  O	T    O	 R   R	 I    B   G  X N
;  E S	L  W E	O |  D	E    R	 E   E	 Z    O   E  E E
;  N T	S  S R	R |  E	S    S	 S   S	 E    X   S  L S
; -- - -- -- - -- | -- --- ---- --- --- --- ---- --- - -
;  7 x 40 25 E	C |  D	16  16	320 200  32 8x8  (2) 1 4
;  7 x 40 25 E	E |  "   "   "   "   "    "  "    "  " "
;  7 x 40 25 S	x |  "   "   "   "   "    "  "    "  " "
;
;  8 x 80 25 E	C |  E	16  16	640 200  64 8x8  (2) 1 4
;  8 x 80 25 E	E |  "   "   "   "   "    "  "    "  " "
;  8 x 80 25 S	x |  "   "   "   "   "    "  "    "  " "
;
;  9 x 80 25 E	E | 10	 4  64	640 350  64 8x14  1  1 2  (64K video memory)
;  9 x 80 43 E	E |  "   "   "   "   "    " 8x8   "  " "
;
;  9 x 80 25 E	E | 10	16  64	640 350 128 8x14 (2) 1 4  (>64K video memory)
;  9 x 80 25 S	x |  "   "   "   "   "    "  "    "  " "
;  9 x 80 43 E	E |  "   "   "   "   "    " 8x8   "  " "
;  9 x 80 43 S	x |  "   "   "   "   "    "  "    "  " "
;
; 10 x 80 25 E	M |  F	 4   9	640 350  64 8x14 (1) 1 2  (>64K video memory)
; 10 x 80 25 S	x |  "   "   "   "   "    "  "    "  " "
; 10 x 80 43 E	M |  "   "   "   "   "    " 8x8   "  " "
; 10 x 80 43 S	x |  "   "   "   "   "    "  "    "  " "
;
;-----------------------------------------------------------------------
;NOTES:  (1) PAGES = <video memory> / 2 / PAGESIZE (max 8 pages)
;	 (2) PAGES = <video memory> / PAGESIZE	   (max 8 pages)
;-----------------------------------------------------------------------
;******************************************************************************

	INCLUDE switch.inc	;feature switches
	INCLUDE rmacros.inc

	USESEG	_DATA
	USESEG	_BSS
	USESEG	GR_TEXT
	USESEG	CN_TEXT
	USESEG	XIB		
	USESEG	XI		
	USESEG	XIE		

	INCLUDE seg.inc
	INCLUDE ibmunv.inc
	INCLUDE baslibma.inc
	INCLUDE llgrp.inc	; Constant definitions
	INCLUDE idmac.inc
	INCLUDE grmac.inc	;ModeData macros

	INITIALIZER B$xINITEGA	;Put B$xINITEGA in initializer list


sBegin	_BSS
;
; ***************************************************************************
; External function vectors
; ***************************************************************************
;
externW b$PutVector
externW b$PalPut
externW b$SetAttr		
;
; ***************************************************************************
; External variables
; ***************************************************************************
;
externB b$BiosMode
externB b$Adapter
externB b$Monitor
externW b$VideoMem
externW b$CurPages
externW b$VideoBase
externB b$MaskC
externB b$AttrC
externW b$PenC 		
externW b$OffC
externW b$SegC
externB b$MaxAttr
externB b$MaxColor
externW B$LEOFST
externW B$REOFST
externB B$VLMASK
externB B$VRMASK
externB b$ForeColor
externB b$PageSize
externW b$CurrPSize
externB b$ScrHeight
externB b$MaxPage
externB b$Tiling
externB b$ForeMapped		
externW b$CURSOR		
externW b$CSRTYP		
externW b$SaveCa
externB b$SaveCm
externB b$PlaneMask
externW b$ScreenTab		

;
; ***************************************************************************
; Local variables
; ***************************************************************************
;
staticB MapMask,,1		;bit mask for Map Mask Register odd/even map
staticB BasePlane,,1		;base plane for odd/even modes
sEnd	_BSS

sBegin	CN_TEXT
externNP B$USRCSR		
sEnd	CN_TEXT

assumes CS,GR_TEXT
sBegin	GR_TEXT

externNP B$OutWord
externNP B$BumpDS
externNP B$BumpES		
externNP B$InitModeData
externNP B$GetParm
externNP b$ColorPalette	
externNP b$EnhPalette		
externNP B$EgaPalReset
externNP B$EgaPalResetB	
externNP B$EgaPalPut
externNP B$EgaPalTrans
externNP B$EgaPalSet
externNP B$EgaMapXYC
externNP B$EgaMapXYC_D
externNP B$EgaLeftC
externNP B$EgaChkUpC
externNP B$EgaUpC
externNP B$EgaChkDownC
externNP B$EgaDownC
externNP B$EgaSetAttr
externNP B$EgaReadC
externNP B$EgaReadC_F
externNP B$EgaReadC_64K
externNP B$EgaSetC
externNP B$EgaSetPixC
externNP B$EgaSetPixFirstC
externNP B$ResetEGA
externNP B$EgaLineX
externNP B$EgaLineY
externNP B$EgaLineV
externNP B$EgaPutAction
externNP B$EgaPutAction_F
externNP B$EgaPutAction_64K
externNP B$EgaNReadL
externNP B$EgaNReadL_F
externNP B$EgaNWriteL
externNP B$EgaNWriteL_F
externNP B$EgaNSetC
externNP B$EgaPaintBound
externNP B$EgaPaintBound_D
externNP B$EgaSetTile
externNP B$EgaScanL
externNP B$EgaScanR
externNP B$EgaCHKBTL
externNP B$EgaCHKBTR
externNP B$EgaPAINPX
externNP B$EgaPIXCNT
externNP B$EgaScanInit
externNP B$EgaSETCMP
externNP B$EgaTILLFT
externNP B$EgaTILRGT

;===========================================================================
mModeData	ModeDData
;
; SCREEN 7, BIOS mode D
;
; Mode-dependent data follows to initialize the the "b$ModeData" table
; in LLCGRP.
;
;===========================================================================
mScreenMode	7
mBiosMode	0DH
mBurst		0
mScrWidth	40
mScrHeight	25
mHorzRes	320
mVertRes	200
mVideoBase	0A000H
mMaxAttr	15
mMaxColor	15
mPageSize	32		    ;page size in K
mCurrPSize	<(32/4*1024) shr 4> ;page size in paragraphs (1 plane)
mMaxPage	0
mNullColor	0
mForeColor	15
mBackColor	0
mEgaWrMd	2
mInitPalette	b$ColorPalette 	;moved to LLXGASUP for sharing
mInitVgaPal	b$VgaPalette		
mAlphaDim	AlphaDim_D
mSetMode	SetMode
mSetPages	SetPages
mPalReset	B$EgaPalReset
mPalPut 	B$EgaPalPut
mPalTrans	B$EgaPalTrans	
mPalSet 	B$EgaPalSet
mSetColor	SetColor
mForeMapped	15
mBitsPerPixel	1
mPlanes 	4
mMapXYC 	B$EgaMapXYC_D
mLeftC		B$EgaLeftC
mChkUpC 	B$EgaChkUpC
mUpC		B$EgaUpC
mChkDownC	B$EgaChkDownC
mDownC		B$EgaDownC
mSetAttr	B$EgaSetAttr
mReadC		B$EgaReadC
mSetC		B$EgaSetC
mSetPixC	B$EgaSetPixC
mSetPixFirstC	B$EgaSetPixFirstC
mSetPixLastC	B$ResetEGA
mLineX		B$EgaLineX
mLineY		B$EgaLineY
mLineV		B$EgaLineV
mPutAction	B$EgaPutAction
mNReadL 	B$EgaNReadL
mNWriteL	B$EgaNWriteL
mNSetC		B$EgaNSetC
mPaintBound	B$EgaPaintBound_D
mSetTile	B$EgaSetTile
mScanL		B$EgaScanL
mScanR		B$EgaScanR
mEnd		GraphDataLen
;===========================================================================

;===========================================================================
mModeData	ModeEData
;
; SCREEN 8, BIOS mode E
;
; Mode-dependent data follows to initialize the the "b$ModeData" table
; in LLCGRP.
;
;===========================================================================
mScreenMode	8
mBiosMode	0EH
mBurst		0
mScrWidth	80
mScrHeight	25
mHorzRes	640
mVertRes	200
mVideoBase	0A000H
mMaxAttr	15
mMaxColor	15
mPageSize	64		    ;page size in K
mCurrPSize	<(64/4*1024) shr 4> ;page size in paragraphs (1 plane)
mMaxPage	0
mNullColor	0
mForeColor	15
mBackColor	0
mEgaWrMd	2
mInitPalette	b$ColorPalette 	;moved to LLXGASUP for sharing
mInitVgaPal	b$VgaPalette
mAlphaDim	AlphaDim_E
mSetMode	SetMode
mSetPages	SetPages
mPalReset	B$EgaPalReset
mPalPut 	B$EgaPalPut
mPalTrans	B$EgaPalTrans	
mPalSet 	B$EgaPalSet
mSetColor	SetColor
mForeMapped	15
mBitsPerPixel	1
mPlanes 	4
mMapXYC 	B$EgaMapXYC
mLeftC		B$EgaLeftC
mChkUpC 	B$EgaChkUpC
mUpC		B$EgaUpC
mChkDownC	B$EgaChkDownC
mDownC		B$EgaDownC
mSetAttr	B$EgaSetAttr
mReadC		B$EgaReadC
mSetC		B$EgaSetC
mSetPixC	B$EgaSetPixC
mSetPixFirstC	B$EgaSetPixFirstC
mSetPixLastC	B$ResetEGA
mLineX		B$EgaLineX
mLineY		B$EgaLineY
mLineV		B$EgaLineV
mPutAction	B$EgaPutAction
mNReadL 	B$EgaNReadL
mNWriteL	B$EgaNWriteL
mNSetC		B$EgaNSetC
mPaintBound	B$EgaPaintBound
mSetTile	B$EgaSetTile
mScanL		B$EgaScanL
mScanR		B$EgaScanR
mEnd		GraphDataLen
;===========================================================================

;===========================================================================
mModeData	ModeFData
;
; SCREEN 10, BIOS mode F (with > 64K video memory>
;
; Mode-dependent data follows to initialize the the "b$ModeData" table
; in LLCGRP.
;
;===========================================================================
mScreenMode	10
mBiosMode	0FH
mBurst		0
mScrWidth	80
mScrHeight	25
mHorzRes	640
mVertRes	350
mVideoBase	0A000H
mMaxAttr	3
mMaxColor	8
mPageSize	64		    ;page size in K
mCurrPSize	<(64/2*1024) shr 4> ;page size in paragraphs (1 plane)
mMaxPage	0
mNullColor	0
mForeColor	3
mBackColor	0
mEgaWrMd	2		    ;no even/odd with > 64K
mInitPalette	ModeFPalette
mInitVgaPal	0			;not applicable
mAlphaDim	AlphaDim_F
mSetMode	SetMode
mSetPages	SetPages
mPalReset	B$EgaPalResetB
mPalPut 	PalPut_F
mPalTrans	PalTrans_F
mPalSet 	B$EgaPalSet
mSetColor	SetColor
mForeMapped	5		    ;attr 3 maps to hardware attr 5
mBitsPerPixel	1
mPlanes 	2
mMapXYC 	B$EgaMapXYC
mLeftC		B$EgaLeftC
mChkUpC 	B$EgaChkUpC
mUpC		B$EgaUpC
mChkDownC	B$EgaChkDownC
mDownC		B$EgaDownC
mSetAttr	SetAttr_F_10_64K
mReadC		B$EgaReadC_F
mSetC		B$EgaSetC
mSetPixC	B$EgaSetPixC
mSetPixFirstC	B$EgaSetPixFirstC
mSetPixLastC	B$ResetEGA
mLineX		B$EgaLineX
mLineY		B$EgaLineY
mLineV		B$EgaLineV
mPutAction	B$EgaPutAction_F
mNReadL 	B$EgaNReadL_F
mNWriteL	B$EgaNWriteL_F
mNSetC		B$EgaNSetC
mPaintBound	B$EgaPaintBound
mSetTile	B$EgaSetTile
mScanL		ScanLX
mScanR		ScanRX
mEnd		GraphDataLen
;===========================================================================

;===========================================================================
mModeData	ModeFData_64K
;
; SCREEN 10, BIOS mode F with 64K video memory
;
; Mode-dependent data follows to initialize the the "b$ModeData" table
; in LLCGRP.
;
;===========================================================================
mScreenMode	10
mBiosMode	0FH
mBurst		0
mScrWidth	80
mScrHeight	25
mHorzRes	640
mVertRes	350
mVideoBase	0A000H
mMaxAttr	3
mMaxColor	8
mPageSize	64		    ;page size in K
mCurrPSize	<(64/2*1024) shr 4> ;page size in paragraphs (1 plane)
mMaxPage	0
mNullColor	0
mForeColor	3
mBackColor	0
mEgaWrMd	12H
mInitPalette	ModeFPalette
mInitVgaPal	0			;not applicable
mAlphaDim	AlphaDim_F
mSetMode	SetMode
mSetPages	SetPages
mPalReset	B$EgaPalResetB
mPalPut 	PalPut_F
mPalTrans	PalTrans_F
mPalSet 	B$EgaPalSet
mSetColor	SetColor
mForeMapped	5		    ;attr 3 maps to hardware attr 5
mBitsPerPixel	1
mPlanes 	2
mMapXYC 	B$EgaMapXYC
mLeftC		B$EgaLeftC
mChkUpC 	B$EgaChkUpC
mUpC		B$EgaUpC
mChkDownC	B$EgaChkDownC
mDownC		B$EgaDownC
mSetAttr	SetAttr_F_10_64K
mReadC		B$EgaReadC_64K
mSetC		B$EgaSetC
mSetPixC	B$EgaSetPixC
mSetPixFirstC	B$EgaSetPixFirstC
mSetPixLastC	B$ResetEGA
mLineX		B$EgaLineX
mLineY		B$EgaLineY
mLineV		B$EgaLineV
mPutAction	B$EgaPutAction_64K
mNReadL 	NReadL_64K
mNWriteL	NWriteL_64K
mNSetC		B$EgaNSetC
mPaintBound	B$EgaPaintBound
mSetTile	B$EgaSetTile
mScanL		ScanLX
mScanR		ScanRX
mEnd		GraphDataLen
;===========================================================================

;===========================================================================
mModeData	Mode10Data
;
; SCREEN 9, BIOS mode 10 (with > 64K video memory)
;
; Mode-dependent data follows to initialize the the "b$ModeData" table
; in LLCGRP.
;
;===========================================================================
mScreenMode	9
mBiosMode	10H
mBurst		0
mScrWidth	80
mScrHeight	25
mHorzRes	640
mVertRes	350
mVideoBase	0A000H
mMaxAttr	15
mMaxColor	63
mPageSize	128		    ;page size in K
mCurrPSize	<(128/4*1024) shr 4>;page size in paragraphs (1 plane)
mMaxPage	0
mNullColor	0
mForeColor	15
mBackColor	0
mEgaWrMd	2
mInitPalette	b$EnhPalette		;moved to LLXGASUP for sharing
mInitVgaPal	b$VgaPalette		
mAlphaDim	AlphaDim_10
mSetMode	SetMode
mSetPages	SetPages
mPalReset	B$EgaPalReset
mPalPut 	B$EgaPalPut
mPalTrans	B$EgaPalTrans
mPalSet 	B$EgaPalSet
mSetColor	SetColor
mForeMapped	15
mBitsPerPixel	1
mPlanes 	4
mMapXYC 	B$EgaMapXYC
mLeftC		B$EgaLeftC
mChkUpC 	B$EgaChkUpC

⌨️ 快捷键说明

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