Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 135 → Rev 134

/programs/media/mv/trunk/mv.asm
32,16 → 32,20
cmp byte [temp_area],0
jz .no_param
mov edi,string ; clear string
mov ecx,256/4 ; length of a string
mov ecx,43*3 ; length of a string
xor eax,eax ; symbol <0>
rep stosd
add al,14h
cld
rep stosb
 
mov edi,temp_area ; look for <0> in temp_area
mov esi,edi
mov ecx,257 ; strlen
mov ecx,43*3+1 ; strlen
repne scasb
lea ecx, [edi-temp_area]
add edi,-temp_area ; get length of the string
dec edi
 
mov ecx,edi
mov esi,temp_area
mov edi,string
rep movsb ; copy string from temp_area to "string" (filename)
 
68,7 → 72,6
; ⥯¥àì ¢ ecx ­®¬¥à ¯à®æ¥áá 
mov [process],ecx
 
draw_still:
call draw_window
 
still:
76,35 → 79,40
mov eax,10 ; wait here for event
int 0x40
 
dec eax
jz red
dec eax
jnz button
cmp eax,1 ; redraw request ?
je red
cmp eax,2 ; key in buffer ?
je key
cmp eax,3 ; button in buffer ?
je button
 
jmp still
 
red:
bt [status],2
jnc @f
mov eax,18
mov ebx,3
mov ecx,[process]
int 0x40
btr [status],2
jmp still
@@:
call draw_window
jmp still
 
key: ; key
mov al,2
int 0x40
mov al,ah
cmp al,6
cmp ah,6
je kfile
cmp al,15
cmp ah,15
je kopen
cmp al,9
cmp ah,9
je kinfo
cmp al,2
cmp ah,2
je kbgrd
jmp still
 
red:
test byte [status], 4
jz draw_still
mov al, 18
mov ebx, 3
mov ecx, [process]
int 0x40
and byte [status], not 4
jmp still
 
button: ; button
mov eax,17 ; get id
int 0x40
118,9 → 126,9
cmp ah,2
jne nofile
kfile:
test byte [status], 1
jnz still
or byte [status], 1
bt dword [status],0
jc still
bts dword [status],0
mov eax,51
mov ebx,1
mov ecx,thread1
155,9 → 163,9
cmp ah,4
jne noinfo
kinfo:
test byte [status], 2
jnz still
or byte [status], 2
bt dword [status],1
jc still
bts dword [status],1
mov eax,51
mov ebx,1
mov ecx,thread2
170,9 → 178,9
cmp ah,5
jne still
kbgrd:
test byte [status], 8
jnz still
or byte [status], 8
bt dword [status],3
jc still
bts dword [status],3
mov eax,51
mov ebx,1
mov ecx,thread3
189,9 → 197,21
 
 
load_image:
mov eax, 70
mov dword [fileinfo+8],1 ; how many blocks to read (1)
mov eax,58
mov ebx, fileinfo
int 0x40
cmp [I_END+2],dword 512 ; à §¬¥à ä ©«  (file size)
jbe @f
mov eax,[I_END+2]
shr eax,9 ; ¯®¤¥«¨¬ ­  512 ¨ ¯à¨¡ ¢¨¬ 1 - ¯®«ã稬 ç¨á«® ¡«®ª®¢
inc eax
 
mov dword [fileinfo+8],eax
mov eax,58
mov ebx,fileinfo
int 0x40
@@:
mov eax,[I_END+18]
mov ebx,[I_END+22]
add eax,20
243,7 → 263,7
 
mov esi, ecx
imul esi, edx
lea esi, [esi+esi*2]
imul esi, 3
mov ebx,5
mov ecx,[soi]
xor edx,edx
262,14 → 282,12
convert:
movzx eax,word [I_END+28]
mul dword [I_END+18]
; mov ebx,32
; div ebx
; test edx,edx
; je noaddword
; inc eax
; noaddword:
add eax, 31
shr eax, 5
mov ebx,32
div ebx
test edx,edx
je noaddword
inc eax
noaddword:
mov [dwps],eax ;dwps-doublewords per string
shl eax,2
mov [bps],eax ;bps-bytes per string
444,8 → 462,7
 
