42,9 → 42,17 |
define __DEBUG__ 1 |
define __DEBUG_LEVEL__ 1 |
include '../../debug-fdo.inc' |
include '../../develop/libraries/box_lib/trunk/box_lib.mac' |
include '../../develop/libraries/box_lib/load_lib.mac' |
@use_library |
;----------------------------------------------------------------------------- |
struct RESULT_SLOT |
text dd ? |
read_speed dd ? |
write_speed dd ? |
chunk_size dd ? |
ends |
;----------------------------------------------------------------------------- |
START: |
DEBUGF 1,'FSPEED: start of programm\n' |
;----------------------------------------------------------------------------- |
61,6 → 69,11 |
;OpenDialog initialisation |
push dword OpenDialog_data |
call [OpenDialog_Init] |
|
push check1 |
call [init_checkbox] |
|
mcall 40,0x27 |
;----------------------------------------------------------------------------- |
red: |
call draw_window |
76,6 → 89,9 |
cmp eax,3 |
je button |
|
push dword check1 |
call [check_box_mouse] |
|
jmp still |
;----------------------------------------------------------------------------- |
key: |
126,14 → 142,31 |
xor ebp,ebp |
mov edx,[w_work] ; color of work area RRGGBB,8->color |
or edx,0x34000000 |
mcall 0,<100,400>,<100,270>,,,title |
mcall 0,<100,400>,<100,300>,,,title |
|
call draw_PathShow |
mov eax,[w_work_text] |
or eax,0x80000000 |
mov [check1.text_color],eax |
push dword check1 |
call [check_box_draw] |
|
mcall 8,<5,80>,<25,15>,2,[w_work_button] |
mcall 4,<5+10,25+4>,[w_work_button_text],s_text,s_text.size |
mcall 8,<400-65,50>,<25,15>,3,[w_work_button] |
mcall 4,<400-65+10,25+4>,[w_work_button_text],r_text,r_text.size |
mcall ,<400-65,50>,,3 |
mov ecx,[w_work_button_text] |
or ecx,0x80000000 |
mcall 4,<5+10,25+4>,,s_text |
mcall ,<400-65+10,25+4>,,r_text |
mov ecx,[w_work_text] |
or ecx,0x80000000 |
mcall ,<10,47>,,check_box_warning_text |
mcall ,<10,65>,,result_table_text |
|
mov ebx,5 shl 16+47 |
mov edx,ecx |
and edx,0xffffff |
mcall 38,<5,400-15>,<59,59> |
; draw result table |
mov ebx,10 shl 16+77 |
mov ebp,result_table |
mov ecx,18 |
;-------------------------------------- |
141,15 → 174,17 |
push ecx |
mov ecx,[w_work_text] |
or ecx,0x80000000 |
mcall 4,,,[ebp] |
mcall 4,,,[ebp+RESULT_SLOT.text] |
push ebx |
mov edx,ebx |
add edx,50 shl 16 |
add edx,(11*6) shl 16 |
mov ebx,0x800a0000 |
mcall 47,,[ebp+4],,[w_work_text] |
mcall 47,,[ebp+RESULT_SLOT.read_speed],,[w_work_text] |
add edx,(16*6) shl 16 |
mcall ,,[ebp+RESULT_SLOT.write_speed] |
pop ebx |
add ebx,6+5 |
add ebp,12 |
add ebp,sizeof.RESULT_SLOT |
pop ecx |
dec ecx |
jnz @b |
173,11 → 208,20 |
@@: |
push ecx |
call read_chunk |
pop ecx |
add ebp,12 |
|
pusha |
call draw_window |
popa |
|
call write_chunk |
|
pusha |
call draw_window |
popa |
|
pop ecx |
add ebp,sizeof.RESULT_SLOT |
|
dec ecx |
jnz @b |
|
185,15 → 229,15 |
;----------------------------------------------------------------------------- |
read_chunk: |
mov eax,[file_info+32] ; file size |
cmp [ebp+8],eax ; chunk size |
cmp [ebp+RESULT_SLOT.chunk_size],eax |
jb @f |
|
xor eax,eax |
mov [ebp+4],eax ; small file size for current chunk size |
xor eax,eax ; small file size for current chunk size |
mov [ebp+RESULT_SLOT.read_speed],eax |
ret |
;-------------------------------------- |
@@: |
mcall 68,12,[ebp+8] ; chunk size |
mcall 68,12,[ebp+RESULT_SLOT.chunk_size] |
mov [fileread.return],eax |
xor eax,eax |
mov [fileread.offset],eax ; zero current offset |
201,7 → 245,7 |
add eax,1600 ; 16 sec for iterations |
mov esi,eax |
mov ecx,1 |
mov eax,[ebp+8] ; chunk size |
mov eax,[ebp+RESULT_SLOT.chunk_size] |
mov [fileread.size],eax |
;-------------------------------------- |
.loop: |
211,11 → 255,11 |
cmp esi,eax |
jbe .end |
; correct offset |
mov edx,[ebp+8] ; chunk size |
mov edx,[ebp+RESULT_SLOT.chunk_size] |
add [fileread.offset],edx ; current offset |
; check offset and file size |
mov edx,[file_info+32] ; file size |
sub edx,[ebp+8] ; chunk size |
sub edx,[ebp+RESULT_SLOT.chunk_size] |
cmp [fileread.offset],edx |
jbe @f |
|
227,17 → 271,78 |
jmp .loop |
;-------------------------------------- |
.end: |
mov eax,[ebp+8] |
mov eax,[ebp+RESULT_SLOT.chunk_size] |
xor edx,edx |
mul ecx |
shr eax,10+4 ;div 1024 ; div 16 |
shl edx,18 |
add eax,edx |
mov [ebp+4],eax ; speed KB/s |
DEBUGF 1,'FSPEED: chunk size: %s iterations: %d speed: %d KB/s\n',[ebp],ecx,eax |
mov [ebp+RESULT_SLOT.read_speed],eax ; speed KB/s |
DEBUGF 1,'FSPEED: read chunk size: %s iterations: %d speed: %d KB/s\n',\ |
[ebp+RESULT_SLOT.text],ecx,eax |
mcall 68,13,[fileread.return] |
ret |
;----------------------------------------------------------------------------- |
write_chunk: |
test [check1.flags],dword 10b |
jz .exit |
|
mov eax,[file_info+32] ; file size |
cmp [ebp+RESULT_SLOT.chunk_size],eax |
jb @f |
;-------------------------------------- |
.exit: |
xor eax,eax ; small file size for current chunk size |
mov [ebp+RESULT_SLOT.write_speed],eax |
ret |
;-------------------------------------- |
@@: |
mcall 68,12,[ebp+RESULT_SLOT.chunk_size] |
mov [filewrite.data],eax |
xor eax,eax |
mov [filewrite.offset],eax ; zero current offset |
mcall 26,9 ; get start time |
add eax,1600 ; 16 sec for iterations |
mov esi,eax |
mov ecx,1 |
mov eax,[ebp+RESULT_SLOT.chunk_size] |
mov [filewrite.size],eax |
;-------------------------------------- |
.loop: |
mcall 70,filewrite |
|
mcall 26,9 ; check current time |
cmp esi,eax |
jbe .end |
; correct offset |
mov edx,[ebp+RESULT_SLOT.chunk_size] |
add [filewrite.offset],edx ; current offset |
; check offset and file size |
mov edx,[file_info+32] ; file size |
sub edx,[ebp+RESULT_SLOT.chunk_size] |
cmp [filewrite.offset],edx |
jbe @f |
|
xor edx,edx |
mov [filewrite.offset],edx ; zero current offset |
;-------------------------------------- |
@@: |
inc ecx |
jmp .loop |
;-------------------------------------- |
.end: |
mov eax,[ebp+RESULT_SLOT.chunk_size] |
xor edx,edx |
mul ecx |
shr eax,10+4 ;div 1024 ; div 16 |
shl edx,18 |
add eax,edx |
mov [ebp+RESULT_SLOT.write_speed],eax ; speed KB/s |
DEBUGF 1,'FSPEED: write chunk size: %s iterations: %d speed: %d KB/s\n',\ |
[ebp+RESULT_SLOT.text],ecx,eax |
mcall 68,13,[filewrite.data] |
ret |
;----------------------------------------------------------------------------- |
include 'idata.inc' |
;----------------------------------------------------------------------------- |
IM_END: |