2007-03-13 21:56:55 +01:00
|
|
|
|
model tiny,stdcall
|
|
|
|
|
p486
|
|
|
|
|
locals
|
|
|
|
|
jumps
|
|
|
|
|
codeseg
|
|
|
|
|
option procalign:byte
|
|
|
|
|
|
|
|
|
|
include "..\include\mem.h"
|
|
|
|
|
include "..\include\graphic.h"
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-19 18:21:20 +01:00
|
|
|
|
org 0h
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
header exe <"CE",1,0,0,offset exports,offset imports,,>
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
2007-03-14 12:18:58 +01:00
|
|
|
|
exporting
|
|
|
|
|
declare setvideomode
|
|
|
|
|
declare getvideomode
|
|
|
|
|
declare clearscreen
|
|
|
|
|
declare setfont
|
|
|
|
|
declare loadfont
|
|
|
|
|
declare getfont
|
|
|
|
|
declare addline
|
2007-03-23 17:49:04 +01:00
|
|
|
|
declare showchars
|
2007-03-14 12:18:58 +01:00
|
|
|
|
declare showpixel
|
|
|
|
|
declare getpixel
|
|
|
|
|
declare setstyle
|
|
|
|
|
declare getstyle
|
|
|
|
|
declare enablecursor
|
|
|
|
|
declare disablecursor
|
|
|
|
|
declare setcolor
|
|
|
|
|
declare getcolor
|
|
|
|
|
declare scrolldown
|
|
|
|
|
declare getxy
|
|
|
|
|
declare setxy
|
|
|
|
|
declare savescreen
|
|
|
|
|
declare restorescreen
|
|
|
|
|
declare page2to1
|
|
|
|
|
declare page1to2
|
|
|
|
|
declare xchgpages
|
|
|
|
|
declare waithretrace
|
|
|
|
|
declare waitretrace
|
|
|
|
|
declare getvideoinfos
|
|
|
|
|
declare savedac
|
|
|
|
|
declare restoredac
|
|
|
|
|
declare savestate
|
|
|
|
|
declare restorestate
|
|
|
|
|
declare enablescroll
|
|
|
|
|
declare disablescroll
|
2007-03-23 17:49:04 +01:00
|
|
|
|
declare getchars
|
|
|
|
|
declare savescreen
|
|
|
|
|
declare savescreento
|
|
|
|
|
declare saveparamto
|
|
|
|
|
declare restoreparamfrom
|
|
|
|
|
declare restorescreen
|
|
|
|
|
declare restorescreenfrom
|
|
|
|
|
declare page2to1
|
|
|
|
|
declare page1to2
|
|
|
|
|
declare xchgpages
|
|
|
|
|
declare savestate
|
|
|
|
|
declare restorestate
|
|
|
|
|
declare savestate
|
|
|
|
|
declare restoredacfrom
|
|
|
|
|
declare restoredac
|
|
|
|
|
declare savedacto
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ende
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
importing
|
|
|
|
|
use SYSTEME,mbcreate
|
|
|
|
|
use SYSTEME,mbfindsb
|
|
|
|
|
use SYSTEME,mbfree
|
|
|
|
|
use SYSTEME,mbchown
|
|
|
|
|
endi
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;================================Table des modes videos (64 BYTES) ============================================
|
|
|
|
|
;40*25 16 couleurs
|
|
|
|
|
mode0 DB 67H,00H, 03H,08H,03H,00H,02H
|
|
|
|
|
DB 2DH,27H,28H,90H,2BH,0A0H,0BFH,01FH,00H,4FH,0DH,0EH,00H,00H,00H,00H
|
|
|
|
|
DB 9CH,8EH,8FH,14H,1FH,96H,0B9H,0A3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,10H,0EH,00H,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,14H,07H,38H,39H,3AH,3BH,3CH,3DH,3EH,3FH
|
|
|
|
|
DB 0CH,00H,0FH,08H,00H
|
|
|
|
|
DB 40,25
|
|
|
|
|
|
|
|
|
|
;80*25 16 couleurs
|
|
|
|
|
mode1 DB 67H,00H, 03H,00H,03H,00H,02H
|
|
|
|
|
DB 5FH,4FH,50H,82H,55H,81H,0BFH,1FH,00H,4FH,0DH,0EH,00H,00H,00H,00H
|
|
|
|
|
DB 9CH,0EH,8FH,28H,1FH,96H,0B9H,0A3h,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,10H,0EH,00H,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,14H,07H,38H,39H,3AH,3BH,3CH,3DH,3EH,3FH
|
|
|
|
|
DB 0CH,00H,0FH,08H,00H
|
|
|
|
|
DB 80,25
|
|
|
|
|
|
|
|
|
|
;80*50 16 couleurs
|
|
|
|
|
mode2 DB 63H, 00H, 03H,01H,03H,01H,02H
|
|
|
|
|
DB 5FH,4FH,50H,82H,55H,81H,0BFH,1FH,00H,47H,06H,07H,00H,00H,00H
|
|
|
|
|
DB 00H,9CH,8EH,8FH,28H,1FH,96H,0B9H,0A3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,10H,0EH,00H,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,14H,07H,10H,11H,3AH,3BH,3CH,3DH,3EH,3FH
|
|
|
|
|
DB 0CH,00H,0FH,00H,00H
|
|
|
|
|
DB 80,50
|
|
|
|
|
|
|
|
|
|
;100*50 16 couleurs
|
|
|
|
|
mode3 DB 067H,00H,03H,01H,03H,01H,02H
|
|
|
|
|
DB 70H,63H,64H,85H,68H,84H,0BFH,1FH,00H,47H,06H,07H,00H,00H,00H
|
|
|
|
|
DB 00H,9Ch,08EH,8FH,32H,1FH,96H,0B9H,0A3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,10H,0EH,00H,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,14H,07H,10H,11H,3AH,3BH,3CH,3DH,3EH,3FH
|
|
|
|
|
DB 0CH,00H,0FH,00H,00H
|
|
|
|
|
DB 100,50
|
|
|
|
|
|
|
|
|
|
;100*60 16 couleurs
|
|
|
|
|
mode4 DB 0A7H,00H,03H,01H,03H,01H,02H
|
|
|
|
|
DB 70H,63H,64H,85H,68H,84H,0FFH,1FH,00H,47H,06H,07H,00H,00H,00H
|
|
|
|
|
DB 00H,0E7H,8EH,0DFH,32H,1FH,0DFH,0E5H,0A3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,10H,0EH,00H,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,14H,07H,10H,11H,3AH,3BH,3CH,3DH,3EH,3FH
|
|
|
|
|
DB 0CH,00H,0FH,00H,00H
|
|
|
|
|
DB 100,60
|
|
|
|
|
|
|
|
|
|
;320*200 256 couleurs
|
|
|
|
|
mode5 DB 63H, 00H, 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 5FH,4FH,50H,82H,54H,80H,0BFH,1FH,00H,41H,00H,00H,00H,00H,00H,00H
|
|
|
|
|
DB 9CH,0EH,8FH,28H,00H,96H,0B9H,0E3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,40H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,06H,07H,08H,09H,0AH,0BH,0CH,0DH,0EH,0FH
|
|
|
|
|
DB 41H,00H,0FH,00H,00H
|
|
|
|
|
DB 40,25
|
|
|
|
|
|
|
|
|
|
;320*400 256 couleurs
|
|
|
|
|
mode6 DB 063H, 00H, 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 5FH,4FH,50H,82H,54H,80H,0BFH,1FH,00H,40H,00H,00H,00H,00H,00H,00H
|
|
|
|
|
DB 9CH,8EH,8FH,28H,00H,96H,0B9H,0E3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,40H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,06H,07H,08H,09H,0AH,0BH,0CH,0DH,0EH,0FH
|
|
|
|
|
DB 41H,00H,0FH,00H,00H
|
|
|
|
|
DB 40,50
|
|
|
|
|
|
|
|
|
|
;320*480 256 couleurs
|
|
|
|
|
mode7 DB 0E3H, 00H, 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 5FH,4FH,50H,82H,54H,80H,0BH,3EH,00H,40H,00H,00H,00H,00H,00H,00H
|
|
|
|
|
DB 0EAH,0ACH,0DFH,28H,00H,0E7H,06H,0E3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,40H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04h,05H,06H,07H,08H,09H,0AH,0BH,0CH,0DH,0EH,0FH
|
|
|
|
|
DB 41H,00H,0FH,00H,00H
|
|
|
|
|
DB 40,60
|
|
|
|
|
|
|
|
|
|
;360*480 256 couleurs
|
|
|
|
|
mode8 DB 0E7H, 00H, 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 6BH,59H,5AH,8EH,5EH,8AH,0DH,3EH,00H,40H,00H,00H,00H,00H,00H,00H
|
|
|
|
|
DB 0EAH,0ACH,0DFH,2DH,00H,0E7H,06H,0E3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,40H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04h,05H,06H,07H,08H,09H,0AH,0BH,0CH,0DH,0EH,0FH
|
|
|
|
|
DB 41H,00H,0FH,00H,00H
|
|
|
|
|
DB 45,60
|
|
|
|
|
|
|
|
|
|
;400*600 256 couleurs
|
|
|
|
|
mode9 DB 0E7H, 00H, 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 74h,63h,64h,97h,68h,95h,86h,0F0h,00h,60h,00h,00h,00h,00h,00h,00h
|
|
|
|
|
DB 5Bh,8Dh,57h,32h,00h,60h,80h,0E3h,0FFh
|
|
|
|
|
DB 00H,00H,00H,00H,00H,40H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04h,05H,06H,07H,08H,09H,0AH,0BH,0CH,0DH,0EH,0FH
|
|
|
|
|
DB 41H,00H,0FH,00H,00H
|
|
|
|
|
DB 50,75
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
|
|
|
|
;640*480 16 couleurs
|
|
|
|
|
mode10 DB 0E3H
|
|
|
|
|
DB 00H
|
|
|
|
|
DB 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 5FH,4FH,50H,82H,53H,9FH,0BH,3EH,00H,40H,00H,00H,00H,00H,00H,00H,0E9H,8BH,0DFH,28H,00H,0E7H,04H,0E3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,00H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,06H,07H,10H,11H,3AH,3BH,3CH,3DH,3EH,3FH,01H,00H,0FH,00H,00H
|
|
|
|
|
DB 80,60
|
|
|
|
|
|
|
|
|
|
;800*600 16 couleurs
|
|
|
|
|
mode11 DB 0E7H
|
|
|
|
|
DB 00H
|
|
|
|
|
DB 03H,01H,0FH,00H,06H
|
|
|
|
|
DB 70H,63H,64H,92H,65H,82H,70H,0F0H,00H,60H,00H,00H,00H,00H,00H,00H,5BH,8CH,57H,32H,00H,58H,70H,0E3H,0FFH
|
|
|
|
|
DB 00H,00H,00H,00H,00H,00H,05H,0FH,0FFH
|
|
|
|
|
DB 00H,01H,02H,03H,04H,05H,06H,07H,10H,11H,3AH,3BH,3CH,3DH,3EH,3FH,01H,00H,0FH,00H,00H
|
|
|
|
|
DB 100,75
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;============================================DATABLOCK=========================================================
|
2007-03-14 12:18:58 +01:00
|
|
|
|
datablock vgainf <0,0,0,0,0,7,0FFh,0,0,0,0,0,0,0,0,0,0,0,1>
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;=======================================Equivalence pour la clart<72> du code========================================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
sequencer equ 03C4h
|
2004-06-12 23:34:04 +02:00
|
|
|
|
misc equ 03C2h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ccrt equ 03D4h
|
|
|
|
|
attribs equ 03C0h
|
2004-06-12 23:34:04 +02:00
|
|
|
|
graphics equ 03CEh
|
|
|
|
|
statut equ 03DAh
|
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
maxmode equ 11
|
2005-12-05 09:01:34 +01:00
|
|
|
|
planesize equ 65000
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;============================================Fonctions de l'int VIDEO===========================================
|
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
;=============ENABLESCROLLING=========
|
|
|
|
|
;Autorise le d<>filement
|
|
|
|
|
;->
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=====================================
|
|
|
|
|
PROC enablescroll FAR
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.scrolling],1
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp enablescroll
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============DISABLESCROLLING=========
|
|
|
|
|
;D<>sactive le d<>filement
|
|
|
|
|
;->
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;======================================
|
|
|
|
|
PROC disablescroll FAR
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.scrolling],0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp disablescroll
|
|
|
|
|
|
|
|
|
|
;=============ENABLECURSOR=============
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;Autorise le d<>filement
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;->
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;======================================
|
|
|
|
|
PROC enablecursor FAR
|
|
|
|
|
USES ax,dx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.cursor],1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov dx,ccrt
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov al,0Ah
|
|
|
|
|
out dx,al
|
|
|
|
|
inc dx
|
|
|
|
|
in al,dx
|
|
|
|
|
and al,11011111b
|
|
|
|
|
mov ah,al
|
|
|
|
|
dec dx
|
|
|
|
|
mov al,0Ah
|
|
|
|
|
out dx,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.x]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov dl,[cs:datablock.y]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor dh,dh
|
|
|
|
|
call setxy,ax,dx
|
2005-12-05 09:01:34 +01:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp enablecursor
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============DISABLECURSOR=============
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;D<>sactive le d<>filement
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;->
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=======================================
|
|
|
|
|
PROC disablecursor FAR
|
|
|
|
|
USES ax,dx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.cursor],0
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov dx,ccrt
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov al,0Ah
|
|
|
|
|
out dx,al
|
|
|
|
|
inc dx
|
|
|
|
|
in al,dx
|
|
|
|
|
or al,00100000b
|
|
|
|
|
mov ah,al
|
|
|
|
|
dec dx
|
|
|
|
|
mov al,0Ah
|
|
|
|
|
out dx,ax
|
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp disablecursor
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SETSTYLE=========
|
|
|
|
|
;Change le style du texte a %0
|
|
|
|
|
;-> %0 style
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;============================
|
|
|
|
|
PROC setstyle FAR
|
|
|
|
|
ARG @style:word
|
|
|
|
|
USES cx
|
|
|
|
|
mov ax,[@style]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.style],al
|
2005-12-05 09:01:34 +01:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp setstyle
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========GETSTYLE=========
|
|
|
|
|
;R<>cup<75>re le style du texte dans AX
|
|
|
|
|
;->
|
|
|
|
|
;<- AX style
|
|
|
|
|
;===========================
|
|
|
|
|
PROC getstyle FAR
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.style]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp getstyle
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============SetVideoMode=========
|
|
|
|
|
;Fixe le mode vid<69>o courant a %0
|
|
|
|
|
;-> %0 mode d'<27>cran
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<- Carry if error
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==================================
|
|
|
|
|
PROC setvideomode FAR
|
|
|
|
|
ARG @mode:word
|
|
|
|
|
USES ax,cx,dx,di
|
|
|
|
|
mov ax,[@mode]
|
|
|
|
|
xor ah,ah
|
2005-12-05 09:01:34 +01:00
|
|
|
|
cmp al,maxmode
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ja @@errorsetvideomode
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.mode],5h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jb @@nographic
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cmp al,5h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jae @@nographic
|
|
|
|
|
call initfont
|
|
|
|
|
@@nographic:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.mode],0FFh
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jne @@noinit
|
|
|
|
|
call initfont
|
|
|
|
|
@@noinit:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.mode],al
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor ah,ah
|
|
|
|
|
mov di,ax
|
|
|
|
|
shl di,6
|
|
|
|
|
add di,offset mode0
|
|
|
|
|
mov dx,misc
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,al
|
|
|
|
|
inc di
|
|
|
|
|
mov dx,statut
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[cs:di]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
out dx,al
|
2004-06-12 23:34:04 +02:00
|
|
|
|
inc di
|
|
|
|
|
mov dx,sequencer
|
|
|
|
|
xor ax,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@initsequencer:
|
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@initsequencer
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ax,0E11h
|
|
|
|
|
mov dx,ccrt
|
2005-12-05 09:01:34 +01:00
|
|
|
|
out dx,ax
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor ax,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@initcrt:
|
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,24
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@initcrt
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,graphics
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor ax,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@initgraphic:
|
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,8
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@initgraphic
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov dx,statut
|
2005-12-05 09:01:34 +01:00
|
|
|
|
in al,dx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov dx,attribs
|
|
|
|
|
xor ax,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@initattribs:
|
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push ax
|
|
|
|
|
in ax,dx
|
|
|
|
|
pop ax
|
|
|
|
|
out dx,al
|
|
|
|
|
xchg ah,al
|
|
|
|
|
out dx,al
|
|
|
|
|
xchg ah,al
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,20
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@initattribs
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov al,20h
|
|
|
|
|
out dx,al
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[cs:di]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.columns],al
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ah,[cs:di+1]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.lines],ah
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mul ah
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov cl,[cs:di-5]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
and cl,01000000b
|
|
|
|
|
cmp cl,0
|
2007-03-13 21:56:55 +01:00
|
|
|
|
je @@colors16
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.color],8
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov cl,4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@colors256
|
|
|
|
|
@@colors16:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.color],4
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov cl,3
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@colors256:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.mode],5
|
|
|
|
|
setae [cs:datablock.graphic]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jb @@istext
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shl ax,cl
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.segments],0A000h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@wasgraph
|
|
|
|
|
@@istext:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.segments],0B800h
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shl ax,1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@wasgraph:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.pagesize],ax
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ax,planesize
|
|
|
|
|
xor dx,dx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
div [cs:datablock.pagesize]
|
|
|
|
|
mov [cs:datablock.nbpage],al
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[cs:di-36]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor ah,ah
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shl ax,2
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cl,[cs:datablock.graphic]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr ax,cl
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.linesize],ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ax,[cs:di-43]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.adress],ax
|
|
|
|
|
mov [cs:datablock.base],ax
|
|
|
|
|
mov [cs:datablock.cursor],1
|
|
|
|
|
mov [cs:datablock.style],0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@errorsetvideomode:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp setvideomode
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
initfont:
|
|
|
|
|
push ds
|
2005-12-05 09:01:34 +01:00
|
|
|
|
call clearscreen
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2007-03-13 21:56:55 +01:00
|
|
|
|
call loadfont,offset font8x8,8,1
|
|
|
|
|
call loadfont,offset font8x16,16,0
|
|
|
|
|
pop ds
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============GetVideoMode=========
|
|
|
|
|
;Renvoie le mode vid<69>o courant dans AX
|
|
|
|
|
;->
|
|
|
|
|
;<- AX
|
|
|
|
|
;==================================
|
|
|
|
|
PROC getvideomode FAR
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.mode]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp getvideomode
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============CLEARSCREEN=========
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;Efface l'ecran graphique ou texte
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;->
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=================================
|
|
|
|
|
PROC clearscreen FAR
|
|
|
|
|
USES eax,cx,dx,di,es
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov cx,planesize
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov di,[cs:datablock.adress]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.graphic],1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jne @@erasetext
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,0A000h
|
|
|
|
|
mov es,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@erasegraph:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,0F02h
|
|
|
|
|
mov dx,sequencer
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0205h
|
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0003h
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0FF08h
|
|
|
|
|
out dx,ax
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov eax,00000000h
|
2005-12-05 09:01:34 +01:00
|
|
|
|
cld
|
2004-06-12 23:34:04 +02:00
|
|
|
|
rep stosd
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,0005h
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.color],4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
je @@not256
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,4005h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@not256:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0003h
|
|
|
|
|
out dx,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@endoferase
|
|
|
|
|
@@erasetext:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ax,0B800h
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov eax,07200720h
|
|
|
|
|
cld
|
2007-03-13 21:56:55 +01:00
|
|
|
|
rep stosd
|
|
|
|
|
@@endoferase:
|
|
|
|
|
call setxy,0,0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp clearscreen
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============SetFont=========
|
|
|
|
|
;Active la font %0 parmi les 8
|
|
|
|
|
;-> %0 n<> font
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<- Carry if error
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============================
|
|
|
|
|
PROC setfont FAR
|
|
|
|
|
ARG @font:word
|
|
|
|
|
USES ax,cx,dx
|
|
|
|
|
mov cx,[@font]
|
|
|
|
|
xor ch,ch
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cmp cl,7
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ja @@errorsetfont
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.font],cl
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ah,cl
|
|
|
|
|
and cl,11b
|
|
|
|
|
and ah,0100b
|
|
|
|
|
shl ah,2
|
|
|
|
|
add ah,cl
|
|
|
|
|
mov dx,sequencer
|
|
|
|
|
mov al,3
|
|
|
|
|
out dx,ax
|
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@errorsetfont:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp setfont
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============GetFont=========
|
|
|
|
|
;R<>cup<75>re le n<> de la font active AX
|
|
|
|
|
;->
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<- CL n<> font, Carry if error
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============================
|
|
|
|
|
PROC getfont FAR
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.font]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
|
|
|
|
endp getfont
|
|
|
|
|
|
|
|
|
|
;!!!!!!!!!!!!!!!!!!!! a remettre les anciens params de timing depuis origine
|
|
|
|
|
;=============LoadFont========
|
|
|
|
|
;Charge une police point<6E>e par %0 dans la carte vid<69>o sous n<>font %1, taille police dans %2
|
|
|
|
|
;-> %0 n<>font, %1 pointeur vers Font, %2 taille police
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<- Carry if error
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============================
|
|
|
|
|
PROC loadfont FAR
|
|
|
|
|
ARG @pointer:word,@size:word,@font:word
|
|
|
|
|
USES ax,bx,cx,dx,si,di,es
|
|
|
|
|
mov si,[@pointer]
|
|
|
|
|
mov cx,[@size]
|
|
|
|
|
mov bx,[@font]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cmp bl,7
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ja @@errorloadfont
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor di,di
|
|
|
|
|
cli
|
|
|
|
|
mov dx,sequencer
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@doseq:
|
|
|
|
|
mov ax,[cs:di+offset reg1]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@doseq
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov dx,graphics
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@doseq2:
|
|
|
|
|
mov ax,[cs:di+offset reg1]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6+6
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@doseq2
|
2004-06-12 23:34:04 +02:00
|
|
|
|
sti
|
|
|
|
|
mov ax,0A000h
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov dx,256
|
|
|
|
|
mov al,0
|
|
|
|
|
xor bh,bh
|
|
|
|
|
cmp bl,4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jb @@isless
|
2004-06-12 23:34:04 +02:00
|
|
|
|
sub bl,4
|
|
|
|
|
shl bl,1
|
|
|
|
|
inc bl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@okmake
|
|
|
|
|
@@isless:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shl bl,1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@okmake:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov di,bx
|
|
|
|
|
shl di,13
|
|
|
|
|
mov bh,cl
|
|
|
|
|
mov bl,cl
|
|
|
|
|
sub bl,32
|
|
|
|
|
neg bl
|
|
|
|
|
xor cx,cx
|
|
|
|
|
cld
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@popz:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cl,bh
|
|
|
|
|
rep movsb
|
|
|
|
|
mov cl,bl
|
|
|
|
|
rep stosb
|
|
|
|
|
dec dx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jnz @@popz
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor di,di
|
|
|
|
|
mov dx,sequencer
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@doseqs:
|
|
|
|
|
mov ax,[cs:di+offset reg2]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@doseqs
|
|
|
|
|
mov dx,graphics
|
|
|
|
|
@@doseqs2:
|
|
|
|
|
mov ax,[cs:di+offset reg2]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6+6
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jbe @@doseqs2
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@errorloadfont:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
stc
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
reg2 dw 0100h, 0302h, 0304h, 0300h
|
|
|
|
|
dw 0004h, 1005h, 0E06h
|
|
|
|
|
reg1 dw 0100h, 0402h, 0704h, 0300h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
dw 0204h, 0005h, 0406h
|
|
|
|
|
endp loadfont
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SHOWLINE===============
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;remet le curseur text a la ligne avec un retour chariot
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;->
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=================================
|
|
|
|
|
PROC addline FAR
|
|
|
|
|
USES bx,cx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov bl,[cs:datablock.y]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor bh,bh
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cl,[cs:datablock.lines]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
sub cl,2
|
|
|
|
|
cmp bl,cl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jne @@scro
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dec bl
|
|
|
|
|
mov cx,1
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.graphic],0
|
2007-03-13 21:56:55 +01:00
|
|
|
|
je @@okscro
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cx,8
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@okscro:
|
|
|
|
|
call scrolldown,cx
|
|
|
|
|
@@scro:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
inc bl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
call setxy,0,bx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp addline
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SETCOLOR=========
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;Change les attributs du texte a CL
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;-> %0 couleur
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;===========================
|
|
|
|
|
PROC setcolor FAR
|
|
|
|
|
ARG @color:word
|
|
|
|
|
USES cx
|
|
|
|
|
mov cx,[@color]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.colors],cl
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp setcolor
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========GETCOLOR=========
|
|
|
|
|
;R<>cup<75>re les attributs du texte dans AX
|
|
|
|
|
;->
|
|
|
|
|
;<- AX couleur
|
|
|
|
|
;===========================
|
|
|
|
|
PROC getcolor FAR
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.colors]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp getcolor
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SCROLLDOWN=========
|
|
|
|
|
;defile de %0 lines vers le bas
|
|
|
|
|
;-> %0 lines <20> d<>filer vers le bas
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;<-
|
|
|
|
|
;=============================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
PROC scrolldown FAR
|
|
|
|
|
ARG @line:word
|
|
|
|
|
USES ax,cx,dx,si,di,ds,es
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.scrolling],0
|
2007-03-13 21:56:55 +01:00
|
|
|
|
je @@graphp
|
|
|
|
|
mov ax,[@line]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mul [cs:datablock.linesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov si,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,[cs:datablock.pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
sub cx,si
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov di,[cs:datablock.adress]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.graphic],1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jne @@textp
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,0A000h
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov es,ax
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ds,ax
|
|
|
|
|
mov ax,0F02h
|
|
|
|
|
mov dx,sequencer
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0105h
|
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
mov ax,0005h
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.color],4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
je @@not256ok
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,4005h
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@not256ok:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0003h
|
|
|
|
|
out dx,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@graphp
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@textp:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ax,0B800h
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov ds,ax
|
|
|
|
|
rep movsb
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@graphp:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp scrolldown
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========GETXY=========
|
2007-03-23 17:49:04 +01:00
|
|
|
|
;Met les coordonn<6E>es du curseur dans ah,al au format point
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;->
|
|
|
|
|
;<- ah coordonn<6E>es x, al coordonn<6E>es y
|
|
|
|
|
;========================
|
|
|
|
|
PROC getxy FAR
|
|
|
|
|
USES bx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov ah,[cs:datablock.x]
|
|
|
|
|
mov al,[cs:datablock.y]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ret
|
|
|
|
|
endp getxy
|
|
|
|
|
|
|
|
|
|
;==========SETXY=========
|
|
|
|
|
;Change les coordonn<6E>es du curseur a X:%0,Y:%1
|
|
|
|
|
;-> %0 coordonn<6E>es x, %1 coordonn<6E>es y
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;========================
|
|
|
|
|
PROC setxy FAR
|
|
|
|
|
ARG @x:word,@y:word
|
|
|
|
|
USES ax,bx,dx,di
|
|
|
|
|
mov ax,[@y]
|
|
|
|
|
mov bx,[@x]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.x],bl
|
|
|
|
|
mov [cs:datablock.y],al
|
|
|
|
|
mov di,[cs:datablock.adress]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
add di,bx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mul [cs:datablock.columns]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
add di,ax
|
|
|
|
|
shl di,1
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.xy],di
|
2005-12-05 09:01:34 +01:00
|
|
|
|
call setcursor
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp setxy
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SHOWPIXEL=========
|
|
|
|
|
;Affiche un pixel de couleur AL en X:%0,Y:%1
|
|
|
|
|
;-> %0 coordonn<6E>es x, %1 coordonn<6E>es y, %2 couleur
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;<-
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;============================
|
|
|
|
|
PROC showpixel FAR
|
|
|
|
|
ARG @x:word,@y:word,@color:word
|
|
|
|
|
USES ax,bx,cx,dx,si,di,es
|
|
|
|
|
mov bx,[@x]
|
|
|
|
|
mov cx,[@y]
|
|
|
|
|
mov ax,[@color]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.color],4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
je @@showpixel4
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov si,ax
|
|
|
|
|
mov ax,cx
|
|
|
|
|
mov cl,bl
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mul [cs:datablock.linesize]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr bx,2
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov di,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add di,[cs:datablock.adress]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
and cl,3
|
|
|
|
|
mov ah,1
|
|
|
|
|
shl ah,cl
|
|
|
|
|
mov al,2
|
|
|
|
|
mov dx,sequencer
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov bx,0A000h
|
|
|
|
|
mov es,bx
|
|
|
|
|
mov ax,si
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov [es:di],al
|
|
|
|
|
jmp @@endofshow
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@showpixel4:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,ax
|
|
|
|
|
mov ax,cx
|
|
|
|
|
mov ch,dl
|
|
|
|
|
mov cl,bl
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mul [cs:datablock.linesize]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr bx,3
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov di,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add di,[cs:datablock.adress]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
and cl,111b
|
|
|
|
|
xor cl,111b
|
|
|
|
|
mov ah,1
|
|
|
|
|
shl ah,cl
|
|
|
|
|
mov al,8
|
|
|
|
|
mov dx,graphics ;masque
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0205h
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0003h
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov bx,0A000h
|
|
|
|
|
mov es,bx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[es:di]
|
|
|
|
|
mov [es:di],ch
|
|
|
|
|
@@endofshow:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp showpixel
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;!!!!!!!!!!!!!! gerer le mode chain 4
|
|
|
|
|
;==========GETPIXEL=========
|
|
|
|
|
;R<>cup<75>re en ax la couleur du pixel de coordonn<6E>es X:%0,Y:%1
|
|
|
|
|
;-> %0 coordonn<6E>es x, %1 coordonn<6E>es y
|
|
|
|
|
;<- AX couleur
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;=========================================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
PROC getpixel FAR
|
|
|
|
|
ARG @x:word,@y:word
|
|
|
|
|
USES ax,bx,cx,dx,di,es
|
|
|
|
|
mov bx,[@x]
|
|
|
|
|
mov cx,[@y]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,cx
|
|
|
|
|
mov cl,bl
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mul [cs:datablock.linesize]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr bx,2
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov di,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add di,[cs:datablock.adress]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
and cl,3
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ah,cl
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov al,4
|
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov bx,0A000h
|
|
|
|
|
mov es,bx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[es:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp getpixel
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========GETVGAINFO=========
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;Renvoie un bloc de donn<6E>e en ES:DI sur l'<27>tat de la carte graphique
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;<- ES:%0 pointeur
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;->
|
|
|
|
|
;=============================================
|
2007-03-14 12:18:58 +01:00
|
|
|
|
PROC getvideoinfos FAR
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ARG @pointer:word
|
|
|
|
|
USES cx,si,di,ds
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,size datablock
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov si,offset datablock
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov di,[@pointer]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
ret
|
2007-03-14 12:18:58 +01:00
|
|
|
|
endp getvideoinfos
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========WAITRETRACE=========
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;Synchronisation avec la retrace verticale
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;<-
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;->
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==============================
|
|
|
|
|
PROC waitretrace FAR
|
|
|
|
|
USES ax,dx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov dx,3DAh
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@waitr:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
in al,dx
|
|
|
|
|
test al,8
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jz @@waitr
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp waitretrace
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========WAITHRETRACE=========
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;Synchronisation avec la retrace horizontale
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;<-
|
2005-12-05 09:01:34 +01:00
|
|
|
|
;->
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;===============================
|
|
|
|
|
PROC waithretrace FAR
|
|
|
|
|
USES ax,dx
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,3DAh
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@waitr:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
in al,dx
|
|
|
|
|
test al,1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jz @@waitr
|
2005-12-05 09:01:34 +01:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp waithretrace
|
|
|
|
|
|
|
|
|
|
;==========GETCHAR=========
|
|
|
|
|
;Renvoie en AX le caract<63>re sur le curseur
|
|
|
|
|
;<-
|
|
|
|
|
;->
|
|
|
|
|
;==========================
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC getchars FAR
|
2007-03-13 21:56:55 +01:00
|
|
|
|
USES di,es
|
2004-11-11 17:19:18 +01:00
|
|
|
|
mov ax,0B800h
|
|
|
|
|
mov es,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov di,[cs:datablock.xy]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov al,[es:di]
|
|
|
|
|
xor ah,ah
|
2004-11-11 17:19:18 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp getchars
|
2004-11-11 17:19:18 +01:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SHOWCHAR=========
|
|
|
|
|
;Ecrit le caract<63>re ASCII %0 attribut %1 apr<70>s le curseur, en le mettant <20> jours
|
|
|
|
|
;<-
|
|
|
|
|
;->
|
|
|
|
|
;===========================
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC showchars FAR
|
2007-03-13 21:56:55 +01:00
|
|
|
|
ARG @char:word,@attr:word
|
|
|
|
|
USES ax,bx,cx,dx,di,es
|
|
|
|
|
mov cl,[byte ptr @char]
|
|
|
|
|
mov ch,[byte ptr @attr]
|
|
|
|
|
cmp [@attr],0FFFFh
|
|
|
|
|
jne @@notlastattr
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov ch,[cs:datablock.colors]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@notlastattr:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.graphic],1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jne @@textaccess
|
2004-11-11 17:19:18 +01:00
|
|
|
|
call emulatechar
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@adjusttext
|
|
|
|
|
@@textaccess:
|
2004-11-11 17:19:18 +01:00
|
|
|
|
mov ax,0B800h
|
|
|
|
|
mov es,ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov di,[cs:datablock.xy]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov [es:di],cx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add [cs:datablock.xy],2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@adjusttext:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
inc [cs:datablock.x]
|
|
|
|
|
mov cl,[cs:datablock.columns]
|
|
|
|
|
cmp [cs:datablock.x],cl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jb @@noadjusted
|
|
|
|
|
call addline
|
|
|
|
|
@@noadjusted:
|
2004-11-11 17:19:18 +01:00
|
|
|
|
call setcursor
|
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp showchars
|
2004-11-11 17:19:18 +01:00
|
|
|
|
|
|
|
|
|
setcursor:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
push ax cx dx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.cursor],1
|
2005-12-05 09:01:34 +01:00
|
|
|
|
jne notshow
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov dx,ccrt
|
2004-11-11 17:19:18 +01:00
|
|
|
|
mov al,0Eh
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,[cs:datablock.xy]
|
2004-11-11 17:19:18 +01:00
|
|
|
|
shr cx,1
|
|
|
|
|
mov ah,ch
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ah,cl
|
|
|
|
|
inc al
|
|
|
|
|
out dx,ax
|
2005-12-05 09:01:34 +01:00
|
|
|
|
notshow:
|
|
|
|
|
pop dx cx ax
|
2004-11-11 17:19:18 +01:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;Ecrit le caract<63>re ASCII CL attribut CH apr<70>s le curseur graphique, en le mettant <20> jours en mode graphique
|
|
|
|
|
emulatechar:
|
|
|
|
|
push ax bx cx dx di
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov al,ch
|
|
|
|
|
mov di,cx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
and di,11111111b
|
|
|
|
|
shl di,3
|
|
|
|
|
add di,offset font8x8
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov bl,[cs:datablock.x]
|
|
|
|
|
mov cl,[cs:datablock.y]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
xor bh,bh
|
|
|
|
|
xor ch,ch
|
|
|
|
|
shl bx,3
|
|
|
|
|
shl cx,3
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ah,[cs:di]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
xor dx,dx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
bouclet:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
rol ah,1
|
|
|
|
|
push ax
|
|
|
|
|
jc colored
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr al,4
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.style],0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
jnz transparent
|
2004-06-12 23:34:04 +02:00
|
|
|
|
colored:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
and ax,1111b
|
|
|
|
|
call showpixel,bx,cx,ax
|
2004-06-12 23:34:04 +02:00
|
|
|
|
transparent:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
pop ax
|
2004-06-12 23:34:04 +02:00
|
|
|
|
inc bx
|
2005-12-05 09:01:34 +01:00
|
|
|
|
inc dl
|
|
|
|
|
cmp dl,8
|
2004-06-12 23:34:04 +02:00
|
|
|
|
jb bouclet
|
|
|
|
|
inc di
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ah,[cs:di]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
xor dl,dl
|
|
|
|
|
sub bx,8
|
2004-06-12 23:34:04 +02:00
|
|
|
|
inc cx
|
2005-12-05 09:01:34 +01:00
|
|
|
|
inc dh
|
|
|
|
|
cmp dh,8
|
2004-06-12 23:34:04 +02:00
|
|
|
|
jb bouclet
|
2004-11-11 17:19:18 +01:00
|
|
|
|
ended:
|
|
|
|
|
pop di dx cx bx ax
|
|
|
|
|
ret
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;sauve l'ecran dans un bloc de m<>moire
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC savescreen FAR
|
|
|
|
|
USES ax,ds
|
|
|
|
|
call [cs:mbcreate],offset data3,[cs:datablock.pagesize]
|
|
|
|
|
jc @@error
|
|
|
|
|
call [cs:mbchown],ax,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2004-11-05 01:58:45 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call savescreento,0
|
|
|
|
|
clc
|
2004-11-05 01:58:45 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
@@error:
|
|
|
|
|
stc
|
|
|
|
|
ret
|
|
|
|
|
endp savescreen
|
2004-11-05 01:58:45 +01:00
|
|
|
|
data3 db '/vgascreen',0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
;===================================sauve l'ecran rapidement en ds:%1================
|
|
|
|
|
PROC savescreento FAR
|
|
|
|
|
ARG @offset:word
|
|
|
|
|
USES ecx,si,di,ds,es
|
|
|
|
|
push ds
|
|
|
|
|
pop es
|
2004-11-05 01:58:45 +01:00
|
|
|
|
mov cx,0B800h
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ds,cx
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,[cs:datablock.pagesize]
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov di,[@offset]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
|
|
|
|
xor si,si
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2004-11-05 01:58:45 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp savescreento
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
;===================================sauve les parametres en ds:%0================
|
|
|
|
|
PROC saveparamto FAR
|
|
|
|
|
ARG @offset:word
|
|
|
|
|
USES ecx,si,di,ds,es
|
|
|
|
|
push ds
|
|
|
|
|
pop es
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
xor ecx,ecx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,size datablock
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov di,[@offset]
|
2004-11-05 01:58:45 +01:00
|
|
|
|
mov si,offset datablock
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp saveparamto
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
;===================================restore les parametres depuis en ds:%0================
|
|
|
|
|
PROC restoreparamfrom FAR
|
|
|
|
|
ARG @offset:word
|
|
|
|
|
USES ecx,si,di,es
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop es
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,size datablock
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov si,[@offset]
|
2004-11-05 01:58:45 +01:00
|
|
|
|
mov di,offset datablock
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
2004-11-05 01:58:45 +01:00
|
|
|
|
rep movsb
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp restoreparamfrom
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;restaure l'ecran dans un bloc de m<>moire
|
|
|
|
|
PROC restorescreen FAR
|
|
|
|
|
USES ax,ds
|
|
|
|
|
call [cs:mbfindsb],offset data3,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2004-11-05 01:58:45 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call restorescreenfrom,0
|
|
|
|
|
clc
|
|
|
|
|
ret
|
|
|
|
|
@@error:
|
|
|
|
|
stc
|
2004-11-05 01:58:45 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp restorescreen
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
;===================================restaure l'ecran rapidement en %1================
|
|
|
|
|
PROC restorescreenfrom FAR
|
|
|
|
|
ARG @offset:word
|
|
|
|
|
USES ecx,si,di,es
|
|
|
|
|
mov cx,0B800h
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov es,cx
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,[cs:datablock.pagesize]
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov si,[@offset]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
|
|
|
|
xor di,di
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2004-11-05 01:58:45 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp restorescreenfrom
|
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;===============================Page2to1============================
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
PROC page2to1 FAR
|
|
|
|
|
ARG @offset:word
|
|
|
|
|
USES ecx,si,di,ds,es
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cx,0B800H
|
|
|
|
|
mov es,cx
|
|
|
|
|
mov ds,cx
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,[cs:datablock.pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov si,[cs:datablock.pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor di,di
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp page2to1
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;===============================Page1to2============================
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC page1to2 FAR
|
|
|
|
|
ARG @offset:word
|
|
|
|
|
USES ecx,si,di,ds,es
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cx,0B800H
|
|
|
|
|
mov es,cx
|
|
|
|
|
mov ds,cx
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,[cs:datablock.pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov di,[cs:datablock.pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor si,si
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp page1to2
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;===============================xchgPages============================
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC xchgpages FAR
|
|
|
|
|
USES ax,ecx,si,di,ds,es
|
|
|
|
|
call [cs:mbcreate],offset data4,[cs:datablock.pagesize]
|
|
|
|
|
jc @@error
|
|
|
|
|
call [cs:mbchown],ax,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call savescreento,0
|
2007-03-14 12:18:58 +01:00
|
|
|
|
call page2to1
|
|
|
|
|
xor si,si
|
|
|
|
|
mov cx,0B800H
|
|
|
|
|
mov es,cx
|
|
|
|
|
mov di,[cs:datablock.pagesize]
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
mov cx,[cs:datablock.pagesize]
|
|
|
|
|
shr cx,2
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
|
|
|
|
ret
|
|
|
|
|
@@error:
|
|
|
|
|
stc
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp xchgpages
|
2007-03-14 12:18:58 +01:00
|
|
|
|
|
|
|
|
|
data4 db '/vgatemp',0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;Sauve l'<27>tat de la carte dans un bloc m<>moire
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC savestate FAR
|
|
|
|
|
USES ax,cx,di,ds
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov cx,size datablock
|
|
|
|
|
add cx,[cs:datablock.pagesize]
|
|
|
|
|
add cx,3*256
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call [cs:mbcreate],offset data,cx
|
|
|
|
|
jc @@error
|
|
|
|
|
call [cs:mbchown],ax,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
|
|
|
|
xor di,di
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call saveparamto,di
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add di,size datablock
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call savescreento,di
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add di,[cs:datablock.pagesize]
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call savedacto,di
|
|
|
|
|
clc
|
|
|
|
|
ret
|
|
|
|
|
@@error:
|
|
|
|
|
stc
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp savestate
|
2007-03-14 12:18:58 +01:00
|
|
|
|
|
|
|
|
|
data db '/vga',0
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;R<>cup<75>re l'<27>tat de la carte depuis son bloc m<>moire
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC restorestate FAR
|
|
|
|
|
USES ax,cx,di,ds
|
|
|
|
|
call [cs:mbfindsb],offset data,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
xor di,di
|
|
|
|
|
call restoreparamfrom,di
|
|
|
|
|
add di,size datablock
|
|
|
|
|
call restorescreenfrom,di
|
|
|
|
|
add di,[cs:datablock.pagesize]
|
|
|
|
|
call restoredacfrom,di
|
|
|
|
|
clc
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
@@error:
|
|
|
|
|
stc
|
|
|
|
|
ret
|
|
|
|
|
endp restorestate
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;sauve le DAC dans un bloc de m<>moire
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC savedac FAR
|
|
|
|
|
USES ax,ds
|
|
|
|
|
call [cs:mbcreate],offset data3,3*256
|
|
|
|
|
jc @@error
|
|
|
|
|
call [cs:mbchown],ax,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call savedacto,0
|
|
|
|
|
clc
|
|
|
|
|
ret
|
|
|
|
|
@@error:
|
|
|
|
|
stc
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp savedac
|
2007-03-14 12:18:58 +01:00
|
|
|
|
|
|
|
|
|
data2 db '/vgadac',0
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;R<>cup<75>re le dac depuis son bloc m<>moire
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC restoredac FAR
|
|
|
|
|
USES ax,ds
|
|
|
|
|
call [cs:mbfindsb],offset data2,[word ptr ss:bp+4]
|
|
|
|
|
jc @@error
|
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
call restoredacfrom,0
|
|
|
|
|
clc
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
@@error:
|
|
|
|
|
stc
|
|
|
|
|
ret
|
|
|
|
|
endp restoredac
|
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
;sauve le DAC en ds:%0
|
|
|
|
|
PROC savedacto FAR
|
|
|
|
|
USES ax,cx,dx,di
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov dx,3C7h
|
|
|
|
|
mov cx,256
|
2007-03-23 17:49:04 +01:00
|
|
|
|
@@save:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,cl
|
|
|
|
|
dec al
|
|
|
|
|
out dx,al
|
|
|
|
|
inc dx
|
|
|
|
|
inc dx
|
|
|
|
|
in al,dx
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov [ds:di],al
|
2007-03-14 12:18:58 +01:00
|
|
|
|
inc di
|
|
|
|
|
in al,dx
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov [ds:di],al
|
2007-03-14 12:18:58 +01:00
|
|
|
|
inc di
|
|
|
|
|
in al,dx
|
2007-03-23 17:49:04 +01:00
|
|
|
|
mov [ds:di],al
|
2007-03-14 12:18:58 +01:00
|
|
|
|
inc di
|
|
|
|
|
dec dx
|
|
|
|
|
dec dx
|
|
|
|
|
dec cx
|
2007-03-23 17:49:04 +01:00
|
|
|
|
jne @@save
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp savedacto
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;restore le DAC depuis ds:si
|
2007-03-23 17:49:04 +01:00
|
|
|
|
PROC restoredacfrom FAR
|
|
|
|
|
USES ax,cx,dx,si
|
2007-03-14 12:18:58 +01:00
|
|
|
|
xor ax,ax
|
|
|
|
|
mov dx,3C8h
|
|
|
|
|
mov cx,256
|
2007-03-23 17:49:04 +01:00
|
|
|
|
@@save2:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,cl
|
|
|
|
|
dec al
|
|
|
|
|
out dx,al
|
|
|
|
|
inc dx
|
|
|
|
|
mov al,[ds:si]
|
|
|
|
|
inc si
|
|
|
|
|
out dx,al
|
|
|
|
|
mov al,[ds:si]
|
|
|
|
|
inc si
|
|
|
|
|
out dx,al
|
|
|
|
|
mov al,[ds:si]
|
|
|
|
|
inc si
|
|
|
|
|
out dx,al
|
|
|
|
|
dec dx
|
|
|
|
|
dec cx
|
2007-03-23 17:49:04 +01:00
|
|
|
|
jne @@save2
|
2007-03-14 12:18:58 +01:00
|
|
|
|
ret
|
2007-03-23 17:49:04 +01:00
|
|
|
|
endp restoredacfrom
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
font8x8:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
include "..\include\pol8x8.inc"
|
2004-06-12 23:34:04 +02:00
|
|
|
|
font8x16:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
include "..\include\pol8x16.inc"
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
|