From aba5058a6b1741c97d56a1fdc06e85bb098e975c Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Mon, 2 Sep 2013 18:36:03 +0000 Subject: [PATCH] console: added support for escape sequences [?25l and [?25h (hide and show cursor) git-svn-id: svn://kolibrios.org@3886 a494cfbc-eb01-0410-851d-a64ba20cac60 --- .../develop/libraries/console/console.asm | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/programs/develop/libraries/console/console.asm b/programs/develop/libraries/console/console.asm index 3ab3d6925..e98f724a4 100644 --- a/programs/develop/libraries/console/console.asm +++ b/programs/develop/libraries/console/console.asm @@ -788,6 +788,8 @@ con.write_special_char: jmp con.write_char .esc_sci: ; this is real Esc sequence + cmp al, '?' ; DEC private mode (DECSET/DECRST sequences) + je .questionmark cmp al, ';' jz .next_arg cmp al, '0' @@ -804,6 +806,11 @@ con.write_special_char: mov [con_esc_attrs+(ecx-1)*4], edx pop edx ecx eax ret +.questionmark: + push ecx + mov ecx, [con_esc_attr_n] + mov dword[con_esc_attrs+(ecx-1)*4], 0xffffffff + pop ecx .next_arg: push eax mov eax, [con_esc_attr_n] @@ -835,7 +842,38 @@ con.write_special_char: jz .cursor_right cmp al, 'D' jz .cursor_left + cmp al, 'l' + je .dec_rst + cmp al, 'h' + je .dec_set ret ; simply skip unknown sequences + +.dec_rst: + mov eax, [con_esc_attrs] + cmp eax, 0xffffffff + jne .no_dec_rst + mov eax, [con_esc_attrs+4] + cmp eax, 25 + je .hide_cursor +.no_dec_rst: + ret +.hide_cursor: + mov [con.cursor_height], 0 + ret + +.dec_set: + mov eax, [con_esc_attrs] + cmp eax, 0xffffffff + jne .no_dec_set + mov eax, [con_esc_attrs+4] + cmp eax, 25 + je .show_cursor +.no_dec_set: + ret + +.show_cursor: + mov [con.cursor_height], (15*font_height+50)/100 ; default height + ret .clear: mov eax, [con_esc_attrs] test eax, eax