📄 csd_ibm.asm
字号:
jz DBB_NotCGA
xor ax,ax
mov ds,ax
mov dx,ds:[BIOS_addr_6845]
add dx,PORT_mode
;* * diddle the mode set flag
and ds:[BIOS_crt_mode_set],NOT 20H
mov al,ds:[BIOS_crt_mode_set]
out dx,al ;* send to port
;Fall through because fvmEGAM is also marked as fvmMDA
; and the above OUT would not work
;* * EGA etc has a BIOS call for this
DBB_NotCGA:
mov ax,1003H ;* set intensify
xor bx,bx ;* intensify
int 10h
cEnd DiddleBlinkBit
;*****************************************************************************
endif ;* DiddleBlinkBit_NonDefault
ifndef MoveHwCursCsd_NonDefault
;*****************************************************************************
;********** MoveHwCursCsd **********
;* * CSD entry point (see documentation for interface)
;* * Standard BIOS call for hardware cursor
;* * save new position in "posCurs"
cProc MoveHwCursCsd,<FAR, PUBLIC, ATOMIC>, <DI>
parmB axCurs
parmB ayCurs
parmW fOn
localB axCursor
localB ayCursor
cBegin MoveHwCursCsd
mov di,OFF_lpwDataCsd ;* Data in data segment
;* * move cursor position
xor bh,bh
mov dh,ayCurs
mov dl,axCurs
mov ah,2
int 10h ;* SetCursorPosition
mov cx,2000H ;* assume off
mov byte ptr [di].fCurs,cl ;* graphics cursor
cmp fOn,0
je SetCursorOnOff ;* turn off
mov dx,[di].vparmCursSize
cmp fOn,2
jne @F
xor dh,dh ;(fOn = 2) Set block cursor
@@:
mov [di].vparmCursOn,dx ;* update cursor size
mov bx,[di].pinstDrv
test ss:[bx].finstInst,finstGraphics ;graphics text 8x14
jz DrawCursDone
mov dx,[di].posCurs ;dl = axFirst
mov ayCursor,dh
mov axCursor,dl
xor cx,cx ;fRestoreDbcs
mov ah,cl
mov al,ss:[bx].axMacInst
mul dh
mov dh,cl
add ax,dx
shl ax,1 ;ax = offFirst
mov dx,1
cCall <Near ptr DoUpdateCsd>, <ayCursor,axCursor,dx,ax,cx,cs> ;erase cursor
xor cx,cx
mov dh,ayCurs
mov dl,axCurs
mov [di].posCurs,dx ;update position
mov ah,cl
mov bx,[di].pinstDrv
mov al,ss:[bx].axMacInst
mul dh
mov dh,cl
add ax,dx
shl ax,1 ;ax = offFirst
mov dx,1
mov byte ptr [di].fCurs,1 ;* graphics cursor on
cCall <Near ptr DoUpdateCsd>, <ayCurs,axCurs,dx,ax,cx,cs> ;draw cursor
DrawCursDone:
mov cx,[di].vparmCursOn ;* turn on
SetCursorOnOff:
mov ah,1
int 10h ;* SetCursorType
cEnd MoveHwCursCsd
;*****************************************************************************
endif ;* MoveHwCursCsd_NonDefault
ifndef FGetColorPaletteCsd_NonDefault
;*****************************************************************************
;********** FGetColorPaletteCsd **********
;* * CSD entry point (see documentation for interface)
cProc FGetColorPaletteCsd, <FAR, PUBLIC, ATOMIC>,<DI,SI>
parmW coGet
parmDP pcovGet
parmDP pcoiGet
cBegin FGetColorPaletteCsd
mov di,OFF_lpwDataCsd
cCall FvmGetCur
mov di,[di].pinstDrv
mov bx,coGet
cmp bl,[di].coMacInst
jae fgcpc_fail ;* color number does not exist
mov cx,pcoiGet
test al,fvmVGA
jz fgcpc_notVGA
;* * VGA
mov ax,1007h ;* palette, read palette value
int 10h
;* * save cov value
xchg bl,bh
xor bh,bh
mov si,pcovGet
mov [si],bx
jcxz fgcpc_success ;* not interested in RGB info
;* * get RGB info
cCall IcrFromCov
mov ax,1015h ;* palette, read color register
int 10h
push ss
pop es
xor ah,ah
mov di,pcoiGet
mov al,dh
stosw
mov al,ch
stosw
mov al,cl
stosw
jmp short fgcpc_success
fgcpc_notVGA:
jcxz fgcpc_getcov
fgcpc_fail:
xor ax,ax
jmp short fgcpc_done
fgcpc_getcov:
test al,fvmMouse ;* check for ega.sys
jz fgcpc_fail ;* not available
;* * EGA.SYS
mov ah,0f0h ;* read one register
mov dx,18h
int 10h
mov si,pcovGet
mov [si],bx
fgcpc_success:
mov ax,sp
fgcpc_done:
cEnd FGetColorPaletteCsd
;********** IcrFromCov **********
;* entry: bl = cov
;* Determine color register number for cov.
;* exit: bx = icr (color register index)
;* TRASHES: ax,cx,dx
cProc IcrFromCov, <NEAR, PUBLIC, ATOMIC>
cBegin IcrFromCov
push bx
mov ax,101ah ;* palette, read color page mode
int 10h
pop dx
xchg bl,bh
mov cl,6
or bh,bh ;* check page mode for 6 or 4 bit
jz ifc_makeicr
dec cl
dec cl
jmp short ifc_makeicr
ifc_makeicr:
shl bl,cl
or bl,dl
xor bh,bh
cEnd IcrFromCov
;*****************************************************************************
endif ;* FGetColorPaletteCsd_NonDefault
ifndef SetColorPaletteCsd_NonDefault
;*****************************************************************************
;********** SetColorPaletteCsd **********
;* * CSD entry point (see documentation for interface)
cProc SetColorPaletteCsd, <FAR, PUBLIC, ATOMIC>,<DI,SI>
parmW coSet
parmW covSet
parmDP pcoiSet
cBegin SetColorPaletteCsd
mov di,OFF_lpwDataCsd
cCall FvmGetCur
mov di,[di].pinstDrv
mov bx,coSet
cmp bl,[di].coMacInst
jae scpc_done ;* color number does not exist
;* EGA.SYS f1 and EGA 1000h calls use bl == co, bh == cov
mov cx,covSet
mov bh,cl
AssertCmp bh,L,[di].covMacInst ;* check range
test al,fvmVGA ;* check for VGA
jnz scpc_RGB
scpc_cov:
IFNDEF NEWEGASYS
;* This code is required until we get the new EGA.SYS
;* Taken from QINTER\mcload.asm
test al,fvmMouse ;* check for EGA.SYS
jz scpc_notEGASYS
mov dx,3dah
in al,dx
mov ah,0f1h
mov dx,18h
int 10h
mov dx,3c0h
mov al,20h
out dx,al
jmp short scpc_done
scpc_notEGASYS:
ENDIF ;!NEWEGASYS
mov ax,1000h ;* set palette registers, individual
jmp short scpc_int10
;* * RGB color palette
scpc_RGB:
mov cx,[di].coiMacInst
jcxz scpc_cov ;* not an RGB system
mov cx,pcoiSet
jcxz scpc_cov ;* not interested in RGB
push cx
mov ax,1007h ;* palette, read palette value
int 10h
mov bl,bh
cCall IcrFromCov
pop si ;* si = pcoiSet
IFDEF DEBUG
mov ax,[si]
AssertCmp ax,L,[di].coiMacInst ;* check ranges
mov ax,[si+2]
AssertCmp ax,L,[di].coiMacInst
mov ax,[si+4]
AssertCmp ax,L,[di].coiMacInst
ENDIF ;DEBUG
mov ax,1010h ;* set color register
mov dh,[si]
mov ch,[si+2]
mov cl,[si+4]
scpc_int10:
int 10h
scpc_done:
cEnd SetColorPaletteCsd
;*****************************************************************************
endif ;* SetColorPaletteCsd_NonDefault
ifndef FQueryInftCsd_NonDefault
;*****************************************************************************
;********** FQueryInftCsd ********** (assume called after FQueryInst)
;* entry: pinft, ifont
;* * get font info
;* exit: AX = 0 => no more fonts
;* ax != 0 Success,filled INFT
;* trash bx,dx
cProc FQueryInftCsd, <FAR, PUBLIC, ATOMIC>, <si, di>
parmDP pinft
parmW ifont
cBegin FQueryInftCsd
xor ax,ax
mov si,ifont
cmp si,cdmMax
jae ExitFQueryInft ; no more fonts
mov ax,SIZE DM
mul si
mov si,ax
add si,drvOffset rgdm ;* CS:SI => INST info
mov di,pinft ;* ds:di => INFT
Assert <dyCharDm EQ dxCharDm+1>
Assert <dyCharInft EQ dxCharInft+1>
mov dx,word ptr cs:[si].dxCharDm
mov wo ds:[di].dxCharInft,dx
;* move both dxChar and dyChar
mov dl,cs:[si].dyBaseDm
mov ds:[di].dyBaseLineInft,dl
mov ax,ifont
mov ds:[di].ifontInft,al ;font index
mov ax,sp
ExitFQueryInft:
cEnd FQueryInftCsd
;*****************************************************************************
endif ;* FQueryInftCsd_NonDefault
ifndef GetCharMapCsd_NonDefault
;*****************************************************************************
;********** GetCharMapCsd **********
;* entry: pinft, ch, pbitmap
;* * get character bit map
cProc GetCharMapCsd, <FAR, ATOMIC, PUBLIC>
parmDP pinft
parmB char
parmDP pbitmap
cBegin GetCharMapCsd
cEnd GetCharMapCsd
;*****************************************************************************
endif ;* GetCharMapCsd_NonDefault
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -