Subversion Repositories Kolibri OS

Compare Revisions

Regard whitespace Rev 135 → Rev 139

/programs/media/ac97wav/trunk/ac97wav.asm
11,8 → 11,9
; stops playing before closing a window
; 0.08 Nov 24, 2004 added support for 8bit and mono modes
; +variable rate for some chipsets
; 0.09 August 26, 2006 modified to use function 70
;
; Use [flat assembler 1.56] to compile.
; Use [flat assembler 1.64] to compile.
;
;---------------------------------------------------------------------
 
31,7 → 32,6
 
;---------------------------------------------------------------------
 
include "lang.inc"
include "macros.inc" ; standart macros & constants
include "meosfunc.inc" ; MenuetOS API functions names
include "debug.inc" ; printing to debug board
449,20 → 449,25
;; in: nothing
;; out: nothing (but sound :) !corrupts registers!
play:
; at first, reset file
mov [fileinfo.first_block], 0
; at first, reset file and get file size
mcall MF_SYSTREE, attrinfo
test eax, eax
jnz .notfound
mov eax, [fileattr+32]
mov [file_size], eax
mov [fileinfo.first_byte], 0
mcall MF_SYSTREE, fileinfo ; load a block, returns error code in eax
; and size of the file in ebx
test eax, eax ; 0 - successful
jz @f
cmp eax, 6 ; 6 = eof - successful too
jz @f
.notfound:
print "AC97: File not found!"
mov [status], ST_STOP
jmp .exit
@@:
shr ebx, 9 ; size_of_file / 512 = number_of_blocks
mov [file_size], ebx
 
 
mov al, [LOAD_BUFFER+32] ; bytes per sample
dec al
jz @f
608,7 → 613,7
 
movzx edx, byte [wav_mode]
mov ecx, [blocks + edx * 4]
mov [fileinfo.blocks], ecx
mov [fileinfo.bytes], ecx
 
mov esi, LOAD_BUFFER
mov edi, [buffers+eax*4]
617,14 → 622,16
mcall MF_SYSTREE, fileinfo
test eax, eax
jz @f
cmp eax, 6
jz @f
cmp [attempts],100
je @f
inc [attempts]
jmp start_attempts
dpd eax
newline
dpd [fileinfo.first_block]
newline
; dpd eax
; newline
; dpd [fileinfo.first_block]
; newline
@@:
; print " loaded!"
 
652,7 → 659,7
 
pop edx ebx
mov eax,[esp+4] ;restore buffer index
add [fileinfo.first_block], ecx ; +60Kb
add [fileinfo.first_byte], ecx ; +60Kb
call [convert + edx * 4]
;start fix for MM (4)
mov eax,[esp+4] ;restore buffer index
881,7 → 888,7
type_of_conversion db 0
 
convert dd c8mono, c8stereo, c16mono, c16stereo
blocks dd 30, 60, 60, 120
blocks dd 30*512, 60*512, 60*512, 120*512
 
 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
993,20 → 1000,29
;---------------------------------------------------------------------
volume dd 15
 
attrinfo:
dd 5
dd 0
dd 0
dd 0
dd fileattr
db 0
dd textbox_string
 
fileinfo:
.mode dd 0 ; READ
.first_block dd 0
.blocks dd 120 ; 120 Kb
.first_byte dd 0
dd 0
.bytes dd 60*1024 ; 60 Kb
.dest dd LOAD_BUFFER ;file_data
.work dd work_area
; db "/HD/1/WINDOWS/MEDIA/WICEB7~1.WAV",0
;sz textbox_string, "/hd/1/testmuz/menuet11.wav",0
sz textbox_string, " ",0
; rb 256
textbox_string:
;---------------------------------------------------------------------
 
IMAGE_END: ; end of program's image
rb 100-textbox_string.size
rb 257
; rb 257-textbox_string.size
; textbox_string.size
 
;---------------------------------------------------------------------
1035,6 → 1051,8
 
status db ?
 
fileattr: rb 40
 
;---------------------------------------------------------------------
phys_bdl_buffer rd 1
phys_wav_buffer1 rd 1
/programs/media/ac97wav/trunk/frontend.inc
1,4 → 1,11
thread:
mov edi, textbox_string
or ecx, -1
xor eax, eax
repnz scasb
not ecx
dec ecx
mov [textbox_position], cl
call draw_window
call main_loop
mov [status], ST_EXIT
36,7 → 43,7
cmp ah, 8
je .backspace
movzx ecx, [textbox_position]
cmp ecx, 47
cmp ecx, 255
jae .enter
mov [textbox_string + ecx], ah
inc [textbox_position]
50,8 → 57,8
movzx ecx, [textbox_position]
test ecx, ecx
jz main_loop
mov [textbox_string + ecx], byte 0
dec [textbox_position]
mov [textbox_string + ecx - 1], byte 0
call textbox_draw
jmp main_loop
 
173,17 → 180,15
mcall MF_GETMOUSE, MS_COORDS_WINDOW
shr eax, 16 ; get mouse.x
sub eax, 7
test eax, eax
jz @f
imul eax, [file_size]
imul [file_size]
mov ebx, 286
cdq
div ebx
@@:
;dps "block: "
;dpd eax
;newline
mov [fileinfo.first_block], eax
mov [fileinfo.first_byte], eax
call draw_progress_bar
jmp main_loop
ret
244,8 → 249,8
draw_progress_bar:
pushad
 
imul eax, [fileinfo.first_block], PBAR_WIDTH
cdq
mov eax, PBAR_WIDTH
mul [fileinfo.first_byte]
div [file_size]
 
push eax
266,5 → 271,5
sz buttons_text, " Play Stop << >> Vol- Vol+"
 
textbox_active db 0
textbox_position db textbox_string.size-1
textbox_position db 0;textbox_string.size-1
file_size dd 100
/programs/media/ac97wav/trunk/macros.inc
143,6 → 143,8
 
 
 
; language for programs
lang fix ru ; ru en fr ge fi
 
 
 
/programs/media/ac97wav/trunk/meosfunc.inc
19,7 → 19,6
PRT_FREE = 1
MF_THREAD = 51
THR_CREATE = 1
MF_SYSTREE = 58
MF_PCI = 62
MF_EXIT = -1
MF_INTERNAL_SERVICES = 68
26,4 → 25,5
ALLOC_PHYS_MEM =5
FREE_PHYS_MEM =6
SET_PHYS_BUFFER =7
GET_PHYS_BUFFER =8
GET_PHYS_BUFFER =8
MF_SYSTREE = 70
/programs/media/midamp/trunk/draw.inc
8,8 → 8,7
test eax,eax
jz .ex
mov ebp,[coo]
mov ebx,[ebp-20]
mul ebx
mul dword [ebp-20]
mov ebx,[tick_count]
test ebx,ebx
jz .ex
353,4 → 352,4
dw 10,40,70,100,240
 
about1:
db 13,10,'* MIDAMP for MenuetOS v1.0 by Willow, July 2005 *',13,10,0
db 13,10,'* MIDAMP for KolibriOS v1.1 by Willow, July 2005 *',13,10,0
/programs/media/midamp/trunk/event.inc
341,51 → 341,37
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
mov ecx,1024/4
rep movsd
and dword [dir_info+4], 0
.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
mcall 70, dir_info
cmp ebx, 1
jnz red ;still
test byte [dir_table+32], 11000b ; exclude directories & vol label
jnz .no
mov eax,[esi+7]
mov al,'.'
cmp eax,'.MID'
je .ok
cmp eax,'.KAR'
jne .no
mov edi, dir_table+32+40
mov esi, edi
xor eax, eax
or ecx, -1
repnz scasb
mov eax, [edi-5]
or eax, 0x20202000
cmp eax, '.mid'
jz .ok
cmp eax, '.kar'
jnz .no
.ok:
mov [esi+8],eax
pusha
lea ecx, [edi-dir_table-32-40-1]
mov edi,edx
mov ecx,12
rep movsb
and byte[edi],0
mov ecx,edi
sub ecx,fnbuf
mov esi,fnbuf
sub ecx, esi
call PL_add
popa
.no:
add esi,32
loop .nxt
add dword[file_info+4],DIR_SIZE/512
inc dword [dir_info+4]
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
/programs/media/midamp/trunk/gif_lite.inc
88,7 → 88,7
mov [.img_count],eax
inc eax
cmp dword[esi],'GIF8'
jne .er ; signature
jne .ex ; signature
mov ecx,[esi+0xa]
inc eax
add esi,0xd
123,7 → 123,7
jmp .block_skip
.noextblock:
cmp byte[edi],0x2c ; image beginning
jne .er
jne .ex
inc [.img_count]
inc edi
mov esi,[.cur_info]
211,9 → 211,6
call .Gif_output
pop ebx eax
jmp .add
.er:
pop edi
jmp .ex
.end:
mov eax,[.cur_info]
mov [eax],edi
229,7 → 226,6
cmp byte[edi],0x3b
jne .nextblock
xor eax,eax
stosd
mov ecx,[.img_count]
.ex:
pop edi esi
/programs/media/midamp/trunk/playlist.inc
236,8 → 236,10
and [list_count],0
mov [pl_ptr],playlist
mov ebx,PL_info
mov dword[ebx+12],playlist
mov eax,58
mov dword[ebx+16],playlist
and dword[ebx],0
mov dword[ebx+12],20*512
mov eax,70
int 0x40
test eax,eax
jz .ok1 ; ebx- filesize
295,7 → 297,7
mov eax,0x0a0d
mov edi,[pl_ptr]
lea edx,[edi+2]
mov [PL_info+12],edx
mov [PL_info+16],edx
.savl:
movzx ebx,word[edi]
and bx,not FL_MULSEL
305,9 → 307,9
stosw
sub edi,[pl_ptr]
mov ebx,PL_info
mov [ebx+8],edi
mov dword[ebx],1
mov eax,58
mov [ebx+12],edi
mov byte[ebx],2
mov eax,70
int 0x40
.ex:
ret
343,7 → 345,7
PL_info:
.mode dd 0
dd 0
.bytes dd 20
dd 0
dd hash_table
.bytes dd 20*512
dd 0
db PLAYLIST_PATH,0