3 ; Copyright 2000-2004 John Coffman
4 ; Copyright 2009-2011 Joachim Wiedorn
7 ; Licensed under the terms contained in the file 'COPYING'
8 ; in the source directory.
25 ; If video mode 7 (MDA) is detected, the default attributes
26 ; are modified to those suitable for monochrome
30 int 0x10 ; AH=cols, AL=mode, BH=page
33 je mn_imono ; MDA does not use 40:84
37 mov ch,[0x84] ; get rows-1
43 mov [mn_page],bh ; save page
45 mov [mn_max_row_col],cx ; save max screen coord.
46 cmp al,#7 ; test for monochrome
48 push dword [mn_at_mono] ; move 4 bytes
55 ; DX = current cursor position
76 ; DX = row/col for cursor
96 mov dx,[mn_max_row_col]
103 ; mn_rdcha: read character and attribute
113 mov ah,#2 ;set cursor position
120 mov ah,#8 ; read char and attr
125 ; mn_wrcha: write character and attribute
141 int 0x10 ; set cursor position
153 ; mn_wrstra: write string with attribute
156 ; DS:BX points at string
157 ; DX = row/col of start
183 ; 3 single top/bot, double sides
184 ; 4 double top/bot, single sides
185 ; (if hi-bit of AL is set, expand box by 1 in horizontal)
186 ; BH = attribute for area
187 ; CX = row/col of upper left
188 ; DX = delta row/delta col
214 lea si,[mn_box-8](si)
216 mov ah,[mn_at_border]
222 mn_dr1: call mn_wrcha
230 mn_dr2: call mn_wrcha
240 mn_dr3: call mn_wrcha
248 mn_dr4: call mn_wrcha
262 ; mn_vline: vertical line
265 ; AL = 1 (single line), 2 (double line)
266 ; CX = row/col to start
273 mov bl,[mn_ver-1](si)
275 lea si,[mn_vint-8](si)
279 jmp mn_line00 ; join common code
283 ; mn_hline: horizontal line
286 ; AL = 1 (single line), 2 (double line)
287 ; CX = row/col to start
294 mov bl,[mn_hor-1](si) ; BL is char to write
296 lea si,[mn_hint-8](si) ; SI is intersect table
299 ; do the beginning of the line
302 mov ah,bl ; AH is char to write
303 cmp al,(si) ; know intersect?
312 mov ah,[mn_at_border]
318 mn_line10: ;do the central part of the line
330 mov ah,[mn_at_border]
336 mn_line20: ;do the end of the line
348 mov ah,[mn_at_border]
354 mn_box: db SE,EW,SW,NS,NW,EW,NE,NS
355 db SSEE,EEWW,SSWW,NNSS,NNWW,EEWW,NNEE,NNSS
356 db SSE,EW,SSW,NNSS,NNW,EW,NNE,NNSS
357 db SEE,EEWW,SWW,NS,NWW,EEWW,NEE,NS
360 mn_hint: db NS,NSE,NSEW,NSW
361 db NNSS,NNSSE,NNSSEW,NNSSW
362 db NS,NSEE,NSEEWW,NSWW
363 db NNSS,NNSSEE,NNSSEEWW,NNSSWW
366 mn_vint: db EW,SEW,NSEW,NEW
367 db EEWW,SEEWW,NSEEWW,NEEWW
368 db EW,SSEW,NNSSEW,NNEW
369 db EEWW,SSEEWW,NNSSEEWW,NNEEWW
373 mn_at_hilite: db 0x71
374 mn_at_border: db 0x47
377 mn_at_mono: db 0x07,0x70,0x07,0x0F