1 /* Copyright (C) 1996 Robert de Bath <robert@mayday.compulink.co.uk>
2 * This file is part of the Linux-8086 C library and is distributed
3 * under the GNU Library General Public License.
6 #if !__FIRST_ARG_IN_AX__
14 extern void (*__smart_putch
)();
16 #define CTRL(x) ((x)&0x1F)
17 static int last_attr
= 0x07;
19 static unsigned char con_height
= 24, con_width
= 79;
21 static int con_colour
= 0;
22 static unsigned char con_row
, con_col
;
29 __smart_putch
= vt52_putch();
31 if( con_mode
==0 ) asm_coninit();
39 case 'A': if( con_row
) con_row
--; asm_cpos(con_row
, con_col
); break;
40 case 'B': if( con_row
!= con_height
) con_row
++;
41 asm_cpos(con_row
, con_col
); break;
42 case 'C': if( con_col
!= con_height
) con_col
++;
43 asm_cpos(con_row
, con_col
); break;
44 case 'D': if( con_col
) con_col
--; asm_cpos(con_row
, con_col
); break;
45 case 'E': last_attr
= 0x07; asm_cls();
46 case 'H': asm_cpos(0,0); break;
47 case 'J': asm_cls(); break;
49 case 'R': ctrl
= 2; break; /* Foreground */
50 case 'S': ctrl
= 3; break; /* Background */
51 case 'Y': ctrl
= 4; break; /* ttypos */
54 case 2: ctrl
=0; new_attr
= (last_attr
& 0xF0) + (c
&0xF);
56 case 3: ctrl
=0; new_attr
= (last_attr
& 0x0F) + (c
<<4);
60 case '_': if( !con_colour
) last_attr
= (last_attr
&0x88) + 1;
62 case '!': last_attr
= (last_attr
&0x88) + 0x70; break;
63 case ' ': last_attr
= 0x07; break;
64 case '+': last_attr
|= 0x08; break;
65 case '*': last_attr
|= 0x80; break;
67 default: if( con_colour
)
71 case 4: ctrl
=5; con_col
= c
-' '; break;
72 case 5: ctrl
=0; con_row
= c
-' '; asm_cpos(con_row
, con_col
); break;
77 { asm_colour(last_attr
) ; asm_putc(c
); }
85 con_col
= ((con_col
+8)& -8);
86 asm_cpos(con_row
, con_col
);
108 if( (con_mode
&0xFF) > 39 ) con_width
= (con_mode
>>8);
109 if( (con_mode
&0xFF) != 0x7)
116 #if !__FIRST_ARG_IN_AX__
136 push bp
! Bug in some old BIOS`s
152 #if __FIRST_ARG_IN_AX__
173 #if __FIRST_ARG_IN_AX__