Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 1097 → Rev 1098

/programs/media/scrshoot/scrsavef.inc
45,13 → 45,21
jmp .next
.str_end:
 
;;;;clean memory
 
mov ecx,dword [sf_buf.bmp_header]
mov ebx,13
mov eax,68
mcall
 
; ‚ëç¨á«ï¥¬, ᪮«ìª® ¡ ©â ­ã¦­® ¯à¨¡ ¢«ïâì ª ª ¦¤®© áâப¥,
; ç⮡ë á«¥¤ãîé ï ¡ë«  ¢ëà ¢­¥­  ­  4 ¡ ©â .
; ¥§ã«ìâ â ¯®¬¥é ¥¬ ¢ edi.
 
xor edx,edx
movzx eax,word [scr_buf.width] ; eax = è¨à¨­  ª à⨭ª¨
lea eax,[eax*3] ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨
movr ebx,4 ; ebx = 4
mov ebx,4 ; ebx = 4
mov edi,ebx ; edi = 4
div ebx ; eax = ¡ ©â ­  áâப㠪 à⨭ª¨ div 4 edx = ¡ ©â... mod 4
sub edi,edx ; edi = ª®«¨ç¥á⢮ ¡ ©â
61,10 → 69,11
@@:
 
; ¢ë¤¥«ï¥¬ ¯ ¬ïâì
mov ecx,[scr_buf.end_ptr]
mov [sf_buf.bmp_header],ecx
add ecx,0x36
mov [sf_buf.bmp_area],ecx
; mov ecx,[scr_buf.end_ptr]
; mov [sf_buf.bmp_header],ecx
 
; add ecx,0x36
; mov [sf_buf.bmp_area],ecx
movsx ebx,word [scr_buf.width]
movsx edx,word [scr_buf.height]
;imul ebx,edx
71,92 → 80,78
lea ebx,[ebx*3]
add ebx,edi
imul ebx,edx
add ecx,ebx
mov [sf_buf.end],ecx
add ecx,4096
xor ebx,ebx
inc ebx
movr eax,64
int 0x40
mov ecx,ebx
 
push edi
; mov [sf_buf.end],ecx
add ecx,0x36
mov ebx,12
mov eax,68
mcall
 
mov [sf_buf.bmp_header],eax
add eax,0x36
mov [sf_buf.bmp_area],eax
add eax,ecx
sub eax,0x36
mov [sf_buf.end],eax
 
; push edi
; § ¯®«­ï¥¬ áâàãªâãàã ¤«ï á®åà ­¥­¨ï ä ©« 
mov edi,fs_struc
mov [edi],dword 2
mov ebp,fs_struc
mov [ebp],dword 2
 
mov eax,[sf_buf.bmp_header]
mov ebx,[sf_buf.end]
sub ebx,eax
mov [edi+12],ebx
mov [edi+16],eax
mov [edi+21],dword file_name
mov [ebp+12],ebx
mov [ebp+16],eax
mov [ebp+21],dword file_name
 
; § ¯®«­ï¥¬ § £®«®¢®ª bmp
mov edi,[sf_buf.bmp_header]
mov [edi],word 'BM'
mov ebp,[sf_buf.bmp_header]
mov [ebp],word 'BM'
mov ebx,[sf_buf.end]
sub ebx,[sf_buf.bmp_area]
mov [edi+34],ebx ; à §¬¥à ª à⨭ª¨
mov [edi+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
mov [ebp+34],ebx ; à §¬¥à ª à⨭ª¨
mov [ebp+10],dword 0x36 ; à §¬¥à § £®«®¢ª 
add ebx,0x36
mov [edi+2],ebx ; à §¬¥à ä ©« 
mov [edi+14],dword 0x28
mov [ebp+2],ebx ; à §¬¥à ä ©« 
mov [ebp+14],dword 0x28
movzx eax,word [scr_buf.width]
mov [edi+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
mov [ebp+18],eax ; £®à¨§®­â «ì­ë© à §¬¥à
movzx eax,word [scr_buf.height]
mov [edi+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [edi+26],word 1
mov [edi+28],word 24
mov [ebp+22],eax ; ¢¥à⨪«ì­ë© à §¬¥à
mov [ebp+26],word 1
mov [ebp+28],word 24
 
; ª®¯¨à㥬 ¨ ¯¥à¥¢®à ç¨¢ ¥¬
; mov esi,[scr_buf.ptr]
; mov edi,[sf_buf.bmp_area]
; mov edx,[sf_buf.end]
; sub edx,edi
; movsx ecx,word [scr_buf.height]
;.next_str:
;push ecx
;
; movsx ecx,word [scr_buf.width]
; lea ecx,[ecx*3]
; mov ebx,ecx
;.next_byte:
; mov ah,[esi+ebx]
; mov [edi+edx],ah
; dec ebx
; dec edx
; loop .next_byte
; movsx ecx,word [scr_buf.width]
; lea ecx,[ecx*3]
; add esi,ecx
;pop ecx
; loop .next_str
 
mov esi,[scr_buf.end_ptr]
mov edi,[sf_buf.bmp_area]
movzx ecx,word [scr_buf.height]
; á®å࠭塞
mov esi,[scr_buf.ptr]
mov edi,[sf_buf.end]
movzx edx,word [scr_buf.height]
movzx ebx,word [scr_buf.width]
lea ebx,[ebx*3]
add edi,ebx
test ebx,11b
jz @f
shr ebx,2
inc ebx
shl ebx,2
@@:
cld
align 4
.next_str:
mov edx,ebx
.next_pixel:
mov ah,[esi]
mov [edi],ah
dec esi
dec edi
sub edi,ebx
mov ecx,ebx
shr ecx,2
rep movsd
sub edi,ebx
dec edx
jnz .next_pixel
lea edi,[2*ebx+edi]
add edi,[esp]
loop .next_str
jnz .next_str
 
pop edi
 
; á®å࠭塞
draw_status saving
mov eax,70
mov ebx,fs_struc
int 0x40
mcall
 
test eax,eax
jne save_error