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

@ -10,7 +10,7 @@
system_shutdown: ; shut down the system system_shutdown: ; shut down the system
push 3 ; stop playing cd push 3 ; stop playing cd
pop eax pop eax
call sys_cd_audio call sys_cd_audio
cld cld
@ -48,22 +48,22 @@ system_shutdown: ; shut down the system
mov eax,[0xfe00] mov eax,[0xfe00]
shr eax,1 shr eax,1
lea esi,[eax+220] ; x end lea esi,[eax+220] ; x end
sub eax,220 ; x start sub eax,220 ; x start
mov ebx,[0xfe04] mov ebx,[0xfe04]
shr ebx,1 shr ebx,1
mov [shutdownpos],ebx mov [shutdownpos],ebx
lea ebp,[ebx+105] ; y end lea ebp,[ebx+105] ; y end
sub ebx,120 ; y start sub ebx,120 ; y start
xor edi,edi xor edi,edi
inc edi ; force putpixel & dtext inc edi ; force putpixel & dtext
mov ecx,0x0000ff mov ecx,0x0000ff
; vertical loop begin ; vertical loop begin
sdnewpix1: sdnewpix1:
push eax ; save x start push eax ; save x start
; horizontal loop begin ; horizontal loop begin
sdnewpix2: sdnewpix2:
@ -75,10 +75,10 @@ system_shutdown: ; shut down the system
jnz sdnewpix2 jnz sdnewpix2
; horizontal loop end ; horizontal loop end
dec ecx ; color dec ecx ; color
pop eax ; restore x start pop eax ; restore x start
inc ebx ; advance y pos inc ebx ; advance y pos
cmp ebx,ebp cmp ebx,ebp
jnz sdnewpix1 jnz sdnewpix1
; vertical loop end ; vertical loop end
@ -121,12 +121,12 @@ system_shutdown: ; shut down the system
push edx push edx
push 12 push 12
pop esi pop esi
push edi ; may be destroyed push edi ; may be destroyed
call fileread call fileread
pop edi pop edi
pop ecx pop ecx
inc ecx ; do not display stars from rose.txt inc ecx ; do not display stars from rose.txt
pop eax pop eax
add eax,20*10000h - 110 add eax,20*10000h - 110
@ -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
@ -185,12 +185,12 @@ pr_mode_exit:
org $-0x10000 org $-0x10000
; setup stack ; setup stack
mov ax, 3000h mov ax, 3000h
mov ss, ax mov ss, ax
mov esp, 0EC00h mov esp, 0EC00h
; setup ds ; setup ds
push cs push cs
pop ds pop ds
lidt [old_ints_h-0x10000] lidt [old_ints_h-0x10000]
;remap IRQs ;remap IRQs
@ -259,21 +259,21 @@ org $-0x10000
nbw32: nbw32:
dec ax ; 1 = write floppy dec ax ; 1 = write floppy
js nbw js nbw
jnz no_floppy_write jnz no_floppy_write
call floppy_write call floppy_write
jmp temp_3456 ;nbw jmp temp_3456 ;nbw
no_floppy_write: no_floppy_write:
dec ax ; 2 = power off dec ax ; 2 = power off
jnz no_apm_off jnz no_apm_off
call APM_PowerOff call APM_PowerOff
jmp $ jmp $
no_apm_off: no_apm_off:
dec ax ; 3 = reboot dec ax ; 3 = reboot
jnz restart_kernel ; 4 = restart kernel jnz restart_kernel ; 4 = restart kernel
push 0x40 push 0x40
pop ds pop ds
mov word[0x0072],0x1234 mov word[0x0072],0x1234
@ -332,20 +332,20 @@ restart_kernel_4000:
; add di,0x1000 ; add di,0x1000
; cmp di,0x2000 ; cmp di,0x2000
; jbe new_kernel_block_move ; jbe new_kernel_block_move
push ds push ds
pop es pop es
mov cx, 0x8000 mov cx, 0x8000
push cx push cx
mov ds, cx mov ds, cx
xor si, si xor si, si
xor di, di xor di, di
rep movsw rep movsw
push 0x9000 push 0x9000
pop ds pop ds
push 0x2000 push 0x2000
pop es pop es
pop cx pop cx
rep movsw rep movsw
wbinvd ; write and invalidate cache wbinvd ; write and invalidate cache
@ -355,27 +355,27 @@ restart_kernel_4000:
; mov ss,ax ; mov ss,ax
; mov sp,0xec00 ; mov sp,0xec00
; restore timer ; restore timer
mov al, 00110100b mov al, 00110100b
out 43h, al out 43h, al
jcxz $+2 jcxz $+2
mov al, 0xFF mov al, 0xFF
out 40h, al out 40h, al
jcxz $+2 jcxz $+2
out 40h, al out 40h, al
jcxz $+2 jcxz $+2
sti sti
; bootloader interface ; bootloader interface
push 0x1000 push 0x1000
pop ds pop ds
mov si, .bootloader_block;-0x10000 mov si, .bootloader_block;-0x10000
mov ax, 'KL' mov ax, 'KL'
jmp 0x1000:0000 jmp 0x1000:0000
.bootloader_block: .bootloader_block:
db 1 ; version db 1 ; version
dw 1 ; floppy image is in memory dw 1 ; floppy image is in memory
dd 0 ; cannot save parameters dd 0 ; cannot save parameters
APM_PowerOff: APM_PowerOff:
mov ax, 5304h mov ax, 5304h
@ -428,46 +428,46 @@ floppy_write: ; write diskette image to physical floppy
je fwwritedone je fwwritedone
mov [flm-0x10000],byte 1 mov [flm-0x10000],byte 1
xor ax, ax ; reset drive xor ax, ax ; reset drive
xor dx, dx xor dx, dx
int 0x13 int 0x13
mov cx,0x0001 ; startcyl,startsector mov cx,0x0001 ; startcyl,startsector
; mov dx,0x0000 ; starthead,drive ; mov dx,0x0000 ; starthead,drive
xor dx, dx xor dx, dx
mov ax, 80*2 ; read no of sect mov ax, 80*2 ; read no of sect
fwwrites: fwwrites:
push ax push ax
; move 1mb+ -> 0:a000 ; move 1mb+ -> 0:a000
pusha pusha
mov si,fwmovedesc -0x10000 mov si,fwmovedesc -0x10000
mov cx,256*18 mov cx,256*18
mov ah,0x87 mov ah,0x87
push ds push ds
pop es pop es
int 0x15 int 0x15
add dword [fwmovedesc-0x10000+0x12], 512*18 add dword [fwmovedesc-0x10000+0x12], 512*18
popa popa
xor si,si xor si,si
mov es,si mov es,si
fwnewwrite: fwnewwrite:
mov bx,0xa000 ; es:bx -> data area mov bx,0xa000 ; es:bx -> data area
mov ax,0x0300+18 ; read, no of sectors to read mov ax,0x0300+18 ; read, no of sectors to read
int 0x13 int 0x13
test ah, ah test ah, ah
jz fwgoodwrite jz fwgoodwrite
inc si inc si
cmp si,10 cmp si,10
jnz fwnewwrite jnz fwnewwrite
; can't access diskette - return ; can't access diskette - return
pop ax pop ax
ret ret
fwgoodwrite: fwgoodwrite:

