2019-07-13 20:49:22 +02:00
|
|
|
|
use16
|
|
|
|
|
align 1
|
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
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
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
header exe 1
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
declare waithretfrace
|
|
|
|
|
declare waitretfrace
|
2007-03-14 12:18:58 +01:00
|
|
|
|
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=========================================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
datablock vgainf
|
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
|
|
|
|
;=====================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc enablescroll
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.scrolling],1
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;======================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc disablescroll
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.scrolling],0
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
;=============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
|
|
|
|
;======================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc enablecursor 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall setxy,ax,dx
|
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;=======================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc disablecursor 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc setstyle uses cx, style:word
|
|
|
|
|
mov ax,[style]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.style],al
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
|
;===========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getstyle
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.style]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;==================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc setvideomode uses ax cx dx di, modenum:word
|
|
|
|
|
mov ax,[modenum]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2005-12-05 09:01:34 +01:00
|
|
|
|
cmp al,maxmode
|
2019-07-09 10:33:10 +02:00
|
|
|
|
ja .errorsetvideomode
|
|
|
|
|
cmp [cs:datablock.modenum],5h
|
|
|
|
|
jb .nographic
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cmp al,5h
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jae .nographic
|
2007-03-13 21:56:55 +01:00
|
|
|
|
call initfont
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.nographic:
|
|
|
|
|
cmp [cs:datablock.modenum],0FFh
|
|
|
|
|
jne .noinit
|
2007-03-13 21:56:55 +01:00
|
|
|
|
call initfont
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.noinit:
|
|
|
|
|
mov [cs:datablock.modenum],al
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor ah,ah
|
|
|
|
|
mov di,ax
|
|
|
|
|
shl di,6
|
2019-07-09 10:33:10 +02:00
|
|
|
|
add di,mode0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.initsequencer:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,4
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.initcrt:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,24
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.initgraphic:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov ah,[cs:di]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc al
|
|
|
|
|
inc di
|
|
|
|
|
cmp al,8
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.initattribs:
|
2007-03-13 21:56:55 +01:00
|
|
|
|
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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.colors256:
|
|
|
|
|
cmp [cs:datablock.modenum],5
|
2007-03-14 12:18:58 +01:00
|
|
|
|
setae [cs:datablock.graphic]
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.errorsetvideomode:
|
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
initfont:
|
|
|
|
|
push ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall clearscreen
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall loadfont,font8x8,8,1
|
|
|
|
|
stdcall loadfont,font8x16,16,0
|
2007-03-13 21:56:55 +01:00
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;=============GetVideoMode=========
|
|
|
|
|
;Renvoie le mode vid<69>o courant dans AX
|
|
|
|
|
;->
|
|
|
|
|
;<- AX
|
|
|
|
|
;==================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getvideomode
|
|
|
|
|
mov al,[cs:datablock.modenum]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;=================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc clearscreen 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jne .erasetext
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,0A000h
|
|
|
|
|
mov es,ax
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
je .not256
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,4005h
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.not256:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0003h
|
|
|
|
|
out dx,ax
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.endoferase:
|
|
|
|
|
stdcall setxy,0,0
|
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;=============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc setfont uses ax cx dx, font:word
|
|
|
|
|
mov cx,[font]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ch,ch
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cmp cl,7
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.errorsetfont:
|
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;=============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getfont
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.font]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
;!!!!!!!!!!!!!!!!!!!! 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
|
|
|
|
;=============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc loadfont uses ax bx cx dx si di es, pointer:word, size:word, font:word
|
|
|
|
|
mov si,[pointer]
|
|
|
|
|
mov cx,[size]
|
|
|
|
|
mov bx,[font]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cmp bl,7
|
2019-07-09 10:33:10 +02:00
|
|
|
|
ja .errorloadfont
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor di,di
|
|
|
|
|
cli
|
|
|
|
|
mov dx,sequencer
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.doseq:
|
|
|
|
|
mov ax,[cs:di+reg1]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jbe .doseq
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov dx,graphics
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.doseq2:
|
|
|
|
|
mov ax,[cs:di+reg1]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6+6
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jb .isless
|
2004-06-12 23:34:04 +02:00
|
|
|
|
sub bl,4
|
|
|
|
|
shl bl,1
|
|
|
|
|
inc bl
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jmp .okmake
|
|
|
|
|
.isless:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shl bl,1
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.popz:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cl,bh
|
|
|
|
|
rep movsb
|
|
|
|
|
mov cl,bl
|
|
|
|
|
rep stosb
|
|
|
|
|
dec dx
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jnz .popz
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor di,di
|
|
|
|
|
mov dx,sequencer
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.doseqs:
|
|
|
|
|
mov ax,[cs:di+reg2]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jbe .doseqs
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov dx,graphics
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.doseqs2:
|
|
|
|
|
mov ax,[cs:di+reg2]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
out dx,ax
|
|
|
|
|
inc di
|
|
|
|
|
inc di
|
|
|
|
|
cmp di,6+6
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jbe .doseqs2
|
|
|
|
|
retf
|
|
|
|
|
.errorloadfont:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;==========SHOWLINE===============
|
2019-07-09 10:33:10 +02:00
|
|
|
|
;remet le curseur text a la ligne avec un retfour 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
|
|
|
|
;=================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc addline 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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
je .okscro
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cx,8
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.okscro:
|
|
|
|
|
stdcall scrolldown,cx
|
|
|
|
|
.scro:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
inc bl
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall setxy,0,bx
|
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;===========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc setcolor, color:word
|
|
|
|
|
mov cx,[color]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov [cs:datablock.colors],cl
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
|
;===========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getcolor
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov al,[cs:datablock.colors]
|
2007-03-13 21:56:55 +01:00
|
|
|
|
xor ah,ah
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;<-
|
|
|
|
|
;=============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc scrolldown uses ax cx dx si di ds es, line:word
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.scrolling],0
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
je .not256ok
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov ax,4005h
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.not256ok:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,graphics
|
|
|
|
|
out dx,ax
|
|
|
|
|
mov ax,0003h
|
|
|
|
|
out dx,ax
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jmp .graphp
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.textp:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ax,0B800h
|
|
|
|
|
mov es,ax
|
|
|
|
|
mov ds,ax
|
|
|
|
|
rep movsb
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.graphp:
|
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
|
;========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getxy uses bx
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov ah,[cs:datablock.x]
|
|
|
|
|
mov al,[cs:datablock.y]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
;==========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
|
|
|
|
;========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc setxy uses ax bx dx di, x:word ,y: word
|
|
|
|
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc showpixel uses ax bx cx dx si di es, x:word,y:word,color:word
|
|
|
|
|
mov bx,[x]
|
|
|
|
|
mov cx,[y]
|
|
|
|
|
mov ax,[color]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.color],4
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jmp .endofshow
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.endofshow:
|
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;=========================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getpixel uses ax bx cx dx di es, x:word,y:word
|
|
|
|
|
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]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
;->
|
|
|
|
|
;=============================================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getvideoinfos uses cx si di ds, pointer:word
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
mov cx,datablock.sizeof
|
|
|
|
|
mov si,datablock
|
|
|
|
|
mov di,[pointer]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
;==========WAITretfRACE=========
|
|
|
|
|
;Synchronisation avec la retfrace 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
|
|
|
|
;==============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc waitretfrace uses ax dx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov dx,3DAh
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.waitr:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
in al,dx
|
|
|
|
|
test al,8
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jz .waitr
|
|
|
|
|
retf
|
|
|
|
|
endp
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
;==========WAITHretfRACE=========
|
|
|
|
|
;Synchronisation avec la retfrace 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
|
|
|
|
;===============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc waithretfrace uses ax dx
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov dx,3DAh
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.waitr:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
in al,dx
|
|
|
|
|
test al,1
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jz .waitr
|
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-13 21:56:55 +01:00
|
|
|
|
|
|
|
|
|
;==========GETCHAR=========
|
|
|
|
|
;Renvoie en AX le caract<63>re sur le curseur
|
|
|
|
|
;<-
|
|
|
|
|
;->
|
|
|
|
|
;==========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc getchars 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
|
;<-
|
|
|
|
|
;->
|
|
|
|
|
;===========================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc showchars uses ax bx cx dx di es, char:word,attr:word
|
|
|
|
|
mov cl,byte [char]
|
|
|
|
|
mov ch,byte [attr]
|
|
|
|
|
cmp [attr],0FFFFh
|
|
|
|
|
jne .notlastattr
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov ch,[cs:datablock.colors]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.notlastattr:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
cmp [cs:datablock.graphic],1
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jne .textaccess
|
2004-11-11 17:19:18 +01:00
|
|
|
|
call emulatechar
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
.adjusttext:
|
2007-03-14 12:18:58 +01:00
|
|
|
|
inc [cs:datablock.x]
|
|
|
|
|
mov cl,[cs:datablock.columns]
|
|
|
|
|
cmp [cs:datablock.x],cl
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jb .noadjusted
|
|
|
|
|
stdcall addline
|
|
|
|
|
.noadjusted:
|
2004-11-11 17:19:18 +01:00
|
|
|
|
call setcursor
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
add di,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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc savescreen uses ax ds bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2007-03-23 23:33:56 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbcreate,data3,[cs:datablock.pagesize]
|
|
|
|
|
jc .error
|
|
|
|
|
invoke mbchown,ax,word [ss:bp+8]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2004-11-05 01:58:45 +01:00
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall savescreento,0
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc savescreento uses ecx si di ds es, offset:word
|
2007-03-23 17:49:04 +01:00
|
|
|
|
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]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
mov di,[offset]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
|
|
|
|
xor si,si
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
;===================================sauve les parametres en ds:%0================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc saveparamto uses ecx si di ds es, offset:word
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ds
|
|
|
|
|
pop es
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
xor ecx,ecx
|
2019-07-09 10:33:10 +02:00
|
|
|
|
mov cx,datablock.sizeof
|
|
|
|
|
mov di,[offset]
|
|
|
|
|
mov si,datablock
|
2004-11-05 01:58:45 +01:00
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
;===================================restore les parametres depuis en ds:%0================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc restoreparamfrom uses ecx si di es, offset:word
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop es
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2019-07-09 10:33:10 +02:00
|
|
|
|
mov cx,datablock.sizeof
|
|
|
|
|
mov si,[offset]
|
|
|
|
|
stdcall setvideomode,word [si+datablock.modenum]
|
|
|
|
|
mov di,datablock
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
2004-11-05 01:58:45 +01:00
|
|
|
|
rep movsb
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc restorescreen uses ax ds bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2007-03-23 23:33:56 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbfindsb,data3,word [ss:bp+8]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2004-11-05 01:58:45 +01:00
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall restorescreenfrom,0
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
;===================================restaure l'ecran rapidement en %1================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc restorescreenfrom uses ecx si di es, offset:word
|
2007-03-23 17:49:04 +01:00
|
|
|
|
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]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
mov si,[offset]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
|
|
|
|
xor di,di
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
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
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc page2to1 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;===============================Page1to2============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc page1to2 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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;===============================xchgPages============================
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc xchgpages uses ax ecx si di ds es bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2007-03-23 23:33:56 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbcreate,data4,[cs:datablock.pagesize]
|
|
|
|
|
jc .error
|
|
|
|
|
invoke mbchown,ax,word [ss:bp+18]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall savescreento,0
|
|
|
|
|
stdcall page2to1
|
2007-03-14 12:18:58 +01:00
|
|
|
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbfree,ax
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
;Sauve l'<27>tat de la carte dans un bloc m<>moire
|
|
|
|
|
proc savestate uses ax cx di ds bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2019-07-09 10:33:10 +02:00
|
|
|
|
mov cx,datablock.sizeof
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add cx,[cs:datablock.pagesize]
|
|
|
|
|
add cx,3*256
|
2007-03-23 23:33:56 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbcreate,adata,cx
|
|
|
|
|
jc .error
|
|
|
|
|
invoke mbchown,ax,word [ss:bp+12]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
|
|
|
|
xor di,di
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall saveparamto,di
|
|
|
|
|
add di,datablock.sizeof
|
|
|
|
|
stdcall savescreento,di
|
2007-03-14 12:18:58 +01:00
|
|
|
|
add di,[cs:datablock.pagesize]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall savedacto,di
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-14 12:18:58 +01:00
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
adata db '/vga',0
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
;R<>cup<75>re l'<27>tat de la carte depuis son bloc m<>moire
|
|
|
|
|
proc restorestate uses ax cx di ds bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2007-03-23 23:33:56 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbfindsb,adata,word [ss:bp+12]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2007-03-23 17:49:04 +01:00
|
|
|
|
xor di,di
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall restoreparamfrom,di
|
|
|
|
|
add di,datablock.sizeof
|
|
|
|
|
stdcall restorescreenfrom,di
|
2007-03-23 17:49:04 +01:00
|
|
|
|
add di,[cs:datablock.pagesize]
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall restoredacfrom,di
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc savedac uses ax ds bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2007-03-23 23:33:56 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbcreate,data3,3*256
|
|
|
|
|
jc .error
|
|
|
|
|
invoke mbchown,ax,word [ss:bp+8]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall savedacto,0
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
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
|
|
|
|
|
|
|
|
|
|
2019-07-09 10:33:10 +02:00
|
|
|
|
;R<>cup<75>re le dac depuis son bloc m<>moire
|
|
|
|
|
proc restoredac uses ax ds bp
|
2007-03-27 12:25:12 +02:00
|
|
|
|
mov bp,sp
|
2019-07-09 10:33:10 +02:00
|
|
|
|
invoke mbfindsb,data2,word [ss:bp+8]
|
|
|
|
|
jc .error
|
2007-03-23 17:49:04 +01:00
|
|
|
|
push ax
|
2007-03-14 12:18:58 +01:00
|
|
|
|
pop ds
|
2019-07-09 10:33:10 +02:00
|
|
|
|
stdcall restoredacfrom,0
|
2007-03-23 17:49:04 +01:00
|
|
|
|
clc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
.error:
|
2007-03-23 17:49:04 +01:00
|
|
|
|
stc
|
2019-07-09 10:33:10 +02:00
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
|
|
|
|
;sauve le DAC en ds:%0
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc savedacto uses ax ds bp, offset:word
|
|
|
|
|
mov di,[offset]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
mov dx,3C7h
|
|
|
|
|
mov cx,256
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jne .save
|
|
|
|
|
retf
|
|
|
|
|
endp
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;restore le DAC depuis ds:si
|
2019-07-09 10:33:10 +02:00
|
|
|
|
proc restoredacfrom uses ax ds bp, offset:word
|
|
|
|
|
mov si,[offset]
|
2007-03-14 12:18:58 +01:00
|
|
|
|
xor ax,ax
|
|
|
|
|
mov dx,3C8h
|
|
|
|
|
mov cx,256
|
2019-07-09 10:33:10 +02: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
|
2019-07-09 10:33:10 +02:00
|
|
|
|
jne .save2
|
|
|
|
|
retf
|
|
|
|
|
endp
|
2007-03-23 17:49:04 +01:00
|
|
|
|
|
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
|
|
|
|
|
|
|
|
|
|