forked from KolibriOS/kolibrios
kiv and libimg.asm: Follow asm style guide, no semantic changes.
git-svn-id: svn://kolibrios.org@8497 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
parent
de8931dae4
commit
a16331c816
File diff suppressed because it is too large
Load Diff
@ -37,7 +37,8 @@ START:
|
|||||||
mcall SF_SYSTEM, SSF_MOUSE_SETTINGS, SSSF_SET_SPEEDUP, 5
|
mcall SF_SYSTEM, SSF_MOUSE_SETTINGS, SSSF_SET_SPEEDUP, 5
|
||||||
mcall SF_SYS_MISC, SSF_HEAP_INIT
|
mcall SF_SYS_MISC, SSF_HEAP_INIT
|
||||||
mcall SF_KEYBOARD, SSF_SET_INPUT_MODE, 1 ; set kbd mode to scancodes
|
mcall SF_KEYBOARD, SSF_SET_INPUT_MODE, 1 ; set kbd mode to scancodes
|
||||||
mcall SF_SET_EVENTS_MASK, EVM_REDRAW or EVM_KEY or EVM_BUTTON or EVM_MOUSE or EVM_MOUSE_FILTER
|
mcall SF_SET_EVENTS_MASK, EVM_REDRAW or EVM_KEY or EVM_BUTTON or \
|
||||||
|
EVM_MOUSE or EVM_MOUSE_FILTER
|
||||||
|
|
||||||
stdcall dll.Load, @IMPORT
|
stdcall dll.Load, @IMPORT
|
||||||
or eax, eax
|
or eax, eax
|
||||||
@ -57,7 +58,7 @@ START:
|
|||||||
mov esi, __params
|
mov esi, __params
|
||||||
mov edi, path
|
mov edi, path
|
||||||
mov ecx, 4096/4
|
mov ecx, 4096/4
|
||||||
rep movsd
|
rep movsd
|
||||||
mov byte[edi-1], 0
|
mov byte[edi-1], 0
|
||||||
@@:
|
@@:
|
||||||
; OpenDialog initialisation
|
; OpenDialog initialisation
|
||||||
@ -73,7 +74,7 @@ START:
|
|||||||
mov [slide_key], eax
|
mov [slide_key], eax
|
||||||
invoke ini_get_shortcut, inifilename, aKivSection, aTglbar, -1, tglbar_mod
|
invoke ini_get_shortcut, inifilename, aKivSection, aTglbar, -1, tglbar_mod
|
||||||
mov [tglbar_key], eax
|
mov [tglbar_key], eax
|
||||||
|
|
||||||
invoke ini_get_int, inifilename, aKivSection, aWinX, 100
|
invoke ini_get_int, inifilename, aKivSection, aWinX, 100
|
||||||
mov [window.left], eax
|
mov [window.left], eax
|
||||||
invoke ini_get_int, inifilename, aKivSection, aWinY, 150
|
invoke ini_get_int, inifilename, aKivSection, aWinY, 150
|
||||||
@ -100,7 +101,7 @@ START:
|
|||||||
mov esi, path
|
mov esi, path
|
||||||
mov edi, __params
|
mov edi, __params
|
||||||
mov ecx, 4096/4
|
mov ecx, 4096/4
|
||||||
rep movsd
|
rep movsd
|
||||||
mov byte[edi-1], 0
|
mov byte[edi-1], 0
|
||||||
jmp params_given
|
jmp params_given
|
||||||
|
|
||||||
@ -148,7 +149,7 @@ still:
|
|||||||
@@:
|
@@:
|
||||||
movi eax, SF_WAIT_EVENT_TIMEOUT
|
movi eax, SF_WAIT_EVENT_TIMEOUT
|
||||||
.wait_event:
|
.wait_event:
|
||||||
mcall
|
mcall
|
||||||
dec eax
|
dec eax
|
||||||
jns @f
|
jns @f
|
||||||
call red_update_frame
|
call red_update_frame
|
||||||
@ -470,7 +471,7 @@ button:
|
|||||||
invoke img.rotate, [cur_image]
|
invoke img.rotate, [cur_image]
|
||||||
@@:
|
@@:
|
||||||
invoke img.rotate, [orig_image]
|
invoke img.rotate, [orig_image]
|
||||||
mov [bNewImage], 1
|
mov [bNewImage], 1
|
||||||
jmp redraw_all
|
jmp redraw_all
|
||||||
|
|
||||||
; rotate right
|
; rotate right
|
||||||
@ -497,14 +498,14 @@ button:
|
|||||||
mov edi, __params
|
mov edi, __params
|
||||||
push edi
|
push edi
|
||||||
mov ecx, 4096/4
|
mov ecx, 4096/4
|
||||||
rep movsd
|
rep movsd
|
||||||
mov byte[edi-1], 0
|
mov byte[edi-1], 0
|
||||||
|
|
||||||
pop esi
|
pop esi
|
||||||
push esi
|
push esi
|
||||||
call find_last_name_component
|
call find_last_name_component
|
||||||
|
|
||||||
pop eax
|
pop eax
|
||||||
push [cur_image]
|
push [cur_image]
|
||||||
stdcall load_image, eax
|
stdcall load_image, eax
|
||||||
jc .restore_old
|
jc .restore_old
|
||||||
@ -831,7 +832,7 @@ load_directory:
|
|||||||
sub ecx, esi
|
sub ecx, esi
|
||||||
dec ecx
|
dec ecx
|
||||||
js @f
|
js @f
|
||||||
rep movsb
|
rep movsb
|
||||||
@@:
|
@@:
|
||||||
mov byte[edi], 0
|
mov byte[edi], 0
|
||||||
mcall 68, 12, 0x1000
|
mcall 68, 12, 0x1000
|
||||||
@ -935,7 +936,7 @@ load_directory:
|
|||||||
.copy:
|
.copy:
|
||||||
mov esi, [esp]
|
mov esi, [esp]
|
||||||
mov ecx, 304 / 4
|
mov ecx, 304 / 4
|
||||||
rep movsd
|
rep movsd
|
||||||
inc dword[esp+4]
|
inc dword[esp+4]
|
||||||
.nocopy:
|
.nocopy:
|
||||||
.noext:
|
.noext:
|
||||||
@ -1051,7 +1052,7 @@ proc draw_window
|
|||||||
@@:
|
@@:
|
||||||
test eax, eax
|
test eax, eax
|
||||||
jz @f
|
jz @f
|
||||||
mcall SF_CHANGE_WINDOW, -1, -1, ,
|
mcall SF_CHANGE_WINDOW, -1, -1, ,
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
.min_size_ok:
|
.min_size_ok:
|
||||||
@ -1059,36 +1060,36 @@ proc draw_window
|
|||||||
jz @f
|
jz @f
|
||||||
call generate_window_header
|
call generate_window_header
|
||||||
@@:
|
@@:
|
||||||
cmp [window.width], 0
|
cmp [window.width], 0
|
||||||
jne @f
|
jne @f
|
||||||
mcall SF_GET_SCREEN_SIZE
|
mcall SF_GET_SCREEN_SIZE
|
||||||
mov ebx,eax ;
|
mov ebx, eax
|
||||||
shr ebx,16 ; ebx = width
|
shr ebx, 16 ; ebx = width
|
||||||
movzx esi,ax ; esi = height
|
movzx esi, ax ; esi = height
|
||||||
|
|
||||||
mov eax, ebx
|
|
||||||
xor edx, edx
|
|
||||||
mov ebx, 3
|
|
||||||
div ebx
|
|
||||||
imul eax, 2
|
|
||||||
mov [window.width], eax
|
|
||||||
|
|
||||||
xor edx, edx
|
mov eax, ebx
|
||||||
mov ebx, 4
|
xor edx, edx
|
||||||
div ebx
|
mov ebx, 3
|
||||||
mov [window.left], eax
|
div ebx
|
||||||
|
imul eax, 2
|
||||||
mov eax, esi
|
mov [window.width], eax
|
||||||
xor edx, edx
|
|
||||||
mov ebx, 3
|
xor edx, edx
|
||||||
div ebx
|
mov ebx, 4
|
||||||
imul eax, 2
|
div ebx
|
||||||
mov [window.height], eax
|
mov [window.left], eax
|
||||||
|
|
||||||
xor edx, edx
|
mov eax, esi
|
||||||
mov ebx, 4
|
xor edx, edx
|
||||||
div ebx
|
mov ebx, 3
|
||||||
mov [window.top], eax
|
div ebx
|
||||||
|
imul eax, 2
|
||||||
|
mov [window.height], eax
|
||||||
|
|
||||||
|
xor edx, edx
|
||||||
|
mov ebx, 4
|
||||||
|
div ebx
|
||||||
|
mov [window.top], eax
|
||||||
@@:
|
@@:
|
||||||
|
|
||||||
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
mcall SF_REDRAW, SSF_BEGIN_DRAW
|
||||||
@ -1234,11 +1235,11 @@ proc draw_toolbar uses ebx esi edi
|
|||||||
mcall
|
mcall
|
||||||
mov ebx, [toolbar_abs_left]
|
mov ebx, [toolbar_abs_left]
|
||||||
add ebx, [toolbar.width]
|
add ebx, [toolbar.width]
|
||||||
sub ebx, 25*5+10
|
sub ebx, 25*5+10
|
||||||
shl ebx, 16
|
shl ebx, 16
|
||||||
add ebx, [toolbar_abs_left]
|
add ebx, [toolbar_abs_left]
|
||||||
add ebx, [toolbar.width]
|
add ebx, [toolbar.width]
|
||||||
sub ebx, 25*5+10
|
sub ebx, 25*5+10
|
||||||
mcall
|
mcall
|
||||||
|
|
||||||
mov ebx, [toolbar_abs_left]
|
mov ebx, [toolbar_abs_left]
|
||||||
@ -1260,7 +1261,7 @@ proc draw_toolbar uses ebx esi edi
|
|||||||
mcall , , , 'scl'+40000000h
|
mcall , , , 'scl'+40000000h
|
||||||
mov ebx, [toolbar_abs_left]
|
mov ebx, [toolbar_abs_left]
|
||||||
add ebx, [toolbar.width]
|
add ebx, [toolbar.width]
|
||||||
sub ebx, 25*5+10
|
sub ebx, 25*5+10
|
||||||
add ebx, 5
|
add ebx, 5
|
||||||
shl ebx, 16
|
shl ebx, 16
|
||||||
mov bl, 21
|
mov bl, 21
|
||||||
@ -1308,7 +1309,7 @@ proc draw_toolbar uses ebx esi edi
|
|||||||
mcall , buttons+rotccwbtn*20
|
mcall , buttons+rotccwbtn*20
|
||||||
add edx, 25*65536
|
add edx, 25*65536
|
||||||
mcall , buttons+rot180btn*20
|
mcall , buttons+rot180btn*20
|
||||||
|
|
||||||
.quit:
|
.quit:
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
@ -1529,7 +1530,7 @@ proc draw_fullscreen_controls
|
|||||||
add edx, [canvas.top]
|
add edx, [canvas.top]
|
||||||
mcall 65, buttons+backbtn*20, <20, 20>, , 8, palette
|
mcall 65, buttons+backbtn*20, <20, 20>, , 8, palette
|
||||||
add edx, 25 SHL 16
|
add edx, 25 SHL 16
|
||||||
mcall 65, buttons+forwardbtn*20, , , 8,
|
mcall 65, buttons+forwardbtn*20, , , 8,
|
||||||
pop esi
|
pop esi
|
||||||
ret
|
ret
|
||||||
endp
|
endp
|
||||||
@ -1630,7 +1631,7 @@ proc generate_window_header
|
|||||||
push eax ebx esi edi
|
push eax ebx esi edi
|
||||||
mov esi, [last_name_component]
|
mov esi, [last_name_component]
|
||||||
mov edi, window_header
|
mov edi, window_header
|
||||||
mov [window_header_len], 4 ; [,/,],
|
mov [window_header_len], 4 ; [,/,],
|
||||||
|
|
||||||
mov byte[edi], '['
|
mov byte[edi], '['
|
||||||
inc edi
|
inc edi
|
||||||
@ -1968,7 +1969,7 @@ proc merge_icons_to_single_img _img
|
|||||||
mov edi, [ebx+Image.Data]
|
mov edi, [ebx+Image.Data]
|
||||||
mov ecx, [ebx+Image.Width]
|
mov ecx, [ebx+Image.Width]
|
||||||
imul ecx, [ebx+Image.Height]
|
imul ecx, [ebx+Image.Height]
|
||||||
rep stosd
|
rep stosd
|
||||||
|
|
||||||
mov eax, [_img]
|
mov eax, [_img]
|
||||||
cmp [eax+Image.Type], Image.bpp32
|
cmp [eax+Image.Type], Image.bpp32
|
||||||
@ -2022,7 +2023,7 @@ endl
|
|||||||
add edi, eax
|
add edi, eax
|
||||||
.next_line:
|
.next_line:
|
||||||
mov ecx, [edx+Image.Width]
|
mov ecx, [edx+Image.Width]
|
||||||
rep movsd
|
rep movsd
|
||||||
mov eax, [ebx+Image.Width]
|
mov eax, [ebx+Image.Width]
|
||||||
sub eax, [edx+Image.Width]
|
sub eax, [edx+Image.Width]
|
||||||
shl eax, 2
|
shl eax, 2
|
||||||
@ -2093,7 +2094,7 @@ proc recalc_client
|
|||||||
|
|
||||||
stdcall copy_box, work, work_prev
|
stdcall copy_box, work, work_prev
|
||||||
xor ecx, ecx
|
xor ecx, ecx
|
||||||
test [bShowToolbar], 1
|
test [bShowToolbar], 1
|
||||||
jz @f
|
jz @f
|
||||||
mov ecx, [toolbar.height]
|
mov ecx, [toolbar.height]
|
||||||
@@:
|
@@:
|
||||||
@ -2527,7 +2528,7 @@ db 'XBM',0
|
|||||||
db 0
|
db 0
|
||||||
|
|
||||||
draw_window_fake:
|
draw_window_fake:
|
||||||
ret
|
ret
|
||||||
;------------------------------------------------------------------------------
|
;------------------------------------------------------------------------------
|
||||||
scale_mode_calc dd scale_none_calc, 0, 0, 0, scale_fit_min_calc
|
scale_mode_calc dd scale_none_calc, 0, 0, 0, scale_fit_min_calc
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user