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-13 21:56:55 +01:00
|
|
|
|
header exe <"CE",1,0,0,offset exports,,,>
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
exports:
|
|
|
|
|
db "setvideomode",0
|
|
|
|
|
dw setvideomode
|
|
|
|
|
db "getvideomode",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw getvideomode
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "clearscreen",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw clearscreen
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "setfont",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw setfont
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "loadfont",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw loadfont
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getfont",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw getfont
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "addline",0
|
|
|
|
|
dw addline
|
|
|
|
|
db "showchar",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw showchar
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "showpixel",0
|
2004-11-30 20:27:29 +01:00
|
|
|
|
dw showpixel
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getpixel",0
|
2004-11-30 20:27:29 +01:00
|
|
|
|
dw getpixel
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "setstyle",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw setstyle
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getstyle",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw getstyle
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "enablecursor",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw enablecursor
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "disablecursor",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw disablecursor
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "setcolor",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw setcolor
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getcolor",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw getcolor
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "scrolldown",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw scrolldown
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getxy",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw getxy
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "setxy",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw setxy
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "savescreen",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw savescreen
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "restorescreen",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw restorescreen
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "page2to1",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw page2to1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "page1to2",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw page1to2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;db "xchgPages",0
|
|
|
|
|
;dw xchgpages
|
|
|
|
|
db "waithretrace",0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
dw waithretrace
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "waitretrace",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw waitretrace
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getvgainfos",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw getvgainfos
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;db "savedac",0
|
|
|
|
|
;dw savedac
|
|
|
|
|
;db "restoredac",0
|
|
|
|
|
;dw restoredac
|
|
|
|
|
;db "savestate",0
|
|
|
|
|
;dw savestate
|
|
|
|
|
;db "restorestate",0
|
|
|
|
|
;dw restorestate
|
|
|
|
|
db "enablescroll",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw enablescroll
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "disablescroll",0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
dw disablescroll
|
2007-03-13 21:56:55 +01:00
|
|
|
|
db "getchar",0
|
2004-11-11 17:19:18 +01:00
|
|
|
|
dw getchar
|
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
|
|
|
|
|
2007-03-13 21:56:55 +01:00
|
|
|
|
datablocksize equ 40
|
|
|
|
|
datablock equ $
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;============================================DATABLOCK=========================================================
|
2005-12-05 09:01:34 +01:00
|
|
|
|
lines db 0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
columns db 0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
x db 0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
y db 0
|
|
|
|
|
xy dw 0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
colors db 7
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mode db 0FFh
|
|
|
|
|
pagesize dw 0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
style db 0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
font db 0
|
|
|
|
|
graphic db 0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
reserved1 dw 0
|
|
|
|
|
reserved2 dw 0
|
|
|
|
|
reserved3 dw 0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
nbpage db 0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
color db 0
|
|
|
|
|
cursor db 0
|
|
|
|
|
segments dw 0
|
|
|
|
|
linesize dw 0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
adress dw 0
|
|
|
|
|
base dw 0
|
|
|
|
|
scrolling db 1
|
|
|
|
|
|
|
|
|
|
;=======================================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
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov [cs:cursor],1
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
mov al,[cs:x]
|
|
|
|
|
xor ah,ah
|
|
|
|
|
mov dl,[cs:y]
|
|
|
|
|
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
|
|
|
|
|
mov [cs:cursor],0
|
|
|
|
|
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]
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov al,[cs:style]
|
|
|
|
|
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
|
|
|
|
|
cmp [cs:mode],5h
|
|
|
|
|
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:
|
|
|
|
|
cmp [cs:mode],0FFh
|
|
|
|
|
jne @@noinit
|
|
|
|
|
call initfont
|
|
|
|
|
@@noinit:
|
|
|
|
|
mov [cs: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]
|
|
|
|
|
mov [cs:columns],al
|
|
|
|
|
mov ah,[cs:di+1]
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov [cs:color],8
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov cl,4
|
2007-03-13 21:56:55 +01:00
|
|
|
|
jmp @@colors256
|
|
|
|
|
@@colors16:
|
|
|
|
|
mov [cs:color],4
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov cl,3
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@colors256:
|
|
|
|
|
cmp [cs:mode],5
|
|
|
|
|
setae [cs:graphic]
|
|
|
|
|
jb @@istext
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shl ax,cl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov [cs:segments],0A000h
|
|
|
|
|
jmp @@wasgraph
|
|
|
|
|
@@istext:
|
|
|
|
|
mov [cs:segments],0B800h
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shl ax,1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
@@wasgraph:
|
|
|
|
|
mov [cs:pagesize],ax
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov ax,planesize
|
|
|
|
|
xor dx,dx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
div [cs:pagesize]
|
|
|
|
|
mov [cs:nbpage],al
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
mov cl,[cs:graphic]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr ax,cl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov [cs:linesize],ax
|
|
|
|
|
mov ax,[cs:di-43]
|
|
|
|
|
mov [cs:adress],ax
|
|
|
|
|
mov [cs:base],ax
|
|
|
|
|
mov [cs:cursor],1
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov al,[cs:mode]
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
mov di,[cs:adress]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
cmp [cs:graphic],1
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
cmp [cs:color],4
|
|
|
|
|
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
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov al,[cs:font]
|
|
|
|
|
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
|
|
|
|
|
LOCAL @poppop:dword
|
|
|
|
|
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
|
|
|
|
|
mov bl,[cs:y]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor bh,bh
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov cl,[cs: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-13 21:56:55 +01:00
|
|
|
|
cmp [cs:graphic],0
|
|
|
|
|
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]
|
|
|
|
|
mov [cs: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
|
|
|
|
|
mov al,[cs:colors]
|
|
|
|
|
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
|
|
|
|
|
cmp [cs:scrolling],0
|
|
|
|
|
je @@graphp
|
|
|
|
|
mov ax,[@line]
|
|
|
|
|
mul [cs:linesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov si,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs:pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
sub cx,si
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov di,[cs:adress]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
2007-03-13 21:56:55 +01:00
|
|
|
|
cmp [cs:graphic],1
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
cmp [cs:color],4
|
|
|
|
|
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=========
|
|
|
|
|
;Met les coordonn<6E>es du curseur dans %0 au format point
|
|
|
|
|
;->
|
|
|
|
|
;<- ah coordonn<6E>es x, al coordonn<6E>es y
|
|
|
|
|
;========================
|
|
|
|
|
PROC getxy FAR
|
|
|
|
|
ARG @pointer:word
|
|
|
|
|
USES bx
|
|
|
|
|
mov bx,[@pointer]
|
|
|
|
|
mov ah,[cs:x]
|
|
|
|
|
mov al,[cs:y]
|
|
|
|
|
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]
|
|
|
|
|
mov [cs:x],bl
|
|
|
|
|
mov [cs:y],al
|
|
|
|
|
mov di,[cs:adress]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
add di,bx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mul [cs:columns]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
add di,ax
|
|
|
|
|
shl di,1
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov [cs: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]
|
|
|
|
|
cmp [cs:color],4
|
|
|
|
|
je @@showpixel4
|
2005-12-05 09:01:34 +01:00
|
|
|
|
mov si,ax
|
|
|
|
|
mov ax,cx
|
|
|
|
|
mov cl,bl
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mul [cs:linesize]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr bx,2
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov di,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
add di,[cs: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-13 21:56:55 +01:00
|
|
|
|
mul [cs:linesize]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr bx,3
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov di,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
add di,[cs: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-13 21:56:55 +01:00
|
|
|
|
mul [cs:linesize]
|
2005-12-05 09:01:34 +01:00
|
|
|
|
shr bx,2
|
|
|
|
|
add ax,bx
|
|
|
|
|
mov di,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
add di,[cs: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-13 21:56:55 +01:00
|
|
|
|
PROC getvgainfos FAR
|
|
|
|
|
ARG @pointer:word
|
|
|
|
|
USES cx,si,di,ds
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
mov cx,datablocksize
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
endp getvgainfos
|
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
|
|
|
|
|
;<-
|
|
|
|
|
;->
|
|
|
|
|
;==========================
|
|
|
|
|
PROC getchar FAR
|
|
|
|
|
USES di,es
|
2004-11-11 17:19:18 +01:00
|
|
|
|
mov ax,0B800h
|
|
|
|
|
mov es,ax
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov di,[cs:xy]
|
|
|
|
|
mov al,[es:di]
|
|
|
|
|
xor ah,ah
|
2004-11-11 17:19:18 +01:00
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp getchar
|
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
|
|
|
|
|
;<-
|
|
|
|
|
;->
|
|
|
|
|
;===========================
|
|
|
|
|
PROC showchar FAR
|
|
|
|
|
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
|
|
|
|
|
mov ch,[cs:colors]
|
|
|
|
|
@@notlastattr:
|
|
|
|
|
cmp [cs:graphic],1
|
|
|
|
|
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-13 21:56:55 +01:00
|
|
|
|
mov di,[cs:xy]
|
|
|
|
|
mov [es:di],cx
|
|
|
|
|
add [cs:xy],2
|
|
|
|
|
@@adjusttext:
|
|
|
|
|
inc [cs:x]
|
|
|
|
|
mov cl,[cs:columns]
|
|
|
|
|
cmp [cs:x],cl
|
|
|
|
|
jb @@noadjusted
|
|
|
|
|
call addline
|
|
|
|
|
@@noadjusted:
|
2004-11-11 17:19:18 +01:00
|
|
|
|
call setcursor
|
|
|
|
|
ret
|
2007-03-13 21:56:55 +01:00
|
|
|
|
endp showchar
|
2004-11-11 17:19:18 +01:00
|
|
|
|
|
|
|
|
|
setcursor:
|
2005-12-05 09:01:34 +01:00
|
|
|
|
push ax cx dx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
cmp [cs: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-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs: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-13 21:56:55 +01:00
|
|
|
|
mov bl,[cs:x]
|
|
|
|
|
mov cl,[cs: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-13 21:56:55 +01:00
|
|
|
|
cmp [cs: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
|
|
|
|
|
savescreen:
|
|
|
|
|
push ax cx dx si di bp ds es gs
|
|
|
|
|
mov bp,sp
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov dx,[ss:bp+22]
|
2004-11-05 01:58:45 +01:00
|
|
|
|
mov ah,2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs:pagesize]
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
mov si,offset data3
|
|
|
|
|
int 49h
|
|
|
|
|
mov ah,6
|
|
|
|
|
int 49h
|
|
|
|
|
push gs
|
|
|
|
|
pop es
|
|
|
|
|
xor di,di
|
|
|
|
|
call savescreento
|
|
|
|
|
pop gs es ds bp di si dx cx ax
|
|
|
|
|
ret
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
data3 db '/vgascreen',0
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
;===================================sauve l'ecran rapidement en es:di================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
savescreento:
|
2004-06-12 23:34:04 +02:00
|
|
|
|
push cx si di ds
|
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-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs:pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
|
|
|
|
xor si,si
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
|
|
|
|
pop ds di si cx
|
2004-11-05 01:58:45 +01:00
|
|
|
|
ret
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;===================================sauve les parametres en es:di================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
saveparamto:
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push ecx si di ds
|
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
xor ecx,ecx
|
|
|
|
|
mov cx,datablocksize
|
|
|
|
|
mov si,offset datablock
|
|
|
|
|
cld
|
|
|
|
|
rep movsb
|
|
|
|
|
pop ds di si ecx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;===================================restore les parametres depuis en ds:si================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
restoreparamfrom:
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push 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
|
|
|
|
|
mov cx,datablocksize
|
|
|
|
|
mov di,offset datablock
|
2004-06-12 23:34:04 +02:00
|
|
|
|
cld
|
2004-11-05 01:58:45 +01:00
|
|
|
|
rep movsb
|
|
|
|
|
pop es di si ecx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
|
|
|
|
;R<>cup<75>re l'ecran de la carte depuis son bloc m<>moire
|
2007-03-13 21:56:55 +01:00
|
|
|
|
restorescreen:
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push ax dx si bp ds gs
|
|
|
|
|
mov bp,sp
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov dx,[ss:bp+16]
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push cs
|
|
|
|
|
pop ds
|
|
|
|
|
mov si,offset data3
|
|
|
|
|
mov ah,9
|
|
|
|
|
int 49h
|
|
|
|
|
push gs
|
|
|
|
|
pop ds
|
|
|
|
|
xor si,si
|
|
|
|
|
call restorescreenfrom
|
|
|
|
|
pop gs ds bp si dx ax
|
|
|
|
|
ret
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;===================================restore l'ecran rapidement de ds:si================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
restorescreenfrom:
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push ecx si di ds es
|
2004-06-12 23:34:04 +02:00
|
|
|
|
mov cx,0B800H
|
|
|
|
|
mov es,cx
|
2004-11-05 01:58:45 +01:00
|
|
|
|
xor ecx,ecx
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs:pagesize]
|
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
|
|
|
|
pop es ds di si ecx
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
|
|
|
|
;===============================Page2to1============================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
page2to1:
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push 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-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs:pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov si,[cs:pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor di,di
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2004-11-05 01:58:45 +01:00
|
|
|
|
pop es ds di si ecx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
;===============================Page1to2============================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
page1to2:
|
2004-11-05 01:58:45 +01:00
|
|
|
|
push 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-13 21:56:55 +01:00
|
|
|
|
mov cx,[cs:pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
shr cx,2
|
2007-03-13 21:56:55 +01:00
|
|
|
|
mov di,[cs:pagesize]
|
2004-06-12 23:34:04 +02:00
|
|
|
|
xor si,si
|
|
|
|
|
cld
|
|
|
|
|
rep movsd
|
2004-11-05 01:58:45 +01:00
|
|
|
|
pop ds es di si ecx
|
2004-06-12 23:34:04 +02:00
|
|
|
|
ret
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
2004-06-12 23:34:04 +02:00
|
|
|
|
;===============================xchgPages============================
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;xchgpages:
|
|
|
|
|
;push ax cx dx si di bp ds es gs
|
|
|
|
|
;mov bp,sp
|
|
|
|
|
;mov dx,[ss:bp+22]
|
|
|
|
|
;mov ah,2
|
|
|
|
|
;mov cx,datablocksize
|
|
|
|
|
;add cx,[cs:pagesize]
|
|
|
|
|
;add cx,3*256
|
|
|
|
|
;push cs
|
|
|
|
|
;pop ds
|
|
|
|
|
;mov si,offset data4
|
|
|
|
|
;int 49h
|
|
|
|
|
;mov ah,6
|
|
|
|
|
;int 49h
|
|
|
|
|
;push gs
|
|
|
|
|
;pop es
|
|
|
|
|
;xor di,di
|
|
|
|
|
;call savescreento
|
|
|
|
|
;call page2to1
|
|
|
|
|
;push gs
|
|
|
|
|
;pop ds
|
|
|
|
|
;xor si,si
|
|
|
|
|
;mov cx,0B800H
|
|
|
|
|
;mov es,cx
|
|
|
|
|
;mov di,[cs:pagesize]
|
|
|
|
|
;xor ecx,ecx
|
|
|
|
|
;mov cx,[cs:pagesize]
|
|
|
|
|
;shr cx,2
|
|
|
|
|
;cld
|
|
|
|
|
;rep movsd
|
|
|
|
|
;mov ah,01h
|
|
|
|
|
;int 49h
|
|
|
|
|
;pop gs es ds bp di si dx cx ax
|
|
|
|
|
;ret
|
|
|
|
|
;
|
|
|
|
|
;data4 db '/vgatemp',0
|
2005-12-05 09:01:34 +01:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
|
|
|
|
;Sauve l'<27>tat de la carte dans un bloc m<>moire
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;savestate:
|
|
|
|
|
;push ax cx dx si di bp ds es gs
|
|
|
|
|
;mov bp,sp
|
|
|
|
|
;mov dx,[ss:bp+22]
|
|
|
|
|
;mov ah,2
|
|
|
|
|
;mov cx,datablocksize
|
|
|
|
|
;add cx,[cs:pagesize]
|
|
|
|
|
;add cx,3*256
|
|
|
|
|
;push cs
|
|
|
|
|
;pop ds
|
|
|
|
|
;mov si,offset data
|
|
|
|
|
;int 49h
|
|
|
|
|
;mov ah,6
|
|
|
|
|
;int 49h
|
|
|
|
|
;push gs
|
|
|
|
|
;pop es
|
|
|
|
|
;xor di,di
|
|
|
|
|
;call saveparamto
|
|
|
|
|
;add di,datablocksize
|
|
|
|
|
;call savescreento
|
|
|
|
|
;add di,[cs:pagesize]
|
|
|
|
|
;call savedacto
|
|
|
|
|
;pop gs es ds bp di si dx cx ax
|
|
|
|
|
;ret
|
|
|
|
|
|
|
|
|
|
;data db '/vga',0
|
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-13 21:56:55 +01:00
|
|
|
|
;restorestate:
|
|
|
|
|
;push ax dx si bp ds gs
|
|
|
|
|
;mov bp,sp
|
|
|
|
|
;mov dx,[ss:bp+16]
|
|
|
|
|
;push cs
|
|
|
|
|
;pop ds
|
|
|
|
|
;mov si,offset data
|
|
|
|
|
;mov ah,9
|
|
|
|
|
;int 49h
|
|
|
|
|
;push gs
|
|
|
|
|
;pop ds
|
|
|
|
|
;mov al,[ds:7]
|
|
|
|
|
;cmp [cs:mode],al
|
|
|
|
|
;je nochangemode
|
|
|
|
|
;mov ah,0
|
|
|
|
|
;call setvideomode
|
|
|
|
|
;nochangemode:
|
|
|
|
|
;xor si,si
|
|
|
|
|
;call restoreparamfrom
|
|
|
|
|
;add si,datablocksize
|
|
|
|
|
;call restorescreenfrom
|
|
|
|
|
;add si,[cs:pagesize]
|
|
|
|
|
;call restoredacfrom
|
|
|
|
|
;pop gs ds bp si dx ax
|
|
|
|
|
;ret
|
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-13 21:56:55 +01:00
|
|
|
|
;savedac:
|
|
|
|
|
;push ax cx dx si di bp ds es gs
|
|
|
|
|
;mov bp,sp
|
|
|
|
|
;mov dx,[ss:bp+22]
|
|
|
|
|
;mov ah,2
|
|
|
|
|
;mov cx,3*256
|
|
|
|
|
;push cs
|
|
|
|
|
;pop ds
|
|
|
|
|
;mov si,offset data2
|
|
|
|
|
;int 49h
|
|
|
|
|
;mov ah,6
|
|
|
|
|
;int 49h
|
|
|
|
|
;push gs
|
|
|
|
|
;pop es
|
|
|
|
|
;xor di,di
|
|
|
|
|
;call savedacto
|
|
|
|
|
;pop gs es ds bp di si dx cx ax
|
|
|
|
|
;ret
|
|
|
|
|
|
|
|
|
|
;data2 db '/vgadac',0
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
|
|
|
|
;R<>cup<75>re le dac depuis son bloc m<>moire
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;restoredac:
|
|
|
|
|
;push ax dx si bp ds gs
|
|
|
|
|
;mov bp,sp
|
|
|
|
|
;mov dx,[ss:bp+16]
|
|
|
|
|
;push cs
|
|
|
|
|
;pop ds
|
|
|
|
|
;mov si,offset data2
|
|
|
|
|
;mov ah,9
|
|
|
|
|
;int 49h
|
|
|
|
|
;push gs
|
|
|
|
|
;pop ds
|
|
|
|
|
;xor si,si
|
|
|
|
|
;call restoredacfrom
|
|
|
|
|
;pop gs ds bp si dx ax
|
|
|
|
|
;ret
|
2004-11-05 01:58:45 +01:00
|
|
|
|
|
|
|
|
|
;sauve le DAC en es:di
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;savedacto:
|
|
|
|
|
;push ax cx dx di
|
|
|
|
|
;mov dx,3C7h
|
|
|
|
|
;mov cx,256
|
|
|
|
|
;save:
|
|
|
|
|
;mov al,cl
|
|
|
|
|
;dec al
|
|
|
|
|
;out dx,al
|
|
|
|
|
;inc dx
|
|
|
|
|
;inc dx
|
|
|
|
|
;in al,dx
|
|
|
|
|
;mov [es:di],al
|
|
|
|
|
;inc di
|
|
|
|
|
;in al,dx
|
|
|
|
|
;mov [es:di],al
|
|
|
|
|
;inc di
|
|
|
|
|
;in al,dx
|
|
|
|
|
;mov [es:di],al
|
|
|
|
|
;inc di
|
|
|
|
|
;dec dx
|
|
|
|
|
;dec dx
|
|
|
|
|
;dec cx
|
|
|
|
|
;jne save
|
|
|
|
|
;pop di dx cx ax
|
|
|
|
|
;ret
|
2004-06-12 23:34:04 +02:00
|
|
|
|
|
2004-11-05 01:58:45 +01:00
|
|
|
|
;restore le DAC depuis ds:si
|
2007-03-13 21:56:55 +01:00
|
|
|
|
;restoredacfrom:
|
|
|
|
|
;push ax cx dx si
|
|
|
|
|
;xor ax,ax
|
|
|
|
|
;mov dx,3C8h
|
|
|
|
|
;mov cx,256
|
|
|
|
|
;save2:
|
|
|
|
|
;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
|
|
|
|
|
;jne save2
|
|
|
|
|
;pop si dx cx ax
|
|
|
|
|
;ret
|
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
|
|
|
|
|
|
|
|
|
|