Kernel: now bootcode loads from floppy only used sectors
sysxtree: rewritten to 70th function, corrected scrollbar copyr: new version for new sysxtree @rcher, rtfread: modified to work with new sysxtree midamp: added version modified to work with new sysxtree git-svn-id: svn://kolibrios.org@134 a494cfbc-eb01-0410-851d-a64ba20cac60
This commit is contained in:
@@ -152,6 +152,26 @@ pagetable_set:
|
||||
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 @@ end if
|
||||
xor ax, ax ; reset drive
|
||||
xor dx, dx
|
||||
int 0x13
|
||||
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
|
||||
; 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
|
||||
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 ah,0x87
|
||||
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
|
||||
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'
|
||||
test ah, ah
|
||||
jz @f
|
||||
sayerr_floppy:
|
||||
mov dx, 0x3f2
|
||||
mov al, 0
|
||||
out dx, al
|
||||
mov si, memmovefailed-0x10000
|
||||
jmp sayerr_plain
|
||||
@@:
|
||||
mov [si+1], al
|
||||
shr ch, 1
|
||||
add ch, '0'
|
||||
mov [si], ch
|
||||
call printplain
|
||||
popa
|
||||
bb2:
|
||||
pop ax
|
||||
dec ax
|
||||
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
|
||||
jnz reads
|
||||
readdone:
|
||||
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 @f
|
||||
mov dh, 0
|
||||
inc ch
|
||||
@@:
|
||||
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
|
||||
cmp [si], ax
|
||||
jz @f
|
||||
mov [si], ax
|
||||
call printplain
|
||||
@@:
|
||||
popa
|
||||
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
|
||||
|
@@ -62,7 +62,8 @@ s_vesa db "VESA version: "
|
||||
.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
|
||||
|
@@ -24,10 +24,10 @@ macro line_space {
|
||||
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 @@ verstr:
|
||||
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 <20>᭮<EFBFBD><E1ADAE><EFBFBD><EFBFBD> <20><> Menuet OS <20> <20><> <20>।<EFBFBD><E0A5A4>⠢<EFBFBD><E2A0A2><EFBFBD><EFBFBD> '
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>a<EFBFBD>⨩. ',186
|
||||
@@ -52,43 +54,26 @@ d80x25_bottom:
|
||||
line_full_bottom
|
||||
d80x25_bottom_num = 3
|
||||
|
||||
msg_apm db " APM x.x ",0
|
||||
|
||||
novesa db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: EGA/CGA",13,10,0
|
||||
vervesa db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 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 <20><><EFBFBD>⮢: [9] 320x200, "
|
||||
db "VGA 16 <20><><EFBFBD>⮢: [0] 640x480",13,10
|
||||
db 186," <20>롥<EFBFBD><EBA1A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>०<EFBFBD><E0A5A6>: ",0
|
||||
bt24 db "<EFBFBD><EFBFBD>㡨<EFBFBD><EFBFBD> 梥<><E6A2A5>: 24",13,10,0
|
||||
bt32 db "<EFBFBD><EFBFBD>㡨<EFBFBD><EFBFBD> 梥<><E6A2A5>: 32",13,10,0
|
||||
s_vesa db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> VESA: "
|
||||
.ver db "?.? ("
|
||||
.mem db "??? <20><>)",13,10,0
|
||||
gr_mode db "<EFBFBD>롥<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>०<EFBFBD><E0A5A6>: ",13,10,0
|
||||
s_bpp db 13,10,186," <20><>㡨<EFBFBD><E3A1A8> 梥<><E6A2A5>: "
|
||||
.bpp dw "??"
|
||||
db 13,10,0
|
||||
vrrmprint db "<EFBFBD>ᯮ<EFBFBD>짮<EFBFBD><EFBFBD><EFBFBD><EFBFBD> VRR? (<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> 60 <20><>"
|
||||
db " ⮫쪮 <20><><EFBFBD> <20><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4>:",13,10
|
||||
db 186," 1024*768>800*600 <20> 800*600>640*480) [1-<2D><>, 2-<2D><><EFBFBD>]: ",0
|
||||
;askmouse db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:" ; 186, " "
|
||||
; db " [1] PS/2 (USB), [2] Com1, [3] Com2."
|
||||
; db " <20>롥<EFBFBD><EBA1A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> [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+: <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MTRR <20><><EFBFBD> <20>७<E1AAAE><E0A5AD> <20><><EFBFBD>䨪<EFBFBD>? "
|
||||
db "[1-<2D><>/2-<2D><><EFBFBD>]: ",0
|
||||
;gr_direct db 186," <20>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>? "
|
||||
; db "[1-<2D><>/2-<2D><><EFBFBD>]: ",0
|
||||
;mem_model db 13,10,186," <20><><EFBFBD>+<2B> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> [1-16 Mb / 2-32 Mb / "
|
||||
; db "3-64Mb / 4-128 Mb / 5-256 Mb]: ",0
|
||||
;bootlog db 13,10,186," <20><><EFBFBD>ᬮ<EFBFBD><E1ACAE><EFBFBD><EFBFBD><EFBFBD> <20><>ୠ<EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD>? [1-<2D><><EFBFBD>/2-<2D><>]: ",0
|
||||
bdev db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>㧨<EFBFBD><EFBFBD> <20><>ࠧ <20><> [1-<2D><>᪥<EFBFBD><E1AAA5>; 2-C:\menuet.img (FAT32);"
|
||||
db 13,10,186," "
|
||||
db "3-<2D>ᯮ<EFBFBD>짮<EFBFBD><ECA7AE><EFBFBD><EFBFBD> 㦥 <20><><EFBFBD><EFBFBD>㦥<EFBFBD><E3A6A5><EFBFBD><EFBFBD> <20><>ࠧ]: ",0
|
||||
probetext db 13,10,13,10,186," <20>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>०<EFBFBD><E0A5A6>? [1-<2D><>, "
|
||||
db "2-<2D><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><>㣨<EFBFBD> (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 "<EFBFBD>訡<EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD>०<EFBFBD><E0A5A6> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",0
|
||||
;modena db "<EFBFBD>訡<EFBFBD><EFBFBD> - <20>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>প<EFBFBD> VBE 0x112+.",0
|
||||
not386 db "<EFBFBD>訡<EFBFBD><EFBFBD> - <20>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 386+.",0
|
||||
@@ -131,3 +116,33 @@ pdm3 db "
|
||||
loading_msg db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧪<EFBFBD> KolibriOS...",0
|
||||
save_quest db "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>騥 <20><><EFBFBD><EFBFBD>ன<EFBFBD><E0AEA9>? [y/n]: ",0
|
||||
loader_block_error db "<EFBFBD>訡<EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>砫쭮<E7A0AB><ECADAE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>稪<EFBFBD>, <20>த<EFBFBD><E0AEA4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.",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 '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ',13,10,\
|
||||
; '<27> ࠧ<><E0A0A7>襭<EFBFBD><E8A5AD> <20> 4 <20> 8 <20> 15 <20> 16 <20> 24 <20> 32 <20>',13,10,\
|
||||
; '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ',13,10,0
|
||||
;_rs db '<27> ????x???? <20> - <20> - <20> - <20> - <20> - <20> - <20>',13,10,0
|
||||
;_bt db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',13,10,0
|
||||
|
||||
_tl db 186,' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ',13,10,\
|
||||
186,' <20> 4 <20> 8 <20> 15 <20> 16 <20> 24 <20> 32 <20>',13,10,\
|
||||
186,' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ŀ',13,10,0
|
||||
_rs db 186,' <20> ????x???? <20> ? <20> ? <20> ? <20> ? <20> ? <20> ? <20>۳',13,10,0
|
||||
_bt db 186,' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',13,10,0
|
||||
|
||||
|
||||
_sel1 db 0x1A,0
|
||||
_sel2 db 0x1B,0
|
||||
|
@@ -150,6 +150,26 @@ pagetable_set:
|
||||
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 @@ start_of_code:
|
||||
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 @@ start_of_code:
|
||||
mov ax,1100h
|
||||
int 10h
|
||||
; End set VGA russian font
|
||||
end if
|
||||
|
||||
; draw frames
|
||||
push 0xb800
|
||||
@@ -960,73 +982,195 @@ end if
|
||||
xor ax, ax ; reset drive
|
||||
xor dx, dx
|
||||
int 0x13
|
||||
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
|
||||
; 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
|
||||
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 ah,0x87
|
||||
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
|
||||
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'
|
||||
test ah, ah
|
||||
jz @f
|
||||
sayerr_floppy:
|
||||
mov dx, 0x3f2
|
||||
mov al, 0
|
||||
out dx, al
|
||||
mov si, memmovefailed-0x10000
|
||||
jmp sayerr_plain
|
||||
@@:
|
||||
mov [si+1], al
|
||||
shr ch, 1
|
||||
add ch, '0'
|
||||
mov [si], ch
|
||||
call printplain
|
||||
popa
|
||||
bb2:
|
||||
pop ax
|
||||
dec ax
|
||||
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
|
||||
jnz reads
|
||||
readdone:
|
||||
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 @f
|
||||
mov dh, 0
|
||||
inc ch
|
||||
@@:
|
||||
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
|
||||
cmp [si], ax
|
||||
jz @f
|
||||
mov [si], ax
|
||||
call printplain
|
||||
@@:
|
||||
popa
|
||||
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
|
||||
|
@@ -1,5 +1,3 @@
|
||||
lang equ ru ; ru en fr ge fi
|
||||
|
||||
;
|
||||
; Assembler
|
||||
; SMALL
|
||||
|
@@ -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,49 +27,30 @@ include 'lang.inc'
|
||||
include 'macros.inc' ; very useful stuff for MeOS
|
||||
include 'ascl.inc'
|
||||
|
||||
STRLEN = 48 ; maximal length of filename
|
||||
|
||||
|
||||
START: ; start of execution
|
||||
|
||||
; <20><>ࠬ<EFBFBD><E0A0AC><EFBFBD><EFBFBD>:
|
||||
; <20><> 0 <20><> 100 <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>筨<EFBFBD><E7ADA8>
|
||||
; <EFBFBD><EFBFBD> 100 <20><> 200 <20><><EFBFBD><EFBFBD> <20> <20>ਥ<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
;
|
||||
; db n1 = <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>筨<EFBFBD><E7ADA8>
|
||||
; times n1 db ? = <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>筨<EFBFBD><EFBFBD>
|
||||
; db n2 = <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><F1ACADA8>
|
||||
; times n2 db ? = <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><F1ACADA8>
|
||||
; 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
|
||||
|
||||
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
|
||||
mov eax, 15
|
||||
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
|
||||
|
||||
call draw_window
|
||||
call copy_file
|
||||
@@ -90,19 +71,16 @@ err_exit:
|
||||
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,10 +100,10 @@ copy_error:
|
||||
;====================================================
|
||||
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
|
||||
int 0x40
|
||||
mov dword [source_attr+32], 0
|
||||
mov eax, 70
|
||||
mov ebx, source_attr_info
|
||||
int 0x40
|
||||
|
||||
; now eax contains error code
|
||||
; and ebx contains file size in bytes
|
||||
@@ -141,9 +119,9 @@ copy_file:
|
||||
.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 @@ copy_file:
|
||||
.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,30 +161,11 @@ copy_file:
|
||||
; 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)
|
||||
|
||||
; 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
|
||||
jmp copy_error
|
||||
|
||||
|
||||
; *********************************************
|
||||
@@ -251,23 +208,23 @@ draw_window:
|
||||
|
||||
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,43 +236,20 @@ draw_window:
|
||||
|
||||
|
||||
; 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 ' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: |<7C><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD>⨭<EFBFBD>, <20><><EFBFBD> <20><>᪢<EFBFBD> , 1 <20><><EFBFBD><EFBFBD> '
|
||||
db ' <20><><EFBFBD><EFBFBD>: | <20><><EFBFBD><EFBFBD><EFBFBD>設 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, waptap@mail.ru '
|
||||
db ' '
|
||||
db 'x' ; <- END MARKER, DONT DELETE
|
||||
labelt:
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>'
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>'
|
||||
labellen:
|
||||
|
||||
errors:
|
||||
@@ -336,6 +270,70 @@ errors:
|
||||
db "(<28><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>) <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⭠<EFBFBD> <20>訡<EFBFBD><E8A8A1> "
|
||||
db "<22><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>筨<EFBFBD><E7ADA8> <20> <20>ਥ<EFBFBD><E0A8A5><EFBFBD><EFBFBD><EFBFBD> <20><> 㪠<><E3AAA0><EFBFBD><EFBFBD>!!! "
|
||||
db "<22><><EFBFBD><EFBFBD> <20> <20>ਥ<EFBFBD><E0A8A5><EFBFBD><EFBFBD><EFBFBD> <20><> 㪠<><E3AAA0><EFBFBD>!!! "
|
||||
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
|
||||
|
@@ -186,9 +186,9 @@ local dlg_is_work, ready, procinfo
|
||||
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 @@ new_d:
|
||||
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 @@ new_d:
|
||||
; STEP 3 run SYSTEM XTREE with parameters
|
||||
;
|
||||
|
||||
mov eax,58
|
||||
mov eax,70
|
||||
mov ebx,run_fileinfo
|
||||
int 0x40
|
||||
|
||||
@@ -253,15 +253,14 @@ getmesloop:
|
||||
mov eax,23
|
||||
mov ebx,50 ;0.5 sec
|
||||
int 0x40
|
||||
|
||||
cmp eax,1
|
||||
je mred
|
||||
cmp eax,2
|
||||
je mkey
|
||||
cmp eax,3
|
||||
je mbutton
|
||||
cmp eax,7
|
||||
je mgetmes
|
||||
dec eax
|
||||
jz mred
|
||||
dec eax
|
||||
jz mkey
|
||||
dec eax
|
||||
jz mbutton
|
||||
cmp al, 7-3
|
||||
jz mgetmes
|
||||
|
||||
; Get number of procces
|
||||
mov ebx,procinfo
|
||||
@@ -348,14 +347,14 @@ mgetmes:
|
||||
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 @@ param:
|
||||
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 @@ local dlg_is_work, ready, procinfo
|
||||
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 @@ new_d:
|
||||
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 @@ new_d:
|
||||
; STEP 3 run SYSTEM XTREE with parameters
|
||||
;
|
||||
|
||||
mov eax,58
|
||||
mov eax,70
|
||||
mov ebx,run_fileinfo
|
||||
int 0x40
|
||||
|
||||
@@ -465,15 +464,14 @@ getmesloop:
|
||||
mov eax,23
|
||||
mov ebx,50 ;0.5 sec
|
||||
int 0x40
|
||||
|
||||
cmp eax,1
|
||||
je mred
|
||||
cmp eax,2
|
||||
je mkey
|
||||
cmp eax,3
|
||||
je mbutton
|
||||
cmp eax,7
|
||||
je mgetmes
|
||||
dec eax
|
||||
jz mred
|
||||
dec eax
|
||||
jz mkey
|
||||
dec eax
|
||||
jz mbutton
|
||||
cmp al, 7-3
|
||||
jz mgetmes
|
||||
|
||||
; Get number of procces
|
||||
mov ebx,procinfo
|
||||
@@ -560,14 +558,14 @@ mgetmes:
|
||||
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 @@ param:
|
||||
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
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
398
programs/media/midamp/trunk/MIDAMP.ASM
Normal file
398
programs/media/midamp/trunk/MIDAMP.ASM
Normal file
@@ -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"
|
||||
; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>室<EFBFBD><E5AEA4><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>:
|
||||
|
||||
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: ; <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
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:
|
BIN
programs/media/midamp/trunk/bottom.gif
Normal file
BIN
programs/media/midamp/trunk/bottom.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
1
programs/media/midamp/trunk/build.bat
Normal file
1
programs/media/midamp/trunk/build.bat
Normal file
@@ -0,0 +1 @@
|
||||
fasm MIDAMP.ASM MIDAMP
|
BIN
programs/media/midamp/trunk/buttons.gif
Normal file
BIN
programs/media/midamp/trunk/buttons.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 673 B |
137
programs/media/midamp/trunk/debug.inc
Normal file
137
programs/media/midamp/trunk/debug.inc
Normal file
@@ -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'
|
209
programs/media/midamp/trunk/dlg.inc
Normal file
209
programs/media/midamp/trunk/dlg.inc
Normal file
@@ -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
|
||||
}
|
356
programs/media/midamp/trunk/draw.inc
Normal file
356
programs/media/midamp/trunk/draw.inc
Normal file
@@ -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
|
||||
|
||||
|
||||
|
||||
; *********************************************
|
||||
; ******* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <EFBFBD><EFBFBD><EFBFBD><EFBFBD> *******
|
||||
; *********************************************
|
||||
|
||||
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
|
449
programs/media/midamp/trunk/event.inc
Normal file
449
programs/media/midamp/trunk/event.inc
Normal file
@@ -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
|
||||
|
328
programs/media/midamp/trunk/gif_lite.inc
Normal file
328
programs/media/midamp/trunk/gif_lite.inc
Normal file
@@ -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
|
BIN
programs/media/midamp/trunk/hdr.gif
Normal file
BIN
programs/media/midamp/trunk/hdr.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
267
programs/media/midamp/trunk/macros.inc
Normal file
267
programs/media/midamp/trunk/macros.inc
Normal file
@@ -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
|
247
programs/media/midamp/trunk/midamp.txt
Normal file
247
programs/media/midamp/trunk/midamp.txt
Normal file
@@ -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 <20><><EFBFBD> Menuet v1.0 29 <20><><EFBFBD><EFBFBD> 2005 <20>.
|
||||
<20><><EFBFBD><EFBFBD>ᠭ<EFBFBD> <20><> <20><><EFBFBD>⮬ <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>誨<EFBFBD><E8AAA8><EFBFBD> <20><><EFBFBD>॥<EFBFBD> (Willow)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>䮭<EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> MIDI-<2D><><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
Vivat assembler et MENUETOS!
|
||||
<EFBFBD><EFBFBD> <20><>㪮<EFBFBD> <20> MenuetOS <20>㣮 <20><> <20><><EFBFBD> <20><><EFBFBD>. <20>ࠩ<EFBFBD><E0A0A9><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ᠭ<EFBFBD> <20><><EFBFBD> <20><>࠭<EFBFBD>祭<EFBFBD><E7A5AD><EFBFBD><EFBFBD> <20><>㣠
|
||||
<EFBFBD><EFBFBD>㪮<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>. <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>६<EFBFBD><E0A5AC><EFBFBD> MeOS <20>뫠 <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD> <20>론. <20><> <20><>⮬
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ୠ⨢<E0ADA0> - 㢠<><E3A2A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD> VaStaNi <20><><EFBFBD><EFBFBD>ᠫ <20><><EFBFBD><EFBFBD><EFBFBD>প<EFBFBD> PC ᯨ<><E1AFA8><EFBFBD><EFBFBD>. <20><><EFBFBD>
|
||||
<EFBFBD>ࠧ<EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>६<EFBFBD><E0A5AC><EFBFBD> <20><>᪠<EFBFBD><E1AAA0> <20> MS-DOS. <20><><EFBFBD> 5 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ᠫ
|
||||
<EFBFBD><EFBFBD> <20><>᪠<EFBFBD><E1AAA0> <20>ணࠬ<E0AEA3><E0A0AC><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>ᨫ<EFBFBD>, <20> <20><>⮬ <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD> <20>
|
||||
ᨭ⠪<EFBFBD><EFBFBD><EFBFBD><EFBFBD> QBasic.
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MeOS <20> <20><><EFBFBD><EFBFBD>ਡ<EFBFBD>⨢<EFBFBD> Mario79 <20><><EFBFBD><EFBFBD>⠥<EFBFBD> <20><><EFBFBD><EFBFBD>⥩<EFBFBD><E2A5A9><EFBFBD> <20><>㪮<EFBFBD><E3AAAE><EFBFBD> <20>奬<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ᯨ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> Menuet <20> <20><><EFBFBD><EFBFBD>蠫 <20><><EFBFBD>-⠪<> <20><> <><E1A2AE> <20>ணࠬ<E0AEA3><E0A0AC> -
|
||||
MIDAMP <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2004 <20><><EFBFBD><EFBFBD>. <20><> <20><>孨<EFBFBD><E5ADA8>᪨<EFBFBD> <20><><EFBFBD>稭<EFBFBD><E7A8AD> <20><> ५<><E0A5AB> <20>ந<EFBFBD>室<EFBFBD><E5AEA4> ⮫쪮
|
||||
ᥩ<EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
<EFBFBD>⠪, MIDAMP - <20><><EFBFBD><EFBFBD>⥩訩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MIDI-<2D>ந<EFBFBD><E0AEA8>뢠⥫<EBA2A0>. <20><> <20><> <20><><EFBFBD>⥭<EFBFBD><E2A5AD><EFBFBD><EFBFBD> <20><>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD> <20> <20><>宦 <20><> WinAmp. <20><><EFBFBD>, <20><><EFBFBD> <20><> 㬥<><E3ACA5>, <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> MIDI-䠩<><E4A0A9>.
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ॣ<><E0A5A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><EFBFBD><E0AEAC><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> <20><> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> ⮣<>,
|
||||
<EFBFBD><EFBFBD><EFBFBD>४⭮<EFBFBD> <20><><EFBFBD>砭<EFBFBD><E7A0AD> <20><><EFBFBD><EFBFBD> <20><>࠭<EFBFBD><E0A0AD><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> 䠩<><E4A0A9><EFBFBD> <20> 1 <20>४<EFBFBD><E0A5AA>, 1 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>㬥<EFBFBD><EFBFBD><EFBFBD> <20> <20> <20>।<EFBFBD><E0A5A4><EFBFBD><EFBFBD> <20><>孮<EFBFBD><E5ADAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E1AAAE> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> :-(
|
||||
|
||||
#########
|
||||
<EFBFBD><EFBFBD><EFBFBD>⥬<EFBFBD><EFBFBD><EFBFBD> <20>ॡ<EFBFBD><E0A5A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
1. <20><><EFBFBD><EFBFBD> <20> ॠ<><E0A5A0><EFBFBD><EFBFBD>樥<EFBFBD> <><E1ABA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⥬<EFBFBD><E2A5AC><EFBFBD> <20>㭪権:
|
||||
55/55 - <20><><EFBFBD><EFBFBD><EFBFBD>䥩<EFBFBD> PC ᯨ<><E1AFA8><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD>!);
|
||||
67 - <><E1A2AE>稢<EFBFBD><E7A8A2><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
66/3 - <20><><EFBFBD> ०<><E0A5A6><EFBFBD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD> <20>४<EFBFBD><E0A5AA> <20><><EFBFBD><EFBFBD><EFBFBD>.
|
||||
2. SYSXTREE <20><><EFBFBD>ᨨ <20><> <20><><EFBFBD><EFBFBD> 52 - <20><><EFBFBD><EFBFBD><EFBFBD>⨥ 䠩<><E4A0A9><EFBFBD> <20> <20><>⠫<EFBFBD><E2A0AB><EFBFBD><EFBFBD> (<28><><EFBFBD><EFBFBD>室<EFBFBD><E5AEA4><EFBFBD>!)
|
||||
3. <20><>ꥬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC> - <20><><EFBFBD><EFBFBD><EFBFBD> 150 <20><>.
|
||||
#########
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> MIDAMP <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>⢥<EFBFBD><E2A2A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><> 㬮<>砭<EFBFBD><E7A0AD>
|
||||
/HD/1/PLAYLIST.TXT. <20><><EFBFBD><EFBFBD><EFBFBD>騥 <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>祭<EFBFBD><E7A5AD> <20><><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD> PLAYLIST_PATH <20>
|
||||
䠩<EFBFBD><EFBFBD> MIDAMP.ASM. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⥪<>⮢<EFBFBD><E2AEA2> 䠩<>, <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD>ண<EFBFBD>
|
||||
<EFBFBD><EFBFBD>室<EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ࠢ<EFBFBD><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> -
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><E1ABA5><EFBFBD>饩 <20><><EFBFBD><EFBFBD>㧪<EFBFBD> <20><><EFBFBD> <20>ਫ<EFBFBD><E0A8AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>᪥ MIDAMP ᮧ<><E1AEA7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>⮪, <20><><EFBFBD><EFBFBD>祩 <20><><EFBFBD><EFBFBD>ண<EFBFBD> <><EFA2AB><EFBFBD><EFBFBD><EFBFBD> ᮡ<>⢥<EFBFBD><E2A2A5><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>窠. <20> ࠭<><E0A0AD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⮪, <20><><EFBFBD>⮬<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>প<EFBFBD> <20> <20><><EFBFBD>砭<EFBFBD><E7A0AD> <20><> <20>६<EFBFBD> <20><>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⮬. <20><>⮪<EFBFBD> <20><>⥭ᨢ<E2A5AD><E1A8A2> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1> <20><>१ IPC, <20><><EFBFBD><EFBFBD> <20> ᪫<><E1AAAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ⮬<>, <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>砥 <20><><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮. <20><> ࠡ<>⠥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
MIDAMP 㬥<><E3ACA5> <><E1A2AE>稢<EFBFBD><E7A8A2><EFBFBD><EFBFBD><EFBFBD> <20> <20><>ப<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⨥<EFBFBD> ᮮ⢥<E1AEAE><E2A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>饩 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
<EFBFBD> <20><>⠫<EFBFBD><E2A0AB> ᤥ<><E1A4A5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <><E1A2AE>稢<EFBFBD><E7A8A2><EFBFBD><EFBFBD> <20><>१ mcall 18,10 (<28><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> Kolibri4),
|
||||
<EFBFBD><EFBFBD> <20>⮫<EFBFBD><E2AEAB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><EFBFBD><E0AEA1><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⨥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> PANEL. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,
|
||||
<EFBFBD>㭪<EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> ⨯<> II ?
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>稥 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> - <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20> WinAmp:
|
||||
|
||||
Del - 㤠<><E3A4A0><EFBFBD><EFBFBD> <20>뤥<EFBFBD><EBA4A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>४<EFBFBD>;
|
||||
z - <20>।<EFBFBD><E0A5A4><EFBFBD>騩 <20>४;
|
||||
x, Enter, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 饫箪 <20><> 䠩<><E4A0A9> - <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
c, Space - <20><>㧠;
|
||||
v - <20>⮯;
|
||||
b - <><E1ABA5><EFBFBD>騩 <20>४;
|
||||
|
||||
Esc - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>;
|
||||
m - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/<2F>몫<EFBFBD><EBAAAB><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>;
|
||||
PgUp, PgDn - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>⠬<EFBFBD> 2 <20><>ᥤ<EFBFBD><E1A5A4><EFBFBD> <20>४<EFBFBD> (<28><> <20><><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD>!);
|
||||
BackSpace - <20><>६<EFBFBD>⪠ <20>४<EFBFBD> <20> <20><>砫<EFBFBD>;
|
||||
Home/End - 㢥<><E3A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>/㬥<><E3ACA5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ⮭<><E2AEAD>쭮<EFBFBD><ECADAE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD> <20><> <20> <20><>砫<EFBFBD>
|
||||
(<28>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD><EFBFBD> <20>冷<EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 'tone>').
|
||||
|
||||
<EFBFBD> <20><><EFBFBD>砥 <20><><EFBFBD><EFBFBD>䮭<EFBFBD><E4AEAD><EFBFBD>᪨<EFBFBD> MIDI, <20> <20><><EFBFBD><EFBFBD><EFBFBD><E1ABA5><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>砥<EFBFBD><E7A0A5><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>㣮<EFBFBD> <20>४ 'trk' <20><><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>㬥<EFBFBD><E3ACA5><EFBFBD> 'chnl', <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
ᮮ⢥<EFBFBD><EFBFBD>⢥<EFBFBD><EFBFBD><EFBFBD> '[' <20><><EFBFBD> ']' <20> <20><>⥬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> <20><> 0 <20><> 9. <20><><EFBFBD><EFBFBD> <20>㤥<EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ந<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ᠬ<><E1A0AC><EFBFBD> <20><>砫<EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><E0AEA6> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD>祭<EFBFBD><E7A5AD> <20><> 㬮<>砭<EFBFBD><E7A0AD> -
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>⨥<EFBFBD> '\' .
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>祭<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>䥩<EFBFBD><E4A5A9>:
|
||||
Shuffle - <20><><EFBFBD>砩<EFBFBD><E7A0A9><EFBFBD> <20><><EFBFBD>冷<EFBFBD> <20>ந<EFBFBD><E0AEA8>뢠<EFBFBD><EBA2A0><EFBFBD> <20>४<EFBFBD><E0A5AA>. Repeat - ⥪<>騩 <20>४ <20>㤥<EFBFBD>
|
||||
<EFBFBD>ந<EFBFBD><EFBFBD>뢠<EFBFBD><EFBFBD><EFBFBD><EFBFBD> ᭮<><E1ADAE> <20> ᭮<><E1ADAE>. <20><><EFBFBD>箪 <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>孥<EFBFBD> 㣫<> <20>뢮<EFBFBD><EBA2AE><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>ଠ<EFBFBD><EFBFBD><EFBFBD> <20> <20>ணࠬ<E0AEA3><E0A0AC> <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20>⫠<EFBFBD><E2ABA0><EFBFBD>. <20><><EFBFBD>箪 <20><> <20>६<EFBFBD><E0A5AC><EFBFBD><EFBFBD><EFBFBD> <20><>⪥ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ᯮᮡ <20><> <20>⮡ࠦ<E2AEA1><E0A0A6><EFBFBD><EFBFBD> - <20> <20><>砫<EFBFBD> <20><><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9>.
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD>箪 <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> Shift <20><><EFBFBD> Ctrl ࠡ<>⠥<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>筮 WinAmp.
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>砭<EFBFBD><EFBFBD> <20>⭮<EFBFBD><E2ADAE>⥫쭮 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>:
|
||||
'Add URL' <20><> ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>稭<EFBFBD><E7A8AD>;
|
||||
'Add Dir' - 㪠<><E3AAA0><EFBFBD><EFBFBD> <20><EFBFBD> 䠩<> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>⠫<EFBFBD><E2A0AB><EFBFBD>. <20><><EFBFBD><EFBFBD><EFBFBD> *.MID <20> *.KAR <20>⮣<EFBFBD>
|
||||
<20><>⠫<EFBFBD><E2A0AB><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ᯨ᮪;
|
||||
'Misc' <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> ॠ<><E0A5A0><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>;
|
||||
'New List' <20><>祣<EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>. <20><><EFBFBD><EFBFBD> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䨪<><E4A8AA><EFBFBD><E0AEA2><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>ப<EFBFBD> <20><>। <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<><E4A0A9> <20><><EFBFBD> <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD> <20><>
|
||||
䫠<EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
W - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>㧨<EFBFBD><E3A7A8> 䠩<> (<28><> 㬮<>砭<EFBFBD><E7A0AD>);
|
||||
P - <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 䠩<>;
|
||||
H - <20><><EFBFBD><EFBFBD>⮢<EFBFBD><E2AEA2><EFBFBD> ᢥ<><E1A2A5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD>ந<EFBFBD><E0AEA8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20>㦭<EFBFBD> ᤥ<><E1A4A5><EFBFBD><EFBFBD>:
|
||||
|
||||
1. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (ᥩ<><E1A5A9><EFBFBD> 40 <20><><EFBFBD><EFBFBD>権).
|
||||
2. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>롮<EFBFBD><EBA1AE> <20>४<EFBFBD><E0A5AA> <20><><EFBFBD><EFBFBD>䮭<EFBFBD><E4AEAD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>.
|
||||
3. <20>⥭<EFBFBD><E2A5AD> ⥪<><E2A5AA><EFBFBD> <20> <20><><EFBFBD><E0A0AE>-䠩<><E4A0A9><EFBFBD>.
|
||||
4. <20>롮<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.
|
||||
5. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ।<><E0A5A4><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD> <20> Ringtone Editor.
|
||||
6. <20>⪮<EFBFBD><E2AAAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E0AEA2><EFBFBD> <20><><EFBFBD> (<28><><EFBFBD> <20>ᥣ<EFBFBD><E1A5A3>, <20><><EFBFBD><EFBFBD>).
|
||||
7. <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2><EFBFBD> <20><><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>, <20><>ᮬ<EFBFBD><E1AEAC><EFBFBD><EFBFBD><EFBFBD>, <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ;-)
|
||||
|
||||
<EFBFBD>ᮡ<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>୮<EFBFBD><E0ADAE><EFBFBD>:
|
||||
|
||||
VaStaNi - <20><><EFBFBD> <20><><EFBFBD> <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>ᠭ<EFBFBD><E1A0AD> MIDAMP <20><> <20><><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>
|
||||
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
|
||||
<20><>ଠ<EFBFBD> 䠩<><E4A0A9><EFBFBD> MIDI
|
||||
The USENET MIDI Primer by Bob McQueer
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD>設<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD>ॢ<EFBFBD><E0A5A2><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> SYSXTREE (DLGS.INC - <20><><EFBFBD><EFBFBD>ࠡ<EFBFBD>⠭<EFBFBD><E2A0AD><EFBFBD> <20>
|
||||
<20><><EFBFBD>⮬ ᯥ<><E1AFA5>䨪<EFBFBD> MIDAMP'a <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> opendialog <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⥪<EFBFBD> ASCL)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> ᮮ<>饭<EFBFBD><E9A5AD> <20><> <20>訡<EFBFBD><E8A8A1><EFBFBD> <20><><EFBFBD>ࠢ<EFBFBD><E0A0A2><EFBFBD><EFBFBD><EFBFBD> <20><> wil_low@hotbox.ru <20><><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
meos.sysbin.com.
|
||||
|
||||
<EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>!
|
292
programs/media/midamp/trunk/midilite.inc
Normal file
292
programs/media/midamp/trunk/midilite.inc
Normal file
@@ -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 "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>",0
|
||||
else
|
||||
db "Header invalid",0
|
||||
end if
|
||||
|
||||
sHSizeInv:
|
||||
if lang eq ru
|
||||
db '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ࠧ<><E0A0A7><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
||||
else
|
||||
db 'Header size invalid',0
|
||||
end if
|
||||
|
||||
sTypeUnsup:
|
||||
if lang eq ru
|
||||
db '<27><><EFBFBD> MIDI <20><> <20><><EFBFBD><EFBFBD><EFBFBD>ন<EFBFBD><E0A6A8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>',0
|
||||
else
|
||||
db 'MIDI type not supported',0
|
||||
end if
|
349
programs/media/midamp/trunk/playlist.inc
Normal file
349
programs/media/midamp/trunk/playlist.inc
Normal file
@@ -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
|
30
programs/media/midamp/trunk/playlist.txt
Normal file
30
programs/media/midamp/trunk/playlist.txt
Normal file
@@ -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
|
||||
|
293
programs/media/midamp/trunk/playnote.txt
Normal file
293
programs/media/midamp/trunk/playnote.txt
Normal file
@@ -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 =-
|
||||
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 1 ͻ<><CDBB><EFBFBD> 2 ͻ
|
||||
<20><><EFBFBD><EFBFBD>⥫쭮<E2A5AB>⨳ DELAY NOTE <20> DELAY <20> DELAY <20><> DELAY <20>
|
||||
<20> <20><><EFBFBD> <20> mSec <20> IRQ 0 <20> CODE <20><> CODE <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><CDB9><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<20> 楫<><E6A5AB> <20> 2000 <20> <20> 0xC8 <20><> absent <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> 1/2 <20> 1000 <20> <20> 0x64 <20><> 0xE4 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> 1/4 <20> 500 <20> <20> 0x32 <20><> 0xB2 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ 10 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> 1/8 <20> 250 <20> mSec <20> 0x19 <20><> 0x99 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> 1/16 <20> 125 <20> <20> 0xC <20><> 0x8C <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> 1/32 <20> 62.5 <20> <20> 6 <20><> 0x86 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ĵ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ<EFBFBD><C4B6><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> 1/64 <20> 31.25 <20> <20> 3 <20><> 0x83 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ
|
||||
|
||||
|
||||
-= PACK CODE =-
|
||||
|
||||
!!!!! IF PACK CODE = 0xFF THEN PAUSE = DELAY CODE !!!!!
|
||||
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͻ
|
||||
<20> <20><><EFBFBD><EFBFBD> <20>number<65> code <20>upper CODE<44> <20> <20><><EFBFBD><EFBFBD> <20>type<70>number<65>lower CODE<44>
|
||||
<20> <20><><EFBFBD><EFBFBD><EFBFBD> <20>OCTAVE<56>number<65>Bit7..Bit4<74> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>NOTE<54> NOTE <20>Bit3..Bit0<74>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD>ப⠢<E0AEAA><E2A0A2> -3 <20> 0 <20> 0000 <20> <20> <20><> <20> C <20> 1 <20> 0001 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> -2 <20> 1 <20> 0001 <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> C# <20> 2 <20> 0010 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><><EFBFBD><EFBFBD><EFBFBD> <20> -1 <20> 2 <20> 0010 <20> <20> <20><> <20> D <20> 3 <20> 0011 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><>ࢠ<EFBFBD> <20> 1 <20> 3 <20> 0011 <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> D# <20> 4 <20> 0100 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 2 <20> 4 <20> 0100 <20> <20> <20><> <20> E <20> 5 <20> 0101 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 3 <20> 5 <20> 0101 <20> <20> <20><> <20> F <20> 6 <20> 0110 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><>⢥<EFBFBD><E2A2A5><EFBFBD><EFBFBD> <20> 4 <20> 6 <20> 0110 <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> F# <20> 7 <20> 0111 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><><EFBFBD><EFBFBD> <20> G <20> 8 <20> 1000 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> G# <20> 9 <20> 1001 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><> <20> A <20> 10 <20> 1010 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> A# <20> 11 <20> 1011 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<20> <20><> <20> B <20> 12 <20> 1100 <20>
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ
|
||||
|
||||
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)
|
||||
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>ͻ
|
||||
<EFBFBD> <20><><EFBFBD> <20>number<65> code <20> <20><><EFBFBD><EFBFBD> <20>type<70>number<65>frequency PACK <20>
|
||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>OCTAVE<56>number<65> 1<> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>NOTE<54> NOTE <20>sound Hz CODE <20>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD> <20> <20> <20> <20><> <20> C <20> 1 <20> 523,251 -- 0x31 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> C# <20> 2 <20> 554,365 --|-- 0x32 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20> D <20> 3 <20> 587,33 | | 0x33 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> D# <20> 4 <20> 622,254 | | 0x34 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20> E <20> 5 <20> 659,255 | | 0x35 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20> F <20> 6 <20> 698,456 | | 0x36 <20>
|
||||
<EFBFBD> <20><>ࢠ<EFBFBD> <20> 1 <20> 3 <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> ( first <20> <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> F# <20> 7 <20> 739,989 | | 0x37 <20>
|
||||
<EFBFBD> octave ) <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><><EFBFBD><EFBFBD> <20> G <20> 8 <20> 783,991 0x38 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> x 2 <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> G# <20> 9 <20> 830,609 0x39 <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20> A <20> 10 <20> 880 | | 0x3A <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> A# <20> 11 <20> 932,328 | | 0x3B <20>
|
||||
<EFBFBD> <20> <20> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>Ķ
|
||||
<EFBFBD> <20> <20> <20> <20><> <20> B <20> 12 <20> 987,767 | | 0x3C <20>
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> | | <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> 2 <20> 4 <20> <20><> <20> <20> <20> 1 <20>1046,502 <- | 0x41 <20>
|
||||
...... .. .. ... .. .. .... ... <----
|
||||
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
|
||||
--- EXAMPLE MUSIC ---
|
||||
|
||||
<EFBFBD>ਬ<EFBFBD><EFBFBD> <20>㧨<EFBFBD><E3A7A8><EFBFBD><E0AEA2><EFBFBD><EFBFBD> <20><> <20><>⠬ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>.<2E><><EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD> <20>砣..."
|
||||
<20> 䨫<><E4A8AB><EFBFBD> "<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>᪨<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>"
|
||||
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! <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<|
|
||||
<<<<<<< >>>>>>>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
121
programs/media/midamp/trunk/thread.inc
Normal file
121
programs/media/midamp/trunk/thread.inc
Normal file
@@ -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
|
@@ -110,7 +110,7 @@ if SYS eq win
|
||||
else
|
||||
Msg 0
|
||||
Msg 1
|
||||
mcall 40,10000101b
|
||||
mcall 40,1000101b
|
||||
; jmp again
|
||||
CmdLine
|
||||
cmdl:
|
||||
|
@@ -261,8 +261,8 @@ local dlg_is_work, ready
|
||||
;; 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 @@ new_d:
|
||||
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 @@ new_d:
|
||||
; STEP 3 run SYSTEM XTREE with parameters
|
||||
;
|
||||
|
||||
mcall 58,run_fileinfo
|
||||
mcall 70,run_fileinfo
|
||||
|
||||
call redproc
|
||||
|
||||
@@ -318,15 +318,14 @@ getmesloop:
|
||||
mov eax,23
|
||||
mov ebx,50 ;0.5 sec
|
||||
int 0x40
|
||||
|
||||
cmp eax,1
|
||||
je mred
|
||||
cmp eax,2
|
||||
je mkey
|
||||
cmp eax,3
|
||||
je mbutton
|
||||
cmp eax,7
|
||||
je mgetmes
|
||||
dec eax
|
||||
jz mred
|
||||
dec eax
|
||||
jz mkey
|
||||
dec eax
|
||||
jz mbutton
|
||||
cmp al, 7-3
|
||||
jz mgetmes
|
||||
|
||||
; Get number of procces
|
||||
mcall 9,os_work,-1
|
||||
@@ -405,14 +404,14 @@ mgetmes:
|
||||
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 @@ param:
|
||||
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
|
||||
|
||||
|
@@ -68,8 +68,8 @@ else
|
||||
; 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
|
||||
|
@@ -143,6 +143,11 @@ macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
|
||||
|
||||
|
||||
; 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 sub arg1,arg2
|
||||
|
||||
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
|
||||
|
@@ -385,12 +385,26 @@ get_6ASCII_num:
|
||||
}
|
||||
|
||||
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 @@ StartPad:
|
||||
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
|
@@ -133,9 +133,9 @@ local dlg_is_work, ready, procinfo
|
||||
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 @@ new_d:
|
||||
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 @@ new_d:
|
||||
; STEP 3 run SYSTEM XTREE with parameters
|
||||
;
|
||||
|
||||
mov eax,58
|
||||
mov eax,70
|
||||
mov ebx,run_fileinfo
|
||||
int 0x40
|
||||
|
||||
@@ -200,15 +200,14 @@ getmesloop:
|
||||
mov eax,23
|
||||
mov ebx,50 ;0.5 sec
|
||||
int 0x40
|
||||
|
||||
cmp eax,1
|
||||
je mred
|
||||
cmp eax,2
|
||||
je mkey
|
||||
cmp eax,3
|
||||
je mbutton
|
||||
cmp eax,7
|
||||
je mgetmes
|
||||
dec eax
|
||||
jz mred
|
||||
dec eax
|
||||
jz mkey
|
||||
dec eax
|
||||
jz mbutton
|
||||
cmp al, 7-3
|
||||
jz mgetmes
|
||||
|
||||
; Get number of procces
|
||||
mov ebx,procinfo
|
||||
@@ -295,14 +294,14 @@ mgetmes:
|
||||
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 @@ param:
|
||||
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 @@ local dlg_is_work, ready, procinfo
|
||||
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 @@ new_d:
|
||||
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 @@ new_d:
|
||||
; STEP 3 run SYSTEM XTREE with parameters
|
||||
;
|
||||
|
||||
mov eax,58
|
||||
mov eax,70
|
||||
mov ebx,run_fileinfo
|
||||
int 0x40
|
||||
|
||||
@@ -412,15 +411,14 @@ getmesloop:
|
||||
mov eax,23
|
||||
mov ebx,50 ;0.5 sec
|
||||
int 0x40
|
||||
|
||||
cmp eax,1
|
||||
je mred
|
||||
cmp eax,2
|
||||
je mkey
|
||||
cmp eax,3
|
||||
je mbutton
|
||||
cmp eax,7
|
||||
je mgetmes
|
||||
dec eax
|
||||
jz mred
|
||||
dec eax
|
||||
jz mkey
|
||||
dec eax
|
||||
jz mbutton
|
||||
cmp al, 7-3
|
||||
jz mgetmes
|
||||
|
||||
; Get number of procces
|
||||
mov ebx,procinfo
|
||||
@@ -457,6 +455,7 @@ mred:
|
||||
call redproc
|
||||
jmp getmesloop
|
||||
mkey:
|
||||
mov eax,2
|
||||
int 0x40 ; read (eax=2)
|
||||
jmp getmesloop
|
||||
mbutton:
|
||||
@@ -506,14 +505,14 @@ mgetmes:
|
||||
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 @@ dlg_pid_get dd 0
|
||||
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
|
||||
|
@@ -571,6 +571,12 @@ if ~ BGI_LEVEL eq KERNEL
|
||||
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
|
||||
|
@@ -143,6 +143,8 @@ macro mcall a,b,c,d,e,f { ; mike.dld
|
||||
|
||||
|
||||
|
||||
; language for programs
|
||||
lang fix ru ; ru en fr ge fi
|
||||
|
||||
|
||||
|
||||
|
@@ -40,20 +40,19 @@ GUTTER equ 10
|
||||
BENCH equ 0;1
|
||||
syms equ 12
|
||||
|
||||
use32 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
use32 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 32-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ०<><E0A5A6> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD><EFBFBD>
|
||||
org 0x0 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
db 'MENUET01' ; 8-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> MenuetOS
|
||||
dd 0x01 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28>ᥣ<EFBFBD><E1A5A3> 1)
|
||||
dd START ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࢮ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd I_END0 ; ࠧ<><E0A0A7><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
dd esp_end ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd sys_mem ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>設<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd fname_buf ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC> (<28><> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
dd 0x0 ; <20><>१<EFBFBD>ࢨ<E0A2A8><E0AEA2><EFBFBD>
|
||||
db 'MENUET01' ; 8-<2D><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> MenuetOS
|
||||
dd 0x01 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> (<28>ᥣ<EFBFBD><E1A5A3> 1)
|
||||
dd START ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ࢮ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd I_END0 ; ࠧ<><E0A0A7><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
dd esp_end ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>⢮ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd sys_mem ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>設<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD>
|
||||
dd fname_buf ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> <20><>ࠬ<EFBFBD><E0A0AC> (<28><> <20>ᯮ<EFBFBD><E1AFAE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>)
|
||||
dd 0x0 ; <20><>१<EFBFBD>ࢨ<E0A2A8><E0AEA2><EFBFBD>
|
||||
|
||||
include 'lang.inc'
|
||||
include 'macros.inc' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD>騪<EFBFBD><E9A8AA>!
|
||||
include 'MACROS.INC' ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20><>ᥬ<EFBFBD><E1A5AC><EFBFBD><EFBFBD>騪<EFBFBD><E9A8AA>!
|
||||
include 'debug.inc'
|
||||
if ~ RENDER eq PIX
|
||||
TOP=TOP+4
|
||||
@@ -77,7 +76,7 @@ START:
|
||||
end if
|
||||
start2:
|
||||
cmp byte[fname_buf],0
|
||||
je load_file;top_red
|
||||
je load_file;top_red
|
||||
jmp noactivate
|
||||
prep_load:
|
||||
; mcall 18,3,dword[prcinfo+30]
|
||||
@@ -103,9 +102,9 @@ START:
|
||||
mov [HClick],-100
|
||||
load_help:
|
||||
test eax,eax
|
||||
jz .sizok
|
||||
jz .sizok
|
||||
cmp eax,5
|
||||
je .sizok
|
||||
je .sizok
|
||||
.nosizok:
|
||||
mov dword[fileinfo.name],N_A
|
||||
.sizok:
|
||||
@@ -124,38 +123,38 @@ START:
|
||||
mov [fname_size],edi
|
||||
top_red:
|
||||
mov [top],TOP
|
||||
red: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
red: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
call draw_window ; <20><><EFBFBD>뢠<EFBFBD><EBA2A0> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
||||
call draw_window ; <20><><EFBFBD>뢠<EFBFBD><EBA2A0> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
;--- <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ----------------------------------------
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
still:
|
||||
mcall 10 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 10 - <20><><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD>
|
||||
mcall 10 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 10 - <20><><EFBFBD><EFBFBD><EFBFBD> ᮡ<><E1AEA1><EFBFBD><EFBFBD>
|
||||
|
||||
cmp eax,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> ?
|
||||
je red ; <20> <20><> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
|
||||
cmp eax,3 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
||||
je button ; <20> <20><> - <20><> button
|
||||
cmp eax,2 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
||||
je key ; <20> <20><> - <20><> key
|
||||
cmp eax,1 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2><EFBFBD> <20><><EFBFBD><EFBFBD> ?
|
||||
je red ; <20> <20><> - <20><> <20><><EFBFBD><EFBFBD><EFBFBD> red
|
||||
cmp eax,3 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
||||
je button ; <20> <20><> - <20><> button
|
||||
cmp eax,2 ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ?
|
||||
je key ; <20> <20><> - <20><> key
|
||||
|
||||
jmp still ; <20> <20><>㣮<EFBFBD> ᮡ<>⨥ - <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
||||
jmp still ; <20> <20><>㣮<EFBFBD> ᮡ<>⨥ - <20> <20><>砫<EFBFBD> 横<><E6A8AA>
|
||||
|
||||
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
|
||||
key: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> (<28> ah)
|
||||
cmp ah,104 ; HELP
|
||||
key: ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 2 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD> ᨬ<><E1A8AC><EFBFBD><EFBFBD> (<28> ah)
|
||||
cmp ah,104 ; HELP
|
||||
jne .nohelp
|
||||
.help:
|
||||
xor [mode],RTF_HELP
|
||||
test [mode],RTF_HELP
|
||||
jz load_file
|
||||
jz load_file
|
||||
mov ecx,help_end-help_file
|
||||
mov [block_end],ecx
|
||||
add [block_end],I_END
|
||||
@@ -176,34 +175,34 @@ still:
|
||||
; je still
|
||||
; jmp prep_load
|
||||
.nohelp2:
|
||||
cmp ah,114 ; R - redraw
|
||||
je red
|
||||
cmp ah,99 ; C - color
|
||||
cmp ah,114 ; R - redraw
|
||||
je red
|
||||
cmp ah,99 ; C - color
|
||||
jne .nocolor
|
||||
.color:
|
||||
xor [mode],RTF_COLORLESS
|
||||
jmp red
|
||||
.nocolor:
|
||||
cmp ah,97 ; A - alignment
|
||||
cmp ah,97 ; A - alignment
|
||||
jne .noalign
|
||||
.alignment:
|
||||
xor [mode],RTF_ALIGNLESS
|
||||
jmp red
|
||||
.noalign:
|
||||
cmp ah,44 ; < - pitch dec
|
||||
cmp ah,44 ; < - pitch dec
|
||||
jne .nopd
|
||||
.decp:
|
||||
dec [pitch]
|
||||
jmp red
|
||||
.nopd:
|
||||
cmp ah,46 ; < - pitch inc
|
||||
cmp ah,46 ; < - pitch inc
|
||||
jne .nopi
|
||||
.incp:
|
||||
inc [pitch]
|
||||
jmp red
|
||||
.nopi:
|
||||
cmp ah,180 ; Home
|
||||
je top_red
|
||||
cmp ah,180 ; Home
|
||||
je top_red
|
||||
mov ebx,dword[prcinfo+46]
|
||||
sub ebx,TOP+15
|
||||
cmp ah,183 ;PgDn
|
||||
@@ -221,20 +220,20 @@ still:
|
||||
jne .nopgup
|
||||
add [top],bx
|
||||
cmp [top],TOP
|
||||
jl red
|
||||
jl red
|
||||
mov [top],TOP
|
||||
cmp cx,[top]
|
||||
je still
|
||||
je still
|
||||
jmp red
|
||||
.nopgup:
|
||||
cmp ah,178 ;arrUp
|
||||
jne .noarup
|
||||
add [top],CHARH
|
||||
cmp [top],TOP
|
||||
jl red
|
||||
jl red
|
||||
mov [top],TOP
|
||||
cmp cx,[top]
|
||||
je still
|
||||
je still
|
||||
jmp red
|
||||
.noarup:
|
||||
if RENDER eq FREE
|
||||
@@ -255,10 +254,10 @@ still:
|
||||
jmp .zoom
|
||||
.nominus:
|
||||
end if
|
||||
cmp ah,108 ; L - load
|
||||
cmp ah,108 ; L - load
|
||||
jne stilld
|
||||
.file_open:
|
||||
or [mode],RTF_OPENING
|
||||
or [mode],RTF_OPENING
|
||||
opendialog draw_window, prep_load, st_1, fname_buf
|
||||
st_1:
|
||||
and [mode],not RTF_OPENING
|
||||
@@ -269,37 +268,37 @@ still:
|
||||
;---------------------------------------------------------------------
|
||||
|
||||
button:
|
||||
mcall 17 ; 17 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
mcall 17 ; 17 - <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>䨪<EFBFBD><E4A8AA><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>⮩ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cmp ah,2
|
||||
je key.help
|
||||
je key.help
|
||||
cmp ah,3
|
||||
je key.color
|
||||
je key.color
|
||||
cmp ah,4
|
||||
je key.alignment
|
||||
je key.alignment
|
||||
cmp ah,5
|
||||
je key.file_open
|
||||
je key.file_open
|
||||
cmp ah,6
|
||||
je key.incp
|
||||
je key.incp
|
||||
cmp ah,7
|
||||
je key.decp
|
||||
je key.decp
|
||||
if RENDER eq FREE
|
||||
cmp ah,8
|
||||
je key.zminus
|
||||
je key.zminus
|
||||
cmp ah,9
|
||||
je key.zplus
|
||||
je key.zplus
|
||||
end if
|
||||
cmp ah, 1 ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> 1,
|
||||
jne .noexit ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
cmp ah, 1 ; <20> <20><> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20> <20><><EFBFBD><EFBFBD> 1,
|
||||
jne .noexit ; <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
.exit:
|
||||
mcall -1 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
mcall -1 ; <20><><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
.noexit:
|
||||
cmp ah,20
|
||||
jne still
|
||||
mcall 37,1
|
||||
and eax,0xffff
|
||||
cmp eax,[HClick]
|
||||
je still
|
||||
je still
|
||||
mov [HClick],eax
|
||||
sub eax,25
|
||||
mul [HDoc]
|
||||
@@ -317,13 +316,14 @@ still:
|
||||
|
||||
draw_window:
|
||||
|
||||
mcall 12, 1 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
||||
; 1 - <20><>稭<EFBFBD><E7A8AD><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
||||
mcall 12, 1 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
||||
; 1 - <20><>稭<EFBFBD><E7A8AD><EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
||||
|
||||
mcall 0, <10,WINW>, <100,WINH>, WIN_COLOR,0x805080D0, 0x005080D0
|
||||
mcall 9,procinfo,-1
|
||||
mov eax,[procinfo.x_size]
|
||||
cmp eax,1
|
||||
ja .temp12345
|
||||
ja .temp12345
|
||||
ret
|
||||
.temp12345:
|
||||
|
||||
@@ -344,10 +344,10 @@ draw_window:
|
||||
and [mode],not RTF_TOEOF
|
||||
mov ebx,[edi+42]
|
||||
cmp ebx,[wSave]
|
||||
je .nochg
|
||||
je .nochg
|
||||
.chg:
|
||||
mov [wSave],ebx
|
||||
or [mode],RTF_TOEOF
|
||||
or [mode],RTF_TOEOF
|
||||
and [HDoc],0
|
||||
and [line_count],0
|
||||
mov [HClick],-100
|
||||
@@ -359,29 +359,29 @@ draw_window:
|
||||
mov esi,0xb810e7
|
||||
mov edx,2
|
||||
BTN_SPACE equ 14 shl 16
|
||||
mcall 8 ;2
|
||||
mcall 8 ;2
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall 8,,,,0x459a ;3
|
||||
mcall 8,,,,0x459a ;3
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall ,,,,0x107a30 ;4
|
||||
mcall ,,,,0x107a30 ;4
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall ,,,,0xcc0000 ;5
|
||||
mcall ,,,,0xcc0000 ;5
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall ,,,,0x575f8c ;6
|
||||
mcall ,,,,0x575f8c ;6
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall ,,,,0x575f8c ;7
|
||||
mcall ,,,,0x575f8c ;7
|
||||
if RENDER eq FREE
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall ,,,,0x6a73d0 ;8
|
||||
mcall ,,,,0x6a73d0 ;8
|
||||
sub ebx,BTN_SPACE
|
||||
inc edx
|
||||
mcall ,,,,0xd048c8 ;9
|
||||
mcall ,,,,0xd048c8 ;9
|
||||
end if
|
||||
shr ecx,16
|
||||
mov bx,cx
|
||||
@@ -476,9 +476,9 @@ end if
|
||||
loop .l0
|
||||
end if
|
||||
.ex:
|
||||
mcall 12, 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
||||
; 2, <20><><EFBFBD><EFBFBD><EFBFBD>稫<EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
||||
ret ; <20><>室<EFBFBD><E5AEA4> <20><> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD>
|
||||
mcall 12, 2 ; <20>㭪<EFBFBD><E3ADAA><EFBFBD> 12: ᮮ<><E1AEAE><EFBFBD><EFBFBD><EFBFBD> <20><> <20><> <20><><EFBFBD><EFBFBD>ᮢ<EFBFBD><E1AEA2> <20><><EFBFBD><EFBFBD>
|
||||
; 2, <20><><EFBFBD><EFBFBD><EFBFBD>稫<EFBFBD> <20><>ᮢ<EFBFBD><E1AEA2><EFBFBD>
|
||||
ret ; <20><>室<EFBFBD><E5AEA4> <20><> <20><><EFBFBD>楤<EFBFBD><E6A5A4><EFBFBD>
|
||||
|
||||
if GUTTER eq 1
|
||||
arrow db 0x19
|
||||
@@ -547,6 +547,8 @@ end if
|
||||
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,16 +596,15 @@ save_stack:
|
||||
rb RTFSTACKSIZE
|
||||
save_limit:
|
||||
rb BGIFONTSIZE
|
||||
fname_buf rd 16
|
||||
|
||||
listptr dd ?
|
||||
szKeyword rb 31
|
||||
szParameter rb 21
|
||||
block_end dd ?
|
||||
I_END: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
I_END: ; <20><>⪠ <20><><EFBFBD><EFBFBD><EFBFBD> <20>ணࠬ<E0AEA3><E0A0AC>
|
||||
rb RTFSIZE
|
||||
esp1:
|
||||
rb ESPSIZE
|
||||
sys_mem:
|
||||
rb ESPSIZE
|
||||
esp_end:
|
||||
esp_end:
|
||||
|
Reference in New Issue
Block a user