Console: fixed double newline, when there is a newline character on the rightmost column. Added support for (aixterm) bright color escape codes.

git-svn-id: svn://kolibrios.org@3690 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
hidnplayr 2013-06-20 21:49:53 +00:00
parent 13b10bc06f
commit f5bede5d6a

View File

@ -221,7 +221,8 @@ times 'x'-' '+1 db con.printfc.normal
set 'u', unsigned set 'u', unsigned
purge set purge set
align 4 align 4
con.charjump dd con_printf.normal con.charjump:
dd con_printf.normal
dd con_printf.percent dd con_printf.percent
dd con_printf.dot dd con_printf.dot
dd con_printf.asterisk dd con_printf.asterisk
@ -294,7 +295,7 @@ con_printf:
cmp al, 'x' cmp al, 'x'
ja .normal ja .normal
movzx ecx, byte [con.charcodes + eax - ' '] movzx ecx, byte [con.charcodes + eax - ' ']
jmp [con.charjump + ecx*4] jmp dword[con.charjump + ecx*4]
.sharp: .sharp:
test bl, bl test bl, bl
@ -701,17 +702,22 @@ con.write_char_ex:
con.write_char: con.write_char:
push eax push eax
stosb
mov al, byte [con_flags]
stosb
mov eax, [con.cur_x] mov eax, [con.cur_x]
inc eax
mov [con.cur_x], eax
cmp eax, [con.scr_width] cmp eax, [con.scr_width]
jb @f jb @f
and [con.cur_x], 0 and [con.cur_x], 0
call con.newline call con.newline
@@: @@:
mov eax, [esp]
stosb
mov al, byte [con_flags]
stosb
mov eax, [con.cur_x]
inc eax
mov [con.cur_x], eax
pop eax pop eax
ret ret
@ -919,6 +925,7 @@ con.write_special_char:
jz .attr_bgr_bold jz .attr_bgr_bold
cmp al, 7 cmp al, 7
jz .attr_reversed jz .attr_reversed
xor edx, edx xor edx, edx
cmp al, 30 cmp al, 30
jz .attr_color jz .attr_color
@ -943,6 +950,7 @@ con.write_special_char:
mov dl, 7 mov dl, 7
cmp al, 37 cmp al, 37
jz .attr_color jz .attr_color
xor edx, edx xor edx, edx
cmp al, 40 cmp al, 40
jz .attr_bgr_color jz .attr_bgr_color
@ -966,16 +974,67 @@ con.write_special_char:
jz .attr_bgr_color jz .attr_bgr_color
mov dl, 0x70 mov dl, 0x70
cmp al, 47 cmp al, 47
jz .attr_bgr_color
mov dl, 0x08
cmp al, 100
jz .attr_color
mov dl, 4 + 8
cmp al, 101
jz .attr_color
mov dl, 2 + 8
cmp al, 102
jz .attr_color
mov dl, 6 + 8
cmp al, 103
jz .attr_color
mov dl, 1 + 8
cmp al, 104
jz .attr_color
mov dl, 5 + 8
cmp al, 105
jz .attr_color
mov dl, 3 + 8
cmp al, 106
jz .attr_color
mov dl, 7 + 8
cmp al, 107
jz .attr_color
mov dl, 0x80
cmp al, 100
jz .attr_bgr_color
mov dl, 0x80 + 0x40
cmp al, 101
jz .attr_bgr_color
mov dl, 0x80 + 0x20
cmp al, 102
jz .attr_bgr_color
mov dl, 0x80 + 0x60
cmp al, 103
jz .attr_bgr_color
mov dl, 0x80 + 0x10
cmp al, 104
jz .attr_bgr_color
mov dl, 0x80 + 0x50
cmp al, 105
jz .attr_bgr_color
mov dl, 0x80 + 0x30
cmp al, 106
jz .attr_bgr_color
mov dl, 0x80 + 0x70
cmp al, 107
jnz .attr_continue jnz .attr_continue
.attr_bgr_color: .attr_bgr_color:
mov eax, [con_flags] mov eax, [con_flags]
and al, 0x8F and al, 0x0F
or al, dl or al, dl
mov [con_flags], eax mov [con_flags], eax
jmp .attr_continue jmp .attr_continue
.attr_color: .attr_color:
mov eax, [con_flags] mov eax, [con_flags]
and al, 0xF8 and al, 0xF0
or al, dl or al, dl
mov [con_flags], eax mov [con_flags], eax
jmp .attr_continue jmp .attr_continue