Subversion Repositories Kolibri OS

Rev

Rev 1583 | Rev 1595 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1583 Rev 1588
1
; MIDI PLAYER FOR MENUET v1.0
1
; MIDI PLAYER FOR MENUET v1.0
2
; Written in pure assembler by Ivushkin Andrey aka Willow
2
; Written in pure assembler by Ivushkin Andrey aka Willow
3
;
3
;
4
;
4
;
5
; Created:      December 7, 2004
5
; Created:      December 7, 2004
6
; Last changed: July 29, 2005
6
; Last changed: July 29, 2005
7
;
7
;
8
; COMPILE WITH FASM
8
; COMPILE WITH FASM
9
 
9
 
10
PLAYLIST_PATH equ '/HD0/1/PLAYLIST.TXT'
10
PLAYLIST_PATH equ '/HD0/1/PLAYLIST.TXT'
11
;APP_MEM   equ 150*1024
11
;APP_MEM   equ 150*1024
12
 
12
 
13
IPC_PLAY  equ 0xa1
13
IPC_PLAY  equ 0xa1
14
IPC_PAUS  equ 0xa2
14
IPC_PAUS  equ 0xa2
15
IPC_TRIG  equ 0xa3
15
IPC_TRIG  equ 0xa3
16
IPC_UPDT  equ 0xb1
16
IPC_UPDT  equ 0xb1
17
IPC_NEXT  equ 0xb2
17
IPC_NEXT  equ 0xb2
18
 
18
 
19
LISTITEMS equ 40
19
LISTITEMS equ 40
20
WND_BACK  equ 0x24263c
20
WND_BACK  equ 0x24263c
21
PLY	  equ 63
21
PLY	  equ 63
22
WND_HEIGHT equ (PLY+9*LISTITEMS+10)+25
22
WND_HEIGHT equ (PLY+9*LISTITEMS+10)+25
23
 
23
 
24
BTNS_XY   equ 14 shl 16+42
24
BTNS_XY   equ 14 shl 16+42
25
BTNS_SIZE equ 222 shl 16+17
25
BTNS_SIZE equ 222 shl 16+17
26
 
26
 
27
BROWSE_X  equ 10 shl 16+8
27
BROWSE_X  equ 10 shl 16+8
28
BROWSE_Y  equ 26 shl 16+8
28
BROWSE_Y  equ 26 shl 16+8
29
FN_XY	  equ 12 shl 16+15
29
FN_XY	  equ 12 shl 16+15
30
BAR_WIDTH equ 251
30
BAR_WIDTH equ 251
31
BAR_X	  equ 10 shl 16
31
BAR_X	  equ 10 shl 16
32
BAR_Y	  equ 29 shl 16+5
32
BAR_Y	  equ 29 shl 16+5
33
TOTALTIME_XY equ 124 shl 16+28
33
TOTALTIME_XY equ 124 shl 16+28
34
CURTIME_X equ 225 shl 16+40
34
CURTIME_X equ 225 shl 16+40
35
CURTIME_Y equ 15 shl 16+11
35
CURTIME_Y equ 15 shl 16+11
36
CURTIME_XY equ 236 shl 16+15
36
CURTIME_XY equ 236 shl 16+15
37
 
37
 
38
NONCRITICAL_MSG equ 0
38
NONCRITICAL_MSG equ 0
39
SOUND equ ON;OFF
39
SOUND equ ON;OFF
40
OUTDUMP equ 0
40
OUTDUMP equ 0
41
OUTLINE equ 8
41
OUTLINE equ 8
42
FL_SHUFFLE equ 0x01
42
FL_SHUFFLE equ 0x01
43
FL_REPEAT  equ 0x02
43
FL_REPEAT  equ 0x02
44
FL_HIDDEN  equ 0x04
44
FL_HIDDEN  equ 0x04
45
FL_MUTE    equ 0x08
45
FL_MUTE    equ 0x08
46
FL_REVERSE equ 0x10
46
FL_REVERSE equ 0x10
47
FL_ADD	   equ 0x20
47
FL_ADD	   equ 0x20
48
FL_PLAY    equ 0x40
48
FL_PLAY    equ 0x40
49
FL_LOCK    equ 0x80
49
FL_LOCK    equ 0x80
50
FL_BOTTRED equ 0x100
50
FL_BOTTRED equ 0x100
51
FL_MULSEL  equ 0x8000
51
FL_MULSEL  equ 0x8000
52
 
