new "tiled" graph engine (* buggy version *)

git-svn-id: svn://kolibrios.org@1859 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
Artem Jerdev (art_zh) 2011-02-09 14:48:45 +00:00
parent 4a76b34dcc
commit 542cb02cea
9 changed files with 3152 additions and 3239 deletions

View File

@ -44,10 +44,28 @@ i40:
align 32 align 32
syscall_entry: syscall_entry:
; sti
push ecx push ecx
and eax, 3 ; sti
call dword [servetable3 + eax * 4] ; and eax, 3
; call dword [servetable3 + eax * 4]
mov edi, [esp+4]
mov ecx, [esp+8]
mov edx, [esp+12]
mov ebx, [esp+16]
and al, 1
jz .hline
mov eax, [esp+20]
sti
call vline
jmp .done
.hline:
mov eax, [esp+20]
sti
call hline
.done:
pop ecx pop ecx
sysret sysret
@ -155,8 +173,8 @@ iglobal
align 4 align 4
servetable3: ; Kolibri-A special service servetable3: ; Kolibri-A special service
dd paleholder ; 0 dd hline ; 0
dd paleholder ; 1 dd vline ; 1
dd paleholder ; 2 dd paleholder ; 2
dd sys_end ; last dd sys_end ; last

View File

@ -315,13 +315,32 @@ srv.fd rd 1
srv.bk rd 1 srv.bk rd 1
align 16 align 64
img_draw_core_fn rd 1 ; putimage variables & helpers
_display display_t img_draw_edge_fn rd 1
img_lfb_origin rd 1
img_buf_origin rd 1
img_buf_line_size rd 1
img_palette rd 1
img_bitoffset rd 1
img_edgeoffset rd 1
img_bytes_per_pix rd 1
img_map_right rd 1
img_map_x rd 1
img_pix_x rd 1 ; real Xsize
img_pix_y rd 1 ; real Ysize
img_screen_x rd 1
img_screen_y rd 1
align 64
_WinMapWidth rd 1
_WinMapHeight rd 1
_WinMapAddress rd 1 _WinMapAddress rd 1
_WinMapSize rd 1 _WinMapSize rd 1
align 16
_display display_t
def_cursor rd 1 def_cursor rd 1
current_cursor rd 1 current_cursor rd 1
hw_cursor rd 1 hw_cursor rd 1

View File

@ -378,9 +378,11 @@ mouse._.move_handler: ;////////////////////////////////////////////////////////
mov eax, [mouse.state.pos.x] mov eax, [mouse.state.pos.x]
sub eax, [mouse.active_sys_window.delta.x] sub eax, [mouse.active_sys_window.delta.x]
and al, 0xFC ; <<<<<<<<<<<<<<<<<<<
mov [mouse.active_sys_window.new_box.left], eax mov [mouse.active_sys_window.new_box.left], eax
mov eax, [mouse.state.pos.y] mov eax, [mouse.state.pos.y]
sub eax, [mouse.active_sys_window.delta.y] sub eax, [mouse.active_sys_window.delta.y]
and al, 0xFE ; <<<<<<<<<<<<<<<<<<<
mov [mouse.active_sys_window.new_box.top], eax mov [mouse.active_sys_window.new_box.top], eax
mov eax, [mouse.active_sys_window.new_box.left] mov eax, [mouse.active_sys_window.new_box.left]
@ -411,15 +413,16 @@ mouse._.move_handler: ;////////////////////////////////////////////////////////
mov eax, [mouse.state.pos.x] mov eax, [mouse.state.pos.x]
sub eax, [mouse.active_sys_window.delta.x] sub eax, [mouse.active_sys_window.delta.x]
and al, 0xFC ; <<<<<<<<<<<<<<<<<<<
mov [mouse.active_sys_window.new_box.left], eax mov [mouse.active_sys_window.new_box.left], eax
sub eax, [mouse.active_sys_window.old_box.left] sub eax, [mouse.active_sys_window.old_box.left]
sub [mouse.active_sys_window.new_box.width], eax sub [mouse.active_sys_window.new_box.width], eax
mov eax, [mouse.active_sys_window.new_box.width] mov eax, [mouse.active_sys_window.new_box.width]
sub eax, 127 sub eax, 128
jge @f jge @f
add [mouse.active_sys_window.new_box.left], eax add [mouse.active_sys_window.new_box.left], eax
mov [mouse.active_sys_window.new_box.width], 127 mov [mouse.active_sys_window.new_box.width], 128
@@: mov eax, [mouse.active_sys_window.new_box.left] @@: mov eax, [mouse.active_sys_window.new_box.left]
or eax, eax or eax, eax
jge .check_resize_s jge .check_resize_s
@ -434,6 +437,7 @@ mouse._.move_handler: ;////////////////////////////////////////////////////////
mov eax, [mouse.state.pos.y] mov eax, [mouse.state.pos.y]
add eax, [mouse.active_sys_window.delta.y] add eax, [mouse.active_sys_window.delta.y]
sub eax, [mouse.active_sys_window.old_box.top] sub eax, [mouse.active_sys_window.old_box.top]
and al, 0xFC ; <<<<<<<<<<<<<<<<<<<
mov [mouse.active_sys_window.new_box.height], eax mov [mouse.active_sys_window.new_box.height], eax
push eax push eax
@ -466,12 +470,13 @@ mouse._.move_handler: ;////////////////////////////////////////////////////////
mov eax, [mouse.state.pos.x] mov eax, [mouse.state.pos.x]
add eax, [mouse.active_sys_window.delta.x] add eax, [mouse.active_sys_window.delta.x]
sub eax, [mouse.active_sys_window.old_box.left] sub eax, [mouse.active_sys_window.old_box.left]
and al, 0xFC ; <<<<<<<<<<<<<<<<<<<
mov [mouse.active_sys_window.new_box.width], eax mov [mouse.active_sys_window.new_box.width], eax
mov eax, [mouse.active_sys_window.new_box.width] mov eax, [mouse.active_sys_window.new_box.width]
cmp eax, 127 cmp eax, 128
jge @f jge @f
mov eax, 127 mov eax, 128
mov [mouse.active_sys_window.new_box.width], eax mov [mouse.active_sys_window.new_box.width], eax
@@: add eax, [mouse.active_sys_window.new_box.left] @@: add eax, [mouse.active_sys_window.new_box.left]
cmp eax, [Screen_Max_X] cmp eax, [Screen_Max_X]
@ -701,4 +706,4 @@ mouse._.check_sys_window_actions: ;////////////////////////////////////////////
ret ret
diff16 "mouse code end ",0,$ diff16 "mouse code end ",0,$
diff16 "mouse code size",mouse_check_events,$ diff10 "mouse code size",mouse_check_events,$