View File

@ -90,19 +90,19 @@ calculatescreen:
cmp edx, [esp+RECT.top] cmp edx, [esp+RECT.top]
jb .out_of_bounds jb .out_of_bounds
cmp eax, [esp+RECT.left] cmp eax, [esp+RECT.left]
jae @f jae @f
mov eax, [esp+RECT.left] mov eax, [esp+RECT.left]
@@: @@:
cmp ebx, [esp+RECT.top] cmp ebx, [esp+RECT.top]
jae @f jae @f
mov ebx, [esp+RECT.top] mov ebx, [esp+RECT.top]
@@: @@:
cmp ecx, [esp+RECT.right] cmp ecx, [esp+RECT.right]
jbe @f jbe @f
mov ecx, [esp+RECT.right] mov ecx, [esp+RECT.right]
@@: @@:
cmp edx, [esp+RECT.bottom] cmp edx, [esp+RECT.bottom]
jbe @f jbe @f
mov edx, [esp+RECT.bottom] mov edx, [esp+RECT.bottom]
@@: @@:
@ -119,7 +119,7 @@ calculatescreen:
jnz .new_wnd jnz .new_wnd
.finish: .finish:
pop eax ebx ecx edx pop eax ebx ecx edx
popfd popfd
popad popad
@ -431,13 +431,13 @@ display_settings:
@@: cmp ebx,[0xFE04] @@: cmp ebx,[0xFE04]
jg .lp2 jg .lp2
mov [screen_workarea.bottom],ebx mov [screen_workarea.bottom],ebx
.lp2: call repos_windows .lp2: call repos_windows
mov eax, 0 mov eax, 0
mov ebx, 0 mov ebx, 0
mov ecx, [0xfe00] mov ecx, [0xfe00]
mov edx, [0xfe04] mov edx, [0xfe04]
call calculatescreen call calculatescreen
; jmp redraw_screen_direct ; jmp redraw_screen_direct
.exit: .exit:
popad popad
ret ret
@ -465,11 +465,11 @@ display_settings:
mov ecx,skin_data+64*512 mov ecx,skin_data+64*512
sub ecx,[edi+0x10] sub ecx,[edi+0x10]
mov dword[ebx+12],ecx ; destination mov dword[ebx+12],ecx ; destination
push eax push eax
pushad pushad
call file_system call file_system
popad popad
pop eax pop eax
popd [ebx+12] [ebx+8] [ebx+4] [ebx+0] popd [ebx+12] [ebx+8] [ebx+4] [ebx+0]
cmp eax,ERROR_SUCCESS cmp eax,ERROR_SUCCESS
je @f je @f
@ -483,13 +483,13 @@ display_settings:
mov ecx,(64*512)/4 mov ecx,(64*512)/4
rep movsd rep movsd
call parse_skin_data call parse_skin_data
pushad pushad
mov eax, 0 mov eax, 0
mov ebx, 0 mov ebx, 0
mov ecx, [0xfe00] mov ecx, [0xfe00]
mov edx, [0xfe04] mov edx, [0xfe04]
call calculatescreen call calculatescreen
popad popad
mov dword[esp+32+36],0 mov dword[esp+32+36],0
jmp redraw_screen_direct jmp redraw_screen_direct
.exit: .exit:
@ -505,12 +505,12 @@ display_settings:
repos_windows: repos_windows:
mov ecx,[0x3004] mov ecx,[0x3004]
mov esi,0x20*2 mov esi,0x20*2
mov byte[0x0000fff0],1 mov byte[0x0000fff0],1
dec ecx dec ecx
jge @f jge @f
ret ret
@@: mov [esi+WDATA.fl_redraw],1 @@: mov [esi+WDATA.fl_redraw],1
test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED test [esi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jz .lp2 jz .lp2
mov eax,[screen_workarea.left] mov eax,[screen_workarea.left]
mov [esi+WDATA.box.left],eax mov [esi+WDATA.box.left],eax
@ -529,31 +529,31 @@ repos_windows:
ret ret
.lp2: mov eax,[esi+WDATA.box.left] .lp2: mov eax,[esi+WDATA.box.left]
add eax,[esi+WDATA.box.width] add eax,[esi+WDATA.box.width]
mov ebx,[0x0000fe00] mov ebx,[0x0000fe00]
; inc ebx ; inc ebx
cmp eax,ebx cmp eax,ebx
jle .lp4 jle .lp4
mov eax,[esi+WDATA.box.width] mov eax,[esi+WDATA.box.width]
sub eax,ebx sub eax,ebx
jle .lp3 jle .lp3
mov [esi+WDATA.box.width],ebx mov [esi+WDATA.box.width],ebx
.lp3: sub ebx,[esi+WDATA.box.width] .lp3: sub ebx,[esi+WDATA.box.width]
mov [esi+WDATA.box.left],ebx mov [esi+WDATA.box.left],ebx
.lp4: mov eax,[esi+WDATA.box.top] .lp4: mov eax,[esi+WDATA.box.top]
add eax,[esi+WDATA.box.height] add eax,[esi+WDATA.box.height]
mov ebx,[0x0000fe04] mov ebx,[0x0000fe04]
; inc ebx ; inc ebx
cmp eax,ebx cmp eax,ebx
jle .lp6 jle .lp6
mov eax,[esi+WDATA.box.height] mov eax,[esi+WDATA.box.height]
sub eax,ebx sub eax,ebx
jle .lp5 jle .lp5
mov [esi+WDATA.box.height],ebx mov [esi+WDATA.box.height],ebx
.lp5: sub ebx,[esi+WDATA.box.height] .lp5: sub ebx,[esi+WDATA.box.height]
mov [esi+WDATA.box.top],ebx mov [esi+WDATA.box.top],ebx
.lp6: add esi,0x20 .lp6: add esi,0x20
loop @b loop @b
ret ret
uglobal uglobal
common_colours: common_colours:
@ -824,12 +824,12 @@ drawwindow_III:
mov edi,edx ; RECTANGLE mov edi,edx ; RECTANGLE
mov eax,[edi+WDATA.box.left] mov eax,[edi+WDATA.box.left]
shl eax,16 shl eax,16
mov ax, word [edi+WDATA.box.left] mov ax, word [edi+WDATA.box.left]
add ax, word [edi+WDATA.box.width] add ax, word [edi+WDATA.box.width]
mov ebx,[edi+WDATA.box.top] mov ebx,[edi+WDATA.box.top]
shl ebx,16 shl ebx,16
mov bx, word [edi+WDATA.box.top] mov bx, word [edi+WDATA.box.top]
add bx, word [edi+WDATA.box.height] add bx, word [edi+WDATA.box.height]
mov esi,[edi+WDATA.cl_frames] mov esi,[edi+WDATA.cl_frames]
shr esi,1 shr esi,1
and esi,0x007f7f7f and esi,0x007f7f7f
@ -1035,10 +1035,10 @@ waredraw: ; if redraw necessary at activate
add esi, window_data add esi, window_data
; coordinates of the upper window ; coordinates of the upper window
mov eax, [esi + WDATA.box.left] ; cx mov eax, [esi + WDATA.box.left] ; cx
mov ebx, [esi + WDATA.box.top] ; cy mov ebx, [esi + WDATA.box.top] ; cy
mov ecx, [esi + WDATA.box.width] ; sx mov ecx, [esi + WDATA.box.width] ; sx
mov edx, [esi + WDATA.box.height] ; sy mov edx, [esi + WDATA.box.height] ; sy
add ecx, eax ; ecx = x_end add ecx, eax ; ecx = x_end
add edx, ebx ; edx = y_end add edx, ebx ; edx = y_end
@ -1048,8 +1048,8 @@ waredraw: ; if redraw necessary at activate
call setscreen call setscreen
popad popad
mov [edi + WDATA.fl_redraw], 1 ; redraw flag for app mov [edi + WDATA.fl_redraw], 1 ; redraw flag for app
mov [0xfb44],byte 0 ; mouse down checks mov [0xfb44],byte 0 ; mouse down checks
ret ret
@ -1175,8 +1175,8 @@ checkwindows:
shl edi, 5 shl edi, 5
add edi, window_data add edi, window_data
; mov edi, ebx ; mov edi, ebx
mov ecx, [edi + WDATA.box.left] mov ecx, [edi + WDATA.box.left]
mov edx, [edi + WDATA.box.top] mov edx, [edi + WDATA.box.top]
mov eax,ecx mov eax,ecx
mov ebx,edx mov ebx,edx
@ -1190,8 +1190,8 @@ checkwindows:
jae cwloop jae cwloop
cmp edx, ebx cmp edx, ebx
jae cwloop jae cwloop
add ecx, [edi + WDATA.box.width] add ecx, [edi + WDATA.box.width]
add edx, [edi + WDATA.box.height] add edx, [edi + WDATA.box.height]
cmp eax, ecx cmp eax, ecx
jae cwloop jae cwloop
cmp ebx, edx cmp ebx, edx
@ -1218,7 +1218,7 @@ checkwindows:
popad popad
; Check for user enabled fixed window ; Check for user enabled fixed window
mov edx, [edi + WDATA.cl_titlebar] mov edx, [edi + WDATA.cl_titlebar]
and edx, 0x0f000000 and edx, 0x0f000000
cmp edx, 0x01000000 cmp edx, 0x01000000
jne .window_move_enabled_for_user jne .window_move_enabled_for_user
@ -1226,17 +1226,17 @@ checkwindows:
ret ret
.window_move_enabled_for_user: .window_move_enabled_for_user:
test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP test [edi+WDATA.fl_wstate],WSTATE_ROLLEDUP
jnz .no_resize_2 jnz .no_resize_2
mov [do_resize_from_corner],byte 0 ; resize for skinned window mov [do_resize_from_corner],byte 0 ; resize for skinned window
mov edx, [edi + WDATA.cl_workarea] mov edx, [edi + WDATA.cl_workarea]
and edx, 0x0f000000 and edx, 0x0f000000
cmp edx, 0x02000000 cmp edx, 0x02000000
jb .no_resize_2 ; not type 2 wnd jb .no_resize_2 ; not type 2 wnd
mov edx, [edi + WDATA.box.top] mov edx, [edi + WDATA.box.top]
add edx, [edi + WDATA.box.height] add edx, [edi + WDATA.box.height]
sub edx, 6 ; edx = y_end - 6 sub edx, 6 ; edx = y_end - 6
cmp ebx, edx ; ebx = mouse_y cmp ebx, edx ; ebx = mouse_y
jb .no_resize_2 jb .no_resize_2
@ -1246,7 +1246,7 @@ checkwindows:
push eax push eax
call get_titlebar_height call get_titlebar_height
add eax,[edi + WDATA.box.top] add eax,[edi + WDATA.box.top]
cmp ebx,eax cmp ebx,eax
pop eax pop eax
jae .exit jae .exit
@ -1267,15 +1267,15 @@ checkwindows:
mov cl, [0xfb40] ; save for shade check mov cl, [0xfb40] ; save for shade check
mov [do_resize], cl mov [do_resize], cl
no_emulation_righ_button: no_emulation_righ_button:
mov ecx, [edi + WDATA.box.left] mov ecx, [edi + WDATA.box.left]
mov edx, [edi + WDATA.box.top] mov edx, [edi + WDATA.box.top]
push eax ecx edx push eax ecx edx
mov [dlx], ecx ; save for drawlimits mov [dlx], ecx ; save for drawlimits
mov [dly], edx mov [dly], edx
mov eax, [edi + WDATA.box.width] mov eax, [edi + WDATA.box.width]
add ecx, eax add ecx, eax
mov eax, [edi + WDATA.box.height] mov eax, [edi + WDATA.box.height]
add edx, eax add edx, eax
mov [dlxe], ecx mov [dlxe], ecx
mov [dlye], edx mov [dlye], edx
@ -1290,21 +1290,21 @@ checkwindows:
pushad ; wait for putimages to finish pushad ; wait for putimages to finish
; mov eax,5 ; mov eax,5
; call delay_hs ; call delay_hs
mov eax,[edi + WDATA.box.left] mov eax,[edi + WDATA.box.left]
mov [npx],eax mov [npx],eax
mov eax,[edi + WDATA.box.top] mov eax,[edi + WDATA.box.top]
mov [npy],eax mov [npy],eax
popad popad
push eax ; save old coordinates push eax ; save old coordinates
mov ax, word [edi + WDATA.box.left] mov ax, word [edi + WDATA.box.left]
mov word [oldc+BOX.left],ax mov word [oldc+BOX.left],ax
mov ax, word [edi + WDATA.box.top] mov ax, word [edi + WDATA.box.top]
mov word [oldc+BOX.top],ax mov word [oldc+BOX.top],ax
mov ax, word [edi + WDATA.box.width] mov ax, word [edi + WDATA.box.width]
mov word [oldc+BOX.width],ax mov word [oldc+BOX.width],ax
mov word [npxe],ax mov word [npxe],ax
mov ax, word [edi + WDATA.box.height] mov ax, word [edi + WDATA.box.height]
mov word [oldc+BOX.height],ax mov word [oldc+BOX.height],ax
mov word [npye],ax mov word [npye],ax
pop eax pop eax
@ -1325,7 +1325,7 @@ checkwindows:
call checkidle call checkidle
call checkEgaCga call checkVga_N13
mov [0xfff4],byte 0 mov [0xfff4],byte 0
@ -1391,12 +1391,12 @@ checkwindows:
;shr edx,5 ;shr edx,5
;shl edx,8 ;shl edx,8
;add edx,0x80000 ; process base at 0x80000+ ;add edx,0x80000 ; process base at 0x80000+
lea edx, [0x80000 + edx*8] lea edx, [0x80000 + edx*8]
movzx eax,word [0xfb0a] movzx eax,word [0xfb0a]
cmp eax,[edi + WDATA.box.left] cmp eax,[edi + WDATA.box.left]
jb nnepx jb nnepx
sub eax,[edi + WDATA.box.left] sub eax,[edi + WDATA.box.left]
cmp eax,32 ; [edx+0x90+8] cmp eax,32 ; [edx+0x90+8]
jge nnepx2 jge nnepx2
mov eax,32 ; [edx+0x90+8] mov eax,32 ; [edx+0x90+8]
@ -1407,9 +1407,9 @@ checkwindows:
call get_rolledup_height call get_rolledup_height
mov ebx,eax mov ebx,eax
movzx eax,word [0xfb0c] movzx eax,word [0xfb0c]
cmp eax,[edi + WDATA.box.top] cmp eax,[edi + WDATA.box.top]
jb nnepy jb nnepy
sub eax,[edi + WDATA.box.top] sub eax,[edi + WDATA.box.top]
cmp eax,ebx ; [edx+0x90+12] cmp eax,ebx ; [edx+0x90+12]
jge nnepy2 jge nnepy2
mov eax,ebx ; [edx+0x90+12] mov eax,ebx ; [edx+0x90+12]
@ -1444,13 +1444,13 @@ checkwindows:
call drawwindowframes call drawwindowframes
mov eax,[npx] mov eax,[npx]
mov [edi + WDATA.box.left],eax mov [edi + WDATA.box.left],eax
mov eax,[npy] mov eax,[npy]
mov [edi + WDATA.box.top],eax mov [edi + WDATA.box.top],eax
mov eax,[npxe] mov eax,[npxe]
mov [edi + WDATA.box.width],eax mov [edi + WDATA.box.width],eax
mov eax,[npye] mov eax,[npye]
mov [edi + WDATA.box.height],eax mov [edi + WDATA.box.height],eax
@@: mov [reposition],cl @@: mov [reposition],cl
@ -1493,7 +1493,7 @@ checkwindows:
jmp @f jmp @f
wnd_rolldown: wnd_rolldown:
and [edi+WDATA.fl_wstate],not WSTATE_ROLLEDUP and [edi+WDATA.fl_wstate],not WSTATE_ROLLEDUP
mov eax,[edx + APPDATA.saved_box.height] ; 0x90+BOX.height mov eax,[edx + APPDATA.saved_box.height] ; 0x90+BOX.height
test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED test [edi+WDATA.fl_wstate],WSTATE_MAXIMIZED
jz @f jz @f
mov eax,[screen_workarea.bottom] mov eax,[screen_workarea.bottom]

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
@ -644,8 +644,8 @@ finit ;reset the registers, contents which are still equal RM
mov esi,boot_setostask mov esi,boot_setostask
call boot_log call boot_log
; name for OS/IDLE process ; name for OS/IDLE process
mov dword [0x80000+256+APPDATA.app_name], dword 'OS/I' 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+4], dword 'DLE '
; task list ; task list
mov [0x3020+TASKDATA.wnd_number], 1 ; on screen number mov [0x3020+TASKDATA.wnd_number], 1 ; on screen number
mov [0x3020+TASKDATA.pid], 1 ; process id number mov [0x3020+TASKDATA.pid], 1 ; process id number
@ -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
@ -3448,12 +3320,12 @@ checkmisc:
jz nobackgr jz nobackgr
mov [0xfff0],byte 2 mov [0xfff0],byte 2
call change_task call change_task
mov [draw_data+32 + RECT.left],dword 0 mov [draw_data+32 + RECT.left],dword 0
mov [draw_data+32 + RECT.top],dword 0 mov [draw_data+32 + RECT.top],dword 0
mov eax,[0xfe00] mov eax,[0xfe00]
mov ebx,[0xfe04] mov ebx,[0xfe04]
mov [draw_data+32 + RECT.right],eax mov [draw_data+32 + RECT.right],eax
mov [draw_data+32 + RECT.bottom],ebx mov [draw_data+32 + RECT.bottom],ebx
call drawbackground call drawbackground
mov [0xfff0],byte 0 mov [0xfff0],byte 0
mov [0xfff4],byte 0 mov [0xfff4],byte 0
@ -3565,7 +3437,7 @@ redrawscreen:
mov edx, [edi + WDATA.box.height] mov edx, [edi + WDATA.box.height]
add ecx, eax add ecx, eax
add edx, ebx add edx, ebx
mov eax,[dly] ; eax = area y start edx = window y end mov eax,[dly] ; eax = area y start edx = window y end
cmp edx,eax cmp edx,eax
jb ricino jb ricino
@ -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
@ -4893,7 +4749,7 @@ syscall_writetext: ; WriteText
shl ebp,16 shl ebp,16
add ebp,[edi-twdw+WDATA.box.top] add ebp,[edi-twdw+WDATA.box.top]
add bp,word[esi+0x80000+APPDATA.wnd_clientbox.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 add eax,ebp
xor edi,edi xor edi,edi
jmp dtext jmp dtext

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