2023-05-22 16:17:35 +02:00
|
|
|
IFEQ FW_VBL_MUSIC_IRQ
|
|
|
|
fail "FW_VBL_MUSIC_IRQ must be enabled"
|
|
|
|
ENDC
|
|
|
|
IFEQ FW_DYNAMIC_MEMORY_SUPPORT
|
|
|
|
fail "FW_DYNAMIC_MEMORY_SUPPORT must be enabled"
|
|
|
|
ENDC
|
|
|
|
|
|
|
|
fw_MusicAlloc:
|
|
|
|
; actually $1C6E for player (V1.0), $984 for song
|
|
|
|
move.l #$1C6E+$984,d0
|
|
|
|
bsr fw_AllocFast
|
|
|
|
move.l a0,fw_PretrackerMyPlayer(a6)
|
|
|
|
lea $1C6E(a0),a0
|
|
|
|
move.l a0,fw_PretrackerMySong(a6)
|
|
|
|
rts
|
|
|
|
|
|
|
|
fw_MusicInit:
|
2024-09-15 17:43:33 +02:00
|
|
|
PUTMSG 10,<"%d: Pretracker song init %p %p">,fw_FrameCounter-2(a6),a0,a1
|
2023-05-22 16:17:35 +02:00
|
|
|
move.l a0,a2
|
|
|
|
PUSHM d7/a1
|
|
|
|
move.l fw_PretrackerMyPlayer(a6),a0
|
|
|
|
move.l fw_PretrackerMySong(a6),a1
|
|
|
|
PUTMSG 10,<"MyPlayer=%p MySong=%p Data=%p">,a0,a1,a2
|
|
|
|
lea fw_PretrackerReplayer(pc),a3
|
|
|
|
adda.w 2(a3),a3
|
|
|
|
jsr (a3) ; songInit
|
|
|
|
POPM
|
|
|
|
|
|
|
|
move.l a1,d1
|
|
|
|
bne.s .noalloc
|
|
|
|
PUTMSG 10,<"Allocating %ld bytes samples memory for Pretracker">,d0
|
|
|
|
bsr fw_AllocChip
|
|
|
|
move.l a0,fw_MusicSamples(a6)
|
|
|
|
move.l a0,a1
|
|
|
|
.noalloc
|
|
|
|
|
2024-09-15 17:43:33 +02:00
|
|
|
PUTMSG 10,<"%d: Pretracker player init">,fw_FrameCounter-2(a6)
|
2023-05-22 16:17:35 +02:00
|
|
|
move.l fw_PretrackerMyPlayer(a6),a0
|
|
|
|
move.l fw_PretrackerMySong(a6),a2
|
|
|
|
|
|
|
|
lea fw_PretrackerReplayer(pc),a3
|
|
|
|
adda.w 6(a3),a3
|
|
|
|
jsr (a3) ; playerInit
|
|
|
|
|
2024-09-15 17:43:33 +02:00
|
|
|
lea fw_MusicPlay(pc),a0
|
|
|
|
move.l a0,fw_MusicTickRoutine(a6)
|
|
|
|
PUTMSG 10,<"%d: Pretracker init done">,fw_FrameCounter-2(a6)
|
2023-05-22 16:17:35 +02:00
|
|
|
rts
|
|
|
|
|
|
|
|
fw_MusicPlay:
|
|
|
|
move.l fw_PretrackerMyPlayer(a6),a0
|
|
|
|
lea fw_PretrackerReplayer(pc),a3
|
|
|
|
adda.w 10(a3),a3
|
2024-09-15 17:43:33 +02:00
|
|
|
jmp (a3) ; playerTick
|
2023-05-22 16:17:35 +02:00
|
|
|
|
|
|
|
fw_MusicStop:
|
2024-09-15 17:43:33 +02:00
|
|
|
clr.l fw_MusicTickRoutine(a6)
|
2023-05-22 16:17:35 +02:00
|
|
|
move.w #DMAF_AUDIO,dmacon(a5)
|
|
|
|
; unsupported right now
|
|
|
|
rts
|
|
|
|
|
|
|
|
;--------------------------------------------------------------------
|
|
|
|
|
|
|
|
fw_PretrackerReplayer:
|
2024-09-15 17:43:33 +02:00
|
|
|
;include "musicplayers/pretracker_replayer_resourced.asm"
|
|
|
|
incbin "musicplayers/pretracker_replayer_binary_blob.bin"
|