View File

@ -328,15 +328,19 @@ syscall_move_window: ;///// system function 67 ////////////////////////////////
cmp ebx, -1 cmp ebx, -1
jne @f jne @f
mov ebx, [edi + WDATA.box.left] mov ebx, [edi + WDATA.box.left]
and bl, 0xFC
@@: cmp ecx, -1 @@: cmp ecx, -1
jne @f jne @f
mov ecx, [edi + WDATA.box.top] mov ecx, [edi + WDATA.box.top]
and cl, 0xFE
@@: cmp edx, -1 @@: cmp edx, -1
jne @f jne @f
mov edx, [edi + WDATA.box.width] mov edx, [edi + WDATA.box.width]
and dl, 0xFC
@@: cmp esi, -1 @@: cmp esi, -1
jne @f jne @f
mov esi, [edi + WDATA.box.height] mov esi, [edi + WDATA.box.height]
and esi, 0xFFFFFFFE
@@: push esi edx ecx ebx @@: push esi edx ecx ebx
mov eax, esp mov eax, esp
@ -344,14 +348,6 @@ syscall_move_window: ;///// system function 67 ////////////////////////////////
call window._.set_window_box call window._.set_window_box
add esp, BOX.sizeof add esp, BOX.sizeof
; NOTE: do we really need this? to be reworked
; mov byte[DONT_DRAW_MOUSE], 0 ; mouse pointer
; mov byte[MOUSE_BACKGROUND], 0 ; no mouse under
; mov byte[MOUSE_DOWN], 0 ; react to mouse up/down
; NOTE: do we really need this? to be reworked
; call [draw_pointer]
.exit: .exit:
ret ret
@ -519,8 +515,10 @@ repos_windows: ;///////////////////////////////////////////////////////////////
mov eax, [edi + WDATA.box.width] mov eax, [edi + WDATA.box.width]
sub eax, ebx sub eax, ebx
jle @f jle @f
and bl, 0xFC ; <<<<<<<
mov [edi + WDATA.box.width], ebx mov [edi + WDATA.box.width], ebx
@@: sub ebx, [edi + WDATA.box.width] @@: sub ebx, [edi + WDATA.box.width]
and bl, 0xFC ; <<<<<<<
mov [edi + WDATA.box.left], ebx mov [edi + WDATA.box.left], ebx
.fix_vertical: .fix_vertical:
@ -532,8 +530,10 @@ repos_windows: ;///////////////////////////////////////////////////////////////
mov eax, [edi + WDATA.box.height] mov eax, [edi + WDATA.box.height]
sub eax, ebx sub eax, ebx
jle @f jle @f
and bl, 0xFE ; <<<<<<<
mov [edi + WDATA.box.height], ebx mov [edi + WDATA.box.height], ebx
@@: sub ebx, [edi + WDATA.box.height] @@: sub ebx, [edi + WDATA.box.height]
and bl, 0xFE ; <<<<<<<
mov [edi + WDATA.box.top], ebx mov [edi + WDATA.box.top], ebx
jmp .fix_client_box jmp .fix_client_box
@ -555,7 +555,8 @@ repos_windows: ;///////////////////////////////////////////////////////////////
call window._.set_window_clientbox call window._.set_window_clientbox
add edi, WDATA.sizeof add edi, WDATA.sizeof
loop .next_window dec ecx
jne .next_window ; <<<<<<<<<<<
.exit: .exit:
ret ret
@ -1454,7 +1455,9 @@ window._.sys_set_window: ;/////////////////////////////////////////////////////
movzx eax, cx movzx eax, cx
mov [edi + WDATA.box.height], eax mov [edi + WDATA.box.height], eax
sar ebx, 16 sar ebx, 16
and bl, 0xFC ; <<<<<<<<
sar ecx, 16 sar ecx, 16
and cl, 0xFE ; <<<<<<<<
mov [edi + WDATA.box.left], ebx mov [edi + WDATA.box.left], ebx
mov [edi + WDATA.box.top], ecx mov [edi + WDATA.box.top], ecx
@ -1673,10 +1676,11 @@ end virtual
; get WinMap start ; get WinMap start
push esi push esi
mov edi, [Screen_Max_X] mov edi, [_WinMapWidth]
inc edi
mov esi, edi mov esi, edi
imul edi, ebx imul edi, ebx
shr eax, 1
shr eax, 1
add edi, eax add edi, eax
add edi, [_WinMapAddress] add edi, [_WinMapAddress]
pop eax pop eax
@ -1715,12 +1719,13 @@ end virtual
; get WinMap start -> ebp ; get WinMap start -> ebp
push eax push eax
mov eax, [Screen_Max_X] ; screen_sx mov eax, [_WinMapWidth] ; <<<<
inc eax
imul eax, ebx imul eax, ebx
add eax, [esp] mov ebp, [esp]
add eax, [_WinMapAddress] shr ebp, 1
mov ebp, eax shr ebp, 1
add ebp, eax
add ebp, [_WinMapAddress]
mov edi, [edi + APPDATA.wnd_shape] mov edi, [edi + APPDATA.wnd_shape]
pop eax pop eax
@ -2085,4 +2090,4 @@ window._.draw_negative_box: ;//////////////////////////////////////////////////
ret ret
diff16 "window code end",0,$ diff16 "window code end",0,$
diff16 "window.inc size",syscall_draw_window,$ diff10 "window.inc size",syscall_draw_window,$

