;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ ;Program: Video Library ;Programmer: Anti Resonance ;Date: ??.??.???? ; ;A collection of video functions ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Revision History: ; ; 1.0 ??.??.???? ;ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ .MODEL MEDIUM .386 LOCALS CODEMAIN SEGMENT PUBLIC "CODE" PAGE USE16 CODEMAIN ENDS DATAMAIN SEGMENT PUBLIC "DATA" PAGE USE16 DATAMAIN ENDS INCLUDE Video.Inc ;ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ DATAMAIN SEGMENT DATAMAIN ENDS ;ÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜÜ CODEMAIN SEGMENT ASSUME CS:CODEMAIN,DS:DATAMAIN ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Display Off ALIGN 16 DispOff PROC USES DX,AX Mov DX,V_SEQ Mov AL,1 Out DX,AL In AX,DX Or AH,20h Out DX,AX Ret DispOff ENDP ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Display On ALIGN 16 DispOn PROC USES DX,AX Mov DX,V_SEQ Mov AL,1 Out DX,AL In AX,DX And AH,Not 20h Out DX,AX Ret DispOn ENDP ;ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Cursor State ; ;Desc: ; Turns the cursor on or off ;In: ; S = 0 - Off ; 1 - On ;Out: ; nothing ;Dest: ; nothing ALIGN 16 CurSt PROC ARG State:Word USES DX,AX Mov DX,V_CRTC Mov AL,0Ah ;AL = Cursor Start Out DX,AL In AX,DX Or AH,20h ;Bit 5 controls state, turn off by default Test Byte Ptr State,1 ;Is state 0? JZ Short @@Off ; Yes, Keep cursor off And AH,Not 20h ;Turn cursor on @@Off: Out DX,AX ;Write register back Ret CurSt ENDP ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Cursor Position ; ;Desc: ; Moves the cursor on the screen ;In: ; Pos -> Current screen location ;Out: ; nothing ;Destroys: ; nothing ALIGN 16 CurPos PROC ARG Pos:Word USES DX,AX Mov DX,V_CRTC Mov AH,Byte Ptr Pos Mov AL,0Fh Out DX,AX Mov AH,Byte Ptr Pos+1 Mov AL,0Eh Out DX,AX Ret CurPos ENDP ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Cursor Type ; ;Desc: ; Selects between an underline and a block cursor ;In: ; T = Type ; 0 - Underline ; 1 - Block ;Out: ; nothing ;Destroys: ; nothing ALIGN 16 CurType PROC ARG T:Word USES DX,AX Mov DX,V_CRTC Mov AL,0Ah ;AL = Cursor Start Out DX,AL In AX,DX And AH,Not 1Fh ;Lower 5 bits are starting scan line, default to 0 Test Byte Ptr T,1 ;Is cursor of block type? SetNZ AL ; Yes Dec AL And AL,6 ; Starting scan line of 6 for underline Or AH,AL Mov AL,0Ah Out DX,AX ;Write cursor start Mov AX,070Bh ;Cursor ends on scan line 7 Out DX,AX Ret CurType ENDP ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Set Write Planes ; ;Desc: ; Enables writing to one or more of the four video planes ;In: ; P = Plane(s) to write to ; Bits 0-3 correspond to planes 0-3 ;Out: ; nothing ;Destroys: ; nothing ALIGN 16 SetWPlane PROC ARG P:Word USES DX,AX Mov DX,V_SEQ Mov AH,Byte Ptr P Mov AL,02h Out DX,AX Ret SetWPlane ENDP ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Get Write Planes ; ;Desc: ; Returns the planes currently enabled for writing ;In: ; nothing ;Out: ; AL = Planes ;Destroys: ; nothing ALIGN 16 GetWPlane PROC USES DX Mov DX,V_SEQ Mov AL,02h Out DX,AX Inc DX In AL,DX Ret GetWPlane ENDP ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ;Set Read Plane ; ;Desc: ; Selects video plane to read from ;In: ; P = Plane to read from (0-3) ;Out: ; nothing ;Destroys: ; nothing ALIGN 16 SetRPlane PROC ARG P:Word USES DX,AX Mov DX,V_GRAPH Mov AH,Byte Ptr P Mov AL,04h Out DX,AX Ret SetRPlane ENDP CODEMAIN ENDS END