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

@@ -208,7 +208,7 @@ boot_log:
call dtext
mov [novesachecksum],1000
call checkEgaCga
call checkVga_N13
cmp [preboot_blogesc],byte 1
je .bll2
@@ -644,8 +644,8 @@ finit ;reset the registers, contents which are still equal RM
mov esi,boot_setostask
call boot_log
; name for OS/IDLE process
mov dword [0x80000+256+APPDATA.app_name], dword 'OS/I'
mov dword [0x80000+256+APPDATA.app_name+4], dword 'DLE '
mov dword [0x80000+256+APPDATA.app_name], dword 'OS/I'
mov dword [0x80000+256+APPDATA.app_name+4], dword 'DLE '
; task list
mov [0x3020+TASKDATA.wnd_number], 1 ; on screen number
mov [0x3020+TASKDATA.pid], 1 ; process id number
@@ -835,7 +835,7 @@ osloop:
call checkwindows
; call check_window_move_request
call checkmisc
call checkEgaCga
call checkVga_N13
call stack_handler
call checkidle
call check_fdd_motor_status
@@ -1042,134 +1042,6 @@ iglobal
process_number dd 0x1
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:
mov ecx,0x100 ; flush port 0x60
@@ -3448,12 +3320,12 @@ checkmisc:
jz nobackgr
mov [0xfff0],byte 2
call change_task
mov [draw_data+32 + RECT.left],dword 0
mov [draw_data+32 + RECT.top],dword 0
mov [draw_data+32 + RECT.left],dword 0
mov [draw_data+32 + RECT.top],dword 0
mov eax,[0xfe00]
mov ebx,[0xfe04]
mov [draw_data+32 + RECT.right],eax
mov [draw_data+32 + RECT.bottom],ebx
mov [draw_data+32 + RECT.right],eax
mov [draw_data+32 + RECT.bottom],ebx
call drawbackground
mov [0xfff0],byte 0
mov [0xfff4],byte 0
@@ -3565,7 +3437,7 @@ redrawscreen:
mov edx, [edi + WDATA.box.height]
add ecx, eax
add edx, ebx
mov eax,[dly] ; eax = area y start edx = window y end
cmp edx,eax
jb ricino
@@ -4104,20 +3976,8 @@ reserve_free_irq:
drawbackground:
inc [mouse_pause]
cmp [0xfe0c],word 0x12
jne dbrv12
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
je dbrv20
dbrv12:
cmp [0xfe0c],word 0100000000000000b
jge dbrv20
cmp [0xfe0c],word 0x13
@@ -4164,9 +4024,9 @@ sys_putimage:
add dx,word[edi+0x80000+APPDATA.wnd_clientbox.left]
rol edx,16
.forced:
mov eax, vga_putimage
; mov eax, vga_putimage
cmp [0xfe0c], word 0x12
jz .doit
jz @f ;.doit
mov eax, vesa12_putimage
cmp [0xfe0c], word 0100000000000000b
jae @f
@@ -4196,11 +4056,7 @@ __sys_drawbar:
.forced:
inc [mouse_pause]
cmp [0xfe0c],word 0x12
jne sdbv20
call vga_drawbar
dec [mouse_pause]
call [draw_pointer]
ret
je dbv20
sdbv20:
cmp [0xfe0c],word 0100000000000000b
jge dbv20
@@ -4893,7 +4749,7 @@ syscall_writetext: ; WriteText
shl ebp,16
add ebp,[edi-twdw+WDATA.box.top]
add bp,word[esi+0x80000+APPDATA.wnd_clientbox.top]
add ecx,[edi+TASKDATA.mem_start]
add ecx,[edi+TASKDATA.mem_start]
add eax,ebp
xor edi,edi
jmp dtext