Fixed constants replaced with correctable definitions (thanks to <Lrz>)

git-svn-id: svn://kolibrios.org@731 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Evgeny Grechnikov (Diamond) 2008-02-11 11:46:18 +00:00
parent 9e7e995235
commit 11c594dc6e
2 changed files with 13 additions and 12 deletions

View File

@ -542,14 +542,14 @@ cfgmanager:
.pgup: cmp ah,0x49 ; page up .pgup: cmp ah,0x49 ; page up
jne .pgdn jne .pgdn
sub si, size_of_step*9 sub si, size_of_step*long_v_table
cmp si, modes_table cmp si, modes_table
jae @f jae @f
mov si, modes_table mov si, modes_table
@@: @@:
mov word [cursor_pos], si mov word [cursor_pos], si
mov si, word [home_cursor] mov si, word [home_cursor]
sub si, size_of_step*9 sub si, size_of_step*long_v_table
cmp si, modes_table cmp si, modes_table
jae @f jae @f
mov si, modes_table mov si, modes_table
@ -560,7 +560,7 @@ cfgmanager:
.pgdn: cmp ah,0x51 ; page down .pgdn: cmp ah,0x51 ; page down
jne .enter jne .enter
mov ax, [end_cursor] mov ax, [end_cursor]
add si, size_of_step*9 add si, size_of_step*long_v_table
cmp si, ax cmp si, ax
jb @f jb @f
mov si, ax mov si, ax
@ -568,8 +568,8 @@ cfgmanager:
@@: @@:
mov word [cursor_pos], si mov word [cursor_pos], si
mov si, word [home_cursor] mov si, word [home_cursor]
sub ax, size_of_step*9 sub ax, size_of_step*long_v_table
add si, size_of_step*9 add si, size_of_step*long_v_table
cmp si, ax cmp si, ax
jb @f jb @f
mov si, ax mov si, ax

View File

@ -74,7 +74,8 @@ cursor_pos dw 0 ;
home_cursor dw 0 ;current shows rows a table home_cursor dw 0 ;current shows rows a table
end_cursor dw 0 ;end of position current shows rows a table end_cursor dw 0 ;end of position current shows rows a table
long_v_table equ 9 ;long of visible video table long_v_table equ 9 ;long of visible video table
size_of_step equ 10 size_of_step equ 10
scroll_area_size equ (long_v_table-2)
int2str: int2str:
dec bl dec bl
jz @f jz @f
@ -523,7 +524,7 @@ draw_vmodes_table:
stosb stosb
add di, 80*2-1 add di, 80*2-1
mov al, 32 mov al, 32
mov cx, 7 mov cx, scroll_area_size
@@: @@:
stosb stosb
add di, 80*2-1 add di, 80*2-1
@ -542,24 +543,24 @@ draw_vmodes_table:
cwd cwd
div bx div bx
mov di, ax mov di, ax
mov ax, 7*9 mov ax, scroll_area_size*long_v_table
cwd cwd
div si div si
test ax, ax test ax, ax
jnz @f jnz @f
inc ax inc ax
@@: @@:
cmp al, 7 cmp al, scroll_area_size
jb @f jb @f
mov al, 7 mov al, scroll_area_size
@@: @@:
mov cx, ax mov cx, ax
; cx = scroll height ; cx = scroll height
; calculate scroll pos ; calculate scroll pos
xor bx, bx ; initialize scroll pos xor bx, bx ; initialize scroll pos
sub al, 7+1 sub al, scroll_area_size+1
neg al neg al
sub si, 9-1 sub si, long_v_table-1
jbe .draw_scroll jbe .draw_scroll
mul di mul di
div si div si