2006-11-02 15:18:23 +01:00
|
|
|
|
save_file:
|
|
|
|
|
pusha
|
2009-06-01 20:25:07 +02:00
|
|
|
|
bt dword [flags],0
|
|
|
|
|
jnc .not_shooted
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
2010-09-08 13:39:41 +02:00
|
|
|
|
cmp byte [fname_buf],0
|
2009-06-01 20:25:07 +02:00
|
|
|
|
je .no_file_name
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
2009-06-01 20:25:07 +02:00
|
|
|
|
mov edi,sign_n_input
|
|
|
|
|
call zstr_to_int
|
|
|
|
|
mov [sign_n],al
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
2009-06-01 20:25:07 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㥬 <EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD>
|
|
|
|
|
xor eax,eax
|
|
|
|
|
mov ecx,1056
|
|
|
|
|
mov edi,file_name
|
|
|
|
|
rep stosb ; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <EFBFBD><EFBFBD><EFBFBD>ﬨ
|
2006-11-02 15:18:23 +01:00
|
|
|
|
|
2010-09-08 13:39:41 +02:00
|
|
|
|
mov esi,fname_buf
|
2009-06-01 20:25:07 +02:00
|
|
|
|
mov edi,file_name
|
2006-11-02 15:18:23 +01:00
|
|
|
|
.next:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
mov ah,[esi]
|
|
|
|
|
test ah,ah
|
|
|
|
|
jz .str_end
|
|
|
|
|
cmp ah,'*'
|
|
|
|
|
jne .no_insert_number
|
|
|
|
|
jmp .insert_number
|
2006-11-02 15:18:23 +01:00
|
|
|
|
.no_insert_number:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
mov [edi],ah
|
|
|
|
|
inc edi
|
|
|
|
|
inc esi
|
|
|
|
|
jmp .next
|
2006-11-02 15:18:23 +01:00
|
|
|
|
.insert_number:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
bt word [ch6.flags],1
|
|
|
|
|
jnc @f
|
|
|
|
|
mov eax,[cur_number]
|
|
|
|
|
movsx ebx,byte [sign_n]
|
|
|
|
|
push ebx
|
|
|
|
|
call int_to_str
|
|
|
|
|
pop ebx
|
|
|
|
|
add edi,ebx
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
inc esi
|
|
|
|
|
jmp .next
|
2006-11-02 15:18:23 +01:00
|
|
|
|
.str_end:
|
|
|
|
|
|
2016-11-26 15:22:34 +01:00
|
|
|
|
mcall SF_SYS_MISC, SSF_MEM_FREE, [sf_buf.bmp_header]
|
|
|
|
|
|
|
|
|
|
;create image struct
|
|
|
|
|
movsx ebx,word[scr_buf.width]
|
|
|
|
|
movsx edx,word[scr_buf.height]
|
|
|
|
|
stdcall [img_create], ebx, edx, Image.bpp24
|
|
|
|
|
mov [sf_buf.bmp_area],eax
|
|
|
|
|
test eax,eax
|
|
|
|
|
jz @f
|
|
|
|
|
;copy foto to image buffer
|
|
|
|
|
mov edi,[eax+Image.Data]
|
|
|
|
|
mov esi,[scr_buf.ptr]
|
|
|
|
|
movsx ecx,word[scr_buf.width]
|
|
|
|
|
movsx edx,word[scr_buf.height]
|
|
|
|
|
imul ecx,edx
|
|
|
|
|
imul ecx,3
|
|
|
|
|
rep movsb
|
|
|
|
|
|
|
|
|
|
;encode image
|
|
|
|
|
stdcall [img_encode], eax, LIBIMG_FORMAT_PNG, 0
|
|
|
|
|
test eax,eax
|
|
|
|
|
jz @f
|
|
|
|
|
|
|
|
|
|
mov [sf_buf.bmp_header],eax
|
|
|
|
|
mov [sf_buf.end],ecx
|
|
|
|
|
@@:
|
|
|
|
|
stdcall [img_destroy], [sf_buf.bmp_area]
|
2007-02-01 10:46:48 +01:00
|
|
|
|
|
2009-06-01 20:25:07 +02:00
|
|
|
|
; <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>塞 <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD>࠭<EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<EFBFBD><EFBFBD>
|
|
|
|
|
mov ebp,fs_struc
|
2016-11-26 15:22:34 +01:00
|
|
|
|
mov [ebp],dword SSF_CREATE_FILE
|
2009-06-01 20:25:07 +02:00
|
|
|
|
|
|
|
|
|
mov eax,[sf_buf.bmp_header]
|
2016-11-26 15:22:34 +01:00
|
|
|
|
mov ecx,[sf_buf.end]
|
|
|
|
|
mov [ebp+12],ecx ;file size
|
2009-06-01 20:25:07 +02:00
|
|
|
|
mov [ebp+16],eax
|
|
|
|
|
mov [ebp+21],dword file_name
|
|
|
|
|
|
2016-11-26 15:22:34 +01:00
|
|
|
|
draw_status saving
|
|
|
|
|
mcall SF_FILE, fs_struc
|
2009-06-01 20:25:07 +02:00
|
|
|
|
|
|
|
|
|
test eax,eax
|
|
|
|
|
jne save_error
|
|
|
|
|
|
|
|
|
|
inc dword [cur_number]
|
|
|
|
|
call draw_number
|
|
|
|
|
|
|
|
|
|
draw_status saved_ok
|
2007-02-01 10:46:48 +01:00
|
|
|
|
|
2006-11-02 15:18:23 +01:00
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.no_file_name:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
draw_status no_file_name
|
2006-11-02 15:18:23 +01:00
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
.not_shooted:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
draw_status not_shooted
|
2006-11-02 15:18:23 +01:00
|
|
|
|
popa
|
|
|
|
|
ret
|
|
|
|
|
|
|
|
|
|
save_error:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
cmp al,5
|
|
|
|
|
jne @f
|
|
|
|
|
mov [status.text],dword bad_file_name
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
cmp al,8
|
|
|
|
|
jne @f
|
|
|
|
|
mov [status.text],dword disk_filled
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
2009-06-01 20:25:07 +02:00
|
|
|
|
cmp al,9
|
|
|
|
|
jne @f
|
|
|
|
|
mov [status.text],dword bad_fat_table
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
2009-06-01 20:25:07 +02:00
|
|
|
|
cmp al,10
|
|
|
|
|
jne @f
|
|
|
|
|
mov [status.text],dword ac_den
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@:
|
|
|
|
|
|
2009-06-01 20:25:07 +02:00
|
|
|
|
cmp al,11
|
|
|
|
|
jne @f
|
|
|
|
|
mov [status.text],dword device_er
|
2006-11-02 15:18:23 +01:00
|
|
|
|
@@:
|
2009-06-01 20:25:07 +02:00
|
|
|
|
call send_draw_status
|
2006-11-02 15:18:23 +01:00
|
|
|
|
popa
|
|
|
|
|
ret
|