From 9e7e99523538bc4d0b66456b4aa0689c31248c8e Mon Sep 17 00:00:00 2001 From: "Evgeny Grechnikov (Diamond)" Date: Mon, 11 Feb 2008 09:08:05 +0000 Subject: [PATCH] Show scrollbar for videomodes table; PgUp,PgDn in videomodes table git-svn-id: svn://kolibrios.org@730 a494cfbc-eb01-0410-851d-a64ba20cac60 --- kernel/trunk/boot/bootcode.inc | 39 +++++++++++++++++++- kernel/trunk/boot/booteng.inc | 6 +-- kernel/trunk/boot/bootru.inc | 6 +-- kernel/trunk/boot/bootvesa.inc | 67 ++++++++++++++++++++++++++++++++-- 4 files changed, 108 insertions(+), 10 deletions(-) diff --git a/kernel/trunk/boot/bootcode.inc b/kernel/trunk/boot/bootcode.inc index db7d82bfb5..5a7b50ad0b 100644 --- a/kernel/trunk/boot/bootcode.inc +++ b/kernel/trunk/boot/bootcode.inc @@ -534,12 +534,49 @@ cfgmanager: jmp .loops .down: cmp ah,0x50;x,0x50E0 ; down - jne .enter + jne .pgup cmp word[es:si+10],-1 je .loops add word [cursor_pos],size_of_step jmp .loops +.pgup: cmp ah,0x49 ; page up + jne .pgdn + sub si, size_of_step*9 + cmp si, modes_table + jae @f + mov si, modes_table +@@: + mov word [cursor_pos], si + mov si, word [home_cursor] + sub si, size_of_step*9 + cmp si, modes_table + jae @f + mov si, modes_table +@@: + mov word [home_cursor], si + jmp .loops + +.pgdn: cmp ah,0x51 ; page down + jne .enter + mov ax, [end_cursor] + add si, size_of_step*9 + cmp si, ax + jb @f + mov si, ax + sub si, size_of_step +@@: + mov word [cursor_pos], si + mov si, word [home_cursor] + sub ax, size_of_step*9 + add si, size_of_step*9 + cmp si, ax + jb @f + mov si, ax +@@: + mov word [home_cursor], si + jmp .loops + .enter: cmp al,0x0D;x,0x1C0D ; enter jne .loops push word [cursor_pos] diff --git a/kernel/trunk/boot/booteng.inc b/kernel/trunk/boot/booteng.inc index 29c81332eb..3cfbf659a6 100644 --- a/kernel/trunk/boot/booteng.inc +++ b/kernel/trunk/boot/booteng.inc @@ -91,9 +91,9 @@ save_quest db "Remember current settings? [y/n]: ",0 loader_block_error db "Bootloader data invalid, I cannot continue. Stopped.",0 _st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿',13,10,0 -_r1 db 186,' ³ 320x200 EGA/CGA 256 colors ³Û³',13,10,0 -_r2 db 186,' ³ 640x480 VGA 16 colors ³Û³',13,10,0 -_rs db 186,' ³ ????x????@?? SVGA VESA ³Û³',13,10,0 +_r1 db 186,' ³ 320x200 EGA/CGA 256 colors ³ ³',13,10,0 +_r2 db 186,' ³ 640x480 VGA 16 colors ³ ³',13,10,0 +_rs db 186,' ³ ????x????@?? SVGA VESA ³ ³',13,10,0 _bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ',13,10,0 remark1 db "Default values were selected to match most of configurations, but not all.",0 diff --git a/kernel/trunk/boot/bootru.inc b/kernel/trunk/boot/bootru.inc index ad52a18b2e..f94f5ad36b 100644 --- a/kernel/trunk/boot/bootru.inc +++ b/kernel/trunk/boot/bootru.inc @@ -96,9 +96,9 @@ loader_block_error db " ;s_mode1 db " 0640-0480-04 (a) 0320-0200-08 (b) ",13,10,0 _st db 186,' ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÂÄ¿',13,10,0 -_r1 db 186,' ³ 320x200 EGA/CGA 256 梥⮢ ³Û³',13,10,0 -_r2 db 186,' ³ 640x480 VGA 16 梥⮢ ³Û³',13,10,0 -_rs db 186,' ³ ????x????@?? SVGA VESA ³Û³',13,10,0 +_r1 db 186,' ³ 320x200 EGA/CGA 256 梥⮢ ³ ³',13,10,0 +_r2 db 186,' ³ 640x480 VGA 16 梥⮢ ³ ³',13,10,0 +_rs db 186,' ³ ????x????@?? SVGA VESA ³ ³',13,10,0 _bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÁÄÙ',13,10,0 ;_tl db 186,' ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄ¿',13,10,\ diff --git a/kernel/trunk/boot/bootvesa.inc b/kernel/trunk/boot/bootvesa.inc index c015e04b53..79a08c155b 100644 --- a/kernel/trunk/boot/bootvesa.inc +++ b/kernel/trunk/boot/bootvesa.inc @@ -172,9 +172,7 @@ calc_vmodes_table: ; push 0 ; pop es - mov si,word[es:vi.VideoModePtr] - push word[es:vi.VideoModePtr+2] - pop fs + lfs si, [es:vi.VideoModePtr] mov bx,modes_table ;save no vesa mode of work 320x200, EGA/CGA 256 梥⮢ and 640x480, VGA 16 梥⮢ @@ -205,6 +203,9 @@ calc_vmodes_table: test [es:mi.ModeAttributes],10000000b ;LFB ? jz @f +; cmp [es:mi.BitsPerPixel], 24 +; jb @f + cmp [es:mi.BitsPerPixel],16 jne .l0 cmp [es:mi.GreenMaskSize],5 @@ -512,6 +513,66 @@ draw_vmodes_table: .@@_end: mov si,_bt call printplain +; show scroll + push es + push 0xB800 + pop es +; arrows + mov di, (11*80+53)*2 + mov al, 30 + stosb + add di, 80*2-1 + mov al, 32 + mov cx, 7 +@@: + stosb + add di, 80*2-1 + loop @b + mov al, 31 + stosb +; calculate scroll size + mov ax, [end_cursor] + sub ax, modes_table + mov bx, size_of_step + cwd + div bx + mov si, ax ; si = size of list + mov ax, [home_cursor] + sub ax, modes_table + cwd + div bx + mov di, ax + mov ax, 7*9 + cwd + div si + test ax, ax + jnz @f + inc ax +@@: + cmp al, 7 + jb @f + mov al, 7 +@@: + mov cx, ax +; cx = scroll height +; calculate scroll pos + xor bx, bx ; initialize scroll pos + sub al, 7+1 + neg al + sub si, 9-1 + jbe .draw_scroll + mul di + div si + mov bx, ax +.draw_scroll: + mov al, 0xDB + imul di, bx, 80*2 + add di, (12*80+53)*2 +@@: + stosb + add di, 80*2-1 + loop @b + pop es ret .show_0x13: push si