View File

@ -35,19 +35,6 @@ endg
;include 'm_com.inc' ;include 'm_com.inc'
;test_mario79:
; push esi
; push eax
; mov [write_error_to],process_test_m79+43
; movzx eax,al ;[DevErrorCode]
; call writehex
; mov esi,process_test_m79
; call sys_msg_board_str
; pop eax
; pop esi
; ret
;process_test_m79 db 'K : Process - test Mario79 error 00000000',13,10,0
draw_mouse_under: draw_mouse_under:
; return old picture ; return old picture
@ -109,9 +96,12 @@ save_draw_mouse:
push eax push eax
push ebx push ebx
mov ecx, [Screen_Max_X] mov ecx, ebx ; <<<<
inc ecx shr ecx, 1
mul ecx imul ecx, [_WinMapWidth]
shr eax, 1
shr eax, 1
add eax, ecx
add eax, [_WinMapAddress] add eax, [_WinMapAddress]
movzx edx, byte [ebx+eax] movzx edx, byte [ebx+eax]
shl edx, 8 shl edx, 8
@ -286,10 +276,12 @@ __sys_disable_mouse:
add edx,window_data add edx,window_data
movzx eax, word [MOUSE_X] movzx eax, word [MOUSE_X]
movzx ebx, word [MOUSE_Y] movzx ebx, word [MOUSE_Y]
mov ecx,[Screen_Max_X] mov ecx, ebx ; <<<<
inc ecx shr ecx, 1
imul ecx,ebx imul ecx, [_WinMapWidth]
add ecx,eax shr eax, 1
shr eax, 1
add ecx, eax
add ecx, [_WinMapAddress] add ecx, [_WinMapAddress]
mov eax, [CURRENT_TASK] mov eax, [CURRENT_TASK]
movzx ebx, byte [ecx] movzx ebx, byte [ecx]
@ -454,3 +446,5 @@ mouse_acceleration:
@@: @@:
ret ret
diff16 "window code end",0,$
diff10 "mousedrv size ",draw_mouse_under,$

View File

