Subversion Repositories Kolibri OS

Rev

Rev 5098 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 5098 Rev 8346
Line 1... Line 1...
1
; MIDI PLAYER FOR MENUET v1.0
1
; MIDI PLAYER FOR KOLIBRI 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: December 8, 2020
7
;
7
;
8
; COMPILE WITH FASM
8
; COMPILE WITH FASM
Line 9... Line 9...
9
 
9
 
Line 51... Line 51...
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
Line 54... Line 54...
54
 
54
 
55
use32
55
use32
Line 56... Line 56...
56
  org    0x0
56
  org    0
57
 
-
 
58
  db     'MENUET01'
-
 
59
  dd     0x01
57
 
60
  dd     START
58
  db     'MENUET01'
61
  dd     IM_END
59
  dd     1, START, IM_END
62
  dd     I_END ;APP_MEM
-
 
63
  dd     stacktop ;APP_MEM - 1024
60
  dd     I_END ;APP_MEM
Line 64... Line 61...
64
  dd     I_PARAM
61
  dd     stacktop ;APP_MEM - 1024
65
  dd     cur_dir_path
62
  dd     I_PARAM, cur_dir_path
66
  
63
  
67
listsel    dd 0
64
listsel    dd 0
68
channel dd 0
65
channel dd 0
-
 
66
COLOR_ORDER equ MENUETOS
69
COLOR_ORDER equ MENUETOS
67
include '../../../config.inc'           ;for nightbuild
Line 70... Line 68...
70
include '../../../config.inc'           ;for nightbuild
68
include '../../../macros.inc' ; decrease code size (optional)
Line 71... Line 69...
71
include '../../../macros.inc' ; decrease code size (optional)
69
include '../../../KOSfuncs.inc'
72
include '../../../develop/libraries/box_lib/load_lib.mac'
70
include '../../../load_lib.mac'
Line 84... Line 82...
84
hdrimg:
82
hdrimg:
85
    file 'hdr.gif'
83
    file 'hdr.gif'
86
btns:
84
btns:
87
    file 'buttons.gif'
85
    file 'buttons.gif'
88
START:
86
START:
89
        mcall 68, 11
87
    mcall SF_SYS_MISC, SSF_HEAP_INIT
Line 90... Line 88...
90
                
88
 
Line 91... Line 89...
91
load_libraries l_libs_start,end_l_libs
89
load_libraries l_libs_start,end_l_libs
92
 
90
 
Line 103... Line 101...
103
        call    [OpenDialog_Init]
101
    call    [OpenDialog_Init]
Line 104... Line 102...
104
 
102
 
105
    or   [flag],FL_BOTTRED;+FL_MUTE
103
    or   [flag],FL_BOTTRED;+FL_MUTE
106
    mov  ecx,ipcarea
104
    mov  ecx,ipcarea
107
    call init_ipc
105
    call init_ipc
108
    mcall 40,1000111b
106
    mcall SF_SET_EVENTS_MASK,1000111b
109
    mov  esi,btns
107
    mov  esi,btns
110
    mov  edi,btn_raw
108
    mov  edi,btn_raw
111
    call ReadGIF
109
    call ReadGIF
112
    mov  esi,hdrimg
110
    mov  esi,hdrimg
113
    mov  edi,hdr_raw
111
    mov  edi,hdr_raw
114
    call ReadGIF
112
    call ReadGIF
115
    mov  esi,bottom
113
    mov  esi,bottom
116
    mov  edi,bottom_raw
114
    mov  edi,bottom_raw
117
    call ReadGIF
115
    call ReadGIF
118
    call respawn
116
    call respawn
119
    mcall 9,prcinfo,-1
117
    mcall SF_THREAD_INFO,prcinfo,-1
120
    mov  edx,[ebx+30]
118
    mov  edx,[ebx+30]
121
    mov  [parentPID],edx
119
    mov  [parentPID],edx
122
    mov  esi,I_PARAM
120
    mov  esi,I_PARAM
123
    cmp  dword[esi],0
121
    cmp  dword[esi],0
Line 188... Line 186...
188
    mov  [curnote],0x80
186
    mov  [curnote],0x80
189
    mov  ecx,64
187
    mov  ecx,64
190
    mov  esi,filename
188
    mov  esi,filename
191
    mov  edi,I_PARAM
189
    mov  edi,I_PARAM
192
    rep  movsd
190
    rep  movsd
193
    mov  eax,70
-
 
194
    mov  ebx,file_info
191
    mcall SF_FILE,file_info
195
    mcall
-
 
196
    add  ebx,workarea
192
    add  ebx,workarea
197
    mov  [midi_limit],ebx
193
    mov  [midi_limit],ebx
198
    mov  edi,I_PARAM
194
    mov  edi,I_PARAM
199
    call find_slash
195
    call find_slash
200
    mov  [fn_ptr],edi
196
    mov  [fn_ptr],edi
Line 243... Line 239...
243
  end if
239
  end if
244
    and  [flag],not FL_LOCK
240
    and  [flag],not FL_LOCK
245
    test [flag],FL_PLAY
241
    test [flag],FL_PLAY
246
    jz   .noplay
242
    jz   .noplay
247
    call draw_window
243
    call draw_window
248
    mcall 5,100
244
    mcall SF_SLEEP,100
249
    mov  eax,IPC_PLAY
245
    mov  eax,IPC_PLAY
250
    call ipc_send
246
    call ipc_send
251
  .noplay:
247
  .noplay:
252
    test [flag],FL_ADD
248
    test [flag],FL_ADD
253
    jz   red
249
    jz   red
Line 261... Line 257...
261
red:
257
red:
262
    call draw_window
258
    call draw_window
263
still:
259
still:
264
    mov  ecx,ipcarea
260
    mov  ecx,ipcarea
265
    call init_ipc
261
    call init_ipc
266
    mov  eax,10
-
 
267
    mcall
262
    mcall SF_WAIT_EVENT
268
prc_event:
263
prc_event:
269
    test eax,eax
264
    test eax,eax
270
    jz   still
265
    jz   still
271
  .evt:
266
  .evt:
272
    cmp  eax,1
267
    cmp  eax,1
Line 288... Line 283...
288
    cmp  [param],'H'
283
    cmp  [param],'H'
289
    je   _close
284
    je   _close
290
    xor  edx,edx
285
    xor  edx,edx
291
    test [flag],FL_SHUFFLE
286
    test [flag],FL_SHUFFLE
292
    jz   .noshuf
287
    jz   .noshuf
293
    mcall 26,9
288
    mcall SF_SYSTEM_GET,SSF_TIME_COUNT
294
    movzx ebx,byte[list_count]
289
    movzx ebx,byte[list_count]
295
    div  ebx
290
    div  ebx
296
    mov  eax,edx
291
    mov  eax,edx
297
    jmp  play_
292
    jmp  play_
298
  .noshuf:
293
  .noshuf:
Line 422... Line 417...
422
.end:
417
.end:
423
db 0
418
db 0
424
;---------------------------------------------------------------------
419
;---------------------------------------------------------------------
425
system_dir_ProcLib                      db '/sys/lib/proc_lib.obj',0
420
system_dir_ProcLib                      db '/sys/lib/proc_lib.obj',0
Line 426... Line -...
426
 
-
 
427
head_f_i:
-
 
428
head_f_l        db 'error',0
-
 
429
err_message_found_lib2          db 'proc_lib.obj - Not found!',0
-
 
430
 
-
 
431
err_message_import2                     db 'proc_lib.obj - Wrong import!',0
-
 
432
 
421
 
433
;---------------------------------------------------------------------
422
;---------------------------------------------------------------------
434
align 4
423
align 4
435
ProcLib_import:
424
ProcLib_import:
436
OpenDialog_Init         dd aOpenDialog_Init
425
OpenDialog_Init         dd aOpenDialog_Init
Line 442... Line 431...
442
aOpenDialog_Start       db 'OpenDialog_start',0
431
aOpenDialog_Start       db 'OpenDialog_start',0
443
;aOpenDialog_Version    db 'Version_OpenDialog',0
432
;aOpenDialog_Version    db 'Version_OpenDialog',0
444
;---------------------------------------------------------------------
433
;---------------------------------------------------------------------
445
l_libs_start:
434
l_libs_start:
Line 446... Line 435...
446
 
435
 
447
library01  l_libs system_dir_ProcLib+9, cur_dir_path, temp_dir_pach, system_dir_ProcLib, \
436
library01  l_libs system_dir_ProcLib+9, temp_dir_pach, system_dir_ProcLib, \
Line 448... Line 437...
448
err_message_found_lib2, head_f_l, ProcLib_import, err_message_import2, head_f_i
437
	ProcLib_import
449
 
438
 
450
end_l_libs:
439
end_l_libs:
451
;---------------------------------------------------------------------
440
;---------------------------------------------------------------------