52
 
53
use32
53
use32
54
  org	 0x0
54
  org	 0x0
55
 
55
 
56
  db	 'MENUET01'
56
  db	 'MENUET01'
57
  dd	 0x01
57
  dd	 0x01
58
  dd	 START
58
  dd	 START
59
  dd	 IM_END
59
  dd	 IM_END
60
  dd	 I_END ;APP_MEM
60
  dd	 I_END ;APP_MEM
61
  dd	 stacktop ;APP_MEM - 1024
61
  dd	 stacktop ;APP_MEM - 1024
62
  dd	 I_PARAM
62
  dd	 I_PARAM
63
  dd     cur_dir_path
63
  dd     cur_dir_path
64
  
64
  
65
listsel    dd 0
65
listsel    dd 0
66
channel dd 0
66
channel dd 0
67
COLOR_ORDER equ MENUETOS
67
COLOR_ORDER equ MENUETOS
68
include '../../../macros.inc' ; decrease code size (optional)
68
include '../../../macros.inc' ; decrease code size (optional)
69
include	'../../../develop/libraries/box_lib/load_lib.mac'
69
include	'../../../develop/libraries/box_lib/load_lib.mac'
70
 
70
 
71
@use_library
71
@use_library
72
 
72
 
73
lang fix en
73
lang fix en
74
;purge mov
74
;purge mov
75
include 'debug.inc'
75
include 'debug.inc'
76
include 'dlg.inc'
76
;include 'dlg.inc'
77
include 'playlist.inc'
77
include 'playlist.inc'
78
include 'gif_lite.inc'
78
include 'gif_lite.inc'
79
bottom:
79
bottom:
80
    file 'bottom.gif'
80
    file 'bottom.gif'
81
hdrimg:
81
hdrimg:
82
    file 'hdr.gif'
82
    file 'hdr.gif'
83
btns:
83
btns:
84
    file 'buttons.gif'
84
    file 'buttons.gif'
85
START:
85
START:
86
        mcall 68, 11
86
        mcall 68, 11
87
		
87
		
88
load_libraries l_libs_start,end_l_libs
88
load_libraries l_libs_start,end_l_libs
89
 
89
 
90
;OpenDialog initialisation
90
;OpenDialog initialisation
91
	push    dword OpenDialog_data
91
	push    dword OpenDialog_data
92
	call    [OpenDialog_Init]
92
	call    [OpenDialog_Init]
93
 
93
 
94
    or	 [flag],FL_BOTTRED;+FL_MUTE
94
    or	 [flag],FL_BOTTRED;+FL_MUTE
95
    mov  ecx,ipcarea
95
    mov  ecx,ipcarea
96
    call init_ipc
96
    call init_ipc
97
    mcall 40,1000111b
97
    mcall 40,1000111b
98
    mov  esi,btns
98
    mov  esi,btns
99
    mov  edi,btn_raw
99
    mov  edi,btn_raw
100
    call ReadGIF
100
    call ReadGIF
101
    mov  esi,hdrimg
101
    mov  esi,hdrimg
102
    mov  edi,hdr_raw
102
    mov  edi,hdr_raw
103
    call ReadGIF
103
    call ReadGIF
104
    mov  esi,bottom
104
    mov  esi,bottom
105
    mov  edi,bottom_raw
105
    mov  edi,bottom_raw
106
    call ReadGIF
106
    call ReadGIF
107
    call respawn
107
    call respawn
108
    mcall 9,prcinfo,-1
108
    mcall 9,prcinfo,-1
109
    mov  edx,[ebx+30]
109
    mov  edx,[ebx+30]
110
    mov  [parentPID],edx
110
    mov  [parentPID],edx
111
    mov  esi,I_PARAM
111
    mov  esi,I_PARAM
112
    cmp  dword[esi],0
112
    cmp  dword[esi],0
113
    jnz  .yesparam
113
    jnz  .yesparam
114
    call PL_load
114
    call PL_load
115
    cmp  [list_count],0
115
    cmp  [list_count],0
116
    je	 noparam
116
    je	 noparam
117
    mov  eax,[pl_ptr]
117
    mov  eax,[pl_ptr]
118
    or	 word[eax],FL_MULSEL
118
    or	 word[eax],FL_MULSEL
119
    jmp  auto_load
119
    jmp  auto_load
120
  .yesparam:
120
  .yesparam:
121
    mov  al,byte[esi]
121
    mov  al,byte[esi]
122
    cmp  al,'/'
122
    cmp  al,'/'
123
    je	 .defact
123
    je	 .defact
124
    mov  [param],al
124
    mov  [param],al
125
    inc  esi
125
    inc  esi
126
  .defact:
126
  .defact:
127
    mov  edi,filename;fnbuf
127
    mov  edi,filename;fnbuf
128
    mov  ecx,64
128
    mov  ecx,64
129
    rep  movsd
129
    rep  movsd
130
    jmp  open_file
130
    jmp  open_file
131
clearpath:
131
clearpath:
132
    newline
132
    newline
133
    mov  [fname_len],0
133
    mov  [fname_len],0
134
  noparam:
134
  noparam:
135
    mov  [param],'W'
135
    mov  [param],'W'
136
    or	 [flag],FL_ADD
136
    or	 [flag],FL_ADD
137
;---------------------------------------------------------------------
137
;---------------------------------------------------------------------
138
;OpenDialog_start:
138
;OpenDialog_start:
139
;	copy_path	open_dialog_name,path,library_path,0
139
;	copy_path	open_dialog_name,path,library_path,0
140
	
-
 
-
 
140
	mov	[OpenDialog_data.type],0	; Open
-
 
141
	or	[flag],FL_LOCK	
141
	push    dword OpenDialog_data
142
	push    dword OpenDialog_data
142
	call    [OpenDialog_Start]
143
	call    [OpenDialog_Start]
143
 
-
 
-
 
144
	and	[flag],not FL_LOCK
144
	cmp	[OpenDialog_data.status],2 ; OpenDialog does not start
145
;	cmp	[OpenDialog_data.status],2 ; OpenDialog does not start
145
	je	.fopen  ; 	some kind of alternative, instead OpenDialog
146
;	je	.fopen  ; 	some kind of alternative, instead OpenDialog
146
	cmp	[OpenDialog_data.status],1
147
	cmp	[OpenDialog_data.status],1
147
	je	open_file
148
;	je	open_file
148
	jmp	still
149
;	jmp	still
-
 
150
	jne	still
149
;---------------------------------------------------------------------
151
;---------------------------------------------------------------------
150
 
152
 
151
.fopen:
153
;.fopen:
152
    call fopen
154
;    call fopen
153
  get_path:
155
;  get_path:
154
    cmp  byte[filename],0
156
;    cmp  byte[filename],0
155
    jz	 still
157
;    jz	 still
156
  open_file:
158
  open_file:
157
    cmp  [param],'W'
159
    cmp  [param],'W'
158
    je	 .noplay
160
    je	 .noplay
159
    cmp  [param],'H'
161
    cmp  [param],'H'
160
    jne  .nohidd
162
    jne  .nohidd
161
;    or   [flag],FL_PLAY
163
;    or   [flag],FL_PLAY
162
    or	 [flag],FL_HIDDEN
164
    or	 [flag],FL_HIDDEN
163
    call draw_window
165
    call draw_window
164
    and  [flag],not FL_HIDDEN
166
    and  [flag],not FL_HIDDEN
165
    call Shade
167
    call Shade
166
;    jmp  .noplay
168
;    jmp  .noplay
167
 
169
 
168
  .nohidd:
170
  .nohidd:
169
    or	 [flag],FL_PLAY
171
    or	 [flag],FL_PLAY
170
  .noplay:
172
  .noplay:
171
    xor  eax,eax
173
    xor  eax,eax
172
    mov  [play_area],ax
174
    mov  [play_area],ax
173
    mov  [tick_count],eax
175
    mov  [tick_count],eax
174
    mov  [delta],eax
176
    mov  [delta],eax
175
    mov  [curnote],0x80
177
    mov  [curnote],0x80
176
    mov  ecx,64
178
    mov  ecx,64
177
    mov  esi,filename
179
    mov  esi,filename
178
    mov  edi,I_PARAM
180
    mov  edi,I_PARAM
179
    rep  movsd
181
    rep  movsd
180
    mov  eax,70
182
    mov  eax,70
181
    mov  ebx,file_info
183
    mov  ebx,file_info
182
    mcall
184
    mcall
183
    add  ebx,workarea
185
    add  ebx,workarea
184
    mov  [midi_limit],ebx
186
    mov  [midi_limit],ebx
185
    mov  edi,I_PARAM
187
    mov  edi,I_PARAM
186
    call find_slash
188
    call find_slash
187
    mov  [fn_ptr],edi
189
    mov  [fn_ptr],edi
188
    mov  edi,filename
190
    mov  edi,filename
189
    call str_len
191
    call str_len
190
    mov  [fname_len],eax
192
    mov  [fname_len],eax
191
midi_kill:
193
midi_kill:
192
    call kill
194
    call kill
193
include 'midilite.inc'
195
include 'midilite.inc'
194
 
196
 
195
decode_end:
197
decode_end:
196
;    dpd  edi
198
;    dpd  edi
197
;    dps  <13,10,'Notes='>
199
;    dps  <13,10,'Notes='>
198
;    sub  edi,[midi_limit]
200
;    sub  edi,[midi_limit]
199
;    shr  edi,1
201
;    shr  edi,1
200
;    dpd  edi
202
;    dpd  edi
201
    dps ' Notes: max='
203
    dps ' Notes: max='
202
    movzx eax,[max_note]
204
    movzx eax,[max_note]
203
    dpd  eax
205
    dpd  eax
204
    dps 'min='
206
    dps 'min='
205
    movzx eax,[min_note]
207
    movzx eax,[min_note]
206
    dpd  eax
208
    dpd  eax
207
    newline
209
    newline
208
;    sub  esi,workarea
210
;    sub  esi,workarea
209
;    jmp  _close
211
;    jmp  _close
210
  .play:
212
  .play:
211
    call kill
213
    call kill
212
    call respawn
214
    call respawn
213
    xor  edx,edx
215
    xor  edx,edx
214
    mov  esi,[midi_limit]
216
    mov  esi,[midi_limit]
215
    mov  [cur_ptr],esi
217
    mov  [cur_ptr],esi
216
    mov  [cur_tick],edx
218
    mov  [cur_tick],edx
217
    mov  [delta],edx
219
    mov  [delta],edx
218
  .count_ticks:
220
  .count_ticks:
219
    lodsw
221
    lodsw
220
    test eax,eax
222
    test eax,eax
221
    jz	 .eof
223
    jz	 .eof
222
    and  eax,0x7f
224
    and  eax,0x7f
223
    add  edx,eax
225
    add  edx,eax
224
    jmp  .count_ticks
226
    jmp  .count_ticks
225
  .eof:
227
  .eof:
226
    mov  [tick_count],edx
228
    mov  [tick_count],edx
227
  if OUTDUMP eq 1
229
  if OUTDUMP eq 1
228
    mov  esi,[midi_limit]
230
    mov  esi,[midi_limit]
229
    call out_dump
231
    call out_dump
230
  end if
232
  end if
231
    and  [flag],not FL_LOCK
233
    and  [flag],not FL_LOCK
232
    test [flag],FL_PLAY
234
    test [flag],FL_PLAY
233
    jz	 .noplay
235
    jz	 .noplay
234
    call draw_window
236
    call draw_window
235
    mcall 5,100
237
    mcall 5,100
236
    mov  eax,IPC_PLAY
238
    mov  eax,IPC_PLAY
237
    call ipc_send
239
    call ipc_send
238
  .noplay:
240
  .noplay:
239
    test [flag],FL_ADD
241
    test [flag],FL_ADD
240
    jz	 red
242
    jz	 red
241
    mov  esi,filename
243
    mov  esi,filename
242
    mov  ecx,[fname_len]
244
    mov  ecx,[fname_len]
243
    movzx eax,[list_count]
245
    movzx eax,[list_count]
244
    mov  [play_num],eax
246
    mov  [play_num],eax
245
 add_song:
247
 add_song:
246
    call PL_add
