Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Ignore whitespace Rev 131 → Rev 130

/programs/fs/sysxtree/trunk/ascml.inc
File deleted
\ No newline at end of file
/programs/fs/sysxtree/trunk/ascgml.inc
File deleted
/programs/fs/sysxtree/trunk/xtree.bmp
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/fs/sysxtree/trunk/xtreeinf.txt
File deleted
\ No newline at end of file
/programs/fs/sysxtree/trunk/xtreinfo.txt
File deleted
\ No newline at end of file
/programs/fs/sysxtree/trunk/xtree.ico
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/fs/sysxtree/trunk/systr12.GIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Deleted: svn:mime-type
-application/octet-stream
\ No newline at end of property
/programs/fs/sysxtree/trunk/SYSTR12.GIF
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programs/fs/sysxtree/trunk/ascgl.inc
20,8 → 20,8
;0.07 convbmp ~13.05.2004
;0.08 fps ~14.05.2004
;0.09 drawfbox ~03.06.2004
;0.10 all macros optimized by Halyavin A., add at ~07.06.2004
;0.11 many macros optimized by Halyavin A., add at ~30.08.2004
;0.10 all macros optimized by halyavin, add at ~07.06.2004
;0.11 many macros optimized by halyavin, add at ~30.08.2004
;0.12 bmptoimg ~07.09.2004
;0.13 imgtoimg ~08.09.2004
;0.14 imgtoimg modify not brake bmp pict! ~09.09.2004
369,8 → 369,8
;DrawBox
macro drawfbox x,y,xs,ys,color
{
words2reg ebx,x,xs ;x*65536+xs
words2reg ecx,y,ys ;y*65536+ys
wordstoreg ebx,x,xs ;x*65536+xs
wordstoreg ecx,y,ys ;y*65536+ys
mov edx,color
mov eax,13
int 0x40
385,8 → 385,8
jmp spdat
savetime dd 0
fps_cntr dd 0
fps dd 0
ttt dd 0
fps dd 0
ttt dd 0
spdat:
get_time:
mov eax,3
395,7 → 395,7
jne new_time
inc [fps_cntr]
cmp dword [ttt],0
je out_fps
je out_fps
dec dword [ttt]
jmp no_out_fps
new_time:
405,7 → 405,7
mov [fps_cntr],0
out_fps:
if ~(delcolor eq )
mov ebx,x*65536+36
mov ebx,x*65536+30
mov ecx,y*65536+7
mov edx,delcolor
mov eax,13
413,7 → 413,7
end if
mov dword [ttt],fps_show_frequency
mov eax,47
mov ebx,6*65536
mov ebx,5*65536
; mov bl,0
mov edx,x*65536+y
mov esi,color
427,44 → 427,44
macro collimg img1_off,x1,y1,img2_off,x2,y2,otv
{
local bounce,exit,anot,bc,nbc
mov esi,[img1_off] ;xs1
mov edi,[img2_off] ;ys2
mov eax,x1 ;
mov ebx,x2 ;
call _1dbounce
mov edx,ecx
mov esi,[img1_off+4] ;ys1
mov edi,[img2_off+4] ;ys2
mov eax,y1 ;
mov ebx,y2 ;
call _1dbounce
add edx,ecx
cmp edx,2
je bounce
mov otv,0
jmp exit
mov esi,[img1_off] ;xs1
mov edi,[img2_off] ;ys2
mov eax,x1 ;
mov ebx,x2 ;
call _1dbounce
mov edx,ecx
mov esi,[img1_off+4] ;ys1
mov edi,[img2_off+4] ;ys2
mov eax,y1 ;
mov ebx,y2 ;
call _1dbounce
add edx,ecx
cmp edx,2
je bounce
mov otv,0
jmp exit
_1dbounce_count=_1dbounce_count+1
if _1dbounce_count = 1
_1dbounce:
cmp ebx,eax
jb anot
add eax,esi
cmp eax,ebx
jbe nbc
cmp ebx,eax
jb anot
add eax,esi
cmp eax,ebx
jbe nbc
bc:
mov ecx,1
ret
mov ecx,1
ret
anot:
add ebx,edi
cmp ebx,eax
ja bc
cmp ebx,eax
ja bc
nbc:
xor ecx,ecx
ret
xor ecx,ecx
ret
end if
bounce:
mov otv,1
exit:
bounce:
mov otv,1
exit:
}
 
macro rgbtobgr image
495,7 → 495,7
shl ecx,16
add cx,[arg3+4]
; wordstoreg ecx,[arg3],[arg3+4]
words2reg edx, x , y ;arg1*65536+arg2
wordstoreg edx, x , y ;arg1*65536+arg2
int 0x40
}
 
504,7 → 504,7
mov eax,7
mov ebx,arg3
add ebx,8
words2reg edx, x , y ;arg1*65536+arg2
wordstoreg edx, x , y ;arg1*65536+arg2
add edx,dword [arg3]
mov ecx,dword [arg3+4]
int 0x40
697,7 → 697,7
sub esi,dword [bmptoimg_data_area_bps]
sub esi,dword [bmptoimg_data_area_bps]
cmp esi,dword [bmptoimg_data_area_sop]
jb end_bmp
jb end_bmp
add edi,eax
add ebp,eax
jmp nextstring
705,7 → 705,7
convertno32:
mov ebx,bmp_load_area
add ebx, [bmp_load_area+14]
add ebx,14 ;start of color table
add ebx,14 ;start of color table
push esi
add esi,dword [bmptoimg_data_area_bps]
mov dword [bmptoimg_data_area_eos],esi
714,9 → 714,9
push eax
movzx eax,byte [esi]
cmp word [bmp_load_area+28],4
je convert4bpp
je convert4bpp
cmp word [bmp_load_area+28],1
je convert1bpp
je convert1bpp
call converttable
 
convert2:
750,7 → 750,7
mov edx,7
nextbit:
xor eax,eax
bt ecx,edx
bt ecx,edx
jnc noaddelem
inc eax
noaddelem:
758,7 → 758,7
call converttable
pop edx
dec edx
js convert2
js convert2
add edi,3
 
add ebp,3
776,12 → 776,12
bmptoimg_data_area_count=bmptoimg_data_area_count+1
if bmptoimg_data_area_count = 1
; DATA AREA
bmptoimg_soi dd 0
bmptoimg_data_area_bps dd 0
bmptoimg_soi dd 0
bmptoimg_data_area_bps dd 0
bmptoimg_data_area_dwps dd 0
bmptoimg_data_area_sop dd 0
bmptoimg_data_area_eop dd 0
bmptoimg_data_area_eos dd 0
bmptoimg_data_area_sop dd 0
bmptoimg_data_area_eop dd 0
bmptoimg_data_area_eos dd 0
end if
 
end_bmp:
806,7 → 806,7
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
local Gif_output, next, loop2
 
_null = 0x1000 ; 0x1000
_null equ 0x1000 ; 0x1000
 
; jmp sss
; if defined gif_hash_offset
816,13 → 816,13
; end if
;sss:
 
mov esi,gifsrc ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
mov edi,imgsrc ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
mov esi,gifsrc ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
mov edi,imgsrc ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
 
if defined gif_hash_offset
mov eax,gif_hash_offset ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
mov eax,gif_hash_offset ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
else
mov eax,hasharea ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
mov eax,hasharea ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
end if
 
call ReadGIF
845,12 → 845,12
mov [img_count],eax
inc eax
cmp dword[esi],'GIF8'
jne er ; signature
jne er ; signature
mov ecx,[esi+0xa]
inc eax
add esi,0xd
mov edi,esi
bt ecx,7
bt ecx,7
jnc nextblock
mov [globalColor],esi
call Gif_skipmap
891,8 → 891,8
push edi
movzx ecx,word[esi]
inc esi
bt ecx,7
jc uselocal
bt ecx,7
jc uselocal
push [globalColor]
mov edi,esi
jmp setPal
909,7 → 909,7
mov edi,[table_ptr]
xor eax,eax
cld
lodsb ; eax - block_count
lodsb ; eax - block_count
add eax,esi
mov [block_ofs],eax
mov [bit_count],8
933,7 → 933,7
pop [compsize]
call Gif_get_sym
cmp eax,[CC]
je reinit
je reinit
call Gif_output
cycle:
movzx ebx,ax
941,9 → 941,9
cmp eax,edx
jae notintable
cmp eax,[CC]
je reinit
je reinit
cmp eax,[EOI]
je zend
je zend
call Gif_output
zadd:
push eax
997,7 → 997,7
; out: edi - pointer to area after colormap
 
and ecx,111b
inc ecx ; color map size
inc ecx ; color map size
mov ebx,1
shl ebx,cl
lea ebx,[ebx*2+ebx]
1015,7 → 1015,7
jnz loop1
inc esi
cmp esi,[block_ofs]
jb noblock
jb noblock
push eax
xor eax,eax
lodsb
1057,14 → 1057,14
add esi,[Palette]
 
if COLOR_ORDER eq MENUETOS
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
else
movsw
movsb
movsw
movsb
end if
 
loop loop2
1073,7 → 1073,7
 
globalColor dd 1
img_count dd 1
cur_info dd 1 ; image table pointer
cur_info dd 1 ; image table pointer
img_start dd 1
codesize dd 1
compsize dd 1
1101,15 → 1101,15
local Gif_get_sym, shift, nextbl, noblock, loop1, exx
local Gif_output, next, loop2
 
_null = 0x1000 ; 0x1000
_null fix 0x1000 ; 0x1000
 
mov esi,gifsrc ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
mov edi,imgsrc ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
mov esi,gifsrc ;“ª § â¥«ì ­  ƒˆ” ä ¨« ¢ ¯ ¬ïâ¨
mov edi,imgsrc ;“ª § â¥«ì ­  ᯨ᮪ ª à⨭®ª
 
if defined gif_hash_offset
mov eax,gif_hash_offset ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
mov eax,gif_hash_offset ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
else
mov eax,hasharea ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
mov eax,hasharea ; ¡®ç ï ®¡« áâì ¬¨­¨¬ã¬ 4096*4 ¡ ©â
end if
 
call ReadGIF
1130,12 → 1130,12
mov [img_count],eax
inc eax
cmp dword[esi],'GIF8'
jne er ; signature
jne er ; signature
mov ecx,[esi+0xa]
inc eax
add esi,0xd
mov edi,esi
bt ecx,7
bt ecx,7
jnc nextblock
mov [globalColor],esi
call Gif_skipmap
1187,8 → 1187,8
push edi
movzx ecx,word[esi]
inc esi
bt ecx,7
jc uselocal
bt ecx,7
jc uselocal
push [globalColor]
mov edi,esi
jmp setPal
1205,7 → 1205,7
mov edi,[table_ptr]
xor eax,eax
cld
lodsb ; eax - block_count
lodsb ; eax - block_count
add eax,esi
mov [block_ofs],eax
mov [bit_count],8
1229,7 → 1229,7
pop [compsize]
call Gif_get_sym
cmp eax,[CC]
je reinit
je reinit
call Gif_output
cycle:
movzx ebx,ax
1237,9 → 1237,9
cmp eax,edx
jae notintable
cmp eax,[CC]
je reinit
je reinit
cmp eax,[EOI]
je zend
je zend
call Gif_output
zadd:
push eax
1291,8 → 1291,9
Gif_skipmap:
; in: ecx - image descriptor, esi - pointer to colormap
; out: edi - pointer to area after colormap
 
and ecx,111b
inc ecx ; color map size
inc ecx ; color map size
mov ebx,1
shl ebx,cl
lea ebx,[ebx*2+ebx]
1310,7 → 1311,7
jnz loop1
inc esi
cmp esi,[block_ofs]
jb noblock
jb noblock
push eax
xor eax,eax
lodsb
1352,14 → 1353,14
add esi,[Palette]
 
if COLOR_ORDER eq MENUETOS
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
else
movsw
movsb
movsw
movsb
end if
 
loop loop2
1368,7 → 1369,7
 
globalColor dd 1
img_count dd 1
cur_info dd 1 ; image table pointer
cur_info dd 1 ; image table pointer
img_start dd 1
codesize dd 1
compsize dd 1
/programs/fs/sysxtree/trunk/ascl.inc
27,13 → 27,11
;0.12 open/save dialog ~13.09.2004
;0.13 dialogs bugs deleted
;0.14 drawlbut ~03.10.2004
;0.15 extendet label!
 
; LOADFILE
; (SYNTAX) LOADFILE 'full_path_to_file',file_load_area,file_temp_area
; (SAMPLE) LOADFILE '/rd/1/clock.bmp',load_area,temp_area
 
 
macro loadfile file_name,file_load_area,file_temp_area
{
local open,fileinfo,string
61,75 → 59,25
}
 
 
;macro wordstoreg reg,hiword,loword
;{
;if hiword eqtype 0 & loword eqtype 0
; mov reg,dword hiword*65536+loword
;else if hiword eqtype 12 & loword eqtype eax
; mov reg,dword hiword*65536
; add reg,dword loword
;else if hiword eqtype 12 & loword eqtype [123]
; mov reg,dword hiword*65536
; add reg,dword loword
;else
; mov reg,dword hiword
; shl reg,16
; add reg,dword loword
;end if
;}
 
macro dword2reg reg,doubleword
macro wordstoreg reg,hiword,loword
{
if doubleword eq
; not changes
if hiword eqtype 0 & loword eqtype 0
mov reg,(hiword)*65536+(loword)
else if hiword eqtype 12 & loword eqtype eax
mov reg,(hiword)*65536
add reg,loword
else if hiword eqtype 0 & loword eqtype [123]
mov reg,(hiword)*65536
add reg,loword
else if (hiword eq ) & (loword eq )
else
mov reg,dword doubleword
mov reg,hiword
shl reg,16
add reg,loword
end if
}
 
macro words2reg reg,hiword,lowword
{
if hiword eq
if lowword eq
; not changes
else
if lowword eqtype 12
and reg,dword 0xffff0000
add reg,dword lowword
else
and reg,dword 0xffff0000
add reg,dword lowword
end if
end if
else
if lowword eq
if hiword eqtype 12
and reg,dword 0x0000ffff
add reg,dword hiword*65536
else
shl reg,16
add reg,dword hiword
ror reg,16
end if
else
if lowword eqtype 12 & hiword eqtype 12
if lowword eq 0 & hiword eq 0
xor reg,reg
else
mov reg,dword hiword*65536+lowword
end if
else
mov reg,dword hiword
shl reg,16
add reg,dword lowword
end if
end if
end if
}
 
 
 
 
; DRAW BUTTON with label
 
macro drawlbut x,y,xs,ys,text,id,bcolor,tcolor
138,8 → 86,8
jmp asd
lab db text ;arg label
asd:
words2reg ebx,x,xs
words2reg ecx,y,ys
wordstoreg ebx,x,xs
wordstoreg ecx,y,ys
mov edx,id
mov esi,bcolor
mov eax,8
380,7 → 328,7
db '/RD/1/SYSXTREE',0
 
procinfo:
times 1024 db 0
times 256 db 0
}
 
 
442,7 → 390,7
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
mov edx,120 ; size 150 bytes
int 0x40
 
; change wanted events list 7-bit IPC event
510,7 → 458,6
call redproc
jmp getmesloop
mkey:
mov eax,2
int 0x40 ; read (eax=2)
jmp getmesloop
mbutton:
579,8 → 526,8
DLGPID dd 0
 
param:
dd 0 ; My dec PID
dd 0,0 ; Type of dialog
rb 4 ; My dec PID
rb 6 ; Type of dialog
 
run_fileinfo:
dd 16
588,11 → 535,11
dd param
dd 0
dd procinfo
;run_filepath:
run_filepath:
db '/RD/1/SYSXTREE',0
 
procinfo:
times 1024 db 0
times 256 db 0
}
 
 
688,15 → 635,10
; mov ebx,x
; shl ebx,16
; add ebx,y
words2reg ebx,x,y
 
dword2reg ecx,color
dword2reg edx,offs
dword2reg esi,size
 
; mov ecx,color
; mov edx,offs
; mov esi,size
wordstoreg ebx,x,y
mov ecx,color
mov edx,offs
mov esi,size
mov eax,4
int 0x40
}
707,7 → 649,7
mov ebx,numtype
mov bl,0
; mov edx,x*65536+y
words2reg edx,x,y
wordstoreg edx,x,y
mov esi,color
mov eax,47
int 0x40
786,8 → 728,8
{
; mov ebx,arg1*65536+arg3
; mov ecx,arg2*65536+arg4
words2reg ebx,arg1,arg3
words2reg ecx,arg2,arg4
wordstoreg ebx,arg1,arg3
wordstoreg ecx,arg2,arg4
mov edx,arg5
mov eax,0
int 0x40
827,7 → 769,7
; (SYNTAX) LABEL Xstart,Ystart,'Text',Color
; (SAMPLE) LABEL 10,12,'Hello World!',cl_Green+font_Big
 
macro glabel arg1,arg2,arg3,arg4
macro label arg1,arg2,arg3,arg4
{
local asd,lab
jmp asd
836,11 → 778,10
; mov ebx,arg1 ;arg1=y arg2=x
; shl ebx,16
; add ebx,arg2
 
words2reg ebx,arg1,arg2
 
dword2reg ecx,arg4
 
wordstoreg ebx,arg1,arg2
if ~(arg4 eq )
mov ecx,arg4 ;arg4 color
end if
mov edx,lab
mov esi,asd-lab ;calc size
mov eax,4
/programs/fs/sysxtree/trunk/macros.inc
1,15 → 1,3
; language for programs
lang fix en ; ru en fr ge fi
 
@^ fix macro comment {
^@ fix }
 
 
macro m2m dest,src {
push src
pop dest
}
 
; new application structure
macro meos_app_start
{
86,75 → 74,38
 
 
; strings
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
name db data
.size = $-name
end if
macro sz name,[data] { ; from MFAR [mike.dld]
common
if used name
label name
end if
forward
if used name
db data
end if
common
if used name
.size = $-name
end if
}
 
macro lsz name,[lng,data] { ; from MFAR [mike.dld]
common
if used name
label name
forward
if lang eq lng
db data
end if
common
.size = $-name
end if
}
 
macro szc name,elsz,[data] { ; from MFAR [mike.dld]
common
local s,m
m = 0
if used name
label name
virtual at 0
db data
s = $
end virtual
d#elsz s
if m < s
m = s
common
if used name
label name
end if
db data
.size = $-name
.maxl = m
end if
}
 
macro lszc name,elsz,[lng,data] { ; from MFAR [mike.dld]
common
local s,m,c
m = 0
c = 0
if used name
label name
forward
if lang eq lng
virtual at 0
forward
if (used name)&(lang eq lng)
db data
s = $
end virtual
d#elsz s
if m < s
m = s
end if
db data
c = c+1
end if
common
.size = $-name
.maxl = m
.count = c
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
172,16 → 123,8
end if
}
 
;macro __mov reg,a { ; mike.dld
; if ~a eq
; mov reg,a
; end if
;}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
macro __mov reg,a { ; mike.dld
if ~a eq
mov reg,a
end if
}
197,72 → 140,12
}
 
 
; -------------------------
macro header a,[b] {
common
use32
org 0
db 'MENUET',a
forward
if b eq
dd 0
else
dd b
end if }
macro section name { align 16
label name }
macro func name {
if ~used name
display 'FUNC NOT USED: ',`name,13,10
else
align 4
name:
;pushad
;pushfd
;dps `name
;newline
;mcall 5,1
;popfd
;popad
}
macro endf { end if }
 
macro diff16 title,l1,l2
{
local s,d
s = l2-l1
display title,': 0x'
repeat 8
d = '0' + s shr ((8-%) shl 2) and $0F
if d > '9'
d = d + 'A'-'9'-1
end if
display d
end repeat
display 13,10
}
; language for programs
lang fix ru ; ru en fr ge fi
 
macro diff10 title,l1,l2
{
local s,d,z,m
s = l2-l1
z = 0
m = 1000000000
display title,': '
repeat 10
d = '0' + s / m
s = s - (s/m)*m
m = m / 10
if d <> '0'
z = 1
end if
if z <> 0
display d
end if
end repeat
display 13,10
}
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
270,9 → 153,9
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
inc arg1
else
add arg1,arg2
add arg1,arg2
end if
else
add arg1,arg2
283,9 → 166,9
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
dec arg1
else
sub arg1,arg2
sub arg1,arg2
end if
else
sub arg1,arg2
296,17 → 179,17
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
push arg2
pop arg1
else
mov arg1,arg2
mov arg1,arg2
end if
else
mov arg1,arg2
314,230 → 197,48
}
 
 
macro RGB [a] {
common
match (r=,g=,b),a \{
\dd ((r) shl 16) or ((g) shl 8) or (b)
\}
}
 
 
struc POINT _t,_dx,_dy {
.x _t _dx
.y _t _dy
}
 
 
; Macroinstructions for defining data structures
 
macro struct name
{ fields@struct equ name
match child parent, name \{ fields@struct equ child,fields@\#parent \}
sub@struct equ
struc db [val] \{ \common fields@struct equ fields@struct,.,db,<val> \}
struc dw [val] \{ \common fields@struct equ fields@struct,.,dw,<val> \}
struc du [val] \{ \common fields@struct equ fields@struct,.,du,<val> \}
struc dd [val] \{ \common fields@struct equ fields@struct,.,dd,<val> \}
struc dp [val] \{ \common fields@struct equ fields@struct,.,dp,<val> \}
struc dq [val] \{ \common fields@struct equ fields@struct,.,dq,<val> \}
struc dt [val] \{ \common fields@struct equ fields@struct,.,dt,<val> \}
struc rb count \{ fields@struct equ fields@struct,.,db,count dup (?) \}
struc rw count \{ fields@struct equ fields@struct,.,dw,count dup (?) \}
struc rd count \{ fields@struct equ fields@struct,.,dd,count dup (?) \}
struc rp count \{ fields@struct equ fields@struct,.,dp,count dup (?) \}
struc rq count \{ fields@struct equ fields@struct,.,dq,count dup (?) \}
struc rt count \{ fields@struct equ fields@struct,.,dt,count dup (?) \}
macro db [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,db,<val> \}
macro dw [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dw,<val> \}
macro du [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,du,<val> \}
macro dd [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dd,<val> \}
macro dp [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dp,<val> \}
macro dq [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dq,<val> \}
macro dt [val] \{ \common \local anonymous
fields@struct equ fields@struct,anonymous,dt,<val> \}
macro rb count \{ \local anonymous
fields@struct equ fields@struct,anonymous,db,count dup (?) \}
macro rw count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dw,count dup (?) \}
macro rd count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dd,count dup (?) \}
macro rp count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dp,count dup (?) \}
macro rq count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dq,count dup (?) \}
macro rt count \{ \local anonymous
fields@struct equ fields@struct,anonymous,dt,count dup (?) \}
macro union \{ fields@struct equ fields@struct,,union,<
sub@struct equ union \}
macro struct \{ fields@struct equ fields@struct,,substruct,<
sub@struct equ substruct \}
virtual at 0 }
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
macro ends
{ match , sub@struct \{ restruc db,dw,du,dd,dp,dq,dt
restruc rb,rw,rd,rp,rq,rt
purge db,dw,du,dd,dp,dq,dt
purge rb,rw,rd,rp,rq,rt
purge union,struct
match name=,fields,fields@struct \\{ fields@struct equ
make@struct name,fields
fields@\\#name equ fields \\}
end virtual \}
match any, sub@struct \{ fields@struct equ fields@struct> \}
restore sub@struct }
 
macro make@struct name,[field,type,def]
{ common
if $
display 'Error: definition of ',`name,' contains illegal instructions.',0Dh,0Ah
err
end if
local define
define equ name
forward
local sub
match , field \{ make@substruct type,name,sub def
define equ define,.,sub, \}
match any, field \{ define equ define,.#field,type,<def> \}
common
match fields, define \{ define@struct fields \} }
 
macro define@struct name,[field,type,def]
{ common
local list
list equ
forward
if ~ field eq .
name#field type def
sizeof.#name#field = $ - name#field
else
rb sizeof.#type
end if
local value
match any, list \{ list equ list, \}
list equ list <value>
common
sizeof.#name = $
restruc name
match values, list \{
struc name value \\{
match any, fields@struct \\\{ fields@struct equ fields@struct,.,name,<values> \\\}
match , fields@struct \\\{ label .
forward
match , value \\\\{ field type def \\\\}
match any, value \\\\{ field type value
if ~ field eq .
rb sizeof.#name#field - ($-field)
end if \\\\}
common \\\} \\} \} }
 
macro enable@substruct
{ macro make@substruct substruct,parent,name,[field,type,def]
\{ \common
\local define
define equ parent,name
\forward
\local sub
match , field \\{ match any, type \\\{ enable@substruct
make@substruct type,name,sub def
purge make@substruct
define equ define,.,sub, \\\} \\}
match any, field \\{ define equ define,.\#field,type,<def> \\}
\common
match fields, define \\{ define@\#substruct fields \\} \} }
 
enable@substruct
 
macro define@union parent,name,[field,type,def]
{ common
virtual at 0
forward
if ~ field eq .
virtual at 0
parent#field type def
sizeof.#parent#field = $ - parent#field
end virtual
if sizeof.#parent#field > $
rb sizeof.#parent#field - $
end if
else if sizeof.#type > $
rb sizeof.#type - $
end if
common
sizeof.#name = $
end virtual
struc name [value] \{ \common
label .\#name
last@union equ
forward
match any, last@union \\{ virtual at .\#name
field type def
end virtual \\}
match , last@union \\{ match , value \\\{ field type def \\\}
match any, value \\\{ field type value \\\} \\}
last@union equ field
common rb sizeof.#name - ($ - .\#name) \} }
 
macro define@substruct parent,name,[field,type,def]
{ common
virtual at 0
forward
if ~ field eq .
parent#field type def
sizeof.#parent#field = $ - parent#field
else
rb sizeof.#type
end if
local value
common
sizeof.#name = $
end virtual
struc name value \{
label .\#name
forward
match , value \\{ field type def \\}
match any, value \\{ field type value
if ~ field eq .
rb sizeof.#parent#field - ($-field)
end if \\}
common \} }
 
; structures used in MeOS
struc process_information
{
.cpu_usage dd ? ; +0
.window_stack_position dw ? ; +4
.window_stack_value dw ? ; +6
.not_used1 dw ? ; +8
.process_name rb 12 ; +10
.memory_start dd ? ; +22
.used_memory dd ? ; +26
.PID dd ? ; +30
.x_start dd ? ; +34
.y_start dd ? ; +38
.x_size dd ? ; +42
.y_size dd ? ; +46
.slot_state dw ? ; +50
rb (1024-52)
}
struct process_information
cpu_usage dd ? ; +0
window_stack_position dw ? ; +4
window_stack_value dw ? ; +6
not_used1 dw ? ; +8
process_name rb 12 ; +10
memory_start dd ? ; +22
used_memory dd ? ; +26
PID dd ? ; +30
x_start dd ? ; +34
y_start dd ? ; +38
x_size dd ? ; +42
y_size dd ? ; +46
slot_state dw ? ; +50
rb (1024-52)
ends
 
struc system_colors
{
.frame dd ?
.grab dd ?
.grab_button dd ?
.grab_button_text dd ?
.grab_text dd ?
.work dd ?
.work_button dd ?
.work_button_text dd ?
.work_text dd ?
.work_graph dd ?
}
struct system_colors
frame dd ?
grab dd ?
grab_button dd ?
grab_button_text dd ?
grab_text dd ?
work dd ?
work_button dd ?
work_button_text dd ?
work_text dd ?
work_graph dd ?
ends
 
 
; constants
546,16 → 247,16
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
562,4 → 263,4
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
EVM_STACK = 10000000b
/programs/fs/sysxtree/trunk/sysxtree.asm
31,55 → 31,29
 
;******************************************************************************
use32
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd I_END ; program image size
dd RAM_END ; memory
dd RAM_END ; stack
dd param_area ,0x0 ; param,icon
org 0x0
db 'MENUET01' ; 8 byte id
dd 0x01 ; header version
dd START ; program start
dd I_END ; program image size
dd RAM_END ; memory
dd RAM_END ; stack
dd param_area ,0x0 ; param,icon
; dd 0,0
 
;******************************************************************************
include 'lang.inc'
include 'macros.inc'
include 'ascl.inc'
include 'ascgl.inc'
 
gif_hash_offset = gif_hash
 
START: ; start of execution
START: ; start of execution
; //// Willow
; mov eax,58
; mov ebx,MRUfile
; int 0x40
mov eax,58
mov ebx,MRUfile
int 0x40
; //// Willow
mcall 18,11,1,table_area
mov edi,hdimg+62*2
cmp [table_area+2],byte 0
je no_hdpartition_on_hd0
mov esi,hdimg1
mov ecx,62
rep movsb
no_hdpartition_on_hd0:
cmp [table_area+3],byte 0
je no_hdpartition_on_hd1
mov esi,hdimg2
mov ecx,62
rep movsb
no_hdpartition_on_hd1:
cmp [table_area+4],byte 0
je no_hdpartition_on_hd2
mov esi,hdimg3
mov ecx,62
rep movsb
no_hdpartition_on_hd2:
cmp [table_area+5],byte 0
je no_hdpartition_on_hd3
mov esi,hdimg4
mov ecx,62
rep movsb
no_hdpartition_on_hd3:
 
mov eax,40
mov ebx,0100111b
86,12 → 60,12
int 0x40
 
cmp byte [param_area],0 ;test parameters line
jne no_brow ;it's dialog
jne no_brow ;it's dialog
mov [browser],dword 1 ;it's browser
no_brow:
 
cmp [browser],dword 1
je no_dlg
je no_dlg
 
mov al,byte [param_area+5]
mov [dlg_type],al
145,9 → 119,9
;************************
 
mov eax,0 ;x
mov ebx,0 ;y
mov ebx,0 ;y
mov esi,286 ;xs
mov edi,16 ;ys
mov edi,16 ;ys
mov ecx,tempimg ;src
mov edx,butimg ;dest
call getimgproc
156,14 → 130,14
mov edx,logoimg ;dest
call getimgproc
mov eax,0 ;x
mov ebx,16 ;y
mov esi,51 ;xs
mov ebx,16 ;y
mov esi,51 ;xs
mov edi,esi ;ys
mov edx,logoinfimg ;dest
mov edx,logoinfimg ;dest
call getimgproc
mov eax,51 ;x
mov esi,8 ;xs
mov edi,9 ;ys
mov eax,51 ;x
mov esi,8 ;xs
mov edi,9 ;ys
mov edx,upsb ;dest
call getimgproc
mov eax,51+8 ;x
171,9 → 145,9
call getimgproc
 
mov eax,51+16 ;x
mov ebx,16 ;y
mov esi,12 ;xs
mov edi,9 ;ys
mov ebx,16 ;y
mov esi,12 ;xs
mov edi,9 ;ys
 
mov ecx,tempimg ;src
mov edx,hdico ;dest
235,7 → 209,7
call read_directory
; call convertation
red:
call draw_window ; at first, draw the window
call draw_window ; at first, draw the window
 
still:
mov eax,9
257,7 → 231,7
mov ebx,1
int 0x40
mov ebx,eax
shr eax,16 ;x
shr eax,16 ;x
and ebx,0xffff ;y
 
mov ebp,eax
271,7 → 245,7
sub ebp,[listy] ;76 ;up scroll
sub ebp,[scrollbutsize]
cmp ebp,0
jl menu_test
jl menu_test
mov [mousey],ebp
 
push eax ebx edx
284,7 → 258,7
mov [filelistsize],eax
mov ebx,eax
cmp ebx,[listsize] ;filelistsize in ebx
ja notusescrl
ja notusescrl
 
mov edx,0
mov eax,[listysize]
313,7 → 287,7
sub ebx,[filelistsize]
cmp eax,ebx
jnae no_cor
mov eax,[listsize] ;correction for full dirs (1000 files)
mov eax,[listsize] ;correction for full dirs (1000 files)
sub eax,[filelistsize]
no_cor:
mov [filecursor],eax
335,7 → 309,7
sub esi,ebp
inc esi ;correction
cmp ebx,esi
ja menu_test ;still
ja menu_test ;still
oks:
 
mov [flick],1
345,7 → 319,7
cmp [pmenu_draw],1 ;if menu is show, update all
jne still
mov [pmenu_draw],0
jmp red ;update all window
jmp red ;update all window
 
;this function not use in dialog when poup menu's is not used
;in dialog's
353,7 → 327,7
;===================
; Test keyboard
;===================
key: ; key
key: ; key
mov eax,2
int 0x40
cmp dword [focus],0
383,19 → 357,19
jmp kfad
no_k_ent:
cmp ah,key_Bspace
je back
je back
cmp ah,key_F2
je viewset
je viewset
cmp ah,key_F3
je textopen
je textopen
cmp ah,key_F5
je copy_to_clip
je copy_to_clip
cmp ah,key_F6
je paste_from_clip
je paste_from_clip
cmp ah,key_F11
je edit_prompt
je edit_prompt
cmp ah,key_F12
je update
je update
jmp still
 
; test input string
423,7 → 397,7
 
mov ecx,[cursor]
cmp ecx,0
je still
je still
dec ecx
mov ebp,[cursor]
lobsp:
449,7 → 423,7
 
mov ebp, [cursor]
cmp ebp,100
ja still
ja still
 
mov byte [path+ebp],ah
inc dword [cursor]
462,12 → 436,12
;Test on mouse button
;-----------------------------
 
button: ; button
button: ; button
mov eax,17
int 0x40
 
cmp ah,2 ;Edit prompt line?
je edit_prompt
cmp ah,2 ;Edit prompt line?
je edit_prompt
 
cmp ah,4
jne no_filelist
477,7 → 451,7
mov ebx,1
int 0x40
mov ebx,eax
shr eax,16 ;x
shr eax,16 ;x
and ebx,0xffff ;y
 
sub ebx,[listy] ;80
485,10 → 459,10
 
mov ecx,[listx]
cmp eax,ecx
jl still
jl still
add ecx,[listxsize]
cmp eax,ecx
jg still
jg still
 
filexadd:
 
518,9 → 492,9
lll2:
mov al,byte [path+esi]
cmp al,byte 0 ;' '; '/'
je fis2
je fis2
cmp al,byte ' '; '/'
je fis2
je fis2
inc esi
cmp esi,100
jna lll2
534,10 → 508,10
inc esi
mov ebp,8
 
los: ;directory extension bug fix
los: ;directory extension bug fix
mov al,[convinfo+edi]
cmp al,' '
jz skip_name_space
jz skip_name_space
mov [path+esi],al
inc esi
skip_name_space:
548,12 → 522,12
cmp byte [convinfo+edi],'.'
jnz dir_name_end
cmp byte [convinfo+edi+1],' '
jz dir_name_end
jz dir_name_end
mov ebp,4
dir_ext_char:
mov al,[convinfo+edi]
cmp al,' '
jz dir_name_end
jz dir_name_end
mov [path+esi],al
inc esi
inc edi
582,17 → 556,17
;Savetest
savetest:
cmp byte [dlg_type],'S'
je savetest_yes
je savetest_yes
jmp still
savetest_yes:
mov ecx,100
savetestloop:
cmp [path+ecx],byte 0
je next_byte
je next_byte
cmp [path+ecx],byte 32
je next_byte
je next_byte
cmp [path+ecx],byte '.'
je openf ;it's file
je openf ;it's file
; cmp [path+ecx],byte '/'
; je no_save ;it's dir
next_byte:
679,7 → 653,7
jmp run
nojv:
cmp eax,'.JPE'
je jpg_jpe
je jpg_jpe
cmp eax,'.GIF'
jne nojv1
mov ebx,gifview
690,11 → 664,6
mov ebx,ac97wav
jmp run
nojv12:
cmp eax,'.MID'
jne nojv13
mov ebx,midamp
jmp run
nojv13:
cmp eax,'.BMP'
jne nobv
mov ebx,bmpview
707,11 → 676,6
jmp run
nopngv:
; //// Willow
cmp eax,'.RTF'
jne nortf
mov ebx,rtfread
jmp run
nortf:
cmp eax,'.ASM'
je edit
cmp eax,'.TXT'
718,6 → 682,8
je edit
cmp eax,'.INC'
je edit
cmp eax,'.DAT'
je edit
jmp still
edit:
mov ebx,editor
763,16 → 729,16
 
no_filelist:
 
cmp ah,5 ;OPEN/SAVE button
je kfad
cmp ah,5 ;OPEN/SAVE button
je kfad
 
cmp ah,6 ;Scroll up
cmp ah,6 ;Scroll up
jne no_scrlup
mov ebx,1
jmp up
no_scrlup:
 
cmp ah,7 ;Scroll down
cmp ah,7 ;Scroll down
jne no_scrldown
mov ebx,1
jmp down
802,7 → 768,7
xfis2:
mov al,byte [path+esi]
cmp al,byte ' '
je xaa2
je xaa2
inc esi
cmp esi,12*20
jnae xfis2
813,7 → 779,7
mul ebx
mov edi,eax
cmp [convinfo+edi+26],dword 'FOL '
je still
je still
mov ecx,12*20
xlopt:
mov al,[path+ecx]
856,7 → 822,7
jmp still
no_view:
 
cmp ah,12 ;move back
cmp ah,12 ;move back
jne no_back
back:
mov esi,12*20
872,7 → 838,7
fis:
mov al,byte [path+esi]
cmp al,byte '/'
je aa
je aa
mov [path+esi],byte 0 ;' '
dec esi
jnz fis
886,9 → 852,9
jmp still
 
no_back:
cmp ah,13 ;string up?
cmp ah,13 ;string up?
jne no_up
mov ebx,1 ;step
mov ebx,1 ;step
up:
mov [downstop],0
sub [filecursor],ebx
898,18 → 864,18
cr_ok:
jmp draw_wd
no_up:
cmp ah,14 ;string down?
cmp ah,14 ;string down?
jne no_dn
mov ebx,1 ;step
mov ebx,1 ;step
down:
cmp [downstop],1
je no_dn
je no_dn
add [filecursor],ebx
jmp draw_wd
no_dn:
 
cmp ah,15
jne no_copyclip ;copy to clipboard
jne no_copyclip ;copy to clipboard
copy_to_clip:
mov ebx,param_area ;clipfilp
mov eax,32
926,7 → 892,7
wfis2:
mov al,byte [path+esi]
cmp al,byte ' '
je waa2
je waa2
inc esi
cmp esi,12*20
jnae wfis2
937,7 → 903,7
mul ebx
mov edi,eax
cmp [convinfo+edi+26],dword 'FOL '
je still
je still
mov ecx,12*20
wlopt:
mov al,[path+ecx]
994,7 → 960,7
zfis2:
mov al,byte [destpath+esi]
cmp al,byte ' '
je zaa2
je zaa2
inc esi
cmp esi,100
jnae zfis2
1007,7 → 973,7
qlll2:
mov al,byte [sourcepath+edi]
cmp al,byte '.'
je qfis2
je qfis2
inc edi
cmp edi,100
jnae qlll2
1019,7 → 985,7
cfname:
mov al,[sourcepath+edi]
cmp al,byte ' '
je dar
je dar
mov [destpath+esi],al
inc esi
dar:
1042,15 → 1008,15
 
cmp [browser],dword 1
jne no_outpath
mov eax,4 ; function 4 : write text to window
mov ebx,10*65536+67 ; [x start] *65536 + [y start]
mov eax,4 ; function 4 : write text to window
mov ebx,10*65536+67 ; [x start] *65536 + [y start]
mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB
mov edx,sourcepath ; pointer to text beginning
mov edx,sourcepath ; pointer to text beginning
mov esi,100 ;12*20 ; text length
int 0x40
mov ebx,250*65536+67 ; [x start] *65536 + [y start]
mov ebx,250*65536+67 ; [x start] *65536 + [y start]
mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB
mov edx,destpath ; pointer to text beginning
mov edx,destpath ; pointer to text beginning
mov esi,100 ;12*20 ; text length
int 0x40
no_outpath:
1063,7 → 1029,7
jmp update ;still
no_clippaste:
 
cmp ah,19 ;Delete from floppy
cmp ah,19 ;Delete from floppy
delete_file:
jne no_delt
cmp dword [path],'/RD/'
1090,8 → 1056,8
jmp update
no_delt:
 
cmp ah,20 ;I - Help
je help_scr
cmp ah,20 ;I - Help
je help_scr
 
cmp ah,22
jne no_headfile
1125,22 → 1091,22
je kfad
 
cmp ah,31
je copy_to_clip ;Copy
je copy_to_clip ;Copy
 
cmp ah,32
je paste_from_clip ;Paste
je paste_from_clip ;Paste
 
cmp ah,33
je delete_file ;Delte
je delete_file ;Delte
 
cmp ah,34
je textopen ;Edit in Tinypad
je textopen ;Edit in Tinypad
 
cmp ah,37
je exit
je exit
 
;VIEW MENU
cmp ah,40 ;Sort by name show del
cmp ah,40 ;Sort by name show del
jne no_sn
; mov dword [viewmode],0
and dword [viewmode],100b
1147,33 → 1113,33
jmp update
no_sn:
 
cmp ah,41 ;Sort by extension show del
cmp ah,41 ;Sort by extension show del
jne no_se
and dword [viewmode],1101b
or dword [viewmode],0001b
or dword [viewmode],0001b
jmp update
no_se:
 
cmp ah,42 ;Sort by size show del
cmp ah,42 ;Sort by size show del
jne no_ss
and dword [viewmode],1110b
or dword [viewmode],0010b
or dword [viewmode],0010b
jmp update
no_ss:
 
cmp ah,43 ;Sort by date show del
cmp ah,43 ;Sort by date show del
jne no_sd
or dword [viewmode],0011b
or dword [viewmode],0011b
jmp update
no_sd:
 
cmp ah,44 ;Show del files
cmp ah,44 ;Show del files
jne no_ds
or dword [viewmode],0100b
or dword [viewmode],0100b
jmp update
no_ds:
 
cmp ah,45 ;Fade del files
cmp ah,45 ;Fade del files
jne no_df
and dword [viewmode],11111011b
jmp update
1180,16 → 1146,16
no_df:
 
;HELP MENU
cmp ah,50 ;Help?
je help_scr
cmp ah,50 ;Help?
je help_scr
 
cmp ah,51 ;Info?
je info_scr
cmp ah,51 ;Info?
je info_scr
 
cmp ah,83
ja no_hd_part
ja no_hd_part
cmp ah,80
jb no_hd_part
jb no_hd_part
mov ecx,0
sub ah,80
inc ah
1200,18 → 1166,18
 
no_hd_part:
 
cmp ah,1 ; test on exit button
je exit
cmp ah,1 ; test on exit button
je exit
 
jmp still
 
exit:
; //// Willow
; mov eax,58
; mov ebx,MRUfile
; mov dword[ebx+8],255
; inc dword[ebx]
; int 0x40
mov eax,58
mov ebx,MRUfile
mov dword[ebx+8],255
inc dword[ebx]
int 0x40
; //// Willow
mov eax,-1
int 0x40
1264,7 → 1230,7
mov ecx,cl_Black
mov edx,ebp ;help_text
 
outlab: ;out labels
outlab: ;out labels
mov eax,4
mov esi,40
helploo:
1333,25 → 1299,25
mov eax,[sc.work_button]
mov [b_color],eax
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,1 ; 1, start of draw
int 0x40
 
;Window
 
xor eax,eax ; function 0 : define and draw window
xor eax,eax ; function 0 : define and draw window
 
cmp [browser],dword 1 ;it's browser
jne nob1
mov ebx,140*65536+400 ; [x start] *65536 + [x size]
mov ecx,160*65536+280 ; [y start] *65536 + [y size]
mov ebx,140*65536+400 ; [x start] *65536 + [x size]
mov ecx,160*65536+280 ; [y start] *65536 + [y size]
jmp isb1
nob1:
mov ebx,140*65536+320 ; [x start] *65536 + [x size]
mov ecx,260*65536+240 ; [y start] *65536 + [y size]
mov ebx,140*65536+320 ; [x start] *65536 + [x size]
mov ecx,260*65536+240 ; [y start] *65536 + [y size]
isb1:
; mov edx,[sc.work] ; color of work area RRGGBB
or edx,0x03ffffff;000000
or edx,0x03ffffff;000000
int 0x40
 
;Get proc info
1362,7 → 1328,7
 
mov eax,[procinfo.x_size]
cmp eax,66
jg temp12345
jg temp12345
ret
temp12345:
 
1397,9 → 1363,9
cmp [browser],dword 1 ;it's browser
jne nob2
 
mov eax,[sc.grab_text] ; color of text RRGGBB
or eax,0x10000000
glabel 8,8,'SYSTEM X-TREE FILE BROWSER',eax
mov eax,[sc.grab_text] ; color of text RRGGBB
or eax,0x10000000
label 8,8,'SYSTEM X-TREE FILE BROWSER',eax
 
;Draw buttons headers
mov eax,8
1406,7 → 1372,7
mov ebx,8*65536+(6*8-1) ;start pos x
mov ecx,23*65536+10 ;start pos y
mov edx,22;+1000000000000000000000000000000b ;spoke butt
mov edi,3 ;draw 13 button's
mov edi,3 ;draw 13 button's
mov esi,0x00339933
int 0x40
dec edi
1422,7 → 1388,7
mov ebx,340*65536+5 ;start pos x
mov ecx,24*65536+8 ;start pos y
mov edx,80;+1000000000000000000000000000000b ;spoke butt
mov edi,4 ;draw 13 button's
mov edi,4 ;draw 13 button's
mov esi,0x00339933
int 0x40
dec edi
1434,10 → 1400,10
jnz nextpbut
 
;DRAW PARTITON TEXT
glabel 341,25,'1234',cl_White;Black
label 341,25,'1234',cl_White;Black
 
;File STRING
glabel 8,25,' FILE VIEW INFO ', ;cl_White ;Black
label 8,25,' FILE VIEW INFO ', ;cl_White ;Black
 
;BlackLine
mov eax,[procinfo.x_size]
1456,20 → 1422,20
 
;Set logo img
setimg 34,88,logoinfimg
glabel 20,165,'SYSTEM X-TREE',cl_Black
label 20,165,'SYSTEM X-TREE',cl_Black
add ebx,10
glabel ,,'FOR MENUETOS',
label ,,'FOR MENUETOS',
 
add ebx,9*65536+20
glabel ,,'welcome to',cl_Green
label ,,'welcome to',cl_Green
add ebx,-15*65536+10
glabel ,,'www.menuetos.org',cl_Green
label ,,'www.menuetos.org',cl_Green
 
; glabel ,,'Create by',cl_Green
; label ,,'Create by',cl_Green
; add ebx,10
; glabel ,,' Pavlushin',
; label ,,' Pavlushin',
; add ebx,10
; glabel ,,' Evgeni',
; label ,,' Evgeni',
 
 
;Draw head->file buttons
1478,7 → 1444,7
mov ebx,8*65536+6*12 ;start pos x
mov ecx,35*65536+10 ;start pos y
mov edx,30 ;spoke butt
mov edi,8 ;draw 4 button's
mov edi,8 ;draw 4 button's
mov esi,cl_Grey
call menubutton
no_drawhf:
1489,7 → 1455,7
mov ebx,(8+6*8)*65536+6*12 ;start pos x
mov ecx,35*65536+10 ;start pos y
mov edx,40 ;spoke butt
mov edi,6 ;draw 4 button's
mov edi,6 ;draw 4 button's
mov esi,cl_Grey
call menubutton
no_drawhv:
1500,7 → 1466,7
mov ebx,(8+12*8)*65536+6*12 ;start pos x
mov ecx,35*65536+10 ;start pos y
mov edx,50 ;spoke butt
mov edi,2 ;draw 2 button's
mov edi,2 ;draw 2 button's
mov esi,cl_Grey
call menubutton
no_drawhi:
1519,7 → 1485,7
mov ecx,29*65536+15 ;start pos y
isb3:
mov edx,8;+1000000000000000000000000000000b ;spoke butt
mov edi,13 ;draw 13 button's
mov edi,13 ;draw 13 button's
mov esi,cl_Grey
int 0x40
dec edi
1556,7 → 1522,7
mov [urlxsize],eax
mov [urlysize],12
 
glabel 20,57,"URL:",cl_Black
label 20,57,"URL:",cl_Black
 
;Out view mode info
mov eax,[viewmode]
1575,9 → 1541,9
jmp isb5
 
head_dlg: db 'OPEN FILE'
db 'SAVE FILE'
db 'SAVE FILE'
but_dlg: db 'OPEN'
db 'SAVE'
db 'SAVE'
 
nob5:
 
1590,18 → 1556,18
mov [urlxsize],eax
mov [urlysize],12
 
cmp byte [dlg_type],'O' ;if byte O - is Open dialog
cmp byte [dlg_type],'O' ;if byte O - is Open dialog
jne no_openh
mov edx,head_dlg ;draw in head OPEN FILE
mov edx,head_dlg ;draw in head OPEN FILE
jmp out_laby
no_openh:
cmp byte [dlg_type],'S' ;if byte S - is Save dialog
cmp byte [dlg_type],'S' ;if byte S - is Save dialog
jne no_saveh
mov edx,head_dlg+9 ;draw in head SAVE FILE
mov edx,head_dlg+9 ;draw in head SAVE FILE
out_laby:
mov ebx,8*65536+8
mov ecx,[sc.grab_text] ; color of text RRGGBB
or ecx,0x10000000
mov ecx,[sc.grab_text] ; color of text RRGGBB
or ecx,0x10000000
mov esi,9
mov eax,4
int 0x40
1632,14 → 1598,14
shl ebx,16
add ebx,eax
 
cmp byte [dlg_type],'O' ;if byte O - is Open dialog
cmp byte [dlg_type],'O' ;if byte O - is Open dialog
jne no_openb
mov edx,but_dlg ;draw in head OPEN FILE
mov edx,but_dlg ;draw in head OPEN FILE
jmp out_labx
no_openb:
cmp byte [dlg_type],'S' ;if byte S - is Save dialog
cmp byte [dlg_type],'S' ;if byte S - is Save dialog
jne no_saveb
mov edx,but_dlg+4 ;draw in head SAVE FILE
mov edx,but_dlg+4 ;draw in head SAVE FILE
out_labx:
mov ecx,cl_White
mov esi,4
1700,7 → 1666,7
int 0x40
 
; OUT TEXT
mov eax,[urlxsize] ;calculating text leight
mov eax,[urlxsize] ;calculating text leight
sub eax,8
mov ebx,6
div ebx
1710,9 → 1676,9
shl ebx,16
add ebx,[urly]
add ebx,3*65536+2
mov eax,4 ; function 4 : write text to window
mov eax,4 ; function 4 : write text to window
mov ecx,0x00000000 ;[sc.grab_text] ; color of text RRGGBB
mov edx,path ; pointer to text beginning
mov edx,path ; pointer to text beginning
int 0x40
 
cmp [flick],2
1752,8 → 1718,8
 
mov edx,0
mov ebx,eax
cmp ebx,[listsize] ;filelistsize in ebx
ja notusescroll
cmp ebx,[listsize] ;filelistsize in ebx
ja notusescroll
;usescroll
mov eax,[listysize]
sub eax,[scrollbutsize]
1785,7 → 1751,7
mov ebx,[listx]
shl ebx,16
add ebx,[listxsize]
sub ebx,15 ;right free zone
sub ebx,15 ;right free zone
sub ebx,[scrollsize]
mov ecx,[listy]
shl ecx,16
1809,7 → 1775,7
mov ecx,[listy]
shl ecx,16
add ecx,[scrollbutsize]
dec ecx ;correction
dec ecx ;correction
mov eax,8
mov edx,6+1000000000000000000000000000000b ;spoke butt
int 0x40
1833,7 → 1799,7
popad
 
 
dec ecx ;correction
dec ecx ;correction
mov edx,7+1000000000000000000000000000000b ;spoke butt
mov eax,[listysize]
sub eax,[scrollbutsize]
1882,7 → 1848,7
mov [filelistsize],eax ;dword 40
 
; OUT FILE DATA
mov eax,[filecursor] ;calc cursor position
mov eax,[filecursor] ;calc cursor position
mov ebx,62
mul ebx
 
1902,13 → 1868,11
mov eax,[edx+8]
;Color set
cmp eax,dword '.TXT' ;text's blue
je itx
je itx
cmp eax,dword '.INC'
je itx
je itx
cmp eax,dword '.ASM'
je itx
cmp eax,dword '.RTF'
je itx
je itx
jmp nt
itx:
mov ecx,0x00446666
1915,21 → 1879,19
jmp cset
nt:
cmp eax,dword '.BMP' ;picture's pure
je ipic
je ipic
cmp eax,dword '.JPG'
je ipic
je ipic
cmp eax,dword '.JPE'
je ipic
je ipic
cmp eax,dword '.GIF'
je ipic
je ipic
; //// Willow
cmp eax,dword '.PNG'
je ipic
je ipic
; //// Willow
cmp eax,dword '.WAV'
je ipic
cmp eax,dword '.MID'
je ipic
je ipic
jmp np
ipic:
mov ecx,0x00226688
1967,30 → 1929,23
push rdico+8
jmp out_ico
no_rdico:
cmp [edx+9],dword 'FLOP'
jne no_fdico
push rdico+8
jmp out_ico
no_fdico:
push folico+8
jmp out_ico
no_folico:
cmp [edx+8],dword '.BMP'
je is_imgico
je is_imgico
cmp [edx+8],dword '.JPG'
je is_imgico
je is_imgico
cmp [edx+8],dword '.JPE'
je is_imgico
je is_imgico
cmp [edx+8],dword '.GIF'
je is_imgico
je is_imgico
; //// Willow
cmp [edx+8],dword '.PNG'
je is_imgico
je is_imgico
; //// Willow
cmp [edx+8],dword '.WAV'
je is_imgico
cmp [edx+8],dword '.MID'
je is_imgico
je is_imgico
jmp no_imgico
is_imgico:
push imgico+8
1997,19 → 1952,16
jmp out_ico
no_imgico:
cmp [edx+8],dword '.ASM'
je is_asmincico
je is_asmincico
cmp [edx+8],dword '.INC'
je is_asmincico
je is_asmincico
jmp no_asmincico
is_asmincico:
push asmincico+8
jmp out_ico
no_asmincico:
cmp [edx+8],dword '.RTF'
je @f
cmp [edx+8],dword '.TXT'
jne no_txtico
@@:
push txtico+8
jmp out_ico
no_txtico:
2046,7 → 1998,7
 
dec [filelistsize]
cmp [filelistsize],dword 0
je extloo
je extloo
 
dec ebp
jnz loo
2072,14 → 2024,14
jmp no_drawhftext
 
file_text_label:
db ' Open '
db ' Copy '
db ' Paste '
db ' Delete '
db ' Tinypad '
db ' Edit '
db ' '
db ' Exit '
db ' Open '
db ' Copy '
db ' Paste '
db ' Delete '
db ' Tinypad '
db ' Edit '
db ' '
db ' Exit '
 
no_drawhftext:
 
2097,12 → 2049,12
jmp no_drawhvtext
 
view_text_label:
db ' Name sort '
db ' Ext. sort '
db ' Size sort '
db ' Date sort '
db ' Show DEL '
db ' Fade DEL '
db ' Name sort '
db ' Ext. sort '
db ' Size sort '
db ' Date sort '
db ' Show DEL '
db ' Fade DEL '
 
no_drawhvtext:
 
2121,8 → 2073,8
jmp no_drawhitext
 
info_text_label:
db ' Help '
db ' About '
db ' Help '
db ' About '
 
no_drawhitext:
 
2133,8 → 2085,8
jmp still
no_flick:
 
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
mov eax,12 ; function 12:tell os about windowdraw
mov ebx,2 ; 2, end of draw
int 0x40
 
ret
2141,8 → 2093,8
 
;FILE LIST PARAMETRS
 
listx dd 15
listy dd 72
listx dd 15
listy dd 72
listxsize dd 350
listysize dd 41
 
2158,8 → 2110,8
 
;URL LINE PARAMETRS
 
urlx dd 10
urly dd 20
urlx dd 10
urly dd 20
urlxsize dd 350
urlysize dd 12
 
2253,7 → 2205,7
;STEP 2 TEST ON HD OR PARTITION
cmp [path],byte '/'
je nstep
mov ecx,61+62*5
mov ecx,61+62
loxhd:
mov al,[hdimg+ecx]
mov [convinfo+ecx],al
2264,53 → 2216,7
nstep:
cmp [path+3],byte '/'
je nstep2
cmp [path+4],byte '/'
je nstep2
cmp [path+1],word 'RD'
jne nostep_RD
mov ecx,61
jmp loxpt
nostep_RD:
cmp [path+1],word 'FD'
jne nostep_FD
mov ecx,61+62
jmp loxpt
nostep_FD:
cmp [path+1],dword 'HD0'
jne nostep_HD0
mov cl,[table_area+2]
movzx ecx,cl
imul ecx,62
dec ecx
jmp loxpt
nostep_HD0:
cmp [path+1],dword 'HD1'
jne nostep_HD1
mov cl,[table_area+3]
movzx ecx,cl
imul ecx,62
dec ecx
jmp loxpt
nostep_HD1:
cmp [path+1],dword 'HD2'
jne nostep_HD2
mov cl,[table_area+4]
movzx ecx,cl
imul ecx,62
dec ecx
jmp loxpt
nostep_HD2:
cmp [path+1],dword 'HD3'
jne nostep_HD3
mov cl,[table_area+5]
movzx ecx,cl
imul ecx,62
dec ecx
jmp loxpt
nostep_HD3:
 
mov ecx,61+62 ;+496
 
loxpt:
mov al,[ptimg+ecx]
mov [convinfo+ecx],al
2350,18 → 2256,18
mov dword [blocksread],ebx ; for quick resorting
 
cmp eax,5
je end_of_dir
je end_of_dir
 
; It's erorr's test is poor code
 
cmp eax,1
jne no_inv_part
glabel 10,10,'Invalid partition or hd base',cl_Red+font_Big
label 10,10,'Invalid partition or hd base',cl_Red+font_Big
jmp end_of_dir
no_inv_part:
cmp eax,3
jne no_unk_fs
glabel 10,10,'Unknow file system',cl_Red+font_Big
label 10,10,'Unknow file system',cl_Red+font_Big
jmp end_of_dir
no_unk_fs:
 
2378,7 → 2284,7
 
mov edi,fileinfo+11
 
pushad ; clear
pushad ; clear
mov al,32
mov ecx,58
sub edi,11
2386,7 → 2292,7
rep stosb
popad
 
mov cl,[esi] ; end of entries ?
mov cl,[esi] ; end of entries ?
cmp cl,6
jnz noib0
 
2399,9 → 2305,9
 
mov cl,[esi+0]
cmp cl,0xe5
je yesdelfil
je yesdelfil
 
mov cl,[esi+11] ; long fat32 name ?
mov cl,[esi+11] ; long fat32 name ?
cmp cl,0xf
jnz noib1
 
2412,13 → 2318,13
 
noib1:
 
mov eax,'DAT ' ; data or .. ?
mov eax,'DAT ' ; data or .. ?
 
mov cl,[esi+0] ; deleted file
mov cl,[esi+0] ; deleted file
cmp cl,0xe5
je yesdelfil
je yesdelfil
cmp cl,0x0
je yesdelfil
je yesdelfil
jmp nodelfil
yesdelfil:
mov eax,'DEL '
2426,9 → 2332,9
 
nodelfil:
 
mov cl,[esi+11] ; folder
mov cl,[esi+11] ; folder
and cl,0x10
jz ffile
jz ffile
mov eax,'FOL '
mov [edi+26],eax
jmp nosize
2435,12 → 2341,12
ffile:
 
; Asko patch for v79
mov cl,[esi+11] ; fold
mov cl,[esi+11] ; fold
and cl,0xf
cmp cl,0xf ; skip long filename
jz novol
test cl,0x8 ; is it fold label?
jz novol ; no
cmp cl,0xf ; skip long filename
jz novol
test cl,0x8 ; is it fold label?
jz novol ; no
mov eax,'Fvol'
mov [edi+26],eax
jmp nosize
2448,7 → 2354,7
 
mov [edi+26],eax
 
pusha ; size
pusha ; size
mov eax,[esi+28]
mov esi,edi
add esi,37
2460,7 → 2366,7
add dl,48
mov [esi],dl
test eax,eax
jz zernum
jz zernum
dec esi
loop newnum
zernum:
2467,11 → 2373,11
popa
nosize:
 
pusha ; date
pusha ; date
mov [edi+17],dword '. .'
 
movzx eax,word [esi+24]
shr eax,9 ; year
shr eax,9 ; year
add eax,1980
mov ecx,4
newdel1:
2485,7 → 2391,7
jnz newdel1
 
movzx eax,word [esi+24]
shr eax,5 ; month
shr eax,5 ; month
and eax,0x0f
mov ecx,2
newdel2:
2514,7 → 2420,7
popa
 
 
pusha ; number
pusha ; number
mov eax,edx
sub eax,4096
neg eax
2523,25 → 2429,25
mov ebx,10
div ebx
add dl,48
mov [edi+43],dl ;0001
mov [edi+43],dl ;0001
xor edx,edx
div ebx
add dl,48
mov [edi+42],dl ;0010
mov [edi+42],dl ;0010
xor edx,edx
div ebx
add al,48
add dl,48
mov [edi+41],dl ;0100
mov [edi+41],dl ;0100
mov [edi+40],byte 0 ;1000
popa
 
mov ecx,8 ; first 8
mov ecx,8 ; first 8
cld
rep movsb
mov [edi],byte '.'
inc edi
mov ecx,3 ; last 3
mov ecx,3 ; last 3
cld
rep movsb
 
2558,25 → 2464,25
 
; Delete del, eoe, f32 and another head-names
cmp [viewmode],3 ;0-3 no outdel
ja del_out
ja del_out
cmp [edx+26],dword 'DEL '
je nextfl
je nextfl
del_out:
cmp [edx+26],dword 'DEL '
jne no_del
cmp [edx],dword 0 ;431 ;435 ;484 +10% speed
je nextfl
je nextfl
no_del:
cmp [edx+26],dword 'EOE '
je nextfl
cmp [edx+26],dword 'F32 ' ;F32 not useles
je nextfl
je nextfl
cmp [edx+26],dword 'F32 ' ;F32 not useles
je nextfl
cmp [edx],dword '. '
je nextfl
je nextfl
cmp [edx],dword '.. '
je nextfl
je nextfl
cmp [edx],dword 'FIRS'
je nextfl
je nextfl
 
; ---------_______-------_______ --------_________-----------
; SORT by name and del deletet files or f32 headers from list
2592,14 → 2498,14
 
ftestname:
cmp byte [fileinfo+11+26],'F'
je F
je F
cmp byte [fileinfo+11+26],'D'
je D
je D
jmp add_element
D: cmp byte [convinfo+esi+26],'D'
je add_element
je add_element
cmp byte [convinfo+esi+26],'F'
je skipfile
je skipfile
jmp add_element
F: cmp byte [convinfo+esi+26],'D'
je writenow
2610,8 → 2516,8
add_element:
mov al,[fileinfo+ebx+11]
cmp al,[convinfo+esi+ebx]
je equal
jb writenow
je equal
jb writenow
skipfile:
add esi,62
mov ebx,[start] ;0
2620,11 → 2526,11
equal:
inc ebx
cmp ebx,[x0]
je writefile
je writefile
cmp ebx,[x1]
je x1p
je x1p
cmp ebx,[x2]
je x2p
je x2p
cmp ebx,[x3]
jae x3p
jmp add_element
2701,57 → 2607,30
 
; DATA AREA
pmenu_draw dd 0 ;if poup menu is draw,update all window
flick dd 0 ;anti flick on ?
drawhf dd 0 ;draw file menu?
drawhv dd 0 ;draw view menu?
drawhi dd 0 ;draw info menu?
flick dd 0 ;anti flick on ?
drawhf dd 0 ;draw file menu?
drawhv dd 0 ;draw view menu?
drawhi dd 0 ;draw info menu?
browser dd 0 ;0-dialog, 1-browser
cursor dd 0 ;cursor in prompt line
focus dd 0 ;prompt edit or window?
cursor dd 0 ;cursor in prompt line
focus dd 0 ;prompt edit or window?
viewmode dd 0 ;folder sort & not del
downstop dd 0
filecursor dd 0
mousex dd 0
mousey dd 0
mousex dd 0
mousey dd 0
blocksread dd 0
listsize dd 0 ;num of files in directory
temp dd 0
temp dd 0
readblock dd 1
dlg_type db 0 ;S-save O-open
 
hdimg1 db 'HD0 HARDDISK FOL '
hdimg2 db 'HD1 HARDDISK FOL '
hdimg3 db 'HD2 HARDDISK FOL '
hdimg4 db 'HD3 HARDDISK FOL '
;01234567890123456789012345678901234567890123456789012345678912
hdimg db 'HD HARDDISK FOL '
db 'RD RAMDISK FOL '
 
;01234567890123456789012345678901234567890123456789012345678912
hdimg db 'RD RAMDISK FOL '
db 'FD FLOPPYDISK FOL '
db ' '
db ' '
db ' '
db ' '
 
ptimg db '1 FIRST PARTITION FOL '
db '2 SECOND PARTITION FOL '
db '3 NEXT PARTITION FOL '
db '4 NEXT PARTITION FOL '
db '5 NEXT PARTITION FOL '
db '6 NEXT PARTITION FOL '
db '7 NEXT PARTITION FOL '
db '8 NEXT PARTITION FOL '
db '9 NEXT PARTITION FOL '
db '10 NEXT PARTITION FOL '
db '11 NEXT PARTITION FOL '
db '12 NEXT PARTITION FOL '
db '13 NEXT PARTITION FOL '
db '14 NEXT PARTITION FOL '
db '15 NEXT PARTITION FOL '
db '16 NEXT PARTITION FOL '
db '17 NEXT PARTITION FOL '
db '18 NEXT PARTITION FOL '
db '19 NEXT PARTITION FOL '
db '20 NEXT PARTITION FOL '
 
modetext:
;0123456789012345
2764,31 → 2643,29
db 'DEL SORT SIZE 6' ;type sort
db 'DEL SORT DATE 7'
 
dirlen dd 0x1
dirlen dd 0x1
b_color dd 0x6677cc
 
; //// Willow
;MRUfile:
; dd 0x0
; dd 0x0
; dd 0x1
; dd path
; dd tempzone
; db '/RD/1/MRU.LST',0
MRUfile:
dd 0x0
dd 0x0
dd 0x1
dd path
dd tempzone
db '/RD/1/MRU.LST',0
; //// Willow
 
;Name of programs
editor db 'TINYPAD '
editor db 'TINYPAD '
bmpview db 'MV '
jpgview db 'JPEGVIEW '
gifview db 'GIFVIEW '
ac97wav db 'AC97WAV '
copyrfile db 'COPYR '
rtfread db 'RTFREAD '
; //// Willow
pngview db '@RCHER '
; //// Willow
midamp db 'MIDAMP '
 
fileinfo_start:
dd 16
2797,34 → 2674,30
dd 0
dd tempzone ;0x10000
open_path:
times 256 db 0 ;run app path
times 256 db 0 ;run app path
 
fileinfoblock:
dd 0x0 ; read
dd 0x0 ; first block
dd 0x1 ; number of blocks to read
dd 0x0 ; read
dd 0x0 ; first block
dd 0x1 ; number of blocks to read
farea:
dd outinfo ; ret offset
dd tempzone ; work size of sytemram
dd outinfo ; ret offset
dd tempzone ; work size of sytemram
path:
times 256 db 0 ;path
 
table_area:
rb 10
 
times 256 db 0 ;path
;rb 256
but_file:
file 'systr12.GIF'
butimg:
rb 400*16*3+8 ;buttons (left pice of picture)
rb 400*16*3+8 ;buttons (left pice of picture)
logoimg:
rb 70*16*3+8 ;logo (right pice of picture)
rb 70*16*3+8 ;logo (right pice of picture)
logoinfimg:
rb 60*60*3+8 ;logoinfo (right pice of picture)
rb 60*60*3+8 ;logoinfo (right pice of picture)
upsb:
rb 8*9*3+8 ;up scroll button
rb 8*9*3+8 ;up scroll button
dnsb:
rb 8*9*3+8 ;down scroll button
rb 8*9*3+8 ;down scroll button
 
;ICONS RESERVE AREA
hdico:
2846,8 → 2719,8
execico:
rb 12*9*3+8
 
tempimg: ;reserve ram for images
rb 400*100*3+8 ;for picture
tempimg: ;reserve ram for images
rb 400*100*3+8 ;for picture
rb 8000
 
gif_hash: