1. Optimization of the mode 320*200*256. Load on CPU is less. Small increase of speed.

2. Optimization of the mode 640*480*16. Substantial growth of speed.
3. At the expense of deleting the superfluous code from vga.inc the size of a kernel has decreased.

git-svn-id: svn://kolibrios.org@117 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Marat Zakiyanov (Mario79) 2006-08-10 18:18:33 +00:00
parent bf63dda480
commit 5638fe22ff
5 changed files with 540 additions and 1013 deletions

View File

@ -142,7 +142,7 @@ system_shutdown: ; shut down the system
cmp cx,word 0x0001+25*31 cmp cx,word 0x0001+25*31
jnz nrl jnz nrl
call checkEgaCga call checkVga_N13
yes_shutdown_param: yes_shutdown_param:
cli cli

View File

@ -1325,7 +1325,7 @@ checkwindows:
call checkidle call checkidle
call checkEgaCga call checkVga_N13
mov [0xfff4],byte 0 mov [0xfff4],byte 0

View File

@ -208,7 +208,7 @@ boot_log:
call dtext call dtext
mov [novesachecksum],1000 mov [novesachecksum],1000
call checkEgaCga call checkVga_N13
cmp [preboot_blogesc],byte 1 cmp [preboot_blogesc],byte 1
je .bll2 je .bll2
@ -835,7 +835,7 @@ osloop:
call checkwindows call checkwindows
; call check_window_move_request ; call check_window_move_request
call checkmisc call checkmisc
call checkEgaCga call checkVga_N13
call stack_handler call stack_handler
call checkidle call checkidle
call check_fdd_motor_status call check_fdd_motor_status
@ -1042,134 +1042,6 @@ iglobal
process_number dd 0x1 process_number dd 0x1
endg endg
uglobal
novesachecksum dd 0x0
endg
checkEgaCga:
cmp [0xfe0c],dword 0x13
je cnvl
ret
cnvl:
pushad
; mov ecx,[0xfb0a]
; cmp ecx,[novesachecksum]
; jne novesal
; popad
; ret
novesal:
; mov [novesachecksum],ecx
mov ecx,0
movzx eax,word [0xfb0c]
cmp eax,100
jge m13l3
mov eax,100
m13l3:
cmp eax,480-100
jbe m13l4
mov eax,480-100
m13l4:
sub eax,100
imul eax,640*4
add ecx,eax
movzx eax,word [0xfb0a]
cmp eax,160
jge m13l1
mov eax,160
m13l1:
cmp eax,640-160
jbe m13l2
mov eax,640-160
m13l2:
sub eax,160
shl eax,2
add ecx,eax
mov esi,[0xfe80]
add esi,ecx
mov edi,0xa0000
mov edx,200
mov ecx,320
cld
m13pix:
lodsd
push eax
mov ebx,eax
and eax,(128+64+32) ; blue
shr eax,5
and ebx,(128+64+32)*256 ; green
shr ebx,8+2
add eax,ebx
pop ebx
and ebx,(128+64)*256*256 ; red
shr ebx,8+8
add eax,ebx
stosb
loop m13pix
mov ecx,320
add esi,4*(640-320)
dec edx
jnz m13pix
popad
ret
palette320x200:
mov edx,0x3c8
xor eax, eax
out dx,al
mov ecx,256
mov edx,0x3c9
xor eax,eax
palnew:
mov al,0
test ah,64
jz pallbl1
add al,21
pallbl1:
test ah,128
jz pallbl2
add al,42
pallbl2:
out dx,al
mov al,0
test ah,8
jz pallbl3
add al,8
pallbl3:
test ah,16
jz pallbl4
add al,15
pallbl4:
test ah,32
jz pallbl5
add al,40
pallbl5:
out dx,al
mov al,0
test ah,1
jz pallbl6
add al,8
pallbl6:
test ah,2
jz pallbl7
add al,15
pallbl7:
test ah,4
jz pallbl8
add al,40
pallbl8:
out dx,al
add ah,1
loop palnew
ret
set_variables: set_variables:
mov ecx,0x100 ; flush port 0x60 mov ecx,0x100 ; flush port 0x60
@ -4104,20 +3976,8 @@ reserve_free_irq:
drawbackground: drawbackground:
inc [mouse_pause] inc [mouse_pause]
cmp [0xfe0c],word 0x12 cmp [0xfe0c],word 0x12
jne dbrv12 je dbrv20
cmp [display_data-12],dword 1
jne bgrstr12
call vga_drawbackground_tiled
dec [mouse_pause]
call [draw_pointer]
ret
bgrstr12:
call vga_drawbackground_stretch
dec [mouse_pause]
call [draw_pointer]
ret
dbrv12: dbrv12:
cmp [0xfe0c],word 0100000000000000b cmp [0xfe0c],word 0100000000000000b
jge dbrv20 jge dbrv20
cmp [0xfe0c],word 0x13 cmp [0xfe0c],word 0x13
@ -4164,9 +4024,9 @@ sys_putimage:
add dx,word[edi+0x80000+APPDATA.wnd_clientbox.left] add dx,word[edi+0x80000+APPDATA.wnd_clientbox.left]
rol edx,16 rol edx,16
.forced: .forced:
mov eax, vga_putimage ; mov eax, vga_putimage
cmp [0xfe0c], word 0x12 cmp [0xfe0c], word 0x12
jz .doit jz @f ;.doit
mov eax, vesa12_putimage mov eax, vesa12_putimage
cmp [0xfe0c], word 0100000000000000b cmp [0xfe0c], word 0100000000000000b
jae @f jae @f
@ -4196,11 +4056,7 @@ __sys_drawbar:
.forced: .forced:
inc [mouse_pause] inc [mouse_pause]
cmp [0xfe0c],word 0x12 cmp [0xfe0c],word 0x12
jne sdbv20 je dbv20
call vga_drawbar
dec [mouse_pause]
call [draw_pointer]
ret
sdbv20: sdbv20:
cmp [0xfe0c],word 0100000000000000b cmp [0xfe0c],word 0100000000000000b
jge dbv20 jge dbv20

View File

@ -278,6 +278,8 @@ put_image_end_32:
.finish: .finish:
add esp, putimg.stack_data add esp, putimg.stack_data
popad popad
call VGA__putimage
mov [EGA_counter],1
ret ret
@ -773,8 +775,9 @@ draw_bar_end_32:
add esp, drbar.stack_data add esp, drbar.stack_data
popad popad
call VGA_draw_bar
xor eax, eax xor eax, eax
mov [EGA_counter],1
ret ret
@ -976,7 +979,8 @@ vesa20_drawbackground_tiled:
pop ebx pop ebx
pop eax pop eax
pop ebp pop ebp
mov [EGA_counter],1
call VGA_drawbackground
ret ret
; ---------- ; ----------
@ -1103,5 +1107,6 @@ vesa20_drawbackground_stretch:
pop ebx pop ebx
pop eax pop eax
pop ebp pop ebp
mov [EGA_counter],1
call VGA_drawbackground
ret ret

File diff suppressed because it is too large Load Diff