lsz buttext,\
en, ' FILE OPEN INFO BGRD',\
ru, ' ”€‰‹ Ž’Š ˆ”Ž ”Ž ',\
de, 'DATEI OEFNEN INFO HGRD'
ru, ' ”€‰‹ Ž’Š ˆ”Ž ”Ž '
 
status dd 0 ;bit0=1 if file thread is created
bps dd 0
617,7 → 634,7
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt1 ; pointer to text beginning
mov esi,labelt1.size ; text length
mov esi,4 ; text length
int 0x40
 
call drawstring
662,9 → 679,22
 
lsz labelt1,\
en, 'File',\
ru, '” ©«',\
de, 'Datei'
ru, '” ©«'
 
pos: dd 6
fileinfo:
dd 0
dd 0
dd 1 ;number of blocks of 512 bytes
dd I_END
dd temp_area
string:
; db '/HARDDISK/FIRST/1/DICK.BMP '
; db '/hd/1/menuet/pics/new.bmp '
db '/rd/1/bgr.bmp '
db ' '
db ' '
 
thread2: ; start of info thread
 
call draw_window2
793,8 → 823,7
 
lsz labelt2,\
en, 'File info',\
ru, 'ˆ­ä®à¬ æ¨ï ® ä ©«¥',\
de, 'Dateiinfo'
ru, 'ˆ­ä®à¬ æ¨ï ® ä ©«¥'
 
lsz fitext,\
en, 'FILE SIZE ',\
805,12 → 834,7
ru, ' §¬¥à ä ©«  ',\
ru, '˜¨à¨­  ',\
ru, '‚ëá®â  ',\
ru, '¨â ­  ¯¨ªá¥« ',\
\
de, 'FATEIGROESSE ',\
de, 'X GROESSE ',\
de, 'Y GROESSE ',\
de, 'BITS PER PIXEL'
ru, '¨â ­  ¯¨ªá¥« '
 
thread3: ; start of bgrd thread
 
915,7 → 939,7
mov ebx,8*65536+8 ; [x start] *65536 + [y start]
mov ecx,0x10ddeeff ; font 1 & color ( 0xF0RRGGBB )
mov edx,labelt3 ; pointer to text beginning
mov esi,labelt3.size ; text length
mov esi,14 ; text length
int 0x40
add ebx,38*65536+20
mov ecx,0xddeeff
975,42 → 999,27
 
lsz labelt3,\
en, 'Background set',\
ru, "“áâ ­®¢ª  ä®­ ",\
de, 'Hintergrund gesetzt'
ru, "“áâ ­®¢ª  ä®­ "
 
lsz bgrdtext,\
en, 'SET AS BACKGROUND:',\
ru, '’¨¯ ®¡®¥¢:',\
de, 'ALS HINTERGRUND'
ru, '’¨¯ ®¡®¥¢:'
 
lsz tiled,\
en, 'TILED',\
ru, '§ ¬®áâ¨âì',\
de, 'GEKACHELT'
ru, '§ ¬®áâ¨âì'
 
lsz stretch,\
en, 'STRETCH',\
ru, 'à áâï­ãâì',\
de, 'GESTRECKT'
ru, 'à áâï­ãâì'
 
lsz ok_btn,\
en, 'Ok',\
ru, 'Ok',\
de, 'Ok'
ru, 'Ok'
 
pos: dd 6
fileinfo:
dd 0
dd 0
dd 0
dd 0x290000-I_END
dd I_END
string:
db '/rd/1/bgr.bmp',0
 
 
IM_END:
rb string+257-$
 
process_info:
temp_area:
rb 0x10000