Subversion Repositories Kolibri OS

Rev

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

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