248
    call PL_add
247
    and  [flag],not FL_ADD
249
    and  [flag],not FL_ADD
248
red:
250
red:
249
    call draw_window
251
    call draw_window
250
still:
252
still:
251
    mov  ecx,ipcarea
253
    mov  ecx,ipcarea
252
    call init_ipc
254
    call init_ipc
253
    mov  eax,10
255
    mov  eax,10
254
    mcall
256
    mcall
255
prc_event:
257
prc_event:
256
    test eax,eax
258
    test eax,eax
257
    jz	 still
259
    jz	 still
258
  .evt:
260
  .evt:
259
    cmp  eax,1
261
    cmp  eax,1
260
    je	 red
262
    je	 red
261
    cmp  eax,2
263
    cmp  eax,2
262
    je	 key
264
    je	 key
263
    cmp  eax,3
265
    cmp  eax,3
264
    je	 button
266
    je	 button
265
    cmp  eax,7
267
    cmp  eax,7
266
    jne  still
268
    jne  still
267
    movzx eax,byte[ipcarea+16]
269
    movzx eax,byte[ipcarea+16]
268
    cmp  eax,IPC_UPDT
270
    cmp  eax,IPC_UPDT
269
    jne  .noupdt
271
    jne  .noupdt
270
    call draw_bar
272
    call draw_bar
271
    jmp  still
273
    jmp  still
272
  .noupdt:
274
  .noupdt:
273
    cmp  eax,IPC_NEXT
275
    cmp  eax,IPC_NEXT
274
    jne  still
276
    jne  still
275
    cmp  [param],'H'
277
    cmp  [param],'H'
276
    je	 _close
278
    je	 _close
277
    xor  edx,edx
279
    xor  edx,edx
278
    test [flag],FL_SHUFFLE
280
    test [flag],FL_SHUFFLE
279
    jz	 .noshuf
281
    jz	 .noshuf
280
    mcall 26,9
282
    mcall 26,9
281
    movzx ebx,byte[list_count]
283
    movzx ebx,byte[list_count]
282
    div  ebx
284
    div  ebx
283
    mov  eax,edx
285
    mov  eax,edx
284
    jmp  play_
286
    jmp  play_
285
  .noshuf:
287
  .noshuf:
286
    test [flag],FL_REPEAT
288
    test [flag],FL_REPEAT
287
    jnz  decode_end.play
289
    jnz  decode_end.play
288
    mov  eax,[play_num]
290
    mov  eax,[play_num]
289
    inc  eax
291
    inc  eax
290
    cmp  al,[list_count]
292
    cmp  al,[list_count]
291
    jb	 bList.next
293
    jb	 bList.next
292
    mov  eax,IPC_PAUS
294
    mov  eax,IPC_PAUS
293
    call ipc_send
295
    call ipc_send
294
    jmp  red
296
    jmp  red
295
 
297
 
296
if OUTDUMP eq 1
298
if OUTDUMP eq 1
297
out_dump:
299
out_dump:
298
    mov  ecx,OUTLINE
300
    mov  ecx,OUTLINE
299
  .next_byte:
301
  .next_byte:
300
    lodsd
302
    lodsd
301
    bswap eax
303
    bswap eax
302
    dph  eax
304
    dph  eax
303
    dps  ' '
305
    dps  ' '
304
    lodsd
306
    lodsd
305
    bswap eax
307
    bswap eax
306
    dph  eax
308
    dph  eax
307
    dps  <13,10>
309
    dps  <13,10>
308
    loop .next_byte
310
    loop .next_byte
309
    ret
311
    ret
310
end if
312
end if
311
 
313
 
312
str_len:
314
str_len:
313
; in: edi-str ptr
315
; in: edi-str ptr
314
; out: eax-str length
316
; out: eax-str length
315
    push ecx edi
317
    push ecx edi
316
    xor  eax,eax
318
    xor  eax,eax
317
    mov  ecx,256
319
    mov  ecx,256
318
    repne scasb
320
    repne scasb
319
    jecxz .nofn
321
    jecxz .nofn
320
    sub  edi,[esp]
322
    sub  edi,[esp]
321
    mov  eax,edi
323
    mov  eax,edi
322
  .nofn:
324
  .nofn:
323
    pop  edi ecx
325
    pop  edi ecx
324
    ret
326
    ret
325
 
327
 
326
fopen:
328
;fopen:
327
    or	 [flag],FL_LOCK
329
;    or	 [flag],FL_LOCK
328
    opendialog draw_window, ret_path, ret_path, filename
330
;;    opendialog draw_window, ret_path, ret_path, filename
329
ret_path:
331
;ret_path:
330
    and  [flag],not FL_LOCK
332
;    and  [flag],not FL_LOCK
331
    ret
333
;    ret
332
 
334
 
333
include 'event.inc'
335
include 'event.inc'
334
include "thread.inc"
336
include "thread.inc"
335
include "draw.inc"
337
include "draw.inc"
336
; ‡¤¥áì ­ å®¤ïâáï ¤ ­­ë¥ ¯à®£à ¬¬ë:
338
; ‡¤¥áì ­ å®¤ïâáï ¤ ­­ë¥ ¯à®£à ¬¬ë:
337
 
339
 
338
     dd -2 shl 16+4,251,12 shl 16,29 shl 16+5
340
     dd -2 shl 16+4,251,12 shl 16,29 shl 16+5
339
     dd 21,16
341
     dd 21,16
340
main_coo:
342
main_coo:
341
     dd 14 shl 16, 42 shl 16,23 shl 16
343
     dd 14 shl 16, 42 shl 16,23 shl 16
342
     dd 228 shl 16+38
344
     dd 228 shl 16+38
343
     dd 14 shl 16+10
345
     dd 14 shl 16+10
344
     dd 236 shl 16+15
346
     dd 236 shl 16+15
345
btncoords:
347
btncoords:
346
     dd 120 shl 16+20, 1 shl 16+15
348
     dd 120 shl 16+20, 1 shl 16+15
347
     dd 149 shl 16+44, 2 shl 16+12
349
     dd 149 shl 16+44, 2 shl 16+12
348
     dd 195 shl 16+26, 2 shl 16+12
350
     dd 195 shl 16+26, 2 shl 16+12
349
 
351
 
350
     dd -2 shl 16+4,54,63 shl 16,6 shl 16+4
352
     dd -2 shl 16+4,54,63 shl 16,6 shl 16+4
351
     dd 6,6
353
     dd 6,6
352
main_coo2:
354
main_coo2:
353
     dd 169 shl 16, 4 shl 16,9 shl 16
355
     dd 169 shl 16, 4 shl 16,9 shl 16
354
     dd 121 shl 16+40
356
     dd 121 shl 16+40
355
     dd 3 shl 16+9
357
     dd 3 shl 16+9
356
     dd 130 shl 16+4
358
     dd 130 shl 16+4
357
btncoords2:
359
btncoords2:
358
     dd 48 shl 16+6, 6
360
     dd 48 shl 16+6, 6
359
     dd 2000 shl 16+44, 2 shl 16+12
361
     dd 2000 shl 16+44, 2 shl 16+12
360
     dd 2000 shl 16+26, 2 shl 16+12
362
     dd 2000 shl 16+26, 2 shl 16+12
361
ipcarea    rb 20
363
ipcarea    rb 20
362
ipcarea2   rb 20
364
ipcarea2   rb 20
363
 
365
 
364
dots	   db ':-'
366
dots	   db ':-'
365
text	   db 'tone>     chnl>  
367
text	   db 'tone>     chnl>  
366
text_end:
368
text_end:
367
coo	   dd main_coo
369
coo	   dd main_coo
368
play_limit dd playlist
370
play_limit dd playlist
369
pl_ptr	   dd playlist
371
pl_ptr	   dd playlist
370
param	   db 'W'
372
param	   db 'W'
371
curnote    db 0x80
373
curnote    db 0x80
372
tick_count dd 0
374
tick_count dd 0
373
;---------------------------------------------------------------------
375
;---------------------------------------------------------------------
374
OpenDialog_data:
376
OpenDialog_data:
375
.type			dd 0
377
.type			dd 0
376
.procinfo		dd prcinfo ;+4
378
.procinfo		dd prcinfo ;+4
377
.com_area_name		dd communication_area_name ;+8
379
.com_area_name		dd communication_area_name ;+8
378
.com_area		dd 0 ;+12
380
.com_area		dd 0 ;+12
379
.opendir_pach		dd temp_dir_pach ;+16
381
.opendir_pach		dd temp_dir_pach ;+16
380
.dir_default_pach	dd communication_area_default_pach ;+20
382
.dir_default_pach	dd communication_area_default_pach ;+20
381
.start_path		dd open_dialog_path ;+24
383
.start_path		dd open_dialog_path ;+24
382
.draw_window		dd draw_window ;+28
384
.draw_window		dd draw_window ;+28
383
.status			dd 0 ;+32
385
.status			dd 0 ;+32
384
.openfile_pach		dd filename ;+36
386
.openfile_pach		dd filename ;+36
385
.filename_area		dd 0	;+40
387
.filename_area		dd 0	;+40
386
.filter_area		dd Filter
388
.filter_area		dd Filter
387
.x:
389
.x:
388
.x_size			dw 420 ;+48 ; Window X size
390
.x_size			dw 420 ;+48 ; Window X size
389
.x_start		dw 10 ;+50 ; Window X position
391
.x_start		dw 10 ;+50 ; Window X position
390
.y:
392
.y:
391
.y_size			dw 320 ;+52 ; Window y size
393
.y_size			dw 320 ;+52 ; Window y size
392
.y_start		dw 10 ;+54 ; Window Y position
394
.y_start		dw 10 ;+54 ; Window Y position
393
 
395
 
394
communication_area_name:
396
communication_area_name:
395
	db 'FFFFFFFF_open_dialog',0
397
	db 'FFFFFFFF_open_dialog',0
396
open_dialog_path:
398
open_dialog_path:
397
	db '/sys/File Managers/opendial',0
399
	db '/sys/File Managers/opendial',0
398
communication_area_default_pach:
400
communication_area_default_pach:
399
	db '/rd/1',0
401
	db '/rd/1',0
400
 
402
 
401
Filter:
403
Filter:
402
dd Filter.end - Filter
404
dd Filter.end - Filter
403
.1:
405
.1:
404
db 'MID',0
406
db 'MID',0
405
.end:
407
.end:
406
db 0
408
db 0
407
;---------------------------------------------------------------------
409
;---------------------------------------------------------------------
408
system_dir_ProcLib			db '/sys/lib/proc_lib.obj',0
410
system_dir_ProcLib			db '/sys/lib/proc_lib.obj',0
409
 
411
 
410
head_f_i:
412
head_f_i:
411
head_f_l	db 'error',0
413
head_f_l	db 'error',0
412
err_message_found_lib2		db 'proc_lib.obj - Not found!',0
414
err_message_found_lib2		db 'proc_lib.obj - Not found!',0
413
 
415
 
414
err_message_import2			db 'proc_lib.obj - Wrong import!',0
416
err_message_import2			db 'proc_lib.obj - Wrong import!',0
415
 
417
 
416
;---------------------------------------------------------------------
418
;---------------------------------------------------------------------
417
align 4
419
align 4
418
ProcLib_import:
420
ProcLib_import:
419
OpenDialog_Init		dd aOpenDialog_Init
421
OpenDialog_Init		dd aOpenDialog_Init
420
OpenDialog_Start	dd aOpenDialog_Start
422
OpenDialog_Start	dd aOpenDialog_Start
421
;OpenDialog__Version	dd aOpenDialog_Version
423
;OpenDialog__Version	dd aOpenDialog_Version
422
        dd      0
424
        dd      0
423
        dd      0
425
        dd      0
424
aOpenDialog_Init	db 'OpenDialog_init',0
426
aOpenDialog_Init	db 'OpenDialog_init',0
425
aOpenDialog_Start	db 'OpenDialog_start',0
427
aOpenDialog_Start	db 'OpenDialog_start',0
426
;aOpenDialog_Version	db 'Version_OpenDialog',0
428
;aOpenDialog_Version	db 'Version_OpenDialog',0
427
;---------------------------------------------------------------------
429
;---------------------------------------------------------------------
428
l_libs_start:
430
l_libs_start:
429
 
431
 
430
library01  l_libs system_dir_ProcLib+9, cur_dir_path, temp_dir_pach, system_dir_ProcLib, \
432
library01  l_libs system_dir_ProcLib+9, cur_dir_path, temp_dir_pach, system_dir_ProcLib, \
431
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
433
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
432
 
434
 
433
end_l_libs:
435
end_l_libs:
434
;---------------------------------------------------------------------
436
;---------------------------------------------------------------------
435
dir_info:
437
dir_info:
436
        dd      1
438
        dd      1
437
        dd      0
439
        dd      0
438
        dd      0
440
        dd      0
439
        dd      1
441
        dd      1
440
        dd      dir_table
442
        dd      dir_table
441
        db      0
443
        db      0
442
        dd      filename
444
        dd      filename
443
play_area  dw ?
445
play_area  dw ?
444
file_info:
446
file_info:
445
	   dd 0
447
	   dd 0
446
	   dd 0
448
	   dd 0
447
	   dd 0
449
	   dd 0
448
fsize	   dd 120*1024  ;APP_MEM-2048-workarea     ; max size
450
fsize	   dd 120*1024  ;APP_MEM-2048-workarea     ; max size
449
	   dd workarea
451
	   dd workarea
450
IM_END:	; ª®­¥æ ¯à®£à ¬¬ë
452
IM_END:	; ª®­¥æ ¯à®£à ¬¬ë
451
filename:
453
filename:
452
	   rb 4096 ;1024+16
454
	   rb 4096 ;1024+16
453
prcinfo    process_information
455
prcinfo    process_information
454
I_PARAM    rb 256
456
I_PARAM    rb 256
455
childPID   dd ?
457
childPID   dd ?
456
parentPID  dd ?
458
parentPID  dd ?
457
play_num   dd ?
459
play_num   dd ?
458
counter    dd ?
460
counter    dd ?
459
flag	   dd ?
461
flag	   dd ?
460
fname_len  dd ?
462
fname_len  dd ?
461
fn_ptr	   dd ?
463
fn_ptr	   dd ?
462
delta	   dd ?
464
delta	   dd ?
463
cur_ptr    dd ?
465
cur_ptr    dd ?
464
cur_tick   dd ?
466
cur_tick   dd ?
465
quarter    dd ?
467
quarter    dd ?
466
octave	   db ?
468
octave	   db ?
467
tempo	   dd ?
469
tempo	   dd ?
468
midi_limit dd ?
470
midi_limit dd ?
469
track_len  dd ?
471
track_len  dd ?
470
list_count db ?
472
list_count db ?
471
cur_track  db ?
473
cur_track  db ?
472
sel_track  db ?
474
sel_track  db ?
473
ipcmsg	   db ?
475
ipcmsg	   db ?
474
fnbuf:
476
fnbuf:
475
	   rb 1024
477
	   rb 1024
476
btn_raw    rb 222*17*3+8
478
btn_raw    rb 222*17*3+8
477
hdr_raw    rb 275*29*3+8
479
hdr_raw    rb 275*29*3+8
478
bottom_raw rb 25*378*3+8
480
bottom_raw rb 25*378*3+8
479
	   rb 4
481
	   rb 4
480
playlist   rb 256*LISTITEMS
482
playlist   rb 256*LISTITEMS
481
IncludeUGlobals
483
IncludeUGlobals
482
;----------------------------------------------------------------
484
;----------------------------------------------------------------
483
temp_dir_pach:
485
temp_dir_pach:
484
        rb 4096
486
        rb 4096
485
;----------------------------------------------------------------
487
;----------------------------------------------------------------
486
cur_dir_path:
488
cur_dir_path:
487
	rb 4096
489
	rb 4096
488
;----------------------------------------------------------------
490
;----------------------------------------------------------------
489
	rb 4096
491
	rb 4096
490
thread_stack:
492
thread_stack:
491
	rb 4096
493
	rb 4096
492
stacktop:
494
stacktop:
493
;----------------------------------------------------------------
495
;----------------------------------------------------------------
-
 
496
dir_table:
494
dir_table  rb 32+304
497
	rb 32+304
495
workarea:
498
workarea:
496
	rb 120*1024
499
	rb 120*1024
497
I_END:
500
I_END:
498
text_end:
501
text_end:
499
coo>
502
coo>