3 Copyright 2000-2004 John Coffman.
6 Licensed under the terms contained in the file 'COPYING' in the
23 ; If video mode 7 (MDA) is detected, the default attributes
24 ; are modified to those suitable for monochrome
28 int 0x10 ; AH=cols, AL=mode, BH=page
31 je mn_imono ; MDA does not use 40:84
35 mov ch,[0x84] ; get rows-1
41 mov [mn_page],bh ; save page
43 mov [mn_max_row_col],cx ; save max screen coord.
44 cmp al,#7 ; test for monochrome
46 push dword [mn_at_mono] ; move 4 bytes
53 ; DX = current cursor position
74 ; DX = row/col for cursor
94 mov dx,[mn_max_row_col]
101 ; mn_rdcha: read character and attribute
111 mov ah,#2 ;set cursor position
118 mov ah,#8 ; read char and attr
123 ; mn_wrcha: write character and attribute
139 int 0x10 ; set cursor position
151 ; mn_wrstra: write string with attribute
154 ; DS:BX points at string
155 ; DX = row/col of start
181 ; 3 single top/bot, double sides
182 ; 4 double top/bot, single sides
183 ; (if hi-bit of AL is set, expand box by 1 in horizontal)
184 ; BH = attribute for area
185 ; CX = row/col of upper left
186 ; DX = delta row/delta col
212 lea si,[mn_box-8](si)
214 mov ah,[mn_at_border]
220 mn_dr1: call mn_wrcha
228 mn_dr2: call mn_wrcha
238 mn_dr3: call mn_wrcha
246 mn_dr4: call mn_wrcha
260 ; mn_vline: vertical line
263 ; AL = 1 (single line), 2 (double line)
264 ; CX = row/col to start
271 mov bl,[mn_ver-1](si)
273 lea si,[mn_vint-8](si)
277 jmp mn_line00 ; join common code
281 ; mn_hline: horizontal line
284 ; AL = 1 (single line), 2 (double line)
285 ; CX = row/col to start
292 mov bl,[mn_hor-1](si) ; BL is char to write
294 lea si,[mn_hint-8](si) ; SI is intersect table
297 ; do the beginning of the line
300 mov ah,bl ; AH is char to write
301 cmp al,(si) ; know intersect?
310 mov ah,[mn_at_border]
316 mn_line10: ;do the central part of the line
328 mov ah,[mn_at_border]
334 mn_line20: ;do the end of the line
346 mov ah,[mn_at_border]
352 mn_box: db SE,EW,SW,NS,NW,EW,NE,NS
353 db SSEE,EEWW,SSWW,NNSS,NNWW,EEWW,NNEE,NNSS
354 db SSE,EW,SSW,NNSS,NNW,EW,NNE,NNSS
355 db SEE,EEWW,SWW,NS,NWW,EEWW,NEE,NS
358 mn_hint: db NS,NSE,NSEW,NSW
359 db NNSS,NNSSE,NNSSEW,NNSSW
360 db NS,NSEE,NSEEWW,NSWW
361 db NNSS,NNSSEE,NNSSEEWW,NNSSWW
364 mn_vint: db EW,SEW,NSEW,NEW
365 db EEWW,SEEWW,NSEEWW,NEEWW
366 db EW,SSEW,NNSSEW,NNEW
367 db EEWW,SSEEWW,NNSSEEWW,NNEEWW
371 mn_at_hilite: db 0x71
372 mn_at_border: db 0x47
375 mn_at_mono: db 0x07,0x70,0x07,0x0F