@ -320,11 +320,9 @@ high_code:
mov eax, [BOOT_VAR + 0x9044] ; version & flags mov eax, [BOOT_VAR + 0x9044] ; version & flags
mov [apm_vf], eax mov [apm_vf], eax
; ----------------------------------------- ; -----------------------------------------
; movzx eax,byte [BOOT_VAR+0x9010] ; mouse port
; mov [0xF604],byte 1 ;al
mov al, [BOOT_VAR+0x901F] ; DMA access mov al, [BOOT_VAR+0x901F] ; DMA access
mov [allow_dma_access], al mov [allow_dma_access], al
movzx eax, byte [BOOT_VAR+0x9000] ; bpp mov eax, 32 ; <<<<<<<<< bpp
mov [ScreenBPP],al mov [ScreenBPP],al
mov [_display.bpp], eax mov [_display.bpp], eax
@ -336,6 +334,9 @@ high_code:
dec eax dec eax
mov [Screen_Max_X],eax mov [Screen_Max_X],eax
mov [screen_workarea.right],eax mov [screen_workarea.right],eax
inc eax
shr eax, 2
mov [_WinMapWidth], eax ; 1 tyle = 4 pixels
movzx eax,word [BOOT_VAR+0x900C] ; Y max movzx eax,word [BOOT_VAR+0x900C] ; Y max
mov [_display.height], eax mov [_display.height], eax
dec eax dec eax
@ -345,17 +346,13 @@ high_code:
mov [SCR_MODE],eax mov [SCR_MODE],eax
mov eax,[BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add mov eax,[BOOT_VAR+0x9014] ; Vesa 1.2 bnk sw add
mov [BANK_SWITCH],eax mov [BANK_SWITCH],eax
mov [BytesPerScanLine],word 640*4 ; Bytes PerScanLine
cmp [SCR_MODE],word 0x13 ; 320x200
je @f
cmp [SCR_MODE],word 0x12 ; VGA 640x480
je @f
movzx eax, word[BOOT_VAR+0x9001] ; for other modes movzx eax, word[BOOT_VAR+0x9001] ; for other modes
mov [BytesPerScanLine],ax mov [BytesPerScanLine],ax
mov [_display.pitch], eax mov [_display.pitch], eax
@@: @@:
mov eax, [_display.width] mov eax, [_display.height]
mul [_display.height] shr eax, 1
mul [_WinMapWidth]
mov [_WinMapSize], eax mov [_WinMapSize], eax
mov esi, BOOT_VAR+0x9080 mov esi, BOOT_VAR+0x9080
@ -500,10 +497,10 @@ v20ga32:
mov [graph_data_l+4],al mov [graph_data_l+4],al
mov [graph_data_l+7],ah mov [graph_data_l+7],ah
or [KERNEL_ALLOC_FLAG], dword PG_NOCACHE ; or [KERNEL_ALLOC_FLAG], dword PG_NOCACHE
stdcall kernel_alloc, [_WinMapSize] stdcall kernel_alloc, [_WinMapSize]
mov [_WinMapAddress], eax mov [_WinMapAddress], eax
xor [KERNEL_ALLOC_FLAG], dword PG_NOCACHE ; xor [KERNEL_ALLOC_FLAG], dword PG_NOCACHE
xor eax,eax xor eax,eax
inc eax inc eax
@ -606,6 +603,17 @@ end if
mov esi, boot_memdetect mov esi, boot_memdetect
call boot_log call boot_log
; <<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>
mov ebx, img_test_struct
mov ecx, 3*65536 + 4
mov edx, 32*65536 + 512
mov esi, 32
xor edi, edi
mov ebp, edi
call sys_putimage_palette.forced
;<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>
movzx ecx, word [boot_y] movzx ecx, word [boot_y]
or ecx, (10+29*6) shl 16 ; "Determining amount of memory" or ecx, (10+29*6) shl 16 ; "Determining amount of memory"
sub ecx, 10 sub ecx, 10
@ -2241,6 +2249,7 @@ draw_background_temp:
; je nosb31 ; je nosb31
;draw_background_temp: ;draw_background_temp:
; mov [bgrchanged],1 ;0 ; mov [bgrchanged],1 ;0
mov [background_defined], 1 mov [background_defined], 1
mov byte[BACKGROUND_CHANGED], 1 mov byte[BACKGROUND_CHANGED], 1
call force_redraw_background call force_redraw_background
@ -2838,23 +2847,24 @@ ret
; check if pixel is allowed to be drawn ; check if pixel is allowed to be drawn
; -- not in use any more ?
checkpixel: ;checkpixel:
push eax edx ; push eax ebx edx
; shr ebx, 1
mov edx,[Screen_Max_X] ; screen x size ; mov edx, [_WinMapWidth] ; <<<<
inc edx ; imul edx, ebx
imul edx, ebx ; shr eax, 2
add eax, [_WinMapAddress] ; add eax, [_WinMapAddress]
mov dl, [eax+edx] ; lea eax, [...] ; mov dl, [eax+edx]
;
xor ecx, ecx ; xor ecx, ecx
mov eax, [CURRENT_TASK] ; mov eax, [CURRENT_TASK]
cmp al, dl ; cmp al, dl
setne cl ; setne cl
;
pop edx eax ; pop edx ebx eax
ret ; ret
iglobal iglobal
cpustring db 'CPU',0 cpustring db 'CPU',0
@ -2903,12 +2913,6 @@ no_set_bgr_event:
jz nobackgr jz nobackgr
cmp [background_defined], 0 cmp [background_defined], 0
jz nobackgr jz nobackgr
; mov [draw_data+32 + RECT.left],dword 0
; mov [draw_data+32 + RECT.top],dword 0
; mov eax,[Screen_Max_X]
; mov ebx,[Screen_Max_Y]
; mov [draw_data+32 + RECT.right],eax
; mov [draw_data+32 + RECT.bottom],ebx
@@: @@:
call drawbackground call drawbackground
xor eax, eax xor eax, eax
@ -2950,8 +2954,6 @@ markz:
je system_shutdown je system_shutdown
noshutdown: noshutdown:
mov eax,[TASK_COUNT] ; termination mov eax,[TASK_COUNT] ; termination
mov ebx,TASK_DATA+TASKDATA.state mov ebx,TASK_DATA+TASKDATA.state
mov esi,1 mov esi,1
@ -2970,19 +2972,13 @@ newct:
ret ret
; redraw screen ; redraw screen
redrawscreen:
; eax , if process window_data base is eax, do not set flag/limits ; eax , if process window_data base is eax, do not set flag/limits
redrawscreen:
pushad pushad
push eax push eax
;;; mov ebx,2 xor ecx,ecx ; redraw flags for apps
;;; call delay_hs
;mov ecx,0 ; redraw flags for apps
xor ecx,ecx
newdw2: newdw2:
inc ecx inc ecx
@ -3034,8 +3030,6 @@ redrawscreen:
cmp dword[esp], 1 cmp dword[esp], 1
jnz .az jnz .az
; cmp byte[BACKGROUND_CHANGED], 0
; jnz newdw8
cmp byte[REDRAW_BACKGROUND], 0 cmp byte[REDRAW_BACKGROUND], 0
jz .az jz .az
mov dl, 0 mov dl, 0
@ -3086,6 +3080,7 @@ redrawscreen:
jne nobgrd jne nobgrd
inc byte[REDRAW_BACKGROUND] inc byte[REDRAW_BACKGROUND]
newdw8: newdw8:
nobgrd: nobgrd:
@ -3106,7 +3101,6 @@ redrawscreen:
ret ret
calculatebackground: ; background calculatebackground: ; background
mov edi, [_WinMapAddress] ; set os to use all pixels mov edi, [_WinMapAddress] ; set os to use all pixels
mov eax,0x01010101 mov eax,0x01010101
mov ecx, [_WinMapSize] mov ecx, [_WinMapSize]
@ -3122,11 +3116,7 @@ uglobal
imax dd 0x0 imax dd 0x0
endg endg
delay_ms: ; delay in 1/1000 sec delay_ms: ; delay in 1/1000 sec
push eax push eax
push ecx push ecx
@ -3154,7 +3144,6 @@ delay_ms: ; delay in 1/1000 sec
ret ret
set_app_param: set_app_param:
mov edi, [TASK_BASE] mov edi, [TASK_BASE]
mov eax, [edi + TASKDATA.event_mask] mov eax, [edi + TASKDATA.event_mask]
@ -3162,8 +3151,6 @@ set_app_param:
mov [esp+32], eax mov [esp+32], eax
ret ret
delay_hs: ; delay in 1/100 secs delay_hs: ; delay in 1/100 secs
; ebx = delay time ; ebx = delay time
push ecx push ecx
@ -3189,7 +3176,6 @@ delay_hs: ; delay in 1/100 secs
align 16 ;very often call this subrutine align 16 ;very often call this subrutine
memmove: ; memory move in bytes memmove: ; memory move in bytes
; eax = from ; eax = from
; ebx = to ; ebx = to
; ecx = no of bytes ; ecx = no of bytes
@ -3219,54 +3205,6 @@ memmove: ; memory move in bytes
ret ret
; <diamond> Sysfunction 34, read_floppy_file, is obsolete. Use 58 or 70 function instead.
;align 4
;
;read_floppy_file:
;
;; as input
;;
;; eax pointer to file
;; ebx file lenght
;; ecx start 512 byte block number
;; edx number of blocks to read
;; esi pointer to return/work area (atleast 20 000 bytes)
;;
;;
;; on return
;;
;; eax = 0 command succesful
;; 1 no fd base and/or partition defined
;; 2 yet unsupported FS
;; 3 unknown FS
;; 4 partition not defined at hd
;; 5 file not found
;; ebx = size of file
;
; mov edi,[TASK_BASE]
; add edi,0x10
; add esi,[edi]
; add eax,[edi]
;
; pushad
; mov edi,esi
; add edi,1024
; mov esi,0x100000+19*512
; sub ecx,1
; shl ecx,9
; add esi,ecx
; shl edx,9
; mov ecx,edx
; cld
; rep movsb
; popad
;
; mov [esp+36],eax
; mov [esp+24],ebx
; ret
align 4 align 4
sys_programirq: sys_programirq:
@ -3294,7 +3232,6 @@ r_f_port_area:
reserve_free_irq: reserve_free_irq:
xor esi, esi xor esi, esi
inc esi inc esi
cmp ecx, 16 cmp ecx, 16
@ -3317,7 +3254,6 @@ reserve_free_irq:
jmp ril1 jmp ril1
reserve_irq: reserve_irq:
cmp dword [ecx], 0 cmp dword [ecx], 0
jne ril1 jne ril1
@ -3355,76 +3291,65 @@ endg
drawbackground: drawbackground:
inc [mouse_pause] inc [mouse_pause]
cmp [SCR_MODE],word 0x12 ; cmp [BgrDrawMode],dword 1
je dbrv20 ; jne bgrstr
dbrv12: ; call vesa20_drawbackground_tiled
cmp [SCR_MODE],word 0100000000000000b call drawbackground
jge dbrv20
; cmp [SCR_MODE],word 0x13
; je dbrv20
; call vesa12_drawbackground
dec [mouse_pause]
call [draw_pointer]
ret
dbrv20:
cmp [BgrDrawMode],dword 1
jne bgrstr
call vesa20_drawbackground_tiled
dec [mouse_pause]
call [draw_pointer]
ret
bgrstr:
call vesa20_drawbackground_stretch
dec [mouse_pause] dec [mouse_pause]
call [draw_pointer] call [draw_pointer]
ret ret
; bgrstr:
; call vesa20_drawbackground_stretch
; dec [mouse_pause]
; call [draw_pointer]
; ret
; ====================================================================
align 4 align 4
syscall_putimage: ; PutImage = SysFn07
syscall_putimage: ; PutImage
sys_putimage: sys_putimage:
test ecx,0x80008000 test ecx,0x80008000 ; ecx = { SizeX | SizeY }
jnz .exit jnz .exit ; edx = { OrigX | OrigY }
test ecx,0x0000FFFF test ecx,0x0000FFFF ; ebx points to the 24bpp-image
jz .exit jz .exit
test ecx,0xFFFF0000 test ecx,0xFFFF0000
jnz @f jnz @f
.exit: .exit:
ret ret
@@: @@:
push edi
mov edi,[current_slot] mov edi,[current_slot]
add dx,word[edi+APPDATA.wnd_clientbox.top] add dx,word[edi+APPDATA.wnd_clientbox.top]
rol edx,16 rol edx,16
add dx,word[edi+APPDATA.wnd_clientbox.left] add dx,word[edi+APPDATA.wnd_clientbox.left]
pop edi
rol edx,16 rol edx,16
.forced: .forced: ; called from gui/skincode.inc [215]
push ebp esi 0 push esi
mov ebp, putimage_get24bpp mov esi, ecx
mov esi, putimage_init24bpp shr esi, 16 ; SizeX
sys_putimage_bpp: lea esi, [esi*2+esi] ; 3 bytes per pixel
; cmp [SCR_MODE], word 0x12 mov [img_buf_line_size], esi
; jz @f ;.doit mov [img_draw_core_fn], draw_core_24bpp
; mov eax, vesa12_putimage mov [img_draw_edge_fn], draw_edge_24bpp
; cmp [SCR_MODE], word 0100000000000000b mov [img_bytes_per_pix], 3
; jae @f pop esi
; cmp [SCR_MODE], word 0x13
; jnz .doit sys_putimage_bpp: ; only called from sys_putimage_palette
;@@:
mov eax, vesa20_putimage
.doit:
inc [mouse_pause] inc [mouse_pause]
call eax call _putimage
dec [mouse_pause] dec [mouse_pause]
pop ebp esi ebp
jmp [draw_pointer] jmp [draw_pointer]
align 4 align 4
sys_putimage_palette: sys_putimage_palette: ; sysFn 65
; ebx = pointer to image ; ebx = pointer to image
; ecx = [xsize]*65536 + [ysize] ; ecx = [xsize]*65536 + [ysize]
; edx = [xstart]*65536 + [ystart] ; edx = [xstart]*65536 + [ystart]
; esi = number of bits per pixel, must be 8, 24 or 32 ; esi = number of bits per pixel, must be 1, 8, 24 or 32
; edi = pointer to palette ; edi = pointer to palette
; ebp = row delta ; ebp = line offset
mov eax, [CURRENT_TASK] mov eax, [CURRENT_TASK]
shl eax, 8 shl eax, 8
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.top] add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.top]
@ -3432,257 +3357,52 @@ sys_putimage_palette:
add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.left] add dx, word [eax+SLOT_BASE+APPDATA.wnd_clientbox.left]
rol edx, 16 rol edx, 16
.forced: .forced:
cmp esi, 1 mov [img_palette], edi
jnz @f mov eax, esi
push edi cmp eax, 32 ;>32bpp (stupid call)
mov eax, [edi+4] ja .exit
sub eax, [edi] shr al, 3 ; 0=1bpp, other lo-pix modes not supported
push eax push esi
push dword [edi] mov [img_bytes_per_pix], eax
push 0ffffff80h mov esi, [eax*4 + img_core_proc_0]
mov edi, esp mov [img_draw_core_fn], esi
call put_mono_image mov esi, [eax*4 + img_edge_proc_0]
add esp, 12 mov [img_draw_edge_fn], esi
pop edi mov esi, ecx
ret shr esi, 16 ; esi = SizeX
@@: or al, al
cmp esi, 2 jz .1bpp
jnz @f imul esi, eax
push edi jmp .done
push 0ffffff80h .1bpp:
mov edi, esp add esi, 7
call put_2bit_image shr esi, 3 ; 8 pixels per byte
pop eax .done:
pop edi add esi, ebp ; + line offset
ret mov [img_buf_line_size], esi
@@: pop esi
cmp esi, 4 jmp _putimage ;<<< sys_putimage_bpp
jnz @f .exit:
push edi
push 0ffffff80h
mov edi, esp
call put_4bit_image
pop eax
pop edi
ret
@@:
push ebp esi ebp
cmp esi, 8
jnz @f
mov ebp, putimage_get8bpp
mov esi, putimage_init8bpp
jmp sys_putimage_bpp
@@:
cmp esi, 15
jnz @f
mov ebp, putimage_get15bpp
mov esi, putimage_init15bpp
jmp sys_putimage_bpp
@@:
cmp esi, 16
jnz @f
mov ebp, putimage_get16bpp
mov esi, putimage_init16bpp
jmp sys_putimage_bpp
@@:
cmp esi, 24
jnz @f
mov ebp, putimage_get24bpp
mov esi, putimage_init24bpp
jmp sys_putimage_bpp
@@:
cmp esi, 32
jnz @f
mov ebp, putimage_get32bpp
mov esi, putimage_init32bpp
jmp sys_putimage_bpp
@@:
pop ebp esi ebp
ret ret
put_mono_image: align 4
push ebp esi ebp img_core_proc_0 dd draw_core_1bpp
mov ebp, putimage_get1bpp img_core_proc_1 dd draw_core_8bpp
mov esi, putimage_init1bpp img_core_proc_2 dd draw_core_16bpp
jmp sys_putimage_bpp img_core_proc_3 dd draw_core_24bpp
put_2bit_image: img_core_proc_4 dd draw_core_32bpp
push ebp esi ebp
mov ebp, putimage_get2bpp
mov esi, putimage_init2bpp
jmp sys_putimage_bpp
put_4bit_image:
push ebp esi ebp
mov ebp, putimage_get4bpp
mov esi, putimage_init4bpp
jmp sys_putimage_bpp
putimage_init24bpp: img_edge_proc_0 dd draw_edge_1bpp
lea eax, [eax*3] img_edge_proc_1 dd draw_edge_8bpp
putimage_init8bpp: img_edge_proc_2 dd draw_edge_16bpp
ret img_edge_proc_3 dd draw_edge_24bpp
img_edge_proc_4 dd draw_edge_32bpp
align 16
putimage_get24bpp:
movzx eax, byte [esi+2]
shl eax, 16
mov ax, [esi]
add esi, 3
ret 4
align 16
putimage_get8bpp:
movzx eax, byte [esi]
push edx
mov edx, [esp+8]
mov eax, [edx+eax*4]
pop edx
inc esi
ret 4
putimage_init1bpp:
add eax, ecx
push ecx
add eax, 7
add ecx, 7
shr eax, 3
shr ecx, 3
sub eax, ecx
pop ecx
ret
align 16
putimage_get1bpp:
push edx
mov edx, [esp+8]
mov al, [edx]
add al, al
jnz @f
lodsb
adc al, al
@@:
mov [edx], al
sbb eax, eax
and eax, [edx+8]
add eax, [edx+4]
pop edx
ret 4
putimage_init2bpp:
add eax, ecx
push ecx
add ecx, 3
add eax, 3
shr ecx, 2
shr eax, 2
sub eax, ecx
pop ecx
ret
align 16
putimage_get2bpp:
push edx
mov edx, [esp+8]
mov al, [edx]
mov ah, al
shr al, 6
shl ah, 2
jnz .nonewbyte
lodsb
mov ah, al
shr al, 6
shl ah, 2
add ah, 1
.nonewbyte:
mov [edx], ah
mov edx, [edx+4]
movzx eax, al
mov eax, [edx+eax*4]
pop edx
ret 4
putimage_init4bpp:
add eax, ecx
push ecx
add ecx, 1
add eax, 1
shr ecx, 1
shr eax, 1
sub eax, ecx
pop ecx
ret
align 16
putimage_get4bpp:
push edx
mov edx, [esp+8]
add byte [edx], 80h
jc @f
movzx eax, byte [edx+1]
mov edx, [edx+4]
and eax, 0x0F
mov eax, [edx+eax*4]
pop edx
ret 4
@@:
movzx eax, byte [esi]
add esi, 1
mov [edx+1], al
shr eax, 4
mov edx, [edx+4]
mov eax, [edx+eax*4]
pop edx
ret 4
putimage_init32bpp:
shl eax, 2
ret
align 16
putimage_get32bpp:
lodsd
ret 4
putimage_init15bpp:
putimage_init16bpp:
add eax, eax
ret
align 16
putimage_get15bpp:
; 0RRRRRGGGGGBBBBB -> 00000000RRRRR000GGGGG000BBBBB000
push ecx edx
movzx eax, word [esi]
add esi, 2
mov ecx, eax
mov edx, eax
and eax, 0x1F
and ecx, 0x1F shl 5
and edx, 0x1F shl 10
shl eax, 3
shl ecx, 6
shl edx, 9
or eax, ecx
or eax, edx
pop edx ecx
ret 4
align 16
putimage_get16bpp:
; RRRRRGGGGGGBBBBB -> 00000000RRRRR000GGGGGG00BBBBB000
push ecx edx
movzx eax, word [esi]
add esi, 2
mov ecx, eax
mov edx, eax
and eax, 0x1F
and ecx, 0x3F shl 5
and edx, 0x1F shl 11
shl eax, 3
shl ecx, 5
shl edx, 8
or eax, ecx
or eax, edx
pop edx ecx
ret 4
; ==================================================
; eax x beginning ; eax x beginning
; ebx y beginning ; ebx y beginning
; ecx x end ; ecx x end
; edx y end ; edx y end
; edi color ; edi color
__sys_drawbar: __sys_drawbar:
@ -3693,28 +3413,13 @@ __sys_drawbar:
add edx,[esi+APPDATA.wnd_clientbox.top] add edx,[esi+APPDATA.wnd_clientbox.top]
.forced: .forced:
inc [mouse_pause] inc [mouse_pause]
; call [disable_mouse] ; dbv20:
cmp [SCR_MODE],word 0x12
je dbv20
sdbv20:
; cmp [SCR_MODE],word 0100000000000000b
; jge dbv20
; cmp [SCR_MODE],word 0x13
; je dbv20
; call vesa12_drawbar
; dec [mouse_pause]
; call [draw_pointer]
; ret
dbv20:
call vesa20_drawbar call vesa20_drawbar
dec [mouse_pause] dec [mouse_pause]
call [draw_pointer] jmp [draw_pointer]
ret
kb_read: kb_read:
push ecx edx push ecx edx
mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's
@ -3745,15 +3450,6 @@ kb_write:
push ecx edx push ecx edx
mov dl,al mov dl,al
; mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's
; kw_loop1:
; in al,0x64
; test al,0x20
; jz kw_ok1
; loop kw_loop1
; mov ah,1
; jmp kw_exit
; kw_ok1:
in al,0x60 in al,0x60
mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's mov ecx,0x1ffff ; last 0xffff, new value in view of fast CPU's
kw_loop: kw_loop:
@ -4491,7 +4187,12 @@ set_screen:
stdcall kernel_free, [_WinMapAddress] stdcall kernel_free, [_WinMapAddress]
mov eax, [_display.width] mov eax, [_display.width]
mul [_display.height] shr eax, 1
shr eax, 1
mov [_WinMapWidth], eax
mov eax, [_display.height]
shr eax, 1
mul [_WinMapWidth]
mov [_WinMapSize], eax mov [_WinMapSize], eax
stdcall kernel_alloc, eax stdcall kernel_alloc, eax

View File

@ -224,9 +224,7 @@ include "sound/playnote.inc" ; player Note for Speaker PC
; display ; display
;include "video/vesa12.inc" ; Vesa 1.2 functions include "video/graph32.inc" ; 32bpp graphics
include "video/vesa20.inc" ; Vesa 2.0 functions
;include "video/vga.inc" ; VGA 16 color functions
include "video/cursors.inc" ; cursors functions include "video/cursors.inc" ; cursors functions
; Network Interface & TCPIP Stack ; Network Interface & TCPIP Stack

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff