Subversion Repositories Kolibri OS

Compare Revisions

No changes between revisions

Regard whitespace Rev 133 → Rev 134

/kernel/branches/gfx_kernel/boot/bootcode.inc
152,6 → 152,26
loop @b
ret
 
boot_read_floppy:
push si
xor si, si
mov ah, 2 ; read
@@:
push ax
int 0x13
pop ax
jnc @f
inc si
cmp si, 10
jb @b
mov si, badsect-0x10000
sayerr_plain:
call printplain
jmp $
@@:
pop si
ret
 
org $+0x10000
 
; table for move to extended memory (int 15h, ah=87h)
824,73 → 844,195
xor ax, ax ; reset drive
xor dx, dx
int 0x13
; now load floppy image to memory
; at first load boot sector and first FAT table
mov cx,0x0001 ; startcyl,startsector
xor dx, dx ; starthead,drive
push word 80*2 ; read no of sect
reads:
pusha
xor si,si
newread:
mov bx,0xa000 ; es:bx -> data area
mov ax,0x0200+18 ; read, no of sectors to read
int 0x13
test ah, ah
jz goodread
inc si
cmp si,10
jnz newread
mov si,badsect-0x10000
sayerr_plain:
call printplain
jmp $
goodread:
; move -> 1mb
mov al, 1+9 ; no of sectors to read
mov bx, 0xB000 ; es:bx -> data area
call boot_read_floppy
; and copy them to extended memory
mov si,movedesc-0x10000
mov [si+8*2+3], bh
push es
push ds
pop es
mov cx,256*18
mov cx, 256*10
mov ah,0x87
int 0x15
pop es
 
test ah,ah ; was the move successfull ?
je goodmove
mov dx,0x3f2 ; floppy motor off
test ah, ah
jz @f
sayerr_floppy:
mov dx, 0x3f2
mov al,0
out dx,al
mov si,memmovefailed-0x10000
jmp sayerr_plain
goodmove:
 
add dword [movedesc-0x10000+0x18+2], 512*18
@@:
add dword [si+8*3+2], 512*10
; copy FAT to second copy
mov byte [si+8*2+3], 0xB2
mov cx, 256*9
mov ah, 0x87
int 0x15
pop es
test ah, ah
jnz sayerr_floppy
add dword [si+8*3+2], 512*9
; calculate total number of sectors to read
mov ax, 1+9+14 ; boot+FAT+root
mov di, 0xB203
.calc_loop:
test word [es:di], 0xFFF
jz @f
inc ax
@@:
test word [es:di+1], 0xFFF0
jz @f
inc ax
@@:
add di, 3
cmp di, 0xB200+1440*3
jb .calc_loop
push ax
mov bp, 1+9 ; already read sectors
; now read rest
mov byte [si+8*2+3], 0xA0
mov di, 2-14 ; absolute sector-31
mov cx, 0x0002 ; cylinder=0, sector=2
mov dx, 0x0100 ; head=1, disk=0
.read_loop:
; determine whether sector must be read
cmp di, 2
jl .read
mov bx, di
shr bx, 1
jnc .even
test word [es:bx+di+0xB200], 0xFFF0
jmp @f
.even:
test word [es:bx+di+0xB200], 0xFFF
@@:
jz .skip
.read:
mov bx, 0xA000
mov al, 1 ; 1 sector
call boot_read_floppy
inc bp
push es
push ds
pop es
pusha
mov cx, 256
mov ah, 0x87
int 0x15
test ah, ah
popa
pop es
jnz sayerr_floppy
.skip:
add dword [si+8*3+2], 512
inc cx
cmp cl, 19
jnz @f
mov cl, 1
inc dh
cmp dh,2
jnz bb2
jnz @f
mov dh,0
inc ch
pusha ; print prosentage
@@:
pop ax
push ax
pusha
; draw percentage
; total sectors: ax
; read sectors: bp
xchg ax, bp
mov cx, 100
mul cx
div bp
aam
xchg al, ah
add ax, '00'
mov si,pros-0x10000
shr ch, 2
mov al, '5'
test ch, 1
jnz @f
mov al, '0'
cmp [si], ax
jz @f
mov [si], ax
call printplain
@@:
mov [si+1], al
shr ch, 1
add ch, '0'
mov [si], ch
call printplain
popa
bb2:
pop ax
dec ax
push ax
jnz reads
readdone:
pop ax
inc di
cmp di, 2880-31
jnz .read_loop
 
; mov cx,0x0001 ; startcyl,startsector
; xor dx, dx ; starthead,drive
; push word 80*2 ; read no of sect
; reads:
; pusha
; xor si,si
; newread:
; mov bx,0xa000 ; es:bx -> data area
; mov ax,0x0200+18 ; read, no of sectors to read
; int 0x13
; test ah, ah
; jz goodread
; inc si
; cmp si,10
; jnz newread
; mov si,badsect-0x10000
;sayerr_plain:
; call printplain
; jmp $
; goodread:
; ; move -> 1mb
; mov si,movedesc-0x10000
; push es
; push ds
; pop es
; mov cx,256*18
; mov ah,0x87
; int 0x15
; pop es
;
; test ah,ah ; was the move successfull ?
; je goodmove
; mov dx,0x3f2 ; floppy motor off
; mov al,0
; out dx,al
; mov si,memmovefailed-0x10000
; jmp sayerr_plain
; goodmove:
;
; add dword [movedesc-0x10000+0x18+2], 512*18
; popa
; inc dh
; cmp dh,2
; jnz bb2
; mov dh,0
; inc ch
; pusha ; print prosentage
; mov si,pros-0x10000
; shr ch, 2
; mov al, '5'
; test ch, 1
; jnz @f
; mov al, '0'
;@@:
; mov [si+1], al
; shr ch, 1
; add ch, '0'
; mov [si], ch
; call printplain
; popa
; bb2:
; pop ax
; dec ax
; push ax
; jnz reads
; readdone:
; pop ax
mov si,backspace2-0x10000
call printplain
mov si,okt-0x10000
/kernel/branches/gfx_kernel/boot/booteng.inc
62,7 → 62,8
.mem db "??? Mbytes)",13,10,0
gr_mode db "Select mode: ",13,10,0
s_bpp db 13,10,186," Bits per pixel: "
.bpp dw "??",13,10,13,10,0
.bpp dw "??"
db 13,10,0
vrrmprint db "Apply VRR? (picture frequency greater than 60Hz"
db " only for transfers:",13,10
db 186," 1024*768->800*600 and 800*600->640*480) [1-yes,2-no]:",0
/kernel/branches/gfx_kernel/boot/bootru.inc
24,10 → 24,10
times 78 db 32
db 186
}
 
d80x25_top:
line_full_top
space_msg: line_space
verstr:
verstr2:
; line_space
; version string
db 186,32
38,12 → 38,14
end if
db a
end repeat
repeat 78 - ($-verstr)
repeat 78 - ($-verstr2)
db ' '
end repeat
db 32,186
verstr:
line_half
d80x25_top_num = 4
space_msg: line_space
d80x25_top_num = 3
d80x25_bottom:
db 186,' Kolibri OS ®á­®¢ ­  ­  Menuet OS ¨ ­¥ ¯à¥¤®áâ ¢«ï¥â '
db '­¨ª ª¨å £ àa­â¨©. ',186
52,43 → 54,26
line_full_bottom
d80x25_bottom_num = 3
 
msg_apm db " APM x.x ",0
 
novesa db "‚¨¤¥®ª àâ : EGA/CGA",13,10,0
vervesa db "‚¥àá¨ï VESA: Vesa x.x",13,10,0
vervesa_off=19
gr_mode db 186," Vesa 2.0+ 16 M LFB: [1] 640x480, [2] 800x600, "
db "[3] 1024x768, [4] 1280x1024",13,10
db 186," Vesa 1.2 16 M Bnk: [5] 640x480, [6] 800x600, "
db "[7] 1024x768, [8] 1280x1024",13,10
db 186," EGA/CGA 256 –¢¥â®¢: [9] 320x200, "
db "VGA 16 –¢¥â®¢: [0] 640x480",13,10
db 186," ‚ë¡¥à¨â¥ ¢¨¤¥®à¥¦¨¬: ",0
bt24 db "ƒ«ã¡¨­  梥â : 24",13,10,0
bt32 db "ƒ«ã¡¨­  梥â : 32",13,10,0
s_vesa db "‚¥àá¨ï VESA: "
.ver db "?.? ("
.mem db "??? Œ¡)",13,10,0
gr_mode db "‚ë¡¥à¨â¥ ¢¨¤¥®à¥¦¨¬: ",13,10,0
s_bpp db 13,10,186," ƒ«ã¡¨­  梥â : "
.bpp dw "??"
db 13,10,0
vrrmprint db "ˆá¯®«ì§®¢ âì VRR? (ç áâ®â  ª ¤à®¢ ¢ëè¥ 60 ƒæ"
db " ⮫쪮 ¤«ï ¯¥à¥å®¤®¢:",13,10
db 186," 1024*768>800*600 ¨ 800*600>640*480) [1-¤ , 2-­¥â]: ",0
;askmouse db "Œëèì:" ; 186, " "
; db " [1] PS/2 (USB), [2] Com1, [3] Com2."
; db " ‚ë¡¥à¨â¥ ¯®àâ [1-3]: ",0
;no_com1 db 13,10,186," No COM1 mouse",0
;no_com2 db 13,10,186," No COM2 mouse",0
gr_acc db "Vesa 2.0+: ‚ª«îç¨âì MTRR ¤«ï ã᪮७¨ï £à ä¨ª¨? "
db "[1-¤ /2-­¥â]: ",0
;gr_direct db 186," ˆá¯®«ì§®¢ âì «¨­¥©­ë© ¢¨¤¥®¡ãä¥à? "
; db "[1-¤ /2-­¥â]: ",0
;mem_model db 13,10,186," Ž¡ê+¬ ¯ ¬ï⨠[1-16 Mb / 2-32 Mb / "
; db "3-64Mb / 4-128 Mb / 5-256 Mb]: ",0
;bootlog db 13,10,186," à®á¬®âà¥âì ¦ãà­ « § £à㧪¨? [1-­¥â/2-¤ ]: ",0
bdev db "‡ £à㧨âì ®¡à § ¨§ [1-¤¨áª¥â ; 2-C:\menuet.img (FAT32);"
db 13,10,186," "
db "3-¨á¯®«ì§®¢ âì 㦥 § £à㦥­­ë© ®¡à §]: ",0
probetext db 13,10,13,10,186," ‘â ­¤ àâ­ë© ¢¨¤¥®à¥¦¨¬? [1-¤ , "
db "2-¯à®¢¥à¨âì ¤à㣨¥ (Vesa 3.0)]: ",0
;memokz256 db 13,10,186," RAM 256 Mb",0
;memokz128 db 13,10,186," RAM 128 Mb",0
;memokz64 db 13,10,186," RAM 64 Mb",0
;memokz32 db 13,10,186," RAM 32 Mb",0
;memokz16 db 13,10,186," RAM 16 Mb",0
prnotfnd db "Žè¨¡ª  - ‚¨¤¥®à¥¦¨¬ ­¥ ­ ©¤¥­.",0
;modena db "Žè¨¡ª  - ’ॡã¥âáï ¯®¤¤¥à¦ª  VBE 0x112+.",0
not386 db "Žè¨¡ª  - ’ॡã¥âáï ¯à®æ¥áá®à 386+.",0
131,3 → 116,33
loading_msg db "ˆ¤ñâ § £à㧪  KolibriOS...",0
save_quest db "‡ ¯®¬­¨âì ⥪ã騥 ­ áâனª¨? [y/n]: ",0
loader_block_error db "Žè¨¡ª  ¢ ¤ ­­ëå ­ ç «ì­®£® § £àã§ç¨ª , ¯à®¤®«¦¥­¨¥ ­¥¢®§¬®¦­®.",0
 
_oem db 'oem: ',0
 
db 5
s_ven_intel db 'Intel'
db 2
s_ven_s3 db 'S3'
;db 5
;s_ven_bochs db 'Bochs'
;db 8
;s_ven_vmware db 'V M ware'
 
s_mode db " ????-????-?? (?) ",0
s_mode1 db " 0640-0480-04 (a) 0320-0200-08 (b) ",13,10,0
 
;_tl db 'ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄ¿',13,10,\
; '³ à §à¥è¥­¨¥ ³ 4 ³ 8 ³ 15 ³ 16 ³ 24 ³ 32 ³',13,10,\
; 'ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄ´',13,10,0
;_rs db '³ ????x???? ³ - ³ - ³ - ³ - ³ - ³ - ³',13,10,0
;_bt db 'ÀÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÙ',13,10,0
 
_tl db 186,' ÚÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄÂÄÄÄÄÄ¿',13,10,\
186,' ³ 4 ³ 8 ³ 15 ³ 16 ³ 24 ³ 32 ³',13,10,\
186,' ÚÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄÄÄÄÄÅÄ¿',13,10,0
_rs db 186,' ³ ????x???? ³ ? ³ ? ³ ? ³ ? ³ ? ³ ? ³Û³',13,10,0
_bt db 186,' ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÄÄÄÄÁÄÙ',13,10,0
 
 
_sel1 db 0x1A,0
_sel2 db 0x1B,0
/kernel/trunk/boot/bootcode.inc
150,6 → 150,26
loop @b
ret
 
boot_read_floppy:
push si
xor si, si
mov ah, 2 ; read
@@:
push ax
int 0x13
pop ax
jnc @f
inc si
cmp si, 10
jb @b
mov si, badsect-0x10000
sayerr_plain:
call printplain
jmp $
@@:
pop si
ret
 
; 16-bit data
; videomodes table
org $+0x10000
210,6 → 230,7
mov ax, 3
int 0x10
 
if lang eq ru
; Load & set russian VGA font (RU.INC)
mov bp,RU_FNT1-10000h ; RU_FNT1 - First part
mov bx,1000h ; 768 bytes
225,6 → 246,7
mov ax,1100h
int 10h
; End set VGA russian font
end if
 
; draw frames
push 0xb800
960,73 → 982,195
xor ax, ax ; reset drive
xor dx, dx
int 0x13
; now load floppy image to memory
; at first load boot sector and first FAT table
mov cx,0x0001 ; startcyl,startsector
xor dx, dx ; starthead,drive
push word 80*2 ; read no of sect
reads:
pusha
xor si,si
newread:
mov bx,0xa000 ; es:bx -> data area
mov ax,0x0200+18 ; read, no of sectors to read
int 0x13
test ah, ah
jz goodread
inc si
cmp si,10
jnz newread
mov si,badsect-0x10000
sayerr_plain:
call printplain
jmp $
goodread:
; move -> 1mb
mov al, 1+9 ; no of sectors to read
mov bx, 0xB000 ; es:bx -> data area
call boot_read_floppy
; and copy them to extended memory
mov si,movedesc-0x10000
mov [si+8*2+3], bh
push es
push ds
pop es
mov cx,256*18
mov cx, 256*10
mov ah,0x87
int 0x15
pop es
 
test ah,ah ; was the move successfull ?
je goodmove
mov dx,0x3f2 ; floppy motor off
test ah, ah
jz @f
sayerr_floppy:
mov dx, 0x3f2
mov al,0
out dx,al
mov si,memmovefailed-0x10000
jmp sayerr_plain
goodmove:
 
add dword [movedesc-0x10000+0x18+2], 512*18
@@:
add dword [si+8*3+2], 512*10
; copy FAT to second copy
mov byte [si+8*2+3], 0xB2
mov cx, 256*9
mov ah, 0x87
int 0x15
pop es
test ah, ah
jnz sayerr_floppy
add dword [si+8*3+2], 512*9
; calculate total number of sectors to read
mov ax, 1+9+14 ; boot+FAT+root
mov di, 0xB203
.calc_loop:
test word [es:di], 0xFFF
jz @f
inc ax
@@:
test word [es:di+1], 0xFFF0
jz @f
inc ax
@@:
add di, 3
cmp di, 0xB200+1440*3
jb .calc_loop
push ax
mov bp, 1+9 ; already read sectors
; now read rest
mov byte [si+8*2+3], 0xA0
mov di, 2-14 ; absolute sector-31
mov cx, 0x0002 ; cylinder=0, sector=2
mov dx, 0x0100 ; head=1, disk=0
.read_loop:
; determine whether sector must be read
cmp di, 2
jl .read
mov bx, di
shr bx, 1
jnc .even
test word [es:bx+di+0xB200], 0xFFF0
jmp @f
.even:
test word [es:bx+di+0xB200], 0xFFF
@@:
jz .skip
.read:
mov bx, 0xA000
mov al, 1 ; 1 sector
call boot_read_floppy
inc bp
push es
push ds
pop es
pusha
mov cx, 256
mov ah, 0x87
int 0x15
test ah, ah
popa
pop es
jnz sayerr_floppy
.skip:
add dword [si+8*3+2], 512
inc cx
cmp cl, 19
jnz @f
mov cl, 1
inc dh
cmp dh,2
jnz bb2
jnz @f
mov dh,0
inc ch
pusha ; print prosentage
@@:
pop ax
push ax
pusha
; draw percentage
; total sectors: ax
; read sectors: bp
xchg ax, bp
mov cx, 100
mul cx
div bp
aam
xchg al, ah
add ax, '00'
mov si,pros-0x10000
shr ch, 2
mov al, '5'
test ch, 1
jnz @f
mov al, '0'
cmp [si], ax
jz @f
mov [si], ax
call printplain
@@:
mov [si+1], al
shr ch, 1
add ch, '0'
mov [si], ch
call printplain
popa
bb2:
pop ax
dec ax
push ax
jnz reads
readdone:
pop ax
inc di
cmp di, 2880-31
jnz .read_loop
 
; mov cx, 0x0001 ; startcyl,startsector
; xor dx, dx ; starthead,drive
; push word 80*2 ; read no of sect
; reads:
; pusha
; xor si,si
; newread:
; mov bx,0xa000 ; es:bx -> data area
; mov ax,0x0200+18 ; read, no of sectors to read
; int 0x13
; test ah, ah
; jz goodread
; inc si
; cmp si,10
; jnz newread
; mov si,badsect-0x10000
;sayerr_plain:
; call printplain
; jmp $
; goodread:
; ; move -> 1mb
; mov si,movedesc-0x10000
; push es
; push ds
; pop es
; mov cx,256*18
; mov ah,0x87
; int 0x15
; pop es
;
; test ah,ah ; was the move successfull ?
; je goodmove
; mov dx,0x3f2 ; floppy motor off
; mov al,0
; out dx,al
; mov si,memmovefailed-0x10000
; jmp sayerr_plain
; goodmove:
;
; add dword [movedesc-0x10000+0x18+2], 512*18
; popa
; inc dh
; cmp dh,2
; jnz bb2
; mov dh,0
; inc ch
; pusha ; print prosentage
; mov si,pros-0x10000
; shr ch, 2
; mov al, '5'
; test ch, 1
; jnz @f
; mov al, '0'
;@@:
; mov [si+1], al
; shr ch, 1
; add ch, '0'
; mov [si], ch
; call printplain
; popa
; bb2:
; pop ax
; dec ax
; push ax
; jnz reads
; readdone:
; pop ax
mov si,backspace2-0x10000
call printplain
mov si,okt-0x10000
/programs/fs/copyr/trunk/ascl.inc
1,5 → 1,3
lang equ ru ; ru en fr ge fi
 
;
; Assembler
; SMALL
/programs/fs/copyr/trunk/copyr.asm
19,7 → 19,7
dd 0x01 ; header version
dd START ; start of code
dd I_END ; size of image
dd 0x20000 ; memory for app
dd 0x10000 ; memory for app
dd 0x10000 ; esp
dd param_area , 0x0 ; I_Param , I_Icon
 
27,50 → 27,31
include 'macros.inc' ; very useful stuff for MeOS
include 'ascl.inc'
 
STRLEN = 48 ; maximal length of filename
 
 
START: ; start of execution
 
;  à ¬¥âàë:
; ®â 0 ¤® 100 ¯ãâì ª ¨áâ®ç­¨ªã
; ®â 100 ¤® 200 ¯ãâì ª ¯à¨¥¬­¨ªã
;
; db n1 = ¤«¨­  ¯ã⨠ª ¨áâ®ç­¨ªã
; times n1 db ? = ¯ãâì ª ¨áâ®ç­¨ªã
; db n2 = ¤«¨­  ¯ã⨠ª ¯à¨ñ¬­¨ªã
; times n2 db ? = ¯ãâì ª ¯à¨ñ¬­¨ªã
; db 0
 
;get param
mov eax,15
cmp byte [param_area],0
je err_exit ;source not found
mov eax,16
cmp byte [param_area+100],0
je err_exit ;dest not found
lea esi, [param_area+1]
movzx ecx, byte [esi-1]
jecxz err_exit
mov edi, source
rep movsb
mov byte [edi], 0
inc eax
movzx ecx, byte [esi]
inc esi
jecxz err_exit
mov edi, destination
rep movsb
mov byte [edi], 0
 
mov ecx,199
cdf:
mov al,[param_area+ecx]
cmp al,byte 32
jne nor
mov al,byte 0
nor:
mov al,[param_area+ecx]
dec ecx
jns cdf
 
mov ecx,STRLEN - 4
copysp:
mov al,[param_area+ecx]
mov [source+ecx],al
dec ecx
jns copysp
mov [source+42],byte 0
 
mov ecx,STRLEN - 4
copydp:
mov al,[param_area+ecx+100]
mov [destination+ecx],al
dec ecx
jns copydp
mov [destination+42],byte 0
 
call draw_window
call copy_file
 
90,19 → 71,16
push eax
call draw_window
pop eax
jmp copy_error
; jmp copy_error
 
; print message now
copy_error:
mov ebp,43
mul ebp
mov ebp,eax
imul ebp, eax, 43
 
mov eax,4
mov ebx,20*65536+70
mov ecx,0x10ff0000
mov edx,errors ;*8]
add edx,ebp
lea edx,[errors+ebp]
mov esi,43 ;[errors+edi*8+4]
int 0x40
jmp dexit
122,9 → 100,9
;====================================================
copy_file:
; at first we must get the size of the source file
mov [source_info.blocks],1 ; load only 512 bytes
mov eax,58
mov ebx,source_info
mov dword [source_attr+32], 0
mov eax, 70
mov ebx, source_attr_info
int 0x40
 
; now eax contains error code
141,9 → 119,9
.ok_getsize:
 
; allocate memory
mov ebx,[source_attr+32]
push ebx ; save file size
mov ecx,ebx
add ecx,0x20000 ; size of memory needed = 0x20000+filesize
lea ecx,[ebx+0x10000] ; size of memory needed = 0x10000+filesize
mov eax,64 ; func 64
mov ebx,1 ; resize application memory
int 0x40
157,18 → 135,16
.ok_memory:
 
; save number of blocks to source_info
shr ebx,9 ; divide by 512
inc ebx ; blocks++
mov [source_info.blocks],ebx
mov [source_info.bytes], ebx
; read the source file
mov eax,58
mov eax,70
mov ebx,source_info
int 0x40
 
; ebx = file size
; ebx = number of read bytes = file size
; save loaded file
mov [dest_info.bytes2write],ebx ; file size in bytes
mov eax,58
mov [dest_info.bytes],ebx ; file size in bytes
mov eax,70
mov ebx,dest_info
int 0x40
 
185,32 → 161,13
; return to the initial amount of memory
mov eax,64
mov ebx,1
mov ecx,0x20000
mov ecx,0x10000
int 0x40
 
xor eax,eax ; eax = message number (0-OK)
jmp copy_error
 
; print strings (source & destination)
print_text:
mov eax,13
mov ebx,107*65536+STRLEN*6
mov ecx,[ya]
shl ecx,16
add ecx,9
mov edx,0xf2f2f2
int 0x40
 
mov eax,4
mov ebx,109*65536
add ebx,[ya]
xor ecx,ecx
mov edx,[addr]
mov esi,STRLEN
int 0x40
 
ret
 
 
; *********************************************
; ******* WINDOW DEFINITIONS AND DRAW ********
; *********************************************
251,23 → 208,23
 
mov esi,source
mov edi,text+14
mov ecx,STRLEN
mov ecx,47
rep movsb
 
mov esi,destination
mov edi,text+STRLEN+59-45+14
mov ecx,STRLEN
mov edi,text+62+14
mov ecx,47
rep movsb
 
mov ebx,25*65536+36 ; print filenames
xor ecx,ecx
mov edx,text
mov esi,STRLEN+59-45
mov esi,62
newline:
mov eax,4
int 0x40
add ebx,16
add edx,STRLEN+59-45
add edx,62
cmp [edx],byte 'x'
jnz newline
 
279,36 → 236,13
 
 
; DATA AREA
align 4
 
param_area:
times 256 db 0
 
source_info: ; SOURCE FILEINFO
.mode dd 0 ; read file
.start_block dd 0x0 ; block to read
.blocks dd 0x700 ; num of blocks
.address dd 0x20000
.workarea dd 0x10000
source:
times (STRLEN) db 32
db 0
 
dest_info: ; DESTINATION FILEINFO
.mode dd 1 ; write
.notused dd 0x0 ; not used
.bytes2write dd 0 ; bytes to write
.address dd 0x20000
.workarea dd 0x10000
destination:
times (STRLEN) db 32
db 0
 
align 4
addr dd 0x0
ya dd 0x0
temp dd 0
 
if lang eq ru
text:
db ' Ž’Š“„€: |®áá¨ï, ‘¥«ï⨭®, ŒŠ Œ®áª¢  , 1 Šãàá '
db ' Š“„€: |  ¢«î設 …¢£¥­¨©, waptap@mail.ru '
315,7 → 249,7
db ' '
db 'x' ; <- END MARKER, DONT DELETE
labelt:
db 'ŠŽˆŽ‚€ˆ… ”€‰‹€'
db 'ŠŽˆŽ‚€ˆ… ”€‰‹€'
labellen:
 
errors:
336,6 → 270,70
db "(§ ¯¨áì) ­¥¨§¢¥áâ­ ï ®è¨¡ª  "
db "ãâì ª ¨áâ®ç­¨ªã ¨ ¯à¨¥¬­¨ªã ­¥ 㪠§ ­ë!!! "
db "ãâì ª ¯à¨¥¬­¨ªã ­¥ 㪠§ ­!!! "
else
text:
db 'SOURCE: | '
db 'DESTINATION: | '
db ' '
db 'x' ; <- END MARKER, DONT DELETE
labelt:
db 'SYSTREE FILE COPIER'
labellen:
 
errors:
db "Success! "
db "(read) no hd base or partition defined "
db "(read) unsupported file system "
db "(read) unknown file system "
db "(read) hd partition not defined "
db "out of memory "
db "(read) end of file "
db "(read) unknown error "
db "(write) no hd base or partition defined "
db "(write) unsupported file system "
db "(write) unknown file system "
db "(write) hd partition not defined "
db "oh shit! "
db "(write) file not found "
db "(write) unknown error "
db "Path to source is not given!!! "
db "Path to destination is not given!!! "
end if
 
;0123456789012345678901234567890123456789012
I_END:
 
source_attr_info:
dd 5
dd 0
dd 0
dd 0
dd source_attr
db 0
dd source
 
source_info:
dd 0
dd 0 ; start from 1st byte
dd 0
.bytes dd ?
dd 0x10000
db 0
dd source
 
dest_info: ; DESTINATION FILEINFO
dd 2
dd 0
dd 0
.bytes dd ?
dd 0x10000
 
I_END:
 
destination:
rb 256
source:
rb 256
source_attr:
rb 40
 
param_area rb 256
/programs/fs/sysxtree/trunk/ascl.inc
186,9 → 186,9
cld
;; mov esi,path
mov edi,path
mov eax,0
mov ecx,200
rep stosb
xor eax,eax
mov ecx,(1024+16)/4
rep stosd
 
;mov [get_loops],0
mov [dlg_pid_get],0
230,7 → 230,7
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
mov edx,1024+16 ; size
int 0x40
 
; change wanted events list 7-bit IPC event
242,7 → 242,7
; STEP 3 run SYSTEM XTREE with parameters
;
 
mov eax,58
mov eax,70
mov ebx,run_fileinfo
int 0x40
 
253,16 → 253,15
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
 
cmp eax,1
je mred
cmp eax,2
je mkey
cmp eax,3
je mbutton
cmp eax,7
je mgetmes
 
; Get number of procces
mov ebx,procinfo
mov ecx,-1
348,14 → 347,14
ready:
;
; The second message get
; Second message is 100 bytes path to SAVE/OPEN file
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,200
rep movsb
mov ecx,1024/4
rep movsd
mov [edi],byte 0
 
jmp openoff
371,11 → 370,11
dd 0,0 ; Type of dialog
 
run_fileinfo:
dd 16
dd 7
dd 0
dd param
dd 0
dd procinfo ; 0x10000
dd 0
;run_filepath
db '/RD/1/SYSXTREE',0
 
398,9 → 397,9
cld
;; mov esi,path
mov edi,path
mov eax,0
mov ecx,200
rep stosb
xor eax,eax
mov ecx,(1024+16)/4
rep stosd
 
;mov [get_loops],0
mov [dlg_pid_get],0
442,7 → 441,7
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
mov edx,1024+16 ; size
int 0x40
 
; change wanted events list 7-bit IPC event
454,7 → 453,7
; STEP 3 run SYSTEM XTREE with parameters
;
 
mov eax,58
mov eax,70
mov ebx,run_fileinfo
int 0x40
 
465,16 → 464,15
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
 
cmp eax,1
je mred
cmp eax,2
je mkey
cmp eax,3
je mbutton
cmp eax,7
je mgetmes
 
; Get number of procces
mov ebx,procinfo
mov ecx,-1
560,14 → 558,14
ready:
;
; The second message get
; Second message is 100 bytes path to SAVE/OPEN file
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,200
rep movsb
mov ecx,1024/4
rep movsd
mov [edi],byte 0
 
jmp openoff
583,11 → 581,11
dd 0,0 ; Type of dialog
 
run_fileinfo:
dd 16
dd 7
dd 0
dd param
dd 0
dd procinfo
dd 0
;run_filepath:
db '/RD/1/SYSXTREE',0
 
/programs/fs/sysxtree/trunk/sysxtree.asm
27,7 → 27,8
;79Ver Asko Vuori volume label add and "put in command line" bug fix
;80Ver prompt edit fatal bug deleted, antiflick when move list up/down
;81Ver Save Dialog bug deleted
;600000 bytes memory!
;82Ver Rewritten to function 70. Corrected work with scrollbar.
;1560000 bytes memory!
 
;******************************************************************************
use32
55,30 → 56,21
; int 0x40
; //// Willow
mcall 18,11,1,table_area
mov edi,hdimg+62*2
cmp [table_area+2],byte 0
cmp [edx+2],byte 0
je no_hdpartition_on_hd0
mov esi,hdimg1
mov ecx,62
rep movsb
mov [hdimg1], aHD0
no_hdpartition_on_hd0:
cmp [table_area+3],byte 0
cmp [edx+3],byte 0
je no_hdpartition_on_hd1
mov esi,hdimg2
mov ecx,62
rep movsb
mov [hdimg2], aHD1
no_hdpartition_on_hd1:
cmp [table_area+4],byte 0
cmp [edx+4],byte 0
je no_hdpartition_on_hd2
mov esi,hdimg3
mov ecx,62
rep movsb
mov [hdimg3], aHD2
no_hdpartition_on_hd2:
cmp [table_area+5],byte 0
cmp [edx+5],byte 0
je no_hdpartition_on_hd3
mov esi,hdimg4
mov ecx,62
rep movsb
mov [hdimg4], aHD3
no_hdpartition_on_hd3:
 
mov eax,40
87,12 → 79,10
 
cmp byte [param_area],0 ;test parameters line
jne no_brow ;it's dialog
mov [browser],dword 1 ;it's browser
mov [browser], 1 ;it's browser
jmp no_dlg
no_brow:
 
cmp [browser],dword 1
je no_dlg
 
mov al,byte [param_area+5]
mov [dlg_type],al
 
184,54 → 174,7
add eax,12
dec ebp
jnz loogetimg
jmp endgip
 
getimgproc:
pushad
mov dword [edx],esi ;xs
mov dword [edx+4],edi ;ys
 
mov ebp,eax
mov eax,dword [ecx] ;getx size
push edx
push ecx
lea ecx,[eax+2*eax]
 
mul ebx
add eax,ebp ;x
mov edx,ecx
lea eax,[eax+2*eax] ;eax=offset on imsrc
 
mov ecx,esi ;xs
mov ebx,edi ;ys
 
mov ebp,esi
 
pop edi
lea esi,[eax+8+edi]
 
pop edi
add edi,8
 
cld
cyc:
movsw
movsb
dec ecx
jne cyc
add esi,edx
mov ecx,ebp ;xs
sub esi,ecx
sub esi,ecx
sub esi,ecx
dec ebx
jne cyc
 
popad
ret
 
endgip:
 
call read_directory
; call convertation
red:
249,7 → 192,7
mov eax,37
mov ebx,2
int 0x40
cmp eax,1
dec eax
jne still
 
scrl:
256,88 → 199,55
mov eax,37
mov ebx,1
int 0x40
mov ebx,eax
movzx ebx, ax ; y
shr eax,16 ;x
and ebx,0xffff ;y
 
mov ebp,eax
sub ebp,[listx] ;[procinfo.x_size]
sub ebp,[listxsize]
add ebp,[scrollsize]
cmp ebp,dword [scrollsize] ;8
ja menu_test ; still
jae menu_test ; still
 
mov ebp,ebx
sub ebp,[listy] ;76 ;up scroll
sub ebp,[scrollbutsize]
cmp ebp,0
lea ebp, [ebx-scrollbutsize]
sub ebp, [listy] ; up scroll
jl menu_test
mov [mousey],ebp
 
push eax ebx edx
mov edx,0
mov ecx, [listysize]
sub ecx, 2*scrollbutsize
mov eax, [scroll_height]
cmp ebp, ecx
jge menu_test
sub ecx, eax
shr eax, 1
sub ebp, eax
jge @f
xor ebp, ebp
@@:
cmp ebp, ecx
jl @f
mov ebp, ecx
@@:
xor edx, edx
mov eax,[listysize]
sub eax,2
mov ebx,dword 10
mov ebx, 10
div ebx
 
mov [filelistsize],eax
mov ebx,eax
cmp ebx,[listsize] ;filelistsize in ebx
ja notusescrl
 
mov edx,0
mov eax,[listysize]
sub eax,[scrollbutsize]
sub eax,[scrollbutsize]
 
shl eax,16+6
div dword [listsize]
mul ebx
shr eax,16+6
 
mov ebp,eax ; in ebp ysize of scroll
 
mov edx,0
cmp ebx, [listsize]
jae notusescrl
mov eax,[listsize]
 
mov ebx,[listysize]
sub ebx,[scrollbutsize]
sub ebx,[scrollbutsize]
shl eax,16
div ebx ;dword [listsize]
mul [mousey]
shr eax,16
 
mov ebx,[listsize]
sub ebx,[filelistsize]
cmp eax,ebx
jnae no_cor
mov eax,[listsize] ;correction for full dirs (1000 files)
sub eax,[filelistsize]
no_cor:
sub eax, ebx
mul ebp
div ecx
cmp eax, [filecursor]
jz still
mov [filecursor],eax
 
jmp usescrl
notusescrl:
cmp [filecursor], 0
jz still
mov [filecursor],0 ;ebp
usescrl:
 
pop edx ebx eax
 
mov esi,[listy];[procinfo.y_size]
add esi,[listysize]
sub esi,[scrollbutsize]
 
cmp ebx,esi
jna oks ;menu_test ;still
 
sub esi,ebp
inc esi ;correction
cmp ebx,esi
ja menu_test ;still
oks:
 
mov [flick],1
jmp anti_flick ;red
 
379,9 → 289,7
jmp down
no_pgdown:
cmp ah,key_Enter
jne no_k_ent
jmp kfad
no_k_ent:
je kfad
cmp ah,key_Bspace
je back
cmp ah,key_F2
404,7 → 312,7
jne no_con_ent
not [focus]
jmp savetest
jmp update
; jmp update
no_con_ent:
cmp ah,key_Left
jne no_con_left
421,16 → 329,14
cmp ah,key_Bspace
jne no_con_bspace
 
mov ecx,[cursor]
cmp ecx,0
je still
dec ecx
mov ebp,[cursor]
test ebp, ebp
jz still
lobsp:
mov bl,byte [path+ebp]
mov byte [path+ebp-1],bl
inc ebp
cmp ebp,100
cmp ebp,1024
jne lobsp
dec [cursor]
mov [flick],2
439,18 → 345,18
 
mov ecx,[cursor]
dec ecx
mov ebp,100 ;[cursor]
mov ebp,1022
cmp byte [path+ebp], 0
jnz still
losx:
cmp ebp, ecx
jbe @f
mov bl,byte [path+ebp]
mov byte [path+ebp+1],bl
dec ebp
cmp ebp,ecx ;100
jne losx
jmp losx
@@:
 
mov ebp, [cursor]
cmp ebp,100
ja still
 
mov byte [path+ebp],ah
inc dword [cursor]
 
504,133 → 410,104
kfad:
mov eax,[filecursor]
no_kfad:
mov ebx,62
mov ebx,27
mul ebx
mov ebp,eax
lea ebp,[convinfo+eax]
mov esi,[ebp]
cmp esi,-1
jz still
 
mov edi,paramtest ;clear param string
mov ecx,256
mov al,0
mov ecx,1024/4
xor eax,eax
rep stosd
 
mov edi, path
mov ecx, 1024
repnz scasb
dec edi
cmp [ebp+15], dword 'FOL '
jnz openf
; open directory - append its name to path
cmp ecx, 2
jb still
push edi
mov al, '/'
stosb
dec ecx
@@:
lodsb
stosb
test al, al
jz @f
dec ecx
jnz @b
; name is too long - do not do anything
pop edi
xor eax, eax
mov ecx, path+1024
sub ecx, edi
rep stosb
 
 
mov esi,0
lll2:
mov al,byte [path+esi]
cmp al,byte 0 ;' '; '/'
je fis2
cmp al,byte ' '; '/'
je fis2
inc esi
cmp esi,100
jna lll2
jmp fis2
 
fis2:
mov edi,ebp
cmp [convinfo+edi+26],dword 'FOL '
jne openf
mov [path+esi],byte '/'
inc esi
mov ebp,8
 
los: ;directory extension bug fix
mov al,[convinfo+edi]
cmp al,' '
jz skip_name_space
mov [path+esi],al
inc esi
skip_name_space:
inc edi
dec ebp
jnz los
 
cmp byte [convinfo+edi],'.'
jnz dir_name_end
cmp byte [convinfo+edi+1],' '
jz dir_name_end
mov ebp,4
dir_ext_char:
mov al,[convinfo+edi]
cmp al,' '
jz dir_name_end
mov [path+esi],al
inc esi
inc edi
dec ebp
jnz dir_ext_char
dir_name_end:
jmp still
@@:
pop edi
; name appended, now read new directory
mov [filecursor],0
 
;los:
; mov al,[convinfo+edi]
; mov [path+esi],al
; inc esi
; inc edi
; dec ebp
; jnz los
; mov [filecursor],0
; cmp byte [dlg_type],'S'
; je savetest
;no_save:
 
call read_directory
;; call convertation
call draw_window
; jmp still
jmp still
 
;Savetest
savetest:
cmp byte [dlg_type],'S'
je savetest_yes
jmp still
savetest_yes:
mov ecx,100
savetestloop:
cmp [path+ecx],byte 0
je next_byte
cmp [path+ecx],byte 32
je next_byte
cmp [path+ecx],byte '.'
je openf ;it's file
; cmp [path+ecx],byte '/'
; je no_save ;it's dir
next_byte:
dec ecx
jnz savetestloop
jmp still
jne still
; always force open file - this is better
; because there exists files without extension and folders with extension
jmp openf
; mov ecx,100
;savetestloop:
; cmp [path+ecx],byte 0
; je next_byte
; cmp [path+ecx],byte 32
; je next_byte
; cmp [path+ecx],byte '.'
; je openf ;it's file
;; cmp [path+ecx],byte '/'
;; je no_save ;it's dir
;next_byte:
; dec ecx
; jnz savetestloop
; jmp still
 
;Open/Run file
 
openf:
mov ecx,100
lopt:
mov al,[path+ecx]
mov [paramtest+ecx],al
dec ecx
jns lopt
push esi edi
mov esi, path
mov edi, paramtest
mov ecx, 1024/4
rep movsd
pop edi esi
add edi, paramtest-path
 
; mov ebp,100
;loow:
; cmp [paramtest+ebp],byte '.'
; je file_set
; dec ebp
; jnz loow ;is file set not file add
 
cmp dword [focus],0 ;if prompt line with focus no add file name from frame
jne file_set
 
mov [paramtest+esi],byte '/'
inc esi
mov ebp,8+4
mov edx,edi
losf:
mov al,[convinfo+edi]
mov [paramtest+esi],al
inc esi
inc edi
dec ebp
jnz losf
cmp edi, paramtest+1022
jae still
mov al, '/'
stosb
@@:
lodsb
stosb
test al, al
jz file_set
cmp edi, paramtest+1024
jb @b
jmp still
 
file_set:
 
cmp [browser],0
655,7 → 532,7
mov eax,60
mov ebx,2
mov edx,paramtest
mov esi,100
mov esi,1024
int 0x40
 
jmp exit
665,101 → 542,79
; cmp [convinfo+edi+26],dword 'Fvol'
; je edit
 
mov eax,dword [convinfo+edx+8]
cmp eax,'. '
jne noexecute
mov ebx,0
; find extension
mov eax, paramtest+1023
@@:
dec eax
cmp byte [eax+1], 0
jz @b
@@:
cmp byte [eax], '/'
jz .noext
cmp byte [eax], '.'
jz .ext
dec eax
cmp eax, paramtest
jae @b
.noext:
; file has no extension
; xor ebx, ebx
jmp execute
noexecute:
 
cmp eax,'.JPG'
jne nojv
jpg_jpe:
.ext:
inc eax
; eax points to extension
cmp byte [eax], 0
jz .noext
mov ecx, dword [eax]
and ecx, not 0x20202020
mov ebx,jpgview
jmp run
nojv:
cmp eax,'.JPE'
je jpg_jpe
cmp eax,'.GIF'
jne nojv1
cmp ecx, 'JPG'
jz run
cmp ecx, 'JPEG' ; note that it will select also *.JPEG*
jz run
mov ebx,gifview
jmp run
nojv1:
cmp eax,'.WAV'
jne nojv12
cmp ecx, 'GIF'
jz run
mov ebx,ac97wav
jmp run
nojv12:
cmp eax,'.MID'
jne nojv13
cmp ecx, 'WAV'
jz run
mov ebx,midamp
jmp run
nojv13:
cmp eax,'.BMP'
jne nobv
cmp ecx, 'MID'
jz run
mov ebx,bmpview
jmp run
nobv:
cmp ecx, 'BMP'
jz run
; //// Willow
cmp eax,'.PNG'
jne nopngv
mov ebx,pngview
jmp run
nopngv:
cmp ecx, 'PNG'
jz run
; //// Willow
cmp eax,'.RTF'
jne nortf
mov ebx,rtfread
jmp run
nortf:
cmp eax,'.ASM'
je edit
cmp eax,'.TXT'
je edit
cmp eax,'.INC'
je edit
cmp ecx, 'RTF'
jz run
mov ebx, editor
cmp ecx, 'ASM'
jz run
cmp ecx, 'TXT'
jz run
cmp ecx, 'INC'
jz run
jmp still
edit:
mov ebx,editor
jmp run
 
execute:
mov ecx,0 ;200
loexe:
mov al,[paramtest+ecx]
; cmp al,0
; je setzr
; cmp al,' '
; je setzr
; je badl
cmp al,'.'
je setzr
; je badl
; jmp okl
;badl:
; mov al,0
okl:
mov [open_path+ecx],al
inc ecx
cmp ecx,200
jnae loexe
 
setzr:
; add ecx,3
; mov al,0
mov [open_path+ecx],byte 0 ;al
 
mov eax,58
mov ebx,fileinfo_start
and dword [ebx+8], 0 ; no parameters
mov dword [ebx+21], paramtest ; program name
.do:
mov eax, 70
int 0x40
 
jmp still
 
run:
mov ecx,paramtest
mov eax,19
int 0x40
jmp still
mov [fileinfo_name], ebx ; program name
mov ebx, fileinfo_start
mov dword [ebx+8], paramtest ; parameters
jmp execute.do
 
no_filelist:
 
790,53 → 645,37
cmp ah,9
jne no_textopen
textopen:
mov esi,0
xlll2:
mov al,byte [path+esi]
cmp al,byte '/'
jne xfis2
inc esi
cmp esi,12*20
jnae xlll2
mov eax, 27
mul [filecursor]
cmp dword [eax+convinfo+15], 'FOL '
jz still
push eax
mov esi, path
mov edi, paramtest
@@:
lodsb
test al, al
jz @f
stosb
jmp @b
@@:
mov al, '/'
stosb
pop eax
mov esi, [eax+convinfo]
cmp esi, -1
jz still
@@:
lodsb
stosb
test al, al
jz @f
cmp edi, paramtest+1024
jb @b
jmp still
xfis2:
mov al,byte [path+esi]
cmp al,byte ' '
je xaa2
inc esi
cmp esi,12*20
jnae xfis2
jmp still
xaa2:
mov eax,[filecursor]
mov ebx,62
mul ebx
mov edi,eax
cmp [convinfo+edi+26],dword 'FOL '
je still
mov ecx,12*20
xlopt:
mov al,[path+ecx]
mov [paramtest+ecx],al
dec ecx
jns xlopt
mov [paramtest+esi],byte '/'
inc esi
mov ebp,8+4
mov edx,edi
xlosf:
mov al,[convinfo+edi]
mov [paramtest+esi],al
inc esi
inc edi
dec ebp
jnz xlosf
mov [paramtest+esi],byte 0
@@:
mov ebx,editor
mov ecx,paramtest
mov eax,19
int 0x40
jmp red ;still
jmp run
 
no_textopen:
 
843,12 → 682,11
cmp ah,11
jne no_view
viewset:
; not dword [delflag]
inc dword [viewmode]
cmp dword [viewmode],8
jnae not_cm
inc [viewmode]
cmp [viewmode], 4
jb @f
mov [viewmode],0
not_cm:
@@:
call read_directory
; call convertation
mov [filecursor],0
859,26 → 697,19
cmp ah,12 ;move back
jne no_back
back:
mov esi,12*20
lll:
mov al,byte [path+esi]
cmp al,byte ' '
jne findsl
dec esi
jnz lll
mov edi, path+1024
mov ecx, edi
@@:
dec edi
cmp byte [edi], '/'
jz @f
cmp edi, path
ja @b
jmp still
findsl:
dec esi
fis:
mov al,byte [path+esi]
cmp al,byte '/'
je aa
mov [path+esi],byte 0 ;' '
dec esi
jnz fis
aa:
mov [path+esi],byte 0 ;' '
 
@@:
sub ecx, edi
xor eax, eax
rep stosb
mov [filecursor],0
call read_directory
; call convertation
911,56 → 742,40
cmp ah,15
jne no_copyclip ;copy to clipboard
copy_to_clip:
mov ebx,param_area ;clipfilp
mov eax,32
int 0x40
mov esi,0
wlll2:
mov al,byte [path+esi]
cmp al,byte '/'
jne wfis2
inc esi
cmp esi,12*20
jnae wlll2
mov eax, 27
mul [filecursor]
cmp dword [convinfo+eax+15], 'FOL '
jz still
push eax
mov esi, path
mov edi, paramtest
@@:
lodsb
test al, al
jz @f
stosb
jmp @b
@@:
pop eax
mov esi, [convinfo+eax]
cmp esi, -1
jz still
mov al, '/'
stosb
@@:
lodsb
stosb
test al, al
jz @f
cmp edi, paramtest+1024
jb @b
jmp still
wfis2:
mov al,byte [path+esi]
cmp al,byte ' '
je waa2
inc esi
cmp esi,12*20
jnae wfis2
jmp still
waa2:
mov eax,[filecursor]
mov ebx,62
mul ebx
mov edi,eax
cmp [convinfo+edi+26],dword 'FOL '
je still
mov ecx,12*20
wlopt:
mov al,[path+ecx]
mov [paramtest+ecx],al
dec ecx
jns wlopt
mov [paramtest+esi],byte '/'
inc esi
mov ebp,8+4
mov edx,edi
wlosf:
mov al,[convinfo+edi]
mov [paramtest+esi],al
inc esi
inc edi
dec ebp
jnz wlosf
mov [paramtest+esi],byte 0
mov ebx,param_area ;clipfile
mov ecx,paramtest
mov edx,100
mov esi,0
mov eax,33
@@:
sub edi, paramtest+1
mov ebx, clipfile_info
mov byte [ebx], 2
mov [ebx+12], edi
mov eax, 70
int 0x40
jmp still
no_copyclip:
968,96 → 783,76
cmp ah,16
jne no_clippaste
paste_from_clip:
mov ebx,param_area ;clipfile
mov ecx,0
mov edx,-1
mov esi,sourcepath
mov eax,6
mov ebx, clipfile_info
mov byte [ebx], 0
mov dword [ebx+12], 1023
mov eax, 70
int 0x40
 
mov ecx,99
cdestp:
mov al,[path+ecx]
mov [destpath+ecx],al
dec ecx
jns cdestp
 
mov esi,0
zlll2:
mov al,byte [destpath+esi]
cmp al,byte '/'
jne zfis2
inc esi
cmp esi,100
jnae zlll2
jmp still
zfis2:
mov al,byte [destpath+esi]
cmp al,byte ' '
je zaa2
inc esi
cmp esi,100
jnae zfis2
jmp still
zaa2:
mov byte [destpath+esi],'/'
inc esi
 
mov edi,0
qlll2:
mov al,byte [sourcepath+edi]
cmp al,byte '.'
je qfis2
cmp ebx, 0
jle still
mov byte [paramtest+ebx], 0
; OS allows only 256 symbols in command line
cmp ebx, 250
jae still
; we use Pascal-style strings for /RD/1/COPYR
; source file
mov edi, copyr_param
mov al, bl
stosb
mov ecx, ebx
mov esi, paramtest
rep movsb
; destination path
inc edi
cmp edi,100
jnae qlll2
jmp still
qfis2:
sub edi,8 ;.-8=start of file name
 
mov ecx,11 ;11 sybols
cfname:
mov al,[sourcepath+edi]
cmp al,byte ' '
je dar
mov [destpath+esi],al
inc esi
dar:
inc edi
dec ecx
jns cfname
 
; mov [destpath+esi],byte 0
 
mov ecx,199
cdestjp:
mov al,[sourcepath+ecx]
cmp al,byte 0
jne nor
mov al,byte 32
nor:
mov [sourcepath+ecx],al
dec ecx
jns cdestjp
 
cmp [browser],dword 1
mov ebp, edi
mov esi, path
@@:
cmp edi, copyr_param+255
jae still
lodsb
test al, al
jz @f
stosb
jmp @b
; destination file name
@@:
dec ebx
jz still
cmp byte [paramtest+ebx], '/'
jnz @b
lea esi, [paramtest+ebx]
@@:
lodsb
test al, al
jz @f
stosb
cmp edi, copyr_param+255
jae still
jmp @b
@@:
mov byte [edi], 0
sub edi, ebp
mov eax, edi
mov [ebp-1], al
; display
cmp [browser], 1
jne no_outpath
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 esi,100 ;12*20 ; text length
mov edx, copyr_param+1
movzx esi, byte [edx-1]
int 0x40
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 esi,100 ;12*20 ; text length
mov edx, ebp
mov esi, edi
int 0x40
no_outpath:
 
mov ebx,copyrfile
mov ecx,sourcepath
mov eax,19
; run COPYR
mov eax, 70
mov ebx, copyr_run
int 0x40
delay 50 ;wait recoed file
jmp update ;still
1064,30 → 859,10
no_clippaste:
 
cmp ah,19 ;Delete from floppy
jne no_delt
delete_file:
jne no_delt
cmp dword [path],'/RD/'
jne no_delt
cmp byte [path+4],'1'
jne no_delt
 
mov eax,[filecursor]
mov ebx,62
mul ebx
mov edi,eax
add edi,convinfo
mov ebp,edi
mov eax,dword [edi]
mov dword [paramtest],eax
mov eax,dword [edi+4]
mov dword [paramtest+4],eax
mov eax,dword [edi+4+4+1]
mov dword [paramtest+4+4],eax
 
mov ebx,paramtest
mov eax,32
int 0x40
jmp update
; OS now do not support file delete
jmp still
no_delt:
 
cmp ah,20 ;I - Help
1140,45 → 915,30
je exit
 
;VIEW MENU
cmp ah,40 ;Sort by name show del
cmp ah,40 ;Sort by name
jne no_sn
; mov dword [viewmode],0
and dword [viewmode],100b
mov [viewmode], 0
jmp update
no_sn:
 
cmp ah,41 ;Sort by extension show del
cmp ah,41 ;Sort by extension
jne no_se
and dword [viewmode],1101b
or dword [viewmode],0001b
mov [viewmode], 1
jmp update
no_se:
 
cmp ah,42 ;Sort by size show del
cmp ah,42 ;Sort by size
jne no_ss
and dword [viewmode],1110b
or dword [viewmode],0010b
mov [viewmode], 2
jmp update
no_ss:
 
cmp ah,43 ;Sort by date show del
cmp ah,43 ;Sort by date
jne no_sd
or dword [viewmode],0011b
mov [viewmode], 3
jmp update
no_sd:
 
cmp ah,44 ;Show del files
jne no_ds
or dword [viewmode],0100b
jmp update
no_ds:
 
cmp ah,45 ;Fade del files
jne no_df
and dword [viewmode],11111011b
jmp update
no_df:
 
;HELP MENU
cmp ah,50 ;Help?
je help_scr
1186,20 → 946,6
cmp ah,51 ;Info?
je info_scr
 
cmp ah,83
ja no_hd_part
cmp ah,80
jb no_hd_part
mov ecx,0
sub ah,80
inc ah
mov cl,ah
mov eax,21
mov ebx,8 ;7
int 0x40
 
no_hd_part:
 
cmp ah,1 ; test on exit button
je exit
 
1237,7 → 983,7
jmp screen
 
screen:
cmp [browser],dword 1 ;it's browser?
cmp [browser], 1 ;it's browser?
jne dialogscr
 
mov eax,[procinfo.y_size]
1278,6 → 1024,44
 
jmp still
 
getimgproc:
pushad
mov dword [edx],esi ;xs
mov dword [edx+4],edi ;ys
 
mov ebp,eax
mov eax,dword [ecx] ;getx size
push edx
push ecx
lea ecx,[eax+2*eax]
 
mul ebx
add eax,ebp ;x
mov edx,ecx
lea eax,[eax+2*eax] ;eax=offset on imsrc
 
mov ebp,esi ;xs
mov ebx,edi ;ys
 
pop edi
lea esi,[eax+8+edi]
 
pop edi
add edi,8
 
cld
cyc:
push esi
lea ecx, [ebp+ebp*2]
rep movsb
pop esi
add esi,edx
dec ebx
jne cyc
 
popad
ret
 
;HELP TEXT
help_text:
;0123456789012345678901234567890123456789
1300,10 → 1084,10
 
info_text:
db ' ~~~~~ SYSTEM X-TREE ~~~~~ '
db ' INFO 81 Ver '
db ' INFO 82 Ver '
db ' '
db ' Create by Pavlushin Evgeni '
db ' with ASCL libary special for Menuet OS '
db 'with ASCL library special for Kolibri OS'
db ' www.deck4.narod.ru waptap@mail.ru '
 
 
1341,7 → 1125,7
 
xor eax,eax ; function 0 : define and draw window
 
cmp [browser],dword 1 ;it's browser
cmp [browser], 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]
1362,39 → 1146,40
 
mov eax,[procinfo.x_size]
cmp eax,66
jg temp12345
jg @f
.ret:
ret
temp12345:
@@:
cmp [procinfo.y_size], 0x70
jl .ret
 
cmp [browser],dword 1 ;it's browser
cmp [browser], 1 ;it's browser
jne nob9
mov [listx],120
mov eax,[procinfo.x_size]
sub eax,[listx]
sub eax,7
; mov eax,[procinfo.x_size]
sub eax,127;[listx]+7
cmp eax,10
jl .ret
mov [listxsize],eax
mov [listy],73
mov eax,[procinfo.y_size]
sub eax,[listy]
sub eax,7
sub eax,73+7;[listy]+7
mov [listysize],eax
jmp isb9
nob9:
mov [listx],10
mov eax,[procinfo.x_size]
sub eax,[listx]
sub eax,7
; mov eax,[procinfo.x_size]
sub eax,17 ;[listx]+7
mov [listxsize],eax
mov [listy],54
mov eax,[procinfo.y_size]
sub eax,[listy]
sub eax,34
sub eax,54+34;[listy]+34
mov [listysize],eax
isb9:
 
 
;Draw only browser components
cmp [browser],dword 1 ;it's browser
cmp [browser], 1 ;it's browser
jne nob2
 
mov eax,[sc.grab_text] ; color of text RRGGBB
1417,27 → 1202,8
dec edi
jnz nexthbut
 
;DRAW PARTITION BUTTONS
mov eax,8
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 esi,0x00339933
int 0x40
dec edi
nextpbut:
add ebx,6*65536
inc edx
int 0x40
dec edi
jnz nextpbut
 
;DRAW PARTITON TEXT
glabel 341,25,'1234',cl_White;Black
 
;File STRING
glabel 8,25,' FILE VIEW INFO ', ;cl_White ;Black
glabel 8,25,' FILE VIEW INFO ', cl_White ;Black
 
;BlackLine
mov eax,[procinfo.x_size]
1458,12 → 1224,12
setimg 34,88,logoinfimg
glabel 20,165,'SYSTEM X-TREE',cl_Black
add ebx,10
glabel ,,'FOR MENUETOS',
glabel ,,'FOR KolibriOS',
 
add ebx,9*65536+20
glabel ,,'welcome to',cl_Green
add ebx,-15*65536+10
glabel ,,'www.menuetos.org',cl_Green
glabel ,,'www.kolibrios.org',cl_Green
 
; glabel ,,'Create by',cl_Green
; add ebx,10
1489,7 → 1255,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,4 ;draw 4 button's
mov esi,cl_Grey
call menubutton
no_drawhv:
1509,7 → 1275,7
 
;Draw buttons instruments
mov eax,8
cmp [browser],dword 1 ;it's browser
cmp [browser], 1 ;it's browser
jne nob3
mov ebx,10*65536+16+5 ;start pos x
mov ecx,37*65536+15 ;start pos y
1531,7 → 1297,7
jnz nextbut
 
 
cmp [browser],dword 1 ;it's browser
cmp [browser], 1 ;it's browser
jne nob4
;But img browser
setimg 10,37,butimg
1546,7 → 1312,7
setimg 16,29,butimg
isb4:
 
cmp [browser],dword 1 ;it's browser
cmp [browser], 1 ;it's browser
jne nob5
 
mov [urlx],48
1559,10 → 1325,8
glabel 20,57,"URL:",cl_Black
 
;Out view mode info
mov eax,[viewmode]
mov ebx,16
mul ebx
mov edx,eax
movzx edx, [viewmode]
shl edx, 4
mov eax,4
mov ebx,180*65536+25
mov ecx,cl_Black
1735,11 → 1499,10
shl ebx,16
add ebx,dword [scrollsize]
mov ecx,[listy]
add ecx,[scrollbutsize]
add ecx,scrollbutsize
shl ecx,16
add ecx,[listysize]
sub ecx,[scrollbutsize]
sub ecx,[scrollbutsize]
sub ecx,scrollbutsize*2
mov edx,[scrollcolor] ;0x00006600
int 0x40
 
1750,32 → 1513,45
mov ebx,dword 10
div ebx
 
mov edx,0
mov ebx,eax
cmp ebx,[listsize] ;filelistsize in ebx
ja notusescroll
jae notusescroll
;usescroll
; calculate scroll size
mov eax,[listysize]
sub eax,[scrollbutsize]
sub eax,[scrollbutsize]
shl eax,16
div dword [listsize]
sub eax, 2*scrollbutsize
push eax
mul ebx
shr eax,16
mov esi,[mousey]
shl esi,16
add esi,eax
 
div [listsize]
cmp eax, 5
jae @f
mov al, 5
@@:
mov [scroll_height], eax
; calculate scroll pos
sub [esp], eax
mov eax, [listsize]
sub eax, ebx
mov ecx, eax
cmp eax, [filecursor]
jb @f
mov eax, [filecursor]
@@:
mul dword [esp]
div ecx
mov [scroll_pos], eax
pop ecx
; draw
lea ecx, [eax+scrollbutsize]
add ecx, [listy]
shl ecx, 16
mov cx, word [scroll_height]
mov eax,13
mov ebx,[listx]
add ebx,[listxsize]
sub ebx,[scrollsize]
shl ebx,16
add ebx,dword [scrollsize]
mov ecx,[listy]
add ecx,[scrollbutsize]
shl ecx,16
add ecx,esi
mov bx, word [scrollsize]
mov edx,[scrollboxcol]
int 0x40
notusescroll:
1808,8 → 1584,7
add ebx,[scrollsize]
mov ecx,[listy]
shl ecx,16
add ecx,[scrollbutsize]
dec ecx ;correction
add ecx,scrollbutsize-1
mov eax,8
mov edx,6+1000000000000000000000000000000b ;spoke butt
int 0x40
1836,7 → 1611,7
dec ecx ;correction
mov edx,7+1000000000000000000000000000000b ;spoke butt
mov eax,[listysize]
sub eax,[scrollbutsize]
sub eax,scrollbutsize
shl eax,16
add ecx,eax
 
1864,10 → 1639,12
 
; Draw text in file list
 
mov eax,[listxsize]
sub eax,40*6 ;leight of string
shr eax,1
add eax,[listx]
; mov eax,[listxsize]
; sub eax,40*6 ;leight of string
; shr eax,1
; add eax,[listx]
mov eax, [listx]
add eax, 12+4 ; for icons
shl eax,16
add eax,[listy]
add eax,2
1883,7 → 1660,7
 
; OUT FILE DATA
mov eax,[filecursor] ;calc cursor position
mov ebx,62
mov ebx,27
mul ebx
 
;OUT TEXT
1893,81 → 1670,133
add edx,eax
mov ebx,dword [filelistxy]
loo:
cmp dword [edx], -1
jz noout
mov ecx,0x00888888 ;for another file's color white
cmp [edx+26],dword 'FOL ' ;folder yellow
cmp [edx+15],dword 'FOL ' ;folder yellow
jne nb
mov ecx,0x00006666
jmp cset1
nb:
mov eax,[edx+8]
mov eax, [edx]
xor edi, edi
; find extension and set color
@@:
inc eax
cmp byte [eax-1], 0
jz @f
cmp byte [eax-1], '.'
jnz @b
mov edi, eax
jmp @b
@@:
test edi, edi
jz @f
mov edi, [edi]
and edi, not 0x20202020 ; toupper
@@:
;Color set
cmp eax,dword '.TXT' ;text's blue
je itx
cmp eax,dword '.INC'
je itx
cmp eax,dword '.ASM'
je itx
cmp eax,dword '.RTF'
je itx
jmp nt
itx:
; text's blue
mov ecx,0x00446666
jmp cset
nt:
cmp eax,dword '.BMP' ;picture's pure
je ipic
cmp eax,dword '.JPG'
je ipic
cmp eax,dword '.JPE'
je ipic
cmp eax,dword '.GIF'
je ipic
; //// Willow
cmp eax,dword '.PNG'
je ipic
; //// Willow
cmp eax,dword '.WAV'
je ipic
cmp eax,dword '.MID'
je ipic
jmp np
ipic:
cmp edi, 'TXT'
jz cset
cmp edi, 'INC'
jz cset
cmp edi, 'ASM'
jz cset
cmp edi, 'RTF'
jz cset
; picture's pure
mov ecx,0x00226688
jmp cset
np:
cmp eax,dword '. ' ;execute's green
jne nexec
cmp edi, 'BMP'
jz cset
cmp edi, 'JPG'
jz cset
cmp edi, 'JPEG'
jz cset
cmp edi, 'GIF'
jz cset
cmp edi, 'PNG'
jz cset
cmp edi, 'WAV'
jz cset
cmp edi, 'MID'
jz cset
; execute's green
mov ecx,0x00008866
jmp cset
nexec:
test edi, edi
jz cset
; for another file's color white
mov ecx, 0x00888888
cset:
 
cset1:
mov esi,40 ;symbols out 62 ;32
push edx
mov edx,[edx]
push ebx edx
mov eax, [listxsize]
sub eax, [scrollsize]
sub eax, 12+4
xor edx, edx
mov ebx, 6
div ebx
pop edx ebx
sub eax, 25
xor esi, esi
@@:
cmp byte [edx+esi], 0
jz @f
inc esi
cmp esi, eax
jbe @b
dec esi
@@:
push eax
mov eax,4
int 0x40
cmp byte [edx+esi], 0
jz @f
pushad
mov edx, more_char
mov eax, esi
imul eax, 6*65536
add ebx, eax
mov esi, 1
mov eax, 4
int 0x40
; popad
popad
@@:
pop eax
pop edx
push ebx edx
inc eax
imul eax, 6*65536
add ebx, eax
add edx,4
mov esi,23
mov eax,4
int 0x40
pop edx ebx
 
; pushad
cmp [edx+26],dword 'Fvol' ;volume label
pushad
cmp [edx+15],dword 'Fvol' ;volume label
jne no_volico
push hdico+8
jmp out_ico
no_volico:
cmp [edx+26],dword 'FOL '
cmp [edx+15],dword 'FOL '
jne no_folico
cmp [edx+9],dword 'HARD'
cmp [edx+4],dword 'HARD'
jne no_hdico
push hdico+8
jmp out_ico
no_hdico:
cmp [edx+9],dword 'RAMD'
cmp [edx+4],dword 'RAMD'
jne no_rdico
push rdico+8
jmp out_ico
no_rdico:
cmp [edx+9],dword 'FLOP'
cmp [edx+4],dword 'FLOP'
jne no_fdico
push rdico+8
jmp out_ico
1975,21 → 1804,21
push folico+8
jmp out_ico
no_folico:
cmp [edx+8],dword '.BMP'
cmp edi,dword 'BMP'
je is_imgico
cmp [edx+8],dword '.JPG'
cmp edi,dword 'JPG'
je is_imgico
cmp [edx+8],dword '.JPE'
cmp edi,dword 'JPEG'
je is_imgico
cmp [edx+8],dword '.GIF'
cmp edi,dword 'GIF'
je is_imgico
; //// Willow
cmp [edx+8],dword '.PNG'
cmp edi,dword 'PNG'
je is_imgico
; //// Willow
cmp [edx+8],dword '.WAV'
cmp edi,dword 'WAV'
je is_imgico
cmp [edx+8],dword '.MID'
cmp edi,dword 'MID'
je is_imgico
jmp no_imgico
is_imgico:
1996,9 → 1825,9
push imgico+8
jmp out_ico
no_imgico:
cmp [edx+8],dword '.ASM'
cmp edi,dword 'ASM'
je is_asmincico
cmp [edx+8],dword '.INC'
cmp edi,dword 'INC'
je is_asmincico
jmp no_asmincico
is_asmincico:
2005,25 → 1834,25
push asmincico+8
jmp out_ico
no_asmincico:
cmp [edx+8],dword '.RTF'
cmp edi,dword 'RTF'
je @f
cmp [edx+8],dword '.TXT'
cmp edi,dword 'TXT'
jne no_txtico
@@:
push txtico+8
jmp out_ico
no_txtico:
cmp [edx+8],dword '. '
test edi,edi
jne no_execico
push execico+8
jmp out_ico
no_execico:
cmp [edx+26],dword 'DAT '
cmp [edx+15],dword 'DAT '
jne no_datico
push datico+8
jmp out_ico
no_datico:
cmp [edx+26],dword 'DEL '
cmp [edx+15],dword 'DEL '
jne no_out_ico
push delico+8
jmp out_ico
2042,11 → 1871,10
 
add ebx,10
noout:
add edx,62
add edx,27
 
dec [filelistsize]
cmp [filelistsize],dword 0
je extloo
jz extloo
 
dec ebp
jnz loo
2055,7 → 1883,7
 
extloo:
 
cmp [browser],dword 1 ;it's browser
cmp [browser], 1 ;it's browser
jne nob8
 
;Draw text for head->file buttons
2086,10 → 1914,10
;Draw text for head->view buttons
cmp [drawhv],1
jne no_drawhvtext
drawfbox (8+6*8),35,(6*12)+1,(11*6),0x00000000
drawfbox (9+6*8),36,(6*12)-1,(11*6)-2,0x00ffffff
drawfbox (8+6*8),35,(6*12)+1,(11*4),0x00000000
drawfbox (9+6*8),36,(6*12)-1,(11*4)-2,0x00ffffff
 
mov edi,6 ;4
mov edi,4
mov ebx,(9+6*8)*65536+37
mov ecx,cl_Black
mov edx,view_text_label
2101,8 → 1929,6
db ' Ext. sort '
db ' Size sort '
db ' Date sort '
db ' Show DEL '
db ' Fade DEL '
 
no_drawhvtext:
 
2153,8 → 1979,7
scrollcolor dd 0x778877
scrollboxcol dd 0x335533
scrollbutcol dd 0x224422
scrollbutsize dd 9
usescroll dd 1
scrollbutsize = 9
 
;URL LINE PARAMETRS
 
2191,74 → 2016,35
 
read_directory:
 
; STEP 0 SEt TYPE OF SORT
 
mov eax,[viewmode]
;with no show del files
and eax,0FFFFFFFBh
cmp eax,0
jnz no_sort_by_name
mov [start],0
mov [x0],12
mov [x1],99
mov [x2],99
mov [x3],99
jmp sortset
 
no_sort_by_name:
dec eax
jnz no_sort_by_ext
mov [start],9
mov [x0],9
mov [x1],99
mov [x2],99
mov [x3],12
jmp sortset
 
no_sort_by_ext:
dec eax
jnz no_sort_by_size
mov [start],30
mov [x0],12
mov [x1],99
mov [x2],99
mov [x3],38
jmp sortset
 
no_sort_by_size:
dec eax
mov [start],21
mov [x0],12
mov [x1],17
mov [x2],20
mov [x3],26
jmp sortset ;sort by date
 
;SORT VARILE
start dd 0
x0 dd 0
x1 dd 0
x2 dd 0
x3 dd 0
 
sortset:
 
;STEP 1 CLEAR CONVINFO
mov edi,convinfo
mov al,255
mov ecx,4096*62 ;512
mov ecx,4096*27
cld
push edi
rep stosb
pop edi
 
;STEP 2 TEST ON HD OR PARTITION
cmp [path],byte '/'
je nstep
mov ecx,61+62*5
loxhd:
mov al,[hdimg+ecx]
mov [convinfo+ecx],al
dec ecx
jns loxhd
; copy info on RD and FD
mov esi, hdimg
mov ecx, 2*27
rep movsb
; hard disks
mov eax, 4
.1:
mov ecx, 27
cmp dword [esi], 0
jz .2
rep movsb
jmp .3
.2:
add esi, ecx
.3:
dec eax
jnz .1
mov [listsize],0
ret
nstep:
2268,88 → 2054,66
je nstep2
cmp [path+1],word 'RD'
jne nostep_RD
mov ecx,61
mov ecx,1
jmp loxpt
nostep_RD:
cmp [path+1],word 'FD'
jne nostep_FD
mov ecx,61+62
mov ecx,2
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
movzx ecx,byte [table_area+2]
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
movzx ecx,byte [table_area+3]
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
movzx ecx,byte [table_area+4]
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
movzx ecx,byte [table_area+5]
jmp loxpt
nostep_HD3:
 
mov ecx,61+62 ;+496
mov ecx,2
 
loxpt:
mov al,[ptimg+ecx]
mov [convinfo+ecx],al
dec ecx
jns loxpt
cmp ecx, 20
jbe @f
mov ecx, 20
@@:
mov eax, a1
mov esi, ptimg
@@:
stosd
add eax, 3
push ecx esi
mov ecx, 23
rep movsb
pop esi ecx
loop @b
mov [listsize],0
ret
nstep2:
 
;STEP 3 CLEAR OUTINFO
mov edi,outinfo ;0x14000 ;0x20000
xor eax,eax
mov ecx,4096*32 ;512
cld
rep stosb
;STEP 3 was deleted
 
;STEP 4 READ DATA FROM HD
mov dword [farea],outinfo
mov dword [readblock],0
 
loorhd:
mov eax,[readblock]
mov [fileinfoblock+4],eax
mov eax,58
mov eax,70
mov ebx,fileinfoblock
int 0x40
cmp eax,0
jne hd_err
add dword [farea],512
inc dword [readblock]
cmp dword [readblock],4096/16
jna loorhd
 
hd_err:
mov ebx,dword [readblock]
shl ebx,4
mov dword [blocksread],ebx ; for quick resorting
 
cmp eax,5
cmp eax,6
je end_of_dir
 
; It's erorr's test is poor code
2361,103 → 2125,63
no_inv_part:
cmp eax,3
jne no_unk_fs
glabel 10,10,'Unknow file system',cl_Red+font_Big
glabel 10,10,'Unknown file system',cl_Red+font_Big
jmp end_of_dir
no_unk_fs:
 
end_of_dir:
; -1 -> 0
cmp ebx, -1
sbb ebx, -1
mov [dirlen],ebx
 
; command succesful
; command successful
 
mov esi,outinfo ;data_area+1024
; mov edi,fileinfo+11
mov edx,0 ;4096 ;16
mov esi, outinfo+32
and [listsize], 0
test ebx, ebx
jz nofiles
 
newlineb:
push ebx
 
mov edi,fileinfo+11
 
pushad ; clear
mov al,32
mov ecx,58
sub edi,11
cld
mov edi, fileinfo
push edi
mov al, ' '
mov ecx, 27
rep stosb
popad
pop edi
push esi
add esi, 40
mov [edi], esi
pop esi
 
mov cl,[esi] ; end of entries ?
cmp cl,6
jnz noib0
 
mov [edi+26],dword 'EOE '
add esi,32
; add edi,62
jmp inf
 
noib0:
 
mov cl,[esi+0]
cmp cl,0xe5
je yesdelfil
 
mov cl,[esi+11] ; long fat32 name ?
cmp cl,0xf
jnz noib1
 
mov [edi+26],dword 'F32 '
add esi,32
; add edi,62
jmp inf
 
noib1:
 
mov eax,'DAT ' ; data or .. ?
 
mov cl,[esi+0] ; deleted file
cmp cl,0xe5
je yesdelfil
cmp cl,0x0
je yesdelfil
jmp nodelfil
yesdelfil:
mov eax,'DEL '
jmp ffile
 
nodelfil:
 
mov cl,[esi+11] ; folder
and cl,0x10
jz ffile
mov eax, 'DAT ' ; data or ... ?
mov cl, [esi]
test cl, 0x10
jz @f
mov eax,'FOL '
mov [edi+26],eax
mov [edi+15], eax
jmp nosize
ffile:
 
; Asko patch for v79
mov cl,[esi+11] ; fold
and cl,0xf
cmp cl,0xf ; skip long filename
@@:
test cl, 8
jz novol
test cl,0x8 ; is it fold label?
jz novol ; no
mov eax,'Fvol'
mov [edi+26],eax
mov [edi+15], eax
jmp nosize
novol:
mov [edi+15], eax
 
mov [edi+26],eax
 
pusha ; size
mov eax,[esi+28]
mov esi,edi
add esi,37
; size
mov eax, [esi+32]
push esi
lea esi, [edi+26]
mov ebx,10
mov ecx,8
newnum:
xor edx,edx
div ebx
add dl,48
add dl, '0'
mov [esi],dl
test eax,eax
jz zernum
2464,239 → 2188,219
dec esi
loop newnum
zernum:
popa
pop esi
nosize:
 
pusha ; date
mov [edi+17],dword '. .'
 
movzx eax,word [esi+24]
shr eax,9 ; year
add eax,1980
; date
mov dword [edi+6], '. .'
; year
movzx eax, word [esi+28+2]
mov ecx,4
newdel1:
dec ecx
xor edx,edx
mov ebx,10
div ebx
add edx,48
mov [edi+ecx+21],dl
test ecx,ecx
jnz newdel1
 
movzx eax,word [esi+24]
shr eax,5 ; month
and eax,0x0f
mov ecx,2
newdel2:
dec ecx
add edx, '0'
mov [edi+ecx+9], dl
loop newdel1
; month
movzx eax, byte [esi+28+1]
xor edx,edx
mov ebx,10
div ebx
add edx,48
mov [edi+ecx+18],dl
test ecx,ecx
jnz newdel2
 
movzx eax,word [esi+24]
and eax,0x1f ; day
mov ecx,2
newdel3:
dec ecx
add al, '0'
add dl, '0'
mov [edi+7], al
mov [edi+8], dl
; day
movzx eax, byte [esi+28]
xor edx,edx
mov ebx,10
div ebx
add edx,48
mov [edi+ecx+15],dl
test ecx,ecx
jnz newdel3
add al, '0'
add dl, '0'
mov [edi+4], al
mov [edi+5], dl
 
popa
 
 
pusha ; number
mov eax,edx
sub eax,4096
neg eax
 
xor edx,edx
mov ebx,10
div ebx
add dl,48
mov [edi+43],dl ;0001
xor edx,edx
div ebx
add dl,48
mov [edi+42],dl ;0010
xor edx,edx
div ebx
add al,48
add dl,48
mov [edi+41],dl ;0100
mov [edi+40],byte 0 ;1000
popa
 
mov ecx,8 ; first 8
cld
rep movsb
mov [edi],byte '.'
inc edi
mov ecx,3 ; last 3
cld
rep movsb
 
add esi,(32-11)
; add edi,(60-12+2)
 
inf:
 
pushad
 
;STEP 5 Test on WRITE OR NOTWRITE
mov edx,fileinfo+11
looo:
cmp word [esi+40], '.'
jz nextfl
cmp word [esi+40], '..'
jnz @f
cmp byte [esi+42], 0
jz nextfl
@@:
 
; Delete del, eoe, f32 and another head-names
cmp [viewmode],3 ;0-3 no outdel
ja del_out
cmp [edx+26],dword 'DEL '
je nextfl
del_out:
cmp [edx+26],dword 'DEL '
jne no_del
cmp [edx],dword 0 ;431 ;435 ;484 +10% speed
je nextfl
no_del:
cmp [edx+26],dword 'EOE '
je nextfl
cmp [edx+26],dword 'F32 ' ;F32 not useles
je nextfl
cmp [edx],dword '. '
je nextfl
cmp [edx],dword '.. '
je nextfl
cmp [edx],dword 'FIRS'
je nextfl
; STEP 6 SORT ALGORYTHM
 
; ---------_______-------_______ --------_________-----------
; SORT by name and del deletet files or f32 headers from list
; _________-------_______ --------_______---------___________
push esi
xor esi, esi
 
; STEP 6 UNIVERSAL SORT ALGORYTHM
; At first Fold after Dat
 
xxx:
mov esi,0 ;[tekfilename] ;0
mov ebx,[start] ; 0
 
; At first Fold after Dat and Del
 
ftestname:
cmp byte [fileinfo+11+26],'F'
cmp dword [convinfo+esi], -1
jz writefile
cmp byte [fileinfo+15],'F'
je F
cmp byte [fileinfo+11+26],'D'
je D
jmp add_element
D: cmp byte [convinfo+esi+26],'D'
cmp byte [fileinfo+15],'D'
jne add_element
D: cmp byte [convinfo+esi+15],'D'
je add_element
cmp byte [convinfo+esi+26],'F'
cmp byte [convinfo+esi+15],'F'
je skipfile
jmp add_element
F: cmp byte [convinfo+esi+26],'D'
F: cmp byte [convinfo+esi+15],'D'
je writenow
; cmp byte [convinfo+esi+26],'F'
; cmp byte [convinfo+esi+15],'F'
; je add_element
; jmp add_element
 
add_element:
mov al,[fileinfo+ebx+11]
cmp al,[convinfo+esi+ebx]
je equal
; compare items
movzx eax, [viewmode]
call [compare+eax*4]
jb writenow
skipfile:
add esi,62
mov ebx,[start] ;0
add esi,27
jmp ftestname
 
equal:
inc ebx
cmp ebx,[x0]
je writefile
cmp ebx,[x1]
je x1p
cmp ebx,[x2]
je x2p
cmp ebx,[x3]
jae x3p
jmp add_element
 
x1p:
mov ebx,18
jmp add_element
x2p:
mov ebx,15
jmp add_element
x3p:
mov ebx,0
jmp add_element
 
writenow:
mov ecx,4096*62
mov ecx,4096*27-1
sub ecx,esi
ldloop:
mov al,[convinfo+ecx+esi]
mov [convinfo+ecx+esi+62],al
mov [convinfo+ecx+esi+27],al
dec ecx
jns ldloop
 
 
writefile:
mov ecx,61
mov ecx,26
wfloop:
mov al,[fileinfo+ecx+11]
mov al,[fileinfo+ecx]
mov [convinfo+ecx+esi],al
dec ecx
jns wfloop
inc [listsize]
pop esi
 
nextfile:
 
nextfl:
; popad
; pushad
mov eax,edx
shl eax,26
cmp eax,0
jne no_outcnt
push edx
drawfbox 294,25,(4*6),10,cl_White
pop ebp
outcount ebp,294,25,cl_Black,4*65536
no_outcnt:
popad
add esi, 304
pop ebx
dec ebx
jnz newlineb
 
inc edx
cmp edx,4096
jnae newlineb
nofiles:
ret
 
toupper:
cmp al, 'a'
jb .ret
cmp al, 'z'
ja @f
.sub20:
sub al, 0x20
.ret:
ret
@@:
cmp al, 0xA0
jb .ret
cmp al, 0xB0
jb .sub20
cmp al, 0xE0
jb .ret
cmp al, 0xF0
jae @f
sub al, 0xE0-0x90
ret
@@:
cmp al, 0xF1
jnz .ret
dec eax
ret
 
;STEP 8 GET SIZE OF RESORTING LIST
mov ecx,0
mov edi,0
mov eax,[blocksread]
mov ebx,62
mul ebx
mov edx,eax
loogs:
mov eax,dword [convinfo+edi+26]
cmp eax,dword 0xffffffff
je endgs
add edi,62
inc ecx
cmp edi,edx ;4096*62
jnae loogs
endgs:
mov [listsize],ecx
compare_date:
pushad
mov al, [fileinfo+10]
cmp al, [convinfo+esi+10]
jnz .ret
mov al, [fileinfo+11]
cmp al, [convinfo+esi+11]
jnz .ret
mov al, [fileinfo+12]
cmp al, [convinfo+esi+12]
jnz .ret
mov al, [fileinfo+13]
cmp al, [convinfo+esi+13]
jnz .ret
mov al, [fileinfo+7]
cmp al, [convinfo+esi+7]
jnz .ret
mov al, [fileinfo+8]
cmp al, [convinfo+esi+8]
jnz .ret
mov al, [fileinfo+4]
cmp al, [convinfo+esi+4]
jnz .ret
mov al, [fileinfo+5]
cmp al, [convinfo+esi+5]
jz compare_name.1
.ret:
popad
ret
compare_name:
pushad
.1:
mov edi, dword [convinfo+esi]
mov esi, dword [fileinfo]
call strcmpi
popad
ret
compare_ext:
pushad
mov esi, dword [convinfo+esi]
mov edi, dword [fileinfo]
call find_ext
xchg esi, edi
call find_ext
call strcmpi
popad
jz compare_name
ret
compare_size:
pushad
lea edi, [convinfo+esi+19]
lea esi, [fileinfo+19]
mov ecx, 8
repz cmpsb
popad
jz compare_name
ret
 
strcmpi:
lodsb
call toupper
push eax
mov al, [edi]
inc edi
call toupper
cmp [esp], al
pop eax
jnz @f
test al, al
jnz strcmpi
@@:
ret
 
find_ext:
lodsb
test al, al
jz .noext
cmp al, '.'
jnz find_ext
ret
.noext:
dec esi
ret
 
;******************************************************************************
 
; DATA AREA
2705,10 → 2409,8
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?
viewmode dd 0 ;folder sort & not del
downstop dd 0
filecursor dd 0
mousex dd 0
2718,40 → 2420,55
temp dd 0
readblock dd 1
dlg_type db 0 ;S-save O-open
browser db 0 ;0-dialog, 1-browser
viewmode db 0 ;folder sort
 
hdimg1 db 'HD0 HARDDISK FOL '
hdimg2 db 'HD1 HARDDISK FOL '
hdimg3 db 'HD2 HARDDISK FOL '
hdimg4 db 'HD3 HARDDISK FOL '
compare dd compare_name
dd compare_ext
dd compare_size
dd compare_date
 
;01234567890123456789012345678901234567890123456789012345678912
hdimg db 'RD RAMDISK FOL '
db 'FD FLOPPYDISK FOL '
db ' '
db ' '
db ' '
db ' '
aRD db 'RD',0
aFD db 'FD',0
aHD0 db 'HD0',0
aHD1 db 'HD1',0
aHD2 db 'HD2',0
aHD3 db 'HD3',0
a1 db '1',0,0
a2 db '2',0,0
a3 db '3',0,0
a4 db '4',0,0
a5 db '5',0,0
a6 db '6',0,0
a7 db '7',0,0
a8 db '8',0,0
a9 db '9',0,0
a10 db '10',0
a11 db '11',0
a12 db '12',0
a13 db '13',0
a14 db '14',0
a15 db '15',0
a16 db '16',0
a17 db '17',0
a18 db '18',0
a19 db '19',0
a20 db '20',0
 
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 '
hdimg:
dd aRD
db 'RAMDISK FOL '
dd aFD
db 'FLOPPYDISK FOL '
hdimg1 dd 0
db 'HARDDISK FOL '
hdimg2 dd 0
db 'HARDDISK FOL '
hdimg3 dd 0
db 'HARDDISK FOL '
hdimg4 dd 0
db 'HARDDISK FOL '
ptimg db 'PARTITION FOL '
 
modetext:
;0123456789012345
2778,36 → 2495,53
; //// Willow
 
;Name of programs
editor db 'TINYPAD '
bmpview db 'MV '
jpgview db 'JPEGVIEW '
gifview db 'GIFVIEW '
ac97wav db 'AC97WAV '
copyrfile db 'COPYR '
rtfread db 'RTFREAD '
editor db '/RD/1/TINYPAD',0
bmpview db '/RD/1/MV',0
jpgview db '/RD/1/JPEGVIEW',0
gifview db '/RD/1/GIFVIEW',0
ac97wav db '/RD/1/AC97WAV',0
rtfread db '/RD/1/RTFREAD',0
; //// Willow
pngview db '@RCHER '
pngview db '/RD/1/@RCHER',0
; //// Willow
midamp db 'MIDAMP '
midamp db '/RD/1/MIDAMP',0
 
more_char db 10h
 
fileinfo_start:
dd 16
dd 7
dd 0
dd 0 ;tempzone+1000;
fileinfo_params:
dd 0
dd tempzone ;0x10000
open_path:
times 256 db 0 ;run app path
dd 0
dd 0
db 0
fileinfo_name:
dd 0
 
clipfile_info:
dd ?
dd 0
dd 0
dd ?
dd paramtest
db '/RD/1/CLIPFILE.TXT',0
copyr_run:
dd 7
dd 0
dd copyr_param
dd 0
dd 0
db '/RD/1/COPYR',0
 
fileinfoblock:
dd 0x0 ; read
dd 0x1 ; read folder
dd 0x0 ; first block
dd 0x1 ; number of blocks to read
farea:
dd 0x0 ; flags (ANSI names)
dd 4095 ; number of blocks to read
dd outinfo ; ret offset
dd tempzone ; work size of sytemram
path:
times 256 db 0 ;path
times 1024 db 0 ;path
 
table_area:
rb 10
2815,6 → 2549,12
;rb 256
but_file:
file 'systr12.GIF'
 
I_END:
 
scroll_height dd ?
scroll_pos dd ?
 
butimg:
rb 400*16*3+8 ;buttons (left pice of picture)
logoimg:
2852,23 → 2592,16
 
gif_hash:
rd 4096
tempzone: ;temp zone for 58 function
rb 4000
 
sourcepath rb 100
destpath rb 100
 
MYPID:
rd 8
 
I_END:
 
param_area:
rb 256
paramtest:
rb 256
rb 1024
filedir:
rb 256
rb 1024
 
procinfo process_information
sc system_colors
2876,10 → 2609,14
fileinfo:
rb 200 ;4096*62+1024
 
copyr_param rb 256
 
outinfo:
rb 4096*34+1024
rb 32+4096*304
 
convinfo:
rb 4096*62+1024
 
rb 4096*27
; stack
align 4
rb 1024
RAM_END:
/programs/media/midamp/trunk/MIDAMP.ASM
0,0 → 1,398
; MIDI PLAYER FOR MENUET v1.0
; Written in pure assembler by Ivushkin Andrey aka Willow
;
;
; Created: December 7, 2004
; Last changed: July 29, 2005
;
; COMPILE WITH FASM
 
PLAYLIST_PATH equ '/HD/1/MIDI/PLAYLIST.TXT'
APP_MEM equ 150*1024
DIR_SIZE equ 1024
 
IPC_PLAY equ 0xa1
IPC_PAUS equ 0xa2
IPC_TRIG equ 0xa3
IPC_UPDT equ 0xb1
IPC_NEXT equ 0xb2
 
LISTITEMS equ 40
WND_BACK equ 0x24263c
PLY equ 63
WND_HEIGHT equ (PLY+9*LISTITEMS+10)+25
 
BTNS_XY equ 14 shl 16+42
BTNS_SIZE equ 222 shl 16+17
 
BROWSE_X equ 10 shl 16+8
BROWSE_Y equ 26 shl 16+8
FN_XY equ 12 shl 16+15
BAR_WIDTH equ 251
BAR_X equ 10 shl 16
BAR_Y equ 29 shl 16+5
TOTALTIME_XY equ 124 shl 16+28
CURTIME_X equ 225 shl 16+40
CURTIME_Y equ 15 shl 16+11
CURTIME_XY equ 236 shl 16+15
 
NONCRITICAL_MSG equ 0
SOUND equ ON;OFF
OUTDUMP equ 0
OUTLINE equ 8
FL_SHUFFLE equ 0x01
FL_REPEAT equ 0x02
FL_HIDDEN equ 0x04
FL_MUTE equ 0x08
FL_REVERSE equ 0x10
FL_ADD equ 0x20
FL_PLAY equ 0x40
FL_LOCK equ 0x80
FL_BOTTRED equ 0x100
FL_MULSEL equ 0x8000
 
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd START
dd I_END
dd APP_MEM
dd APP_MEM-1024
dd I_PARAM
listsel dd 0
channel dd 0
COLOR_ORDER equ MENUETOS
include 'macros.inc' ; decrease code size (optional)
lang fix en
;purge mov
include 'debug.inc'
include 'dlg.inc'
include 'playlist.inc'
include 'gif_lite.inc'
bottom:
file 'bottom.gif'
hdrimg:
file 'hdr.gif'
btns:
file 'buttons.gif'
START:
or [flag],FL_BOTTRED;+FL_MUTE
mov ecx,ipcarea
call init_ipc
mcall 40,1000111b
mov esi,btns
mov edi,btn_raw
mov eax,hash_table
call ReadGIF
mov esi,hdrimg
mov edi,hdr_raw
mov eax,hash_table
call ReadGIF
mov esi,bottom
mov edi,bottom_raw
mov eax,hash_table
call ReadGIF
call respawn
mcall 9,prcinfo,-1
mov edx,[ebx+30]
mov [parentPID],edx
mov esi,I_PARAM
cmp dword[esi],0
jnz .yesparam
call PL_load
cmp [list_count],0
je noparam
mov eax,[pl_ptr]
or word[eax],FL_MULSEL
jmp auto_load
.yesparam:
mov al,byte[esi]
cmp al,'/'
je .defact
mov [param],al
inc esi
.defact:
mov edi,filename;fnbuf
mov ecx,64
rep movsd
jmp open_file
clearpath:
newline
mov [fname_len],0
noparam:
mov [param],'W'
or [flag],FL_ADD
call fopen
get_path:
cmp byte[filename],0
jz still
open_file:
cmp [param],'W'
je .noplay
cmp [param],'H'
jne .nohidd
; or [flag],FL_PLAY
or [flag],FL_HIDDEN
call draw_window
and [flag],not FL_HIDDEN
call Shade
; jmp .noplay
 
.nohidd:
or [flag],FL_PLAY
.noplay:
xor eax,eax
mov [play_area],ax
mov [tick_count],eax
mov [delta],eax
inc eax
mov [fsize],eax
mov [curnote],0x80
mov ecx,64
mov esi,filename
mov edi,I_PARAM
rep movsd
mov eax,58
mov ebx,file_info
int 0x40
mov eax,ebx
shr eax,9
inc eax
mov [fsize],eax
add ebx,workarea
mov [midi_limit],ebx
mov edi,I_PARAM
call find_slash
mov [fn_ptr],edi
mov edi,filename
call str_len
mov [fname_len],eax
mov eax,58
mov ebx,file_info
int 0x40
midi_kill:
call kill
include 'midilite.inc'
 
decode_end:
; dpd edi
; dps <13,10,'Notes='>
; sub edi,[midi_limit]
; shr edi,1
; dpd edi
dps ' Notes: max='
movzx eax,[max_note]
dpd eax
dps 'min='
movzx eax,[min_note]
dpd eax
newline
; sub esi,workarea
; jmp _close
.play:
call kill
call respawn
xor edx,edx
mov esi,[midi_limit]
mov [cur_ptr],esi
mov [cur_tick],edx
mov [delta],edx
.count_ticks:
lodsw
test eax,eax
jz .eof
and eax,0x7f
add edx,eax
jmp .count_ticks
.eof:
mov [tick_count],edx
if OUTDUMP eq 1
mov esi,[midi_limit]
call out_dump
end if
and [flag],not FL_LOCK
test [flag],FL_PLAY
jz .noplay
call draw_window
mcall 5,100
mov eax,IPC_PLAY
call ipc_send
.noplay:
test [flag],FL_ADD
jz red
mov esi,filename
mov ecx,[fname_len]
movzx eax,[list_count]
mov [play_num],eax
add_song:
call PL_add
and [flag],not FL_ADD
red:
call draw_window
still:
mov ecx,ipcarea
call init_ipc
mov eax,10
int 0x40
prc_event:
test eax,eax
jz still
.evt:
cmp eax,1
je red
cmp eax,2
je key
cmp eax,3
je button
cmp eax,7
jne still
movzx eax,byte[ipcarea+16]
cmp eax,IPC_UPDT
jne .noupdt
call draw_bar
jmp still
.noupdt:
cmp eax,IPC_NEXT
jne still
cmp [param],'H'
je _close
xor edx,edx
test [flag],FL_SHUFFLE
jz .noshuf
mcall 26,9
movzx ebx,byte[list_count]
div ebx
mov eax,edx
jmp play_
.noshuf:
test [flag],FL_REPEAT
jnz decode_end.play
mov eax,[play_num]
inc eax
cmp al,[list_count]
jb bList.next
mov eax,IPC_PAUS
call ipc_send
jmp red
 
if OUTDUMP eq 1
out_dump:
mov ecx,OUTLINE
.next_byte:
lodsd
bswap eax
dph eax
dps ' '
lodsd
bswap eax
dph eax
dps <13,10>
loop .next_byte
ret
end if
 
str_len:
; in: edi-str ptr
; out: eax-str length
push ecx edi
xor eax,eax
mov ecx,256
repne scasb
jecxz .nofn
sub edi,[esp]
mov eax,edi
.nofn:
pop edi ecx
ret
 
fopen:
or [flag],FL_LOCK
opendialog draw_window, ret_path, ret_path, filename
ret_path:
and [flag],not FL_LOCK
ret
 
include 'event.inc'
include "thread.inc"
include "draw.inc"
; ‡¤¥áì ­ å®¤ïâáï ¤ ­­ë¥ ¯à®£à ¬¬ë:
 
dd -2 shl 16+4,251,12 shl 16,29 shl 16+5
dd 21,16
main_coo:
dd 14 shl 16, 42 shl 16,23 shl 16
dd 228 shl 16+38
dd 14 shl 16+10
dd 236 shl 16+15
btncoords:
dd 120 shl 16+20, 1 shl 16+15
dd 149 shl 16+44, 2 shl 16+12
dd 195 shl 16+26, 2 shl 16+12
 
dd -2 shl 16+4,54,63 shl 16,6 shl 16+4
dd 6,6
main_coo2:
dd 169 shl 16, 4 shl 16,9 shl 16
dd 121 shl 16+40
dd 3 shl 16+9
dd 130 shl 16+4
btncoords2:
dd 48 shl 16+6, 6
dd 2000 shl 16+44, 2 shl 16+12
dd 2000 shl 16+26, 2 shl 16+12
ipcarea rb 20
ipcarea2 rb 20
 
dots db ':-'
text db 'tone> chnl> <trk'
text_end:
coo dd main_coo
play_limit dd playlist
pl_ptr dd playlist
param db 'W'
curnote db 0x80
tick_count dd 0
play_area dw ?
file_info:
dd 0
dd 0
fsize dd 1
dd workarea
dd hash_table
I_END: ; ª®­¥æ ¯à®£à ¬¬ë
filename:
rb 1024+16
prcinfo process_information
I_PARAM rb 256
childPID dd ?
parentPID dd ?
play_num dd ?
counter dd ?
flag dd ?
fname_len dd ?
fn_ptr dd ?
delta dd ?
cur_ptr dd ?
cur_tick dd ?
quarter dd ?
octave db ?
tempo dd ?
midi_limit dd ?
track_len dd ?
list_count db ?
cur_track db ?
sel_track db ?
ipcmsg db ?
fnbuf:
rb 256
btn_raw rb 222*17*3+12
hdr_raw rb 275*29*3+12
bottom_raw rb 25*378*3+12
rb 4
playlist rb 256*LISTITEMS
hash_table:
rd 4096
dir_table rb DIR_SIZE
workarea:
/programs/media/midamp/trunk/bottom.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/media/midamp/trunk/build.bat
0,0 → 1,0
fasm MIDAMP.ASM MIDAMP
/programs/media/midamp/trunk/buttons.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/media/midamp/trunk/debug.inc
0,0 → 1,137
macro debug_print str
{
local ..string, ..label
 
jmp ..label
..string db str,0
..label:
 
pushf
pushad
mov edx,..string
call debug_outstr
popad
popf
}
 
dps fix debug_print
 
macro debug_print_dec arg
{
pushf
pushad
if ~arg eq eax
mov eax,arg
end if
call debug_outdec
popad
popf
}
 
dpd fix debug_print_dec
 
;---------------------------------
debug_outdec: ;(eax - num, edi-str)
push 10 ;2
pop ecx ;1
push -'0' ;2
.l0:
xor edx,edx ;2
div ecx ;2
push edx ;1
test eax,eax ;2
jnz .l0 ;2
.l1:
pop eax ;1
add al,'0' ;2
call debug_outchar ; stosb
jnz .l1 ;2
ret ;1
;---------------------------------
 
debug_outchar: ; al - char
pushf
pushad
mov cl,al
mov eax,63
mov ebx,1
int 0x40
popad
popf
ret
 
debug_outstr:
mov eax,63
mov ebx,1
@@:
mov cl,[edx]
test cl,cl
jz @f
int 40h
inc edx
jmp @b
@@:
ret
 
_debug_crlf db 13, 10, 0
 
macro newline
{
pushf
pushad
mov edx, _debug_crlf
call debug_outstr
popad
popf
}
 
macro print message
{
dps message
newline
}
 
macro pregs
{
dps "EAX: "
dpd eax
dps " EBX: "
dpd ebx
newline
dps "ECX: "
dpd ecx
dps " EDX: "
dpd edx
newline
}
 
macro debug_print_hex arg
{
pushf
pushad
if ~arg eq eax
mov eax, arg
end if
call debug_outhex
popad
popf
}
dph fix debug_print_hex
 
debug_outhex:
; eax - number
mov edx, 8
.new_char:
rol eax, 4
movzx ecx, al
and cl, 0x0f
mov cl, [__hexdigits + ecx]
pushad
mcall 63, 1
popad
dec edx
jnz .new_char
ret
 
__hexdigits:
db '0123456789ABCDEF'
/programs/media/midamp/trunk/dlg.inc
0,0 → 1,209
macro opendialog redproc,openoff,erroff,path
{
local new_d, get_loops, dlg_pid_get, DLGPID, num_of_proc
local run_fileinfo, param
local getmesloop, loox, mred, mkey, mbutton, mgetmes
local dlg_is_work, ready
;
; STEP 1 Run SYSXTREE with parametrs MYPID 4 bytes in dec,
; 1 byte space, 1 byte type of dialog (O - Open ,S - Save)
;
 
cld
;; mov esi,path
mov edi,path
xor eax,eax
mov ecx,(1024+16)/4
rep stosb
 
;mov [get_loops],0
mov [dlg_pid_get],0
 
; Get my PID in dec format 4 bytes
; mov eax,9
; mov ebx,prcinfo
; mov ecx,-1
; int 0x40
mov eax,[parentPID]
; convert eax bin to param dec
; mov eax,dword [prcinfo+30] ;offset of myPID
mov edi,param+4-1 ;offset to 4 bytes
mov ecx,4
mov ebx,10
cld
new_d:
xor edx,edx
div ebx
add dl,'0'
mov [edi],dl
dec edi
loop new_d
 
; wirite 1 byte space to param
mov [param+4],byte 32 ;Space for next parametr
; and 1 byte type of dialog to param
mov [param+5],byte 'O' ;Get Open dialog (Use 'S' for Save dialog)
 
;
; STEP2 prepare IPC area for get messages
;
 
; prepare IPC area
mov [path],dword 0
mov [path+4],dword 8
 
; define IPC memory
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,1024+16 ; size
int 0x40
 
; change wanted events list 7-bit IPC event
mov eax,40
mov ebx,01000111b
int 0x40
 
;
; STEP 3 run SYSTEM XTREE with parameters
;
 
mov eax,70
mov ebx,run_fileinfo
int 0x40
 
call redproc
 
mov [get_loops],0
getmesloop:
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
 
; Get number of procces
mov ebx,prcinfo
mov ecx,-1
mov eax,9
int 0x40
mov ebp,eax
 
loox:
mov eax,9
mov ebx,prcinfo
mov ecx,ebp
int 0x40
mov eax,[DLGPID]
cmp [prcinfo+30],eax ;IF Dialog find
je dlg_is_work ;jmp to dlg_is_work
dec ebp
jnz loox
 
jmp erroff
 
dlg_is_work:
cmp [prcinfo+50],word 9 ;If slot state 9 - dialog is terminated
je erroff ;TESTODP2 terminated too
 
cmp [dlg_pid_get],dword 1
je getmesloop
inc [get_loops]
cmp [get_loops],4 ;2 sec if DLG_PID not get, TESTOP2 terminated
jae erroff
jmp getmesloop
 
mred:
call redproc
jmp getmesloop
mkey:
mov eax,2
int 0x40 ; read (eax=2)
jmp getmesloop
mbutton:
mov eax,17 ; get id
int 0x40
cmp ah,1 ; button id=1 ?
jne getmesloop
mov eax,-1 ; close this program
int 0x40
mgetmes:
 
; If dlg_pid_get then second message get jmp to still
cmp [dlg_pid_get],dword 1
je ready
 
; First message is number of PID SYSXTREE dialog
 
; convert PID dec to PID bin
movzx eax,byte [path+16]
sub eax,48
imul eax,10
movzx ebx,byte [path+16+1]
add eax,ebx
sub eax,48
imul eax,10
movzx ebx,byte [path+16+2]
add eax,ebx
sub eax,48
imul eax,10
movzx ebx,byte [path+16+3]
add eax,ebx
sub eax,48
mov [DLGPID],eax
 
; Claear and prepare IPC area for next message
mov [path],dword 0
mov [path+4],dword 8
mov [path+8],dword 0
mov [path+12],dword 0
mov [path+16],dword 0
 
; Set dlg_pid_get for get next message
mov [dlg_pid_get],dword 1
call redproc ;show DLG_PID
jmp getmesloop
 
ready:
;
; The second message get
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,1024/4
rep movsd
mov [edi],byte 0
 
jmp openoff
 
 
; DATA AREA
get_loops dd 0
dlg_pid_get dd 0
DLGPID dd 0
 
param:
dd 0 ; My dec PID
dd 0,0 ; Type of dialog
 
run_fileinfo:
dd 7
dd 0
dd param
dd 0
dd 0
;run_filepath
db '/RD/1/SYSXTREE',0
 
;prcinfo:
;times 256 db 0
}
/programs/media/midamp/trunk/draw.inc
0,0 → 1,356
; *********************************************
; ******* DRAW PLAY BAR **********************
; *********************************************
 
draw_bar:
push eax ebp
mov eax,[cur_tick]
test eax,eax
jz .ex
mov ebp,[coo]
mov ebx,[ebp-20]
mul ebx
mov ebx,[tick_count]
test ebx,ebx
jz .ex
div ebx
mov ebx,[ebp-16]
mov bx,ax
mov ecx,[ebp-12]
mov edx,0x84706a
mov eax,13
int 0x40
mov esi,TOTALTIME_XY
mov eax,[tick_count]
call draw_total_time
.nobar:
mov esi,[ebp+20]
mov ebx,[ebp+12]
mov ecx,[ebp+16]
call draw_cur_time
mov esi,140 shl 16+(WND_HEIGHT-18)
sub ebx,95 shl 16
add ecx,(WND_HEIGHT-34)shl 16
call draw_cur_time
.ex:
pop ebp eax
ret
 
 
 
; *********************************************
; ******* Ž…„…‹…ˆ… ˆ Ž’ˆ‘Ž‚Š€ ŽŠ€ *******
; *********************************************
 
draw_window:
mov eax,12
mov ebx,1
int 0x40
or [flag],FL_BOTTRED
xor eax,eax
mov ebx,100*65536+275
mov ecx,200*65536+WND_HEIGHT
mov edi,hdr_raw+12
mov ebp,[coo]
test [flag],FL_HIDDEN
jz .nohide1
and ebx,0xffff
and ecx,0xffff
add edi,275*14*3
.nohide1:
push edi
mov edx,WND_BACK
mov esi,edx
mov edi,edx
int 0x40
mov ecx,[channel]
shl ecx,4
add cl,[sel_track]
mcall 47,0x20100,,<191,15>,0xf0f000
movsx ecx,[octave]
add ecx,100
mcall ,0x30000,,<132,15>
pop ebx
mcall 7,,(275 shl 16+14),0
mov esi,0x80ecce7a
 
mov eax,8
mov ebx,265 shl 16+7
mov ecx,3 shl 16+7
mov edx,1+1 shl 30
int 0x40 ; close button
sub ebx,10 shl 16
mov edx,100+1 shl 30
int 0x40 ; shade button-101
sub ebx,10 shl 16
add edx,3
int 0x40 ; minimize button-103
sub ebx,239 shl 16
inc edx ; about button-104
int 0x40
xor esi,esi
xor edi,edi
mov ecx,3
pushd [ebp+12]
pushd [ebp+16]
call draw_navigation
add esp,8
 
mov ebx,[ebp-16]
add ebx,[ebp-20]
mov ecx,[ebp-12]
add ecx,[ebp-24]
mov esi,0x2c2b46
mov edx,2+1 shl 29
int 0x40
 
shr eax,1
 
mov ecx,12
mov ebx,FN_XY
mov edx,[fn_ptr];I_PARAM;filename
mov esi,1;[fname_len]
mov edi,0x00e200
.fnlp:
push ecx
mcall ,,edi
add ebx,1 shl 16
mcall
add ebx,6 shl 16
inc edx
pop ecx
loop .fnlp
add ebx,5 shl 16
mcall ,,0xa0a0a0,text,text_end-text
call draw_bar
call PL_show
test [flag],FL_HIDDEN
jnz .nohide2
mov eax,7
mov ebx,btn_raw+12
mov ecx,BTNS_SIZE
mov edx,BTNS_XY
int 0x40
.nohide2:
mov esi,FL_SHUFFLE
mov edi,btncoords+8
mov eax,13
mov edx,0xd600
mov ecx,2
.loo3:
test [flag],esi
je .el
mov ebx,[edi]
add ebx,5 shl 16
add ebx,[ebp]
mov bx,3
push ecx
mov ecx,[edi+4]
add ecx,4 shl 16
add ecx,[ebp+4]
mov cx,2
int 0x40
pop ecx
.el:
add edi,8
inc esi
loop .loo3
 
.enddraw:
mov eax,12
mov ebx,2
int 0x40
ret
 
draw_navigation:
; ebp - coordinates
push esi edi ecx
mov eax,8
 
mov ecx,5
mov ebx,[ebp]
add ebx,[ebp-8]
add ebx,esi
mov edx,3+1 shl 30
.btnloo:
push ecx
mov ecx,[ebp+4]
add ecx,[ebp-4]
add ecx,edi
int 0x40
pop ecx
add ebx,[ebp+8]
inc edx
loop .btnloo
pop ecx
 
lea edi,[ebp+24]
.btnloo2:
mov ebx,[edi]
add ebx,[ebp]
add ebx,[esp+4]
push ecx
mov ecx,[edi+4]
add ecx,[ebp+4]
add ecx,[esp+4]
int 0x40
pop ecx
add edi,8
inc edx
loop .btnloo2
pop edi esi
ret
 
draw_cur_time:
pusha
mcall 13,,,WND_BACK
mcall 8,,,101+1 shl 29+1 shl 30
mov ebx,[tick_count]
mov eax,[cur_tick]
test [flag],FL_REVERSE
jz .norev
xchg eax,ebx
sub eax,ebx
lea ebx,[esi-6 shl 16]
push eax
mcall 4,,0xf000,dots+1,1
pop eax
.norev:
mov [esp+28],eax
popa
draw_total_time: ; eax -time to show
pusha
xor edx,edx
mov ebx,100
div ebx
xor edx,edx
mov ebx,60
div ebx
push edx
mov ecx,eax
mcall 47,0x20000,,esi,0xf000
pop ecx
add edx,17 shl 16
int 0x40
sub edx,5 shl 16
mcall 4,edx,esi,dots,1
popa
ret
 
BOTT_BTN equ 25 shl 16+18
BOTT_SIZEX equ 25
BOTT_SIZEY equ 18
BOTT_S equ BOTT_SIZEX*BOTT_SIZEY*3
BOTT_X equ PL_X
BOTT_Y equ (WND_HEIGHT-27)
BOTT_SPACE equ 30 shl 16
 
popup db -1
 
draw_bottom:
pusha
mcall 13,175,(BOTT_Y-5)shl 16+24,WND_BACK
add ebx,(266-30)shl 16-135
mcall
mov ecx,5
mov esi,bot_btn
push esi
mov ebx,bottom_raw+12
xor eax,eax
.nxt:
push ecx
lodsw
shl eax,16
lea edx,[eax+BOTT_Y]
mcall 7,,BOTT_BTN
add ebx,BOTT_S*4
pop ecx
cmp ecx,4
jne .noadj
add ebx,BOTT_S
.noadj:
loop .nxt
mov esi,[esp]
mov ecx,5
mov ebp,BOTT_Y shl 16+BOTT_SIZEY
mov edx,20+1 shl 30
.nxt2:
push ecx
lodsw
shl eax,16
lea ebx,[eax+BOTT_SIZEX+2 shl 16-3]
mcall 8,,ebp
inc edx
pop ecx
loop .nxt2
pop esi
call draw_popup
popa
ret
 
draw_popup:
movsx eax,[popup]
cmp eax,0
jge .ok
mov edx,30+1 shl 31
mov ecx,21
mov eax,8
.clr:
mcall
inc edx
loop .clr
jmp .ex
.ok:
push eax
lea edx,[eax+1 shl 31+20]
mcall 8
pop eax
mov ebx,eax
shl eax,2
mov ecx,3
cmp eax,4
jne .noadj1
inc ecx
.noadj1:
cmp eax,8
jb .noadj2
inc eax
.noadj2:
inc eax
push eax
movzx edx,word[bot_btn+ebx*2]
shl edx,16
add edx,BOTT_Y
push edx
.noadj3:
imul ebx,eax,BOTT_S
add ebx,bottom_raw+12
push ecx
.nxt:
push ecx
mcall 7,,BOTT_BTN
add ebx,BOTT_S
sub edx,BOTT_SIZEY
pop ecx
loop .nxt
pop ecx ebx edx
mov ebp,BOTT_Y shl 16+BOTT_SIZEY
mov eax,8
add edx,1 shl 30+30
add ebx,2 shl 16
mov bx,BOTT_SIZEX-3
.nxt2:
push ecx
mcall ,,ebp
inc edx
sub ebp,BOTT_SIZEY shl 16
pop ecx
loop .nxt2
.ex:
ret
 
bot_btn:
dw 10,40,70,100,240
 
about1:
db 13,10,'* MIDAMP for MenuetOS v1.0 by Willow, July 2005 *',13,10,0
/programs/media/midamp/trunk/event.inc
0,0 → 1,449
key_codes db 27,182,109,115,114,122,98,118,108,120,99,13,8,32,0, 0, 0,0
db 180,181,93,91
; bottom actions
db 0, 0, 0, 0, 0,185,0, 0, 0, 0,0,0,92
btn_codes db 1, 0, 0, 9, 10, 3, 7, 6, 8, 4, 5, 0,0, 0,101,100,11,2
db 0, 0, 0, 0
; bottom actions
db 35,49,48,37,31,32,41,42,40,36,103,104,0
jmps dw _close, kDel,kMute, bList.shuf, bList.repe, bList.prev, bList.next
dw bList.stop, kLoad, Xpress, Rewind.space, auto_load,Rewind, Rewind.space
dw bReverse, bShade, bList, bBar, bOctU, bOctD, bSelTrack, bSelChannel
; bottom actions
dw kDel,bLsave,bLload,bRemAll,bAdd,bAddDir,bSelZero,bInvSel,bSelAll,bRemCrop
dw bMinimize,bAbout,bResetTrk
 
jmps_end:
 
key:
mov eax,2
int 0x40
mov edi,key_codes
cmp ah,48
jb .jump
cmp ah,57
ja .jump
sub ah,48
mov byte[channel],ah
jmp midi_kill
.jump:
mov ecx,(jmps_end-jmps)/2
mov ebx,edi
shr eax,8
repne scasb
jne play_.noplsel
sub edi,ebx
jmp word[jmps+edi*2-2]
kDel:
call PL_del
call PL_show
jmp still
kMute:
xor [flag],FL_MUTE
jmp still
kLoad:
; dps 'Load'
cmp [list_count],LISTITEMS
jbe noparam
jmp still
Xpress:
mov eax,IPC_PLAY
call ipc_send
jmp still;Rewind.space
auto_load:
call PL_get1stsel
mov eax,ebx
play_:
mov [play_num],eax
call PL_getbyindex
mov edi,filename;fnbuf
rep movsb
xor eax,eax
mov byte[edi],al
and [flag],not FL_ADD
or [flag],FL_PLAY
jmp open_file
.noplsel:
call PL_get1stsel
test ebx,ebx
jz .noupward
cmp al,178
jne .noupa
.seldec:
dec ebx;[listsel]
.listdraw:
call PL_clearsel
mov eax,ebx
call PL_getbyindex
or word[esi-2],FL_MULSEL
call PL_show
jmp still
.noupa:
cmp al,184
jne .noupward
dec [listsel]
.swap:
dec ebx
call PL_swap
jmp .listdraw
.noupward:
inc ebx
cmp bl,[list_count]
jae still
cmp al,177
je .listdraw
.nodowna:
cmp al,183
jne still
inc [listsel]
jmp .swap
Rewind:
push [midi_limit]
pop [cur_ptr]
and [cur_tick],0
jmp red
.space:
cmp [tick_count],0
jz still
mov eax,IPC_TRIG
call ipc_send
jmp red
 
button:
mov eax,17
int 0x40
cmp ah,20
jb .nobott
cmp ah,25
ja .nobott
sub ah,20
mov [popup],ah
.sh:
or [flag],FL_BOTTRED
call PL_show
jmp still
.nobott:
cmp ah,31
jb .nopop
cmp ah,50
ja .nopop
mov [popup],-1
or [flag],FL_BOTTRED
call PL_show
 
SH_POPUP equ 10
if SH_POPUP eq 1
mov ebx,eax
shr ebx,8
dps 'Popup#='
dpd ebx
jmp .sh
end if
.nopop:
mov edi,btn_codes
jmp key.jump
bReverse:
xor [flag],FL_REVERSE
call draw_bar
jmp still
_close:
call kill
or eax,-1
int 0x40
 
bShade:
call Shade
jmp still
Shade:
xor [flag],FL_HIDDEN
test [flag],FL_HIDDEN
jz .open
mov esi,14
mov [coo],main_coo2
jmp .op
.open:
mov esi,WND_HEIGHT
mov [coo],main_coo
.op:
mov ebx,-1
mov ecx,ebx
mov edx,ebx
mov eax,67
int 0x40
ret
bMinimize:
; mcall 18,10
jmp still
bList:
mov [popup],-1
mov edx,[listsel]
call PL_getitemclick
mov [listsel],eax
mcall 66,3
mov ebx,eax
; dph ebx
test ebx,1100b
jnz .mul
call PL_clearsel
test ebx,11b
jz .skipor
mov ecx,[listsel]
mov [listsel],edx
cmp ecx,edx
je .skipor
ja .above
xchg ecx,edx
.above:
sub ecx,edx
inc ecx
mov eax,edx
push ecx
call PL_getbyindex
sub esi,2
pop ecx
call PL_shiftsel
jmp .plsh
.mul:
bts [flag],15
jc .skipor
mov eax,edx
call PL_getbyindex
or word[esi-2],FL_MULSEL
.skipor:
mov eax,[listsel]
call PL_getbyindex
xor word[esi-2],FL_MULSEL
.plsh:
call PL_show
mcall 40,111b
mcall 23,30
push eax
mcall 40,1000111b
pop eax
cmp eax,3
jne still
mcall 17
cmp ah,11
jne still
call PL_getitemclick
cmp eax,[listsel]
je auto_load
mov [listsel],eax
call PL_show
jmp still
.repe:
xor [flag],FL_REPEAT
jmp red
.stop:
mov eax,IPC_PAUS
call ipc_send
jmp Rewind
.shuf:
xor [flag],FL_SHUFFLE
jmp red
.prev:
mov eax,[play_num]
test eax,eax
jz still
dec eax
jmp play_
.next:
mov eax,[play_num]
inc eax
cmp al,[list_count]
jae still
jmp play_
bBar:
cmp [tick_count],0
jz still
mov eax,37
mov ebx,1
int 0x40
mov ebp,[coo]
sub eax,[ebp-16]
shr eax,16
mov ebx,[tick_count]
mul ebx
mov ebx,[ebp-20]
div ebx
mov ebx,eax ; ebx - selected tick
xor ecx,ecx
mov esi,[midi_limit]
.further:
lodsw
and eax,0x7f
add ecx,eax
cmp ecx,ebx
jb .further
sub ecx,eax
mov [cur_tick],ecx
sub esi,2
mov [cur_ptr],esi
drw:
jmp red
 
OCT_CH equ 3
bOctU:
add [octave],OCT_CH
jmp midi_kill
bOctD:
sub [octave],OCT_CH
jmp midi_kill
bSelChannel:
call get_num
cmp eax,-1
je still
dps <13,10,'Channel#'>
dpd eax
mov [channel],eax
jmp midi_kill
bSelTrack:
call get_num
cmp eax,-1
je still
dps <13,10,'Track#'>
dpd eax
mov [sel_track],al
jmp midi_kill
bResetTrk:
xor eax,eax
mov [sel_track],al
mov [channel],eax
dps <13,10,'Both track & channel are 0',13,10>
jmp midi_kill
bLsave:
call PL_save
bLload:
call PL_load
jmp red
bRemAll:
and [list_count],0
mov [play_limit],playlist-2
jmp red
bAdd:
movzx eax,[list_count]
dpd eax
call fopen
mov edi,filename
cmp byte[edi],0
jz still
call str_len
xchg eax,ecx
mov esi,edi
jmp add_song
bAddDir:
call fopen
mov edi,filename
cmp byte[edi],0
jz still
call find_slash
lea edx,[edi-filename+fnbuf] ; edx -> '/'
and byte[edi],0
mov esi,filename
mov edi,fnbuf
mov ecx,64
rep movsb
mov dword[file_info+12],dir_table
mov dword[file_info+8],DIR_SIZE/512
.nxt2:
mcall 58,file_info
mov ecx,DIR_SIZE/32
mov esi,dir_table
.nxt:
mov al,[esi]
cmp al,0xe5
je .no
test al,al
jz .end
test byte[esi+12],11000b
jnz .no
mov eax,[esi+7]
mov al,'.'
cmp eax,'.MID'
je .ok
cmp eax,'.KAR'
jne .no
.ok:
mov [esi+8],eax
pusha
mov edi,edx
mov ecx,12
rep movsb
and byte[edi],0
mov ecx,edi
sub ecx,fnbuf
mov esi,fnbuf
call PL_add
popa
.no:
add esi,32
loop .nxt
add dword[file_info+4],DIR_SIZE/512
jmp .nxt2
.end:
mov ebx,file_info
and dword[ebx+4],0
mov [fsize],1
mov dword[ebx+12],workarea
jmp red;still
bSelZero:
call PL_clearsel
jmp red
bInvSel:
call PL_invsel
jmp red
bSelAll:
call PL_clearsel
call PL_invsel
jmp red
bRemCrop:
call PL_invsel
call PL_del
jmp bSelAll
bAbout:
mov edx,about1
call debug_outstr
jmp still
 
get_num: ; out: eax-number entered
or [flag],FL_LOCK
mcall 10
dpd eax
cmp eax,1
jne .nored
call draw_window
jmp get_num
.nored:
cmp eax,2
jne .nokey
mcall 2
movzx eax,ah
sub eax,'0'
jl .none
cmp eax,9
jbe .ok
.none:
mov eax,-1
.ok:
and [flag],not FL_LOCK
ret
.nokey:
cmp eax,3
jne get_num
mcall 17
jmp get_num
 
find_slash:
; in: edi-filename, out: edi-slash ptr-1
push eax ecx
call str_len
mov ecx,eax
std
add edi,eax
mov al,'/'
repne scasb
cld
add edi,2
pop ecx eax
ret
 
/programs/media/midamp/trunk/gif_lite.inc
0,0 → 1,328
; GIF LITE v2.0 by Willow
; Written in pure assembler by Ivushkin Andrey aka Willow
;
; This include file will contain functions to handle GIF image format
;
; Created: August 15, 2004
; Last changed: September 9, 2004
 
; Change COLOR_ORDER in your program
; if colors are displayed improperly
 
if ~ (COLOR_ORDER in <MENUETOS,OTHER>)
; This message may not appear under MenuetOS, so watch...
display 'Please define COLOR_ORDER: MENUETOS or OTHER',13,10
end if
 
; virtual structure, used internally
 
struc GIF_list
{
.NextImg rd 1
.Left rw 1
.Top rw 1
.Width rw 1
.Height rw 1
}
 
struc GIF_info
{
.Left rw 1
.Top rw 1
.Width rw 1
.Height rw 1
}
 
_null fix 0x1000
 
; ****************************************
; FUNCTION GetGIFinfo - retrieve Nth image info
; ****************************************
; in:
; esi - pointer to image list header
; ecx - image_index (0...img_count-1)
; edi - pointer to GIF_info structure to be filled
 
; out:
; eax - pointer to RAW data, or 0, if error
 
GetGIFinfo:
push esi ecx edi
xor eax,eax
jecxz .eloop
.lp:
mov esi,[esi]
test esi,esi
jz .error
loop .lp
.eloop:
add esi,4
movsd
movsd
mov eax,esi
.error:
pop edi ecx esi
ret
 
; ****************************************
; FUNCTION ReadGIF - unpacks GIF image
; ****************************************
; in:
; esi - pointer to GIF file in memory
; edi - pointer to output image list
; eax - pointer to work area (MIN 16 KB!)
 
; out:
; eax - 0, all OK;
; eax - 1, invalid signature;
; eax >=8, unsupported image attributes
;
; ecx - number of images
 
ReadGIF:
push esi edi
mov [.table_ptr],eax
mov [.cur_info],edi
xor eax,eax
mov [.globalColor],eax
mov [.img_count],eax
inc eax
cmp dword[esi],'GIF8'
jne .er ; signature
mov ecx,[esi+0xa]
inc eax
add esi,0xd
mov edi,esi
bt ecx,7
jnc .nextblock
mov [.globalColor],esi
call .Gif_skipmap
.nextblock:
cmp byte[edi],0x21
jne .noextblock
inc edi
cmp byte[edi],0xf9 ; Graphic Control Ext
jne .no_gc
add edi,7
jmp .nextblock
.no_gc:
cmp byte[edi],0xfe ; Comment Ext
jne .no_comm
inc edi
.block_skip:
movzx eax,byte[edi]
lea edi,[edi+eax+1]
cmp byte[edi],0
jnz .block_skip
inc edi
jmp .nextblock
.no_comm:
cmp byte[edi],0xff ; Application Ext
jne .nextblock
add edi,13
jmp .block_skip
.noextblock:
cmp byte[edi],0x2c ; image beginning
jne .er
inc [.img_count]
inc edi
mov esi,[.cur_info]
add esi,4
xchg esi,edi
movsd
movsd
push edi
movzx ecx,word[esi]
inc esi
bt ecx,7
jc .uselocal
push [.globalColor]
mov edi,esi
jmp .setPal
.uselocal:
call .Gif_skipmap
push esi
.setPal:
movzx ecx,byte[edi]
inc ecx
mov [.codesize],ecx
dec ecx
pop [.Palette]
lea esi,[edi+1]
mov edi,[.table_ptr]
xor eax,eax
cld
lodsb ; eax - block_count
add eax,esi
mov [.block_ofs],eax
mov [.bit_count],8
mov eax,1
shl eax,cl
mov [.CC],eax
inc eax
mov [.EOI],eax
lea ecx,[eax-1]
mov eax, _null shl 16
.filltable:
stosd
inc eax
loop .filltable
pop edi
mov [.img_start],edi
.reinit:
mov edx,[.EOI]
inc edx
push [.codesize]
pop [.compsize]
call .Gif_get_sym
cmp eax,[.CC]
je .reinit
call .Gif_output
.cycle:
movzx ebx,ax
call .Gif_get_sym
cmp eax,edx
jae .notintable
cmp eax,[.CC]
je .reinit
cmp eax,[.EOI]
je .end
call .Gif_output
.add:
push eax
mov eax,[.table_ptr]
mov [eax+edx*4],ebx
pop eax
cmp edx,0xFFF
jae .cycle
inc edx
bsr ebx,edx
cmp ebx,[.compsize]
jne .noinc
inc [.compsize]
.noinc:
jmp .cycle
.notintable:
push eax
mov eax,ebx
call .Gif_output
push ebx
movzx eax,bx
call .Gif_output
pop ebx eax
jmp .add
.er:
pop edi
jmp .ex
.end:
mov eax,[.cur_info]
mov [eax],edi
mov [.cur_info],edi
add esi,2
xchg esi,edi
.nxt:
cmp byte[edi],0
jnz .continue
inc edi
jmp .nxt
.continue:
cmp byte[edi],0x3b
jne .nextblock
xor eax,eax
stosd
mov ecx,[.img_count]
.ex:
pop edi esi
ret
 
.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
mov ebx,1
shl ebx,cl
lea ebx,[ebx*2+ebx]
lea edi,[esi+ebx]
ret
 
.Gif_get_sym:
mov ecx,[.compsize]
push ecx
xor eax,eax
.shift:
ror byte[esi],1
rcr eax,1
dec [.bit_count]
jnz .loop1
inc esi
cmp esi,[.block_ofs]
jb .noblock
push eax
xor eax,eax
lodsb
test eax,eax
jnz .nextbl
mov eax,[.EOI]
sub esi,2
add esp,8
jmp .exx
.nextbl:
add eax,esi
mov [.block_ofs],eax
pop eax
.noblock:
mov [.bit_count],8
.loop1:
loop .shift
pop ecx
rol eax,cl
.exx:
xor ecx,ecx
ret
 
.Gif_output:
push esi eax edx
mov edx,[.table_ptr]
.next:
push word[edx+eax*4]
mov ax,word[edx+eax*4+2]
inc ecx
cmp ax,_null
jnz .next
shl ebx,16
mov bx,[esp]
.loop2:
pop ax
 
lea esi,[eax+eax*2]
add esi,[.Palette]
 
if COLOR_ORDER eq MENUETOS
mov esi,[esi]
bswap esi
shr esi,8
mov [edi],esi
add edi,3
else
movsw
movsb
end if
 
loop .loop2
pop edx eax esi
ret
 
.globalColor rd 1
.img_count rd 1
.cur_info rd 1 ; image table pointer
.img_start rd 1
.codesize rd 1
.compsize rd 1
.bit_count rd 1
.CC rd 1
.EOI rd 1
.Palette rd 1
.block_ofs rd 1
.table_ptr rd 1
/programs/media/midamp/trunk/hdr.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/media/midamp/trunk/macros.inc
0,0 → 1,267
; new application structure
macro meos_app_start
{
use32
org 0x0
 
db 'MENUET01'
dd 0x01
dd __start
dd __end
dd __memory
dd __stack
 
if used __params & ~defined __params
dd __params
else
dd 0x0
end if
 
dd 0x0
}
MEOS_APP_START fix meos_app_start
 
macro code
{
__start:
}
CODE fix code
 
macro data
{
__data:
}
DATA fix data
 
macro udata
{
if used __params & ~defined __params
__params:
db 0
__end:
rb 255
else
__end:
end if
__udata:
}
UDATA fix udata
 
macro meos_app_end
{
align 32
rb 2048
__stack:
__memory:
}
MEOS_APP_END fix meos_app_end
 
 
; macro for defining multiline text data
struc mstr [sstring]
{
forward
local ssize
virtual at 0
db sstring
ssize = $
end virtual
dd ssize
db sstring
common
dd -1
}
 
 
; strings
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
end if
forward
if (used name)&(lang eq lng)
db data
end if
common
if used name
.size = $-name
end if
}
 
 
 
; easy system call macro
macro mpack dest, hsrc, lsrc
{
if (hsrc eqtype 0) & (lsrc eqtype 0)
mov dest, (hsrc) shl 16 + lsrc
else
if (hsrc eqtype 0) & (~lsrc eqtype 0)
mov dest, (hsrc) shl 16
add dest, lsrc
else
mov dest, hsrc
shl dest, 16
add dest, lsrc
end if
end if
}
 
macro __mov reg,a,b { ; mike.dld
if (~a eq)&(~b eq)
mpack reg,a,b
else if (~a eq)&(b eq)
mov reg,a
end if
}
 
macro mcall a,b,c,d,e,f { ; mike.dld
__mov eax,a
__mov ebx,b
__mov ecx,c
__mov edx,d
__mov esi,e
__mov edi,f
int 0x40
}
 
 
 
 
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
macro add arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
inc arg1
else
add arg1,arg2
end if
else
add arg1,arg2
end if
}
 
macro sub arg1,arg2
{
if (arg2 eqtype 0)
if (arg2) = 1
dec arg1
else
sub arg1,arg2
end if
else
sub arg1,arg2
end if
}
 
macro mov arg1,arg2
{
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
xor arg1,arg1
inc arg1
else if (arg2) = -1
or arg1,-1
else if (arg2) > -128 & (arg2) < 128
push arg2
pop arg1
else
mov arg1,arg2
end if
else
mov arg1,arg2
end if
}
 
 
macro struct name
{
virtual at 0
name name
sizeof.#name = $ - name
end virtual
}
 
; 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
 
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
 
 
; constants
 
; events
EV_IDLE = 0
EV_TIMER = 0
EV_REDRAW = 1
EV_KEY = 2
EV_BUTTON = 3
EV_EXIT = 4
EV_BACKGROUND = 5
EV_MOUSE = 6
EV_IPC = 7
EV_STACK = 8
 
; event mask bits for function 40
EVM_REDRAW = 1b
EVM_KEY = 10b
EVM_BUTTON = 100b
EVM_EXIT = 1000b
EVM_BACKGROUND = 10000b
EVM_MOUSE = 100000b
EVM_IPC = 1000000b
EVM_STACK = 10000000b
/programs/media/midamp/trunk/midamp.txt
0,0 → 1,247
MIDAMP for Menuet v1.0 July 29, 2005
Written in pure assembler by Ivushkin Andrey aka Willow
 
Monophonic MIDI player
 
Vivat assembler et MENUETOS!
MenuetOS still has a poor sound capabilities. Drivers are written for a few
soundcard models. Till recently I considered MEOS to be as voiceless as an
oyster. But then an alternative appeared; dear VaStaNi wrote kernel support of
PC speaker. Old good times of Pascal and MS-DOS came to me again. About 5 years
ago I wrote a Pascal application that parsed and played a note string in QBasic
syntax.
 
Now MeOS gets the simplest, speaker-driven sound scheme in Mario79's distro,
but the first melody in Menuet I heard was from the my program MIDAMP in
December, 2004. On technical reasons its release takes place only now.
 
So, MIDAMP is the simplest single-voiced MIDI player. It cannot do much though
it resembles the famous WinAmp. All it can do is to beep MIDI files.
There are no equalizer, balance and fader, and they won't appear. Moreover,
I may guarantee the correct sound only for files having a single track, one
instrument channel and within technological range of notes :-(
 
#########
System requirements:
1. Kernel having following function implemented:
55/55 - PC speaker interface (critical!)
67 - window shading;
66/3 - for extended mouse selection in playlist.
2. SYSXTREE version not below 52 - opening files and directories (critical!)
3. RAM amount for application - about 150 Kbytes.
#########
 
MIDAMP still uses a single playlist - /HD/1/PLAYLIST.TXT by default. Persons
interested can change the PLAYLIST_PATH constant value in MIDAMP.ASM. Playlist
is a simple text file having filenames to be played in each line. It is NOT
RECOMMENDED to edit the playlist by hand - bugs may appear while loading MIDAMP.
 
When started, MIDAMP creates a new thread whose job is actually playing. Early
versions had main thread that processed everything, therefore unpleasant sound
delays appeared when managing the playlist. Threads communicate intensively
through IPC, although I think it's an excess in such a case. But it works not
bad.
 
MIDAMP is able to shade to window header by pressing the proper button. I tried
to perform complete minimization through mcall 18,10 (new feature of Kolibri4),
but ran into the problem while restoring of window when PANEL button pressed.
That function possibly does not support windows type II ?
 
Hotkeys - almost like in WinAmp:
 
Del - delete the selected tracks;
z - previous track;
x, Enter, double click - play selected file;
c, Space - pause;
v - stop;
b - next track;
 
Esc - close the program;
m - sound on/off;
PgUp, PgDn - swap 2 tracks (not completed!);
BackSpace - rewind track;
Home/End - increase/decrease melody notes offset and play track from beginning
(it is shown near 'tone>' text).
In the case of polyphonic MIDI, if an intelligent melody isn't heard, you may
try to choose another track 'trk' or instrument channel 'chnl', pressing '[' or
']' accordingly and then a number key from '0' to '9'. The file will be played
from the beginning. To reset track and channel to the default value, press '\' .
 
Explaining some interface buttons:
Shuffle toggles random playback on/off. Repeat - current track will loop again
and again. An icon in the top left corner outputs a brief info about the
program to the Debug Board. Clicking the time toggles its view - from beginning
or from the end of file.
 
Mouse click on playlist when holding Shift or Ctrl button works like in WinAmp.
 
Remarks to bottom buttons:
'Add URL' not implemented, on clear reasons;
'Add Dir' - specify any file in the directory desired. *.MID and *.KAR files of
that directory will be added to the list;
'Misc' submenu is not implemented;
'New List' does nothing. MIDAMP still uses a fixed playlist.
 
One of the following flags may precede a filename in the commandline:
 
W - to load a file and wait (default);
P - to play a file;
H - to start shaded and close after playback.
 
To-Do list:
 
1. Increase playlist size (40 items for now).
2. Add dialog to select tracks of polyphonic melodies including analysis on
notes.
3. Reading text in Karaoke files.
4. Playlist select.
5. Note editor, as in Ringtone Editor.
6. Add comments to source.
7. Correct bugs to be found.
 
Special thanks to:
 
VaStaNi - there would be no need of MIDAMP w/o his code
Standard MIDI Files 0.06 March 1, 1988
MIDI 1.0 Specification
General MIDI Level Spec
MIDI SAMPLE DUMP STANDARD
Standard MIDI File Format by Dustin Caldwell
Files format of MIDI
The USENET MIDI Primer by Bob McQueer
Pavlushin Evgeny for his splendid SYSXTREE (DLGS.INC is the opendialog macro
of ASCL library edited to meet MIDAMP specific needs)
 
Send the wishes and bug reports to wil_low@hotbox.ru or to the meos.sysbin.com
forum.
 
See you later!
 
 
****************************************
****************************************
 
MIDAMP ¤«ï Menuet v1.0 29 ¨î«ï 2005 £.
 ¯¨á ­  ­  ç¨á⮬  áᥬ¡«¥à¥ ˆ¢ã誨­ë¬ €­¤à¥¥¬ (Willow)
 
Œ®­®ä®­¨ç¥áª¨© MIDI-¯«¥¥à
 
Vivat assembler et MENUETOS!
‘® §¢ãª®¬ ¢ MenuetOS â㣮 ¤® á¨å ¯®à. „à ©¢¥à  ­ ¯¨á ­ë ¤«ï ®£à ­¨ç¥­­®£® ªà㣠
§¢ãª®¢ëå ª àâ. „® ­¥¤ ¢­¥£® ¢à¥¬¥­¨ MeOS ¡ë«  ¤«ï ¬¥­ï ­¥¬ , ª ª àë¡ . ® ¯®â®¬
¯®ï¢¨« áì  «ìâ¥à­ â¨¢  - 㢠¦ ¥¬ë© VaStaNi ­ ¯¨á « ¯®¤¤¥à¦ªã PC ᯨª¥à . Œ­¥
áࠧ㠢ᯮ¬­¨«¨áì áâ àë¥ ¤®¡àë¥ ¢à¥¬¥­   áª «ï ¨ MS-DOS. ‹¥â 5 ­ § ¤ ­ ¯¨á «
­   áª «¥ ¯à®£à ¬¬ªã, ª®â®à ï ¯ àᨫ ,   ¯®â®¬ ¢®á¯à®¨§¢®¤¨«  áâப㠭®â ¢
ᨭ⠪á¨á¥ QBasic.
 
‘¥©ç á MeOS ¢ ¤¨áâਡã⨢¥ Mario79 ®¡à¥â ¥â ¯à®á⥩èãî §¢ãª®¢ãî á奬ã á ¯®¬®éìî
ᯨª¥à , ­® ¯¥à¢ãî ¬¥«®¤¨î ¢ Menuet ï ãá«ëè « ¢á¥-â ª¨ ®â ᢮¥© ¯à®£à ¬¬ë -
MIDAMP ¢ ¤¥ª ¡à¥ 2004 £®¤ . ® â¥å­¨ç¥áª¨¬ ¯à¨ç¨­ ¬ ¥¥ ५¨§ ¯à®¨á室¨â ⮫쪮
ᥩç á.
 
ˆâ ª, MIDAMP - ¯à®á⥩訩 ®¤­®£®«®áë© MIDI-¯à®¨£à뢠⥫ì. Ž­ ­¥ ¯à¥â¥­¤ã¥â ­ 
¬­®£®¥, å®âì ¨ ¯®å®¦ ­  WinAmp. ‚á¥, çâ® ®­ 㬥¥â, íâ® ¯¨«¨ª âì MIDI-ä ©«ë.
ª¢ « ©§¥à , ¡ « ­á  ¨ ॣã«ïâ®à  £à®¬ª®á⨠­¥â ¨ ­¥ ¯à¥¤¢¨¤¨âáï. ®«¥¥ ⮣®,
ª®à४⭮¥ §¢ãç ­¨¥ ¬®£ã £ à ­â¨à®¢ âì «¨èì ¤«ï ä ©«®¢ á 1 â४®¬, 1 ª ­ «®¬
¨­áâà㬥­â  ¨ ¢ ¯à¥¤¥« å â¥å­®«®£¨ç¥áª®£® ¤¨ ¯ §®­  ­®â :-(
 
#########
‘¨á⥬­ë¥ âॡ®¢ ­¨ï:
1. Ÿ¤à® á ॠ«¨§ æ¨¥© á«¥¤ãîé¨å á¨á⥬­ëå ä㭪権:
55/55 - ¨­â¥à䥩á PC ᯨª¥à  (­¥®¡å®¤¨¬®!);
67 - ᢮à ç¨¢ ­¨¥ ®ª­  ¢ § £®«®¢®ª;
66/3 - ¤«ï ०¨¬®¢ ¢ë¤¥«¥­¨ï â४®¢ ¬ëèìî.
2. SYSXTREE ¢¥àᨨ ­¥ ­¨¦¥ 52 - ®âªàë⨥ ä ©«®¢ ¨ ª â «®£®¢ (­¥®¡å®¤¨¬®!)
3. Ž¡ê¥¬ ¯ ¬ï⨠¤«ï ¯à®£à ¬¬ë - ®ª®«® 150 Š¡.
#########
 
®ª  çâ® MIDAMP ¨á¯®«ì§ã¥â ¥¤¨­á⢥­­ë© ¯«¥©«¨áâ - ¯® 㬮«ç ­¨î
/HD/1/PLAYLIST.TXT. †¥« î騥 ¬®£ãâ ¨§¬¥­¨âì §­ ç¥­¨¥ ª®­áâ ­âë PLAYLIST_PATH ¢
ä ©«¥ MIDAMP.ASM. «¥©«¨áâ - ®¡ëç­ë© ⥪áâ®¢ë© ä ©«, ¢ ª ¦¤®© áâப¥ ª®â®à®£®
­ å®¤¨âáï ¨¬ï ä ©«  ¤«ï ¢®á¯à®¨§¢¥¤¥­¨ï. …£® … …ŠŽŒ…„“…’‘Ÿ ¯à ¢¨âì ¢àãç­ãî -
¢®§¬®¦­ë ¡ £¨ ¯à¨ ¯®á«¥¤ãî饩 § £à㧪¥ ¥£® ¯à¨«®¦¥­¨¥¬.
 
à¨ § ¯ã᪥ MIDAMP ᮧ¤ ¥â ­®¢ë© ¯®â®ª, § ¤ ç¥© ª®â®à®£® ï¥âáï ᮡá⢥­­®
®§¢ã窠. ‚ à ­­¨å ¢¥àá¨ïå ¢á¥ ¤¥« « £« ¢­ë© ¯®â®ª, ¯®í⮬㠢®§­¨ª «¨ ­¥¯à¨ïâ­ë¥
§ ¤¥à¦ª¨ ¢ §¢ãç ­¨¨ ¢® ¢à¥¬ï ã¯à ¢«¥­¨ï ¯«¥©«¨á⮬. ®â®ª¨ ¨­â¥­á¨¢­® ®¡é îâáï
¬¥¦¤ã ᮡ®© ç¥à¥§ IPC, å®âï ï ᪫®­ïîáì ª ⮬ã, çâ® ¢ ¤ ­­®¬ á«ãç ¥ íâ®
¨§«¨è¥á⢮. ® à ¡®â ¥â ­¥¯«®å®.
 
MIDAMP 㬥¥â ᢮à ç¨¢ âìáï ¢ áâப㠧 £®«®¢ª  ­ ¦ â¨¥¬ ᮮ⢥âáâ¢ãî饩 ª­®¯ª¨.
Ÿ ¯ëâ «áï ᤥ« âì ¯®«­®¥ ᢮à ç¨¢ ­¨¥ ç¥à¥§ mcall 18,10 (­®¢ ï ä¨ç  Kolibri4),
­® á⮫ª­ã«áï á ¯à®¡«¥¬®© ¢®ááâ ­®¢«¥­¨ï ®ª­  ­ ¦ â¨¥¬ ª­®¯ª¨ PANEL. ‚®§¬®¦­®,
äã­ªæ¨ï ­¥ ¯®¤¤¥à¦¨¢ ¥â ®ª­  ⨯  II ?
 
ƒ®àï稥 ª« ¢¨è¨ - ¯®ç⨠ª ª ¢ WinAmp:
 
Del - 㤠«¨âì ¢ë¤¥«¥­­ë¥ â४¨;
z - ¯à¥¤ë¤ã騩 â४;
x, Enter, ¤¢®©­®© 饫箪 ­  ä ©«¥ - ¢®á¯à®¨§¢¥¤¥­¨¥;
c, Space - ¯ ã§ ;
v - á⮯;
b - á«¥¤ãî騩 â४;
 
Esc - § ªàëâì ¯à®£à ¬¬ã;
m - ¢ª«îç¨âì/¢ëª«îç¨âì §¢ãª;
PgUp, PgDn - ¯®¬¥­ïâì ¬¥áâ ¬¨ 2 á®á¥¤­¨å â४  (­¥ § ª®­ç¥­®!);
BackSpace - ¯¥à¥¬®âª  â४  ¢ ­ ç «®;
Home/End - 㢥«¨ç¨âì/㬥­ìè¨âì â®­ «ì­®áâì ¬¥«®¤¨¨ ¨ ¯à®¨£à âì ¥¥ á ­ ç « 
(®â®¡à ¦ ¥âáï à冷¬ á ­ ¤¯¨áìî 'tone>').
‚ á«ãç ¥ ¯®«¨ä®­¨ç¥áª¨å MIDI, ¥á«¨ ®á¬ëá«¥­­®© ¬¥«®¤¨¨ ­¥ ¯®«ãç ¥âáï, ¬®¦­®
¯®¯à®¡®¢ âì ¢ë¡à âì ¤à㣮© â४ 'trk' ¨«¨ ª ­ « ¨­áâà㬥­â  'chnl', ­ ¦ ¢
ᮮ⢥âá⢥­­® '[' ¨«¨ ']' ¨ § â¥¬ ª« ¢¨èã á ­®¬¥à®¬ ®â 0 ¤® 9. ” ©« ¡ã¤¥â
¢®á¯à®¨§¢¥¤¥­ á á ¬®£® ­ ç « . ‘¡à®á ¤®à®¦ª¨ ¨ ª ­ «  ¢ §­ ç¥­¨¥ ¯® 㬮«ç ­¨î -
­ ¦ â¨¥¬ '\' .
 
 §­ ç¥­¨¥ ­¥ª®â®àëå ª­®¯®ª ¨­â¥à䥩á :
Shuffle - á«ãç ©­ë© ¯®à冷ª ¯à®¨£à뢠­¨ï â४®¢. Repeat - ⥪ã騩 â४ ¡ã¤¥â
¯à®¨£à뢠âìáï á­®¢  ¨ á­®¢ . ‡­ ç®ª ¢ «¥¢®¬ ¢¥àå­¥¬ 㣫㠢뢮¤¨â ªà âªãî
¨­ä®à¬ æ¨î ® ¯à®£à ¬¬¥ ­  ¤®áªã ®â« ¤ª¨. ™¥«ç®ª ­  ¢à¥¬¥­­®© ¬¥âª¥ ¬¥­ï¥â
ᯮᮡ ¥¥ ®â®¡à ¦¥­¨ï - á ­ ç «  ¨«¨ á ª®­æ  ä ©« .
 
™¥«ç®ª ¬ëèìî ­  ¯«¥©«¨áâ¥ á ­ ¦ âë¬ Shift ¨«¨ Ctrl à ¡®â ¥â  ­ «®£¨ç­® WinAmp.
 
‡ ¬¥ç ­¨ï ®â­®á¨â¥«ì­® ª­®¯®ª ¢­¨§ã:
'Add URL' ­¥ ॠ«¨§®¢ ­® ¯® ¯®­ïâ­ë¬ ¯à¨ç¨­ ¬;
'Add Dir' - 㪠¦¨â¥ «î¡®© ä ©« ¢ ¦¥« ¥¬®¬ ª â «®£¥. ” ©«ë *.MID ¨ *.KAR í⮣®
ª â «®£  ¡ã¤ãâ ¤®¡ ¢«¥­ë ¢ ᯨ᮪;
'Misc' ¯®¤¬¥­î ­¥ ॠ«¨§®¢ ­®;
'New List' ­¨ç¥£® ­¥ ¤¥« ¥â. ®ª  ¨á¯®«ì§ã¥âáï 䨪á¨à®¢ ­­ë© ¯«¥©«¨áâ.
 
‚ ª®¬ ­¤­®© áâப¥ ¯¥à¥¤ ¨¬¥­¥¬ ä ©«  ¤«ï ¢®á¯à®¨§¢¥¤¥­¨ï ¬®¦¥â áâ®ïâì ®¤¨­ ¨§
ä« £®¢:
 
W - ¯à®áâ® § £à㧨âì ä ©« (¯® 㬮«ç ­¨î);
P - ¢®á¯à®¨§¢¥á⨠䠩«;
H - áâ à⮢ âì ᢥà­ãâë¬ ¢ § £®«®¢®ª, § ªàëâìáï ¯®á«¥ ¢®á¯à®¨§¢¥¤¥­¨ï.
 
—â® ¥é¥ ­ã¦­® ᤥ« âì:
 
1. “¢¥«¨ç¨âì à §¬¥àë ¯«¥©«¨áâ  (ᥩç á 40 ¯®§¨æ¨©).
2. „®¡ ¢¨âì ¤¨ «®£ ¢ë¡®à  â४®¢ ¯®«¨ä®­¨ç¥áª¨å ¬¥«®¤¨© á ¨å  ­ «¨§®¬ ¯®
­ «¨ç¨î ­®â.
3. —⥭¨¥ ⥪áâ  ¢ ª à ®ª¥-ä ©« å.
4. ‚ë¡®à ¯«¥©«¨áâ .
5. ®â­ë© । ªâ®à, ª ª ¢ Ringtone Editor.
6. Žâª®¬¬¥­â¨à®¢ âì ª®¤ (ª ª ¢á¥£¤ , «¥­ì).
7. ˆá¯à ¢¨âì ¡ £¨, ª®â®àë¥, ­¥á®¬­¥­­®, ­ ©¤ãâáï ;-)
 
Žá®¡ë¥ ¡« £®¤ à­®áâ¨:
 
VaStaNi - ¡¥§ ¥£® ª®¤  ­ ¯¨á ­¨¥ MIDAMP ­¥ ¨¬¥«® ¡ë á¬ëá« 
Standard MIDI Files 0.06 March 1, 1988
MIDI 1.0 Specification
General MIDI Level Spec
MIDI SAMPLE DUMP STANDARD
Standard MIDI File Format by Dustin Caldwell
”®à¬ â ä ©«®¢ MIDI
The USENET MIDI Primer by Bob McQueer
 ¢«îè¨­ã …¢£¥­¨î §  ­¥¯à¥¢§®©¤¥­­ë© SYSXTREE (DLGS.INC - ¯¥à¥à ¡®â ­­ë© á
ãç¥â®¬ ᯥæ¨ä¨ª¨ MIDAMP'a ¬ ªà®á opendialog ¡¨¡«¨®â¥ª¨ ASCL)
 
®¦¥« ­¨ï ¨ á®®¡é¥­¨ï ®¡ ®è¨¡ª å ­ ¯à ¢«ï©â¥ ­  wil_low@hotbox.ru ¨«¨ ­  ä®àã¬
meos.sysbin.com.
 
„® ­®¢ëå ¢áâà¥ç!
/programs/media/midamp/trunk/midilite.inc
0,0 → 1,292
SYS equ meos
midi_parse:
and [max_note],0
and [cur_track],0
mov [min_note],0xff
mov edi,[midi_limit]
cmp dword[workarea],'MThd'
je .head_ok
mov edx,sHeadInv
call debug_outstr
jmp clearpath
.head_ok:
cmp dword[workarea+4],0x6000000
je .heads_ok
mov edx,sHSizeInv
call debug_outstr
jmp clearpath
.heads_ok:
cmp dword[workarea+8],0x1000000
jmp .headt_ok
mov edx,sTypeUnsup
call debug_outstr
jmp clearpath
.headt_ok:
movzx eax,word[workarea+12]
rol ax,8
mov [quarter],eax
mov [tempo],50
mov esi,workarea+0xe
skip_sections:
lodsd
cmp eax,'MTrk'
je track_found
if SYS eq meos
; dps <'What?',13,10>
end if
lodsd
add esi,eax
cmp esi,[midi_limit]
jbe skip_sections
if NONCRITICAL_MSG eq 1
dps 'No more tracks'
end if
and word[edi],0
; ud2
jmp decode_end
track_found:
if SYS eq meos1
dps <13,10,'Track '>
push esi
sub esi,workarea
; dpd esi
pop esi
end if
lodsd
bswap eax
mov bl,[cur_track]
cmp bl,[sel_track]
je .trk_fnd
add esi,eax
jmp next_event.eot
.trk_fnd:
mov [track_len],eax
dps 'TRK'
next_event:
call readvar
; dpd eax
add [delta],eax
lodsw ; al -event, ah - next byte
if SYS eq meos1
dph eax
dps <' ',13,10>
newline
end if
test al,0x80 ; check if a valid event
jnz .valid_evt2
dec esi
shl ax,8
mov al,[prev_cmd]
jmp .valid_evt
.valid_evt2:
mov [prev_cmd],al
.valid_evt:
cmp al,0xf0
jne .nosysex
dec esi
call readvar
add esi,eax
jmp next_event
.nosysex:
cmp al,0xff
jne .no_meta
 
; meta events
cmp ah,0x51
jne .notempo
push eax edx
mov eax,[esi]
xor al,al
bswap eax
xor edx,edx
mov ebx,10000
div ebx
pop edx eax
jmp .no_eot
.notempo:
cmp ah,0x2f ; end of track
jne .no_eot
inc esi
if SYS eq meos1
dps <13,10,'EOT'>
push esi
sub esi,workarea
dpd esi
pop esi
; mcall 5,200
; dph eax
; ud2
end if
.eot:
; dps 'EOT '
inc [cur_track]
jmp skip_sections;decode_end
.no_eot:
lodsb
movzx ecx,al ; ecx - length of metadata
add esi,ecx
jmp next_event
.no_meta:
cmp al,0xfa ; system ctl events
jb .no_sys
.dec_esi:
dec esi
jmp next_event
.no_sys:
cmp al,0xf8
je .dec_esi
movzx ecx,al ; ecx - MIDI Event Command
and ecx,0xf ; cl - channel
and al,0xf0 ; al - event code
 
cmp al,0xe0 ; Pitch wheel change
je .inc_esi
cmp al,0xb0
ja .no_inc
.inc_esi:
inc esi
.no_inc:
cmp ecx,[channel] ; Channel must be 0 !!!
jz .chan_ok
if NONCRITICAL_MSG eq 1
dps 'C' ; Reference to unsupported channel !!!
dpd ecx
mov ecx,esi
dps '-'
sub ecx,workarea+1
dpd ecx
end if
jmp next_event
.chan_ok:
cmp al,0x90 ; Note On
jne .no_noon
add al,[octave]
cmp [curnote],0x80
je .note_ok
if NONCRITICAL_MSG eq 1
dps 'N!' ; Note On without Off !!!
end if
.note_ok:
; dps 'N+'
; movzx ecx,ah
; dpd ecx
call insert_pause
mov [curnote],ah ; [curnote]=note number
jmp next_event
.no_noon:
cmp al,0x80 ; Note Off
jne .no_nooff
add ah,[octave]
cmp ah,[curnote]
je .off_ok
if NONCRITICAL_MSG eq 1
dps 'n!' ; Note Off mismatch !!!
end if
.off_ok:
; dps 'N-'
cmp ah,[max_note]
jbe .nomax
mov [max_note],ah
.nomax:
cmp ah,[min_note]
jae .ins
mov [min_note],ah
.ins:
call insert_note
mov [curnote],al
 
.no_nooff: ; No more supported events
jmp next_event
prev_cmd db ?
max_note db ?
min_note db ?
; *********************************************
; ******* READ VARIABLE BYTES ****************
; *********************************************
 
readvar:
; in: esi - pointer;
; out: esi - new pointer; eax - value;
push ebx ecx
movzx ebx,byte[esi]
inc esi
btr ebx,7
jnc .exit
.next:
shl ebx,7
lodsb
mov ecx,eax
and eax,0x7f
add ebx,eax
cmp cl,0x7f
ja .next
.exit:
mov eax,ebx
pop ecx ebx
ret
 
; *********************************************
; ******* INSERT PAUSE ***********************
; *********************************************
 
insert_pause:
cmp [delta],0
jz return
push eax ebx ecx
mov ah,0xff
jmp write_note
 
; *********************************************
; ******* INSERT NOTE ************************
; *********************************************
 
insert_note: ; ah - note code
push eax ebx ecx
movzx eax,ah
mov ebx,12
div bl
shl al,4
add ah,al
sub ah,0x1f
write_note:
push eax
mov eax,[delta]
mov edx,[tempo]
mul edx
mov ecx,[quarter]
div ecx ; ax - note delay
cmp eax,0x7f
jb .ok
mov eax,0x7f
.ok:
movzx ecx,al
or ecx,0x80
pop eax
mov al,cl
stosw
xor eax,eax
mov [delta],eax
pop ecx ebx eax
return:
ret
 
sHeadInv:
if lang eq ru
db "¥¢¥à­ë© § £®«®¢®ª",0
else
db "Header invalid",0
end if
 
sHSizeInv:
if lang eq ru
db '¥¢¥à­ë© à §¬¥à § £®«®¢ª ',0
else
db 'Header size invalid',0
end if
 
sTypeUnsup:
if lang eq ru
db '’¨¯ MIDI ­¥ ¯®¤¤¥à¦¨¢ ¥âáï',0
else
db 'MIDI type not supported',0
end if
/programs/media/midamp/trunk/playlist.inc
0,0 → 1,349
; Playlist support for MIDPLAY
LCOLOR equ 0x00ff00
PCOLOR equ 0xffffff
 
PL_X equ 10 shl 16
PL_Y equ PLY shl 16
PL_XY equ 10 shl 16+PLY
 
PL_show:
test [flag],FL_HIDDEN
jnz .ex
pusha
and [counter],0
mov ebx,PL_X+255
mov eax,13
mov ecx,PL_Y-1 shl 16+4+9*LISTITEMS
xor edx,edx
int 0x40
movzx ecx,byte[list_count]
test ecx,ecx
jz .ex2
push ecx
imul ecx,9
add ecx,PL_Y-1 shl 16-2
mov edx,11+1 shl 29+1 shl 30
mov eax,8
int 0x40
pop ecx
mov edi,[pl_ptr]
mov eax,4
mov ebx,PL_XY+2 shl 16
.sh_loop:
movzx esi,word[edi]
and esi,not FL_MULSEL
add edi,2
pusha
mov edx,edi
mov ecx,[counter]
test word[edi-2],FL_MULSEL
jz .nosel
pusha
mov ebx,PL_X+255+1 shl 16-2
imul ecx,9
shl ecx,16
add ecx,PL_Y-1 shl 16+8
mov edx,0xc6
mov eax,13
int 0x40
popa
.nosel:
pusha
mov edx,ebx
mov esi,0xa0a0a0;0x508cec
mcall 47,0x30000
popa
cmp ecx,[play_num]
je .high
mov ecx,LCOLOR
jmp .int
.high:
mov ecx,PCOLOR
.int:
add ebx,25 shl 16
int 0x40
popa
add edi,esi
add ebx,9
inc [counter]
loop .sh_loop2
jmp .ex2
.sh_loop2:
jmp .sh_loop
.ex2:
popa
test [flag],FL_BOTTRED
jz .nobott
pusha
mcall 7,hdr_raw+12+275*16*3,<275,12>,<10,(WND_HEIGHT-20)>
mov ebp,main_coo2
mov esi,10 shl 16
mov edi,(WND_HEIGHT-22)shl 16
mov ecx,1
pushd 155 shl 16+5
pushd (WND_HEIGHT-22) shl 16+5
call draw_navigation
add esp,8
popa
call draw_bottom
and [flag],not FL_BOTTRED
.nobott:
.ex:
ret
 
PL_add:
; in: esi->filename,ecx->fname_len
jecxz .ex
cmp [list_count],LISTITEMS
jae .ex
pusha
mov edi,[play_limit]
mov [edi],cx
add edi,2
rep movsb
mov [play_limit],edi
inc [list_count]
popa
.ex:
ret
 
PL_del:
movzx ecx,byte[list_count]
jecxz .ex
call PL_get1stsel
mov edx,ebx
.lp:
mov edi,esi
xor eax,eax
lodsw
btr eax,15
jc .elp2
add esi,eax
jmp .elp
.elp2:
push esi ecx
add esi,eax
mov ecx,[play_limit]
sub ecx,esi
rep movsb
mov [play_limit],edi
dec [list_count]
cmp edx,[play_num]
ja .no
dec [play_num]
.no:
pop ecx esi
sub esi,2
.elp:
inc edx
loop .lp
.ex:
ret
 
PL_getitemclick:
; out: eax- item # (0..n)
mov ebx,1
mov eax,37
int 0x40
sub eax,PLY-1
mov ebx,9
div bl
movzx eax,al
ret
 
PL_getbyindex:
; in:eax-index, out: esi-filename, ecx-length
mov esi,[pl_ptr]
mov ecx,eax
.loop:
lodsw
and eax,not FL_MULSEL
jecxz .gbi
add esi,eax
dec ecx
jmp .loop
.gbi:
movzx ecx,ax
ret
 
PL_get1stsel:
; out: esi- 1st selected, ebx - index
mov esi,[pl_ptr]
xor ebx,ebx
PL_getnextsel:
push eax ecx
movzx ecx,[list_count]
.lp:
movzx eax,word[esi]
btr eax,15
jc .ex2
lea esi,[esi+eax+2]
inc ebx
loop .lp
xor ebx,ebx
.ex2:
pop ecx
.ex:
pop eax
ret
 
PL_clearsel:
pusha
mov ebx,not FL_MULSEL
xor eax,eax
mov esi,[pl_ptr]
movzx ecx,[list_count]
jecxz .flg
.loop:
and word[esi],bx
lodsw
add esi,eax
loop .loop
.flg:
and [flag],not FL_MULSEL
popa
ret
 
PL_shiftsel:
pusha
xor eax,eax
; mov esi,[pl_ptr]
; movzx ecx,[list_count]
.loop:
lodsw
or word[esi-2],FL_MULSEL
add esi,eax
loop .loop
jmp PL_clearsel.flg
 
PL_invsel:
pusha
mov ebx,not FL_MULSEL
xor eax,eax
mov esi,[pl_ptr]
movzx ecx,[list_count]
jecxz .ex
.loop:
xor word[esi],FL_MULSEL
lodsw
and eax,ebx
add esi,eax
loop .loop
.ex:
jmp PL_clearsel.flg
 
PL_load:
and [list_count],0
mov [pl_ptr],playlist
mov ebx,PL_info
mov dword[ebx+12],playlist
mov eax,58
int 0x40
test eax,eax
jz .ok1 ; ebx- filesize
cmp eax,6
jne .ex
.ok1:
mov eax,0x0a0d
cmp word[playlist],ax
je .ok
sub [pl_ptr],2
.ok:
mov edi,[pl_ptr]
add ebx,edi
mov word[ebx],ax
add edi,2
.loo:
mov edx,edi
.loo2:
mov ecx,256
repne scasb
cmp edi,ebx
jb .ok2
lea edi,[ebx+1]
.ok2:
mov ecx,edi
sub ecx,edx
dec ecx
inc edi
jecxz .shift
mov [edx-2],cx
inc [list_count]
cmp edi,ebx
jb .loo
.ex1:
sub ebx,2
mov [play_limit],ebx
.ex:
ret
 
.shift:
mov ecx,ebx
sub ecx,edi
jecxz .ex1
sub ebx,2
mov esi,edi
sub edi,2
push edi
rep movsb
pop edi
jmp .loo
 
PL_save:
movzx ecx,byte[list_count]
jecxz .ex
mov eax,0x0a0d
mov edi,[pl_ptr]
lea edx,[edi+2]
mov [PL_info+12],edx
.savl:
movzx ebx,word[edi]
and bx,not FL_MULSEL
stosw
add edi,ebx
loop .savl
stosw
sub edi,[pl_ptr]
mov ebx,PL_info
mov [ebx+8],edi
mov dword[ebx],1
mov eax,58
int 0x40
.ex:
ret
 
PL_swap: ; swap [ebx] with [ebx+1]
mov eax,ebx
call PL_getbyindex
add ecx,2
sub esi,2
push ecx esi ; save begin & length of 1st fname
mov edi,fnbuf
rep movsb
movzx ecx,word[esi]
and cx,not FL_MULSEL
add ecx,2
pop edi
rep movsb
pop ecx
mov esi,fnbuf
rep movsb
cmp ebx,[play_num]
jne .nosel1
inc [play_num]
ret
.nosel1:
inc ebx
cmp ebx,[play_num]
jne .nosel2
dec [play_num]
.nosel2:
ret
 
PL_info:
.mode dd 0
dd 0
.bytes dd 20
dd 0
dd hash_table
db PLAYLIST_PATH,0
/programs/media/midamp/trunk/playlist.txt
0,0 → 1,30
/HD/1/MIDI2/MID/CALIFOR .MID
/HD/1/MIDI2/ZNAYU .MID
/HD/1/MIDI2/MID/WILD_D~1.MID
/HD/1/MIDI/FILES/JACKSON .MID
/HD/1/MIDI/FILES/MOZART .MID
/HD/1/MIDI2/MID/FAVGAME .MID
/HD/1/MIDI/PETERB .MID
/HD/1/MIDI/KVN .MID
/HD/1/MIDI2/911 .MID
/HD/1/MIDI2/HYMN .MID
/HD/1/MIDI2/GEIGU .MID
/HD/1/MIDI2/MID/COMEAS .MID
/HD/1/MIDI/FILES/SAINTS .MID
/HD/1/MIDI/FILES/SNOW .MID
/HD/1/MIDI/FILES/90210 .MID
/HD/1/MIDI/FILES/AMAZING .MID
/HD/1/MIDI/FILES/99LUFT~1.MID
/HD/1/MIDI/FILES/EUROPE .MID
/HD/1/MIDI/FILES/VANESSA .MID
/HD/1/MIDI/FILES/SPICE .MID
/HD/1/MIDI/FILES/NIEMAL~1.MID
/HD/1/MIDI/FILES/SMS .MID
/HD/1/MIDI/FILES/PRIMA .MID
/HD/1/MIDI/FILES/POPCORN .MID
/HD/1/MIDI/FILES/POLKKA .MID
/HD/1/MIDI/FILES/SW_FINAL.MID
/HD/1/MIDI/FILES/MAJORT~1.MID
/HD/1/MIDI/FILES/7DAYS .MID
/HD/1/MIDI/FILES/AADAMS .MID
 
/programs/media/midamp/trunk/playnote.txt
0,0 → 1,293
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Copyright 2003 VaStaNi *
* vastani@ukr.net *
* >>>- SIMPLY - QUICKLY - SHORTLY -<<< *
* *
* About Player Notes for Speaker PC. *
* ( PLAYNOTE.INC v.1.1 for MENUET OS ) *
* *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
--- ATTACH ---
 
>>> Insert string: include "PLAYNOTE.INC" in list file KERNEL32.INC
.........
......... ......... .............................
......... ......... .............................
......... ......... .............................
 
; sound
 
include "SB16.INC" ; playback for Sound Blaster 16
include "PLAYNOTE.INC" ; player Note for Speaker PC
 
.........
......... ......... .............................
......... ......... .............................
 
 
 
>>> Insert line --->>> call playNote --->>> in procedure irq0
 
( listing file SYS32.INC for KERNEL.ASM )
 
.... ....
.... ....
.... ....
 
no_error_in_previous_process:
 
mov edi,[0x3000]
imul edi,8
mov [edi+gdts+ tss0 +5], word 01010000b *256 +11101001b
 
inc dword [0xfdf0]
 
mov eax,[0xfdf0]
 
call playNote ; <<<--- INSERT THIS LINE !!!!!!!!!!
 
cmp eax,[next_usage_update]
jb nocounter
add eax,100
mov [next_usage_update],eax
call updatecputimes
 
nocounter:
.... ....
.... ....
.... ....
 
 
 
>>> file SB16.INC have this label...
.... ....
.... ....
.... ....
 
no_SB16_data_format:
 
ret
 
>>> I suggest add this code for subfunction #55 function #55 OS (player notes)
.... ....
.... ....
.... ....
 
no_SB16_data_format:
cmp eax, edi ; this is subfunction #55 ?
jne retFunc55 ; if no then return.
movzx eax, byte [countDelayNote]
or al, al ; player is busy ?
jnz retFunc55 ; return counter delay Note
mov eax, [0x3010]
mov eax, [eax+0x10] ; address application im memory
add eax, edx ; add offset Delay-Note string
mov [memAdrNote], eax
xor eax, eax ; Ok! EAX = 0
retFunc55:
mov [esp+36], eax ; return value EAX for application
ret
 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
--- USE ---
 
>>> Example use in your programs:
.... ....
.... ....
.... ....
mov eax, 55 ; OS function #55
mov ebx, eax ; EBX = 55 for subfunction Play Note
mov esi, MyMusic_1 ; ESI = head string Delay-Note code
int 0x40 ; start play
.... ....
.... ....
.... ....
 
 
>>> Very simply OS use. Only put dword adress head string in [memAdrNote]
 
.... ....
mov [memAdrNote], dword MyMusic_1 ; IRQ0 -> start play!!!
.... ....
 
!!! Example OS use for send: error tone, ring signal, disconnect hardware...
!!! Saund Card may be OFF, but Speaker PC always IS ON !!!
 
 
..... .. ..
..... .. ..
MyMusic_1 db .., .., .., .., .., 0 ; string Delay-Note code for MUSIC
... .. ..
...... .. ..
 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
--- CODE DELAY & NOTEs ---
 
>>> Format Delay-Note string:
 
1. Free style play Tone
 
db 1..0x80 ; !!! only (1..0x80) byte for Delay Tone
db 1..0xFF ; lower byte (counter for period oscillate)
db 1..0xFF ; upper byte (counter for period oscillate)
.. .. \
.. .. > 3 bytes for 1 TONE !!!
.. .. /
db 0 ; THE END Play!
 
2. Musical style play Note
 
db 0x81..0xFE ; !!! 0x80 + byte (1..0x7E) for Delay Note
db 1..0xFF ; PACK CODE (number Note & number Octave)
.. .. \
.. .. / 2 bytes for 1 Note in 1 Octave !!!
db 0 ; THE END Play!
 
 
 
-= DELAY CODE =-
 
ÚÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÄÉÍÍ 1 Í»ÉÍÍ 2 Í»
³¤«¨â¥«ì­®á⨳ DELAY NOTE ³ DELAY º DELAY ºº DELAY º
³ Ž’ ³ mSec ³ IRQ 0 º CODE ºº CODE º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÌÍÍÍÍÍÍÍ͹ÌÍÍÍÍÍÍÍ͹
³ 楫 ï ³ 2000 ³ º 0xC8 ºº absent º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄ´ ÇÄÄÄÄÄÄÄĶÇÄÄÄÄÄÄÄĶ
³ 1/2 ³ 1000 ³ º 0x64 ºº 0xE4 º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄ´ ÇÄÄÄÄÄÄÄĶÇÄÄÄÄÄÄÄĶ
³ 1/4 ³ 500 ³ º 0x32 ºº 0xB2 º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄ´ 10 ºÄÄÄÄÄÄÄĶºÄÄÄÄÄÄÄĶ
³ 1/8 ³ 250 ³ mSec º 0x19 ºº 0x99 º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄ´ ÇÄÄÄÄÄÄÄĶÇÄÄÄÄÄÄÄĶ
³ 1/16 ³ 125 ³ º 0xC ºº 0x8C º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄ´ ºÄÄÄÄÄÄÄĶºÄÄÄÄÄÄÄĶ
³ 1/32 ³ 62.5 ³ º 6 ºº 0x86 º
ÃÄÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÄ´ ÇÄÄÄÄÄÄÄĶÇÄÄÄÄÄÄÄĶ
³ 1/64 ³ 31.25 ³ º 3 ºº 0x83 º
ÀÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÄÈÍÍÍÍÍÍÍͼÈÍÍÍÍÍÍÍͼ
 
 
-= PACK CODE =-
 
!!!!! IF PACK CODE = 0xFF THEN PAUSE = DELAY CODE !!!!!
 
ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÉÍÍÍÍÍÍÍÍÍÍ» ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÂÄÄÄÄÄÄÉÍÍÍÍÍÍÍÍÍÍ»
³ ’ˆ› ³number³ code ºupper CODEº ³ Ž’› ³type³numberºlower CODEº
³ ŽŠ’€‚ ³OCTAVE³numberºBit7..Bit4º ³ ŽŠ’€‚› ³NOTE³ NOTE ºBit3..Bit0º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÌÍÍÍÍÍÍÍÍÍ͹ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄÌÍÍÍÍÍÍÍÍÍ͹
³ª®­âப⠢ ³ -3 ³ 0 º 0000 º ³ „Ž ³ C ³ 1 º 0001 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÌÄÄÄÄÄÄÄÄÄĶ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ¡®«ìè ï ³ -2 ³ 1 º 0001 º ³ „Ž ¡¥¬®«ì ³ C# ³ 2 º 0010 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÇÄÄÄÄÄÄÄÄÄĶ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ¬ « ï ³ -1 ³ 2 º 0010 º ³ … ³ D ³ 3 º 0011 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄĺÄÄÄÄÄÄÄÄÄĶ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ¯¥à¢ ï ³ 1 ³ 3 º 0011 º ³ … ¡¥¬®«ì ³ D# ³ 4 º 0100 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÇÄÄÄÄÄÄÄÄÄĶ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ¢â®à ï ³ 2 ³ 4 º 0100 º ³ Œˆ ³ E ³ 5 º 0101 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄĺÄÄÄÄÄÄÄÄÄĶ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ âà¥âìï ³ 3 ³ 5 º 0101 º ³ ”€ ³ F ³ 6 º 0110 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÇÄÄÄÄÄÄÄÄÄĶ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ç¥â¢¥àâ ï ³ 4 ³ 6 º 0110 º ³ ”€ ¡¥¬®«ì ³ F# ³ 7 º 0111 º
ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÄÄÁÄÄÄÄÄÄÈÍÍÍÍÍÍÍÍÍͼ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ‘Ž‹œ ³ G ³ 8 º 1000 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³‘Ž‹œ ¡¥¬®«ì³ G# ³ 9 º 1001 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ‹Ÿ ³ A ³ 10 º 1010 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ‹Ÿ ¡¥¬®«ì ³ A# ³ 11 º 1011 º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄĶ
³ ‘ˆ ³ B ³ 12 º 1100 º
ÀÄÄÄÄÄÄÄÄÄÄÄÁÄÄÄÄÁÄÄÄÄÄÄÈÍÍÍÍÍÍÍÍÍͼ
 
PACK CODE = (number Note) AND ((code number Octave) SHL 4)
or
PACK CODE = (number Note) AND ((code number Octave) * 16)
 
 
-= PERIOD OSCILLATE =-
 
counter = 1193180 / FREQUENCY;
(WORD) (sound Hz)
 
ÚÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÂÄÄÄÄÄÄÄÄÄÄÄÂÄÄÄÄÂÄÄÄÄÄÄÉÍÍÍÍÍÍÍÍÍ ÍÍÍÍÍÍ»
³ ’ˆ ³number³ code ³ Ž’› ³type³numberºfrequency PACK º
³ ŽŠ’€‚› ³OCTAVE³number³ 1© Ž‘’€‚› ³NOTE³ NOTE ºsound Hz CODE º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄÌÍÍÍÍÍÍÍÍÍ ÍÍÍÍÍ͹
³ ³ ³ ³ „Ž ³ C ³ 1 º 523,251 -- 0x31 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | ÄÄÄÄÄĶ
³ ³ ³ ³ „Ž ¡¥¬®«ì ³ C# ³ 2 º 554,365 --|-- 0x32 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ … ³ D ³ 3 º 587,33 | | 0x33 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ … ¡¥¬®«ì ³ D# ³ 4 º 622,254 | | 0x34 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ Œˆ ³ E ³ 5 º 659,255 | | 0x35 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ ”€ ³ F ³ 6 º 698,456 | | 0x36 º
³ ¯¥à¢ ï ³ 1 ³ 3 ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ( first ³ ³ ³ ”€ ¡¥¬®«ì ³ F# ³ 7 º 739,989 | | 0x37 º
³ octave ) ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ ‘Ž‹œ ³ G ³ 8 º 783,991 0x38 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ x 2 ÄÄÄÄÄĶ
³ ³ ³ ³‘Ž‹œ ¡¥¬®«ì³ G# ³ 9 º 830,609 0x39 º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ ‹Ÿ ³ A ³ 10 º 880 | | 0x3A º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ ‹Ÿ ¡¥¬®«ì ³ A# ³ 11 º 932,328 | | 0x3B º
³ ³ ³ ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄ×ÄÄÄÄÄÄÄÄÄ | | ÄÄÄÄÄĶ
³ ³ ³ ³ ‘ˆ ³ B ³ 12 º 987,767 | | 0x3C º
ÃÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÅÄÄÄÄÄÄÄÄÄÄÄÅÄÄÄÄÅÄÄÄÄÄÄÌÍÍÍÍÍÍÍÍÍ | | ÍÍÍÍÍ͹
³ ¢â®à ï ³ 2 ³ 4 ³ „Ž ³ ‘ ³ 1 º1046,502 <- | 0x41 º
...... .. .. ... .. .. .... ... <----
 
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 
--- EXAMPLE MUSIC ---
 
à¨¬¥à ¬ã§¨æ¨à®¢ ­¨ï ¯® ­®â ¬ ¬¥«®¤¨¨ ˆ.Š à­¥«îª  "ƒ®à¨â ®ç £..."
ª 䨫ì¬ã " ­¤¨â᪨© ¥â¥à¡ãà£"
MyMusic_1:
db 0xe4,0x35, 0x99,0x33, 0x99,0x31, 0x99,0x33, 0xe4,0x35, 0x99,0x35, 0x99,0x36
db 0x99,0x38, 0x99,0x3a, 0xe4,0x36, 0xe4,0x36, 0xb2,0xff, 0xe4,0x33, 0x99,0x31
db 0x99,0x2c, 0x99,0x31, 0xe4,0x33, 0xb2,0x33, 0x99,0x35, 0x99,0x36, 0xe4,0x35
db 0xe4,0x35, 0xb2,0xff, 0x99,0x35, 0x99,0x36, 0xe4,0x33, 0x99,0x35, 0x99,0x36
db 0xb2,0x33, 0x99,0x35, 0x99,0x36, 0xb2,0x33, 0x99,0x35, 0x99,0x36, 0xe4,0x39
db 0xe4,0x39, 0xb2,0xff, 0x99,0x35, 0x99,0x36, 0xe4,0x33, 0x99,0x35, 0x99,0x36
db 0xb2,0x33, 0x99,0x35, 0x99,0x36, 0xb2,0x33, 0x99,0x35, 0x99,0x36, 0xe4,0x35
db 0xe4,0x35, 0
 
 
MyMusic_2:
db 0x90,0x31, 0x90,0x33, 0x90,0x35, 0x90,0x36, 0xA0,0xFF, 0xA0,0x06, 0x90,0xFF
db 0xA0,0x06, 0x90,0xFF, 0x90,0x33, 0x90,0x35, 0x90,0x37, 0x90,0x38, 0xA0,0xFF
db 0xA0,0x18, 0x90,0xFF, 0xA0,0x18, 0x90,0xFF, 0x90,0x33, 0x90,0x35, 0x90,0x37
db 0x90,0x38, 0xA0,0xFF, 0x90,0x33, 0x90,0x35, 0x90,0x37, 0x90,0x38, 0xA0,0xFF
db 0x90,0x31, 0x90,0x33, 0x90,0x35, 0x90,0x36, 0xA0,0xFF, 0xA0,0x16, 0x90,0xFF
db 0xA0,0x16, 0
 
 
MyMusic_3:
db 0x99,0x31, 0xB2,0x36, 0x99,0x3A, 0xB2,0x36, 0x99,0x33, 0xB2,0x28, 0xBC,0x38
db 0
 
<<<<<<< >>>>>>>
|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> !GOOD LUCK! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<|
<<<<<<< >>>>>>>
 
 
 
 
 
 
 
 
 
 
 
 
 
/programs/media/midamp/trunk/thread.inc
0,0 → 1,121
new_thread:
mov ecx,ipcarea2
call init_ipc
mcall 40,1000000b
tstill:
mov dword[ipcarea2],0
mov dword[ipcarea2+4],8
mcall 10
.prc:
cmp eax,7
jne tstill
and [flag],not FL_PLAY
mov eax,dword[ipcarea2+8]
cmp eax,[parentPID]
jne tstill
cmp byte[ipcarea2+16],IPC_PLAY
je .play_next
cmp byte[ipcarea2+16],IPC_TRIG
jne tstill
.play_next:
or [flag],FL_PLAY
mov edi,[cur_ptr]
movzx eax,word[edi]
mov [play_area],ax
add [cur_ptr],2
if SOUND eq ON
test [flag],FL_MUTE
jnz .nosound
mov esi,play_area
mov eax,55
mov ebx,eax
int 0x40
.nosound:
end if
movzx ebx,byte[play_area]
and ebx,0x7f
add [cur_tick],ebx
mov eax,23
int 0x40
cmp word[edi],0
jne .checkevt
mov eax,IPC_NEXT
call ipc_send
jmp tstill
.checkevt:
test eax,eax
jz .upd
cmp eax,7
jne tstill
cmp byte[ipcarea2+16],IPC_PLAY
jne tstill
.upd:
mov eax,IPC_UPDT
call ipc_send
jmp .play_next
 
respawn:
mcall 9,prcinfo,-1
mov ecx,eax
xor edx,edx
xor esi,esi
.nxt:
mcall 9
cmp dx,[ebx+4]
jae .less
mov dx,[ebx+4]
mov esi,[ebx+30]
.less:
loop .nxt
push esi
mcall 51,1,new_thread,APP_MEM
pop edx
cmp edx,[childPID]
jne .nochild
mov edx,[parentPID]
.nochild:
mov [childPID],eax
call prc_find
mcall 18,3
ret
 
kill:
mov edx,[childPID]
call prc_find
mcall 18,2
.nothread:
ret
 
prc_find: ;in: edx-PID, out: ecx-number
mcall 9,prcinfo,-1
mov ecx,eax
.nxt:
mcall 9
cmp edx,[ebx+30]
je .found
loop .nxt
.found:
ret
 
init_ipc:
mcall 60,1,,20
ret
 
ipc_send: ;eax-msg
test [flag],FL_LOCK
jnz .noipc
pusha
mov [ipcmsg],al
mov ebx,ipcarea2
mov ecx,childPID
cmp eax,0xb0
jb .noparent
add ecx,4
sub ebx,20
.noparent:
mov dword[ebx],0
mov dword[ebx+4],8
mcall 60,2,[ecx],ipcmsg,1
popa
.noipc:
ret
/programs/other/archer/trunk/@RCHER.ASM
110,7 → 110,7
else
Msg 0
Msg 1
mcall 40,10000101b
mcall 40,1000101b
; jmp again
CmdLine
cmdl:
/programs/other/archer/trunk/arcmacro.inc
261,8 → 261,8
;; mov esi,path
mov edi,path
xor eax,eax
mov ecx,200
rep stosb
mov ecx,(1024+16)/4
rep stosd
 
;mov [get_loops],0
mov [dlg_pid_get],0
301,7 → 301,7
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
mov edx,1024+16 ; size
int 0x40
 
mcall 40,1000111b
309,7 → 309,7
; STEP 3 run SYSTEM XTREE with parameters
;
 
mcall 58,run_fileinfo
mcall 70,run_fileinfo
 
call redproc
 
318,16 → 318,15
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
 
cmp eax,1
je mred
cmp eax,2
je mkey
cmp eax,3
je mbutton
cmp eax,7
je mgetmes
 
; Get number of procces
mcall 9,os_work,-1
mov ebp,eax
405,14 → 404,14
ready:
;
; The second message get
; Second message is 100 bytes path to SAVE/OPEN file
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,200
rep movsb
mov ecx,1024/4
rep movsd
mov [edi],byte 0
 
jmp openoff
428,11 → 427,11
dd 0,0 ; Type of dialog
 
run_fileinfo:
dd 16
dd 7
dd 0
dd param
dd 0
dd os_work ; 0x10000
dd 0
;run_filepath
db '/RD/1/SYSXTREE',0
 
/programs/other/archer/trunk/data.inc
68,8 → 68,8
; db '/hd/1/zip/test2.zip',0
end if
db 0
rb 256-($-filename)
I_END:
rb 1024+16-($-filename)
 
if SYS eq win
cr_lf db 0xa,0xd
/programs/other/archer/trunk/macros.inc
143,6 → 143,11
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
; optimize the code for size
__regs fix <eax,ebx,ecx,edx,esi,edi,ebp,esp>
 
174,7 → 179,7
 
macro mov arg1,arg2
{
if (arg1 in __regs) & ((arg2 eqtype 0) | (arg2 eqtype '0'))
if (arg1 in __regs) & (arg2 eqtype 0)
if (arg2) = 0
xor arg1,arg1
else if (arg2) = 1
/programs/other/archer/trunk/sys.inc
385,12 → 385,26
}
 
StartPad:
; mcall 19,editorcmd,dumpfile
pusha
mov esi,[outfile.size]
; dpd esi
mov [par_fsize],esi
mcall 19,editorcmd,editor_par
; convert number in esi to decimal representation
mov ecx, 10
push -'0'
mov eax, esi
@@:
xor edx, edx
div ecx
push edx
test eax, eax
jnz @b
mov edi, par_fsize
@@:
pop eax
add al, '0'
stosb
jnz @b
mcall 70,fileinfo
mov ecx,eax
mcall 5,20
mcall 60,2,,[outfile.out];output
398,7 → 412,13
popa
ret
 
editorcmd db 'TINYPAD '
fileinfo:
dd 7
dd 0
dd editor_par
dd 0
dd 0
db '/RD/1/TINYPAD',0
editor_par db '*'
par_fsize dd ?
par_fsize rb 11
end if
/programs/other/rtfread/trunk/ascl.inc
133,9 → 133,9
cld
;; mov esi,path
mov edi,path
mov eax,0
mov ecx,200
rep stosb
xor eax,eax
mov ecx,(1024+16)/4
rep stosd
 
;mov [get_loops],0
mov [dlg_pid_get],0
177,7 → 177,7
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,150 ; size 150 bytes
mov edx,1024+16 ; size
int 0x40
 
; change wanted events list 7-bit IPC event
189,7 → 189,7
; STEP 3 run SYSTEM XTREE with parameters
;
 
mov eax,58
mov eax,70
mov ebx,run_fileinfo
int 0x40
 
200,16 → 200,15
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
 
cmp eax,1
je mred
cmp eax,2
je mkey
cmp eax,3
je mbutton
cmp eax,7
je mgetmes
 
; Get number of procces
mov ebx,procinfo
mov ecx,-1
295,14 → 294,14
ready:
;
; The second message get
; Second message is 100 bytes path to SAVE/OPEN file
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,200
rep movsb
mov ecx,1024/4
rep movsd
mov [edi],byte 0
 
jmp openoff
318,16 → 317,16
dd 0,0 ; Type of dialog
 
run_fileinfo:
dd 16
dd 7
dd 0
dd param
dd 0
dd procinfo ; 0x10000
dd 0
;run_filepath
db '/RD/1/SYSXTREE',0
 
procinfo:
times 256 db 0
times 1024 db 0
}
 
 
345,9 → 344,9
cld
;; mov esi,path
mov edi,path
mov eax,0
mov ecx,200
rep stosb
xor eax,eax
mov ecx,(1024+16)/4
rep stosd
 
;mov [get_loops],0
mov [dlg_pid_get],0
389,7 → 388,7
mov eax,60
mov ebx,1 ; define IPC
mov ecx,path ; offset of area
mov edx,120 ; size 150 bytes
mov edx,1024+16 ; size
int 0x40
 
; change wanted events list 7-bit IPC event
401,7 → 400,7
; STEP 3 run SYSTEM XTREE with parameters
;
 
mov eax,58
mov eax,70
mov ebx,run_fileinfo
int 0x40
 
412,16 → 411,15
mov eax,23
mov ebx,50 ;0.5 sec
int 0x40
dec eax
jz mred
dec eax
jz mkey
dec eax
jz mbutton
cmp al, 7-3
jz mgetmes
 
cmp eax,1
je mred
cmp eax,2
je mkey
cmp eax,3
je mbutton
cmp eax,7
je mgetmes
 
; Get number of procces
mov ebx,procinfo
mov ecx,-1
457,6 → 455,7
call redproc
jmp getmesloop
mkey:
mov eax,2
int 0x40 ; read (eax=2)
jmp getmesloop
mbutton:
506,14 → 505,14
ready:
;
; The second message get
; Second message is 100 bytes path to SAVE/OPEN file
; Second message is 1024 bytes path to SAVE/OPEN file
; shl path string on 16 bytes
;
cld
mov esi,path+16
mov edi,path
mov ecx,200
rep movsb
mov ecx,1024/4
rep movsd
mov [edi],byte 0
 
jmp openoff
525,25 → 524,26
DLGPID dd 0
 
param:
rb 4 ; My dec PID
rb 6 ; Type of dialog
dd 0 ; My dec PID
dd 0,0 ; Type of dialog
 
run_fileinfo:
dd 16
dd 7
dd 0
dd param
dd 0
dd procinfo
run_filepath:
dd 0
;run_filepath:
db '/RD/1/SYSXTREE',0
 
procinfo:
times 256 db 0
times 1024 db 0
}
 
 
 
 
 
; RANDOM - generate random count (small)
; (SYNTAX) RANDOM MaxCount,OutArgument
; (SAMPLE) RANDOM 10000,eax
/programs/other/rtfread/trunk/bgifont.inc
571,6 → 571,12
jg .nobold
end if
mov edx,[.color]
; \begin{diamond}[18.08.2006]
; starting from K0530 kernel interprets flag 0x1000000 as
; negate existing pixels colors, disregarding passed color
; we do not want this
and edx, 0xFFFFFF
; \end{diamond}[18.08.2006]
mov eax,38
int 0x40
test ebp,BGI_BOLD
/programs/other/rtfread/trunk/macros.inc
143,6 → 143,8
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
/programs/other/rtfread/trunk/rtfread.asm
52,8 → 52,7
dd fname_buf ;  ¤à¥á ¡ãä¥à  ¤«ï ¯ à ¬¥â஢ (­¥ ¨á¯®«ì§ã¥âáï)
dd 0x0 ; § à¥§¥à¢¨à®¢ ­®
 
include 'lang.inc'
include 'macros.inc' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
include 'MACROS.INC' ; ¬ ªà®áë ®¡«¥£ç îâ ¦¨§­ì  áᥬ¡«¥à騪®¢!
include 'debug.inc'
if ~ RENDER eq PIX
TOP=TOP+4
319,6 → 318,7
 
mcall 12, 1 ; äã­ªæ¨ï 12: á®®¡é¨âì Ž‘ ®¡ ®âà¨á®¢ª¥ ®ª­ 
; 1 - ­ ç¨­ ¥¬ à¨á®¢ âì
 
mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x805080D0, 0x005080D0
mcall 9,procinfo,-1
mov eax,[procinfo.x_size]
547,6 → 547,8
Free BGIfree FONT_NAME,0,0,1.0,1.0,char,1,0x44000000,0
end if
I_END0:
fname_buf:
rb 1024+16
if BENCH eq 1
bench dd ?
end if
594,7 → 596,6
rb RTFSTACKSIZE
save_limit:
rb BGIFONTSIZE
fname_buf rd 16
 
listptr dd ?
szKeyword rb 31