diff --git a/sound/Makefile b/sound/Makefile index 7517d49..32d5155 100644 --- a/sound/Makefile +++ b/sound/Makefile @@ -3,10 +3,10 @@ include ../Makefile.config INCL+=-I../include SRCC= -SRCS=sound.s paula.s +SRCS=sound.s paula.s protracker.s OBJS=$(SRCC:.c=.o) $(SRCS:.s=.o) DISTFILES=Makefile $(SRCC) $(SRCH) $(SRCS) pt-play.s paula_def.s -INSTALLLIB=sound.o paula.o +INSTALLLIB=sound.o paula.o protracker.o include ../Makefile.template diff --git a/sound/paula.s b/sound/paula.s index 54feaa4..a04e0ae 100644 --- a/sound/paula.s +++ b/sound/paula.s @@ -20,9 +20,6 @@ include "../risc.s" - ;; the following disable clear_dma commands in the mod replayer -PAULA equ 1 - ;; enable this to display time devoted to resampling DSP_BG equ 0 @@ -632,10 +629,6 @@ SOUND_DRIVER_SIZE equ .dsp_sound_driver_end-.dsp_sound_driver_begin .print "Sound driver code size (DSP): ", SOUND_DRIVER_SIZE .68000 - -.macro dsp_interrupt - move.l #DSPGO|DSPINT0,D_CTRL ; generate DSP interrupt -.endm .globl _init_sound_driver ;; int init_sound_driver(int frequency) @@ -828,40 +821,8 @@ replay_frequency: ds.l 1 .long - .globl _amiga_frequencies _amiga_frequencies: ds.w MAX_PERIOD .long - .text -SOUND_VOICE0 equ SOUND_VOICES -SOUND_VOICE1 equ SOUND_VOICE0+VOICE_SIZEOF -SOUND_VOICE2 equ SOUND_VOICE1+VOICE_SIZEOF -SOUND_VOICE3 equ SOUND_VOICE2+VOICE_SIZEOF -SOUND_VOICE4 equ SOUND_VOICE3+VOICE_SIZEOF -SOUND_VOICE5 equ SOUND_VOICE4+VOICE_SIZEOF -SOUND_VOICE6 equ SOUND_VOICE5+VOICE_SIZEOF -SOUND_VOICE7 equ SOUND_VOICE6+VOICE_SIZEOF - include "pt-play.s" - - .text - .globl _init_module -;; init_module(char *module, int tempo_enabled); -_init_module equ mt_init - - .globl _play_module -;; play_module(); -_play_module equ mt_music_vbl - - .globl _clear_module -;; clear_module(); -_clear_module equ mt_clear - - .globl _pause_module -;; pause_module(); -_pause_module equ mt_pause - - .globl _enable_module_voices -;; enable_module_voices(int mask); -_enable_module_voices equ mt_enable_voices diff --git a/sound/paula_def.s b/sound/paula_def.s index 00a8a9d..2d6a454 100644 --- a/sound/paula_def.s +++ b/sound/paula_def.s @@ -24,6 +24,8 @@ __PAULA_DEF_H equ 1 .globl SOUND_DMA .globl SOUND_VOICES + + .globl _amiga_frequencies ; VOICEs ; ====== @@ -85,8 +87,15 @@ VOICE_SIZEOF: ds.l 0 DMA_CONTROL: ds.l 1 DMA_SIZEOF: ds.l 0 - .macro wait_dma + .text + +.macro wait_dma .wait\~: tst.l \1 bne.s .wait\~ - .endm +.endm + +.macro dsp_interrupt + move.l #DSPGO|DSPINT0,D_CTRL ; generate DSP interrupt +.endm + diff --git a/sound/protracker.s b/sound/protracker.s new file mode 100644 index 0000000..6b32b38 --- /dev/null +++ b/sound/protracker.s @@ -0,0 +1,32 @@ + ;; the following disable clear_dma commands in the mod replayer +PAULA equ 1 + + include "../jaguar.inc" + + include "paula_def.s" + + .text + + include "pt-play.s" + + .text + .globl _init_module +;; init_module(char *module, int tempo_enabled); +_init_module equ mt_init + + .globl _play_module +;; play_module(); +_play_module equ mt_music_vbl + + .globl _clear_module +;; clear_module(); +_clear_module equ mt_clear + + .globl _pause_module +;; pause_module(); +_pause_module equ mt_pause + + .globl _enable_module_voices +;; enable_module_voices(int mask); +_enable_module_voices equ mt_enable_voices + diff --git a/sound/pt-play.s b/sound/pt-play.s index 44c503a..e928ea3 100644 --- a/sound/pt-play.s +++ b/sound/pt-play.s @@ -311,7 +311,7 @@ mt_init: mt_end: movem.l d7/a5,-(sp) ; the macros uses d7 - move.l #SOUND_VOICE0,a5 + move.l #SOUND_VOICES,a5 move.b #%10011001,d0 ; left - right - right - left - ... swap d0 move.w mt_nbVoices,d0 @@ -441,7 +441,7 @@ mt_NoNewAllChannels: move.w mt_nbVoices,d5 subq.w #1,d5 - move.l #SOUND_VOICE0,a5 + move.l #SOUND_VOICES,a5 move.l #mt_chan1temp,a6 .go_CheckEfx: bsr mt_CheckEfx @@ -471,7 +471,7 @@ mt_GetNewNote: move.l #mt_PeriodTable,a2 move.l #_amiga_frequencies,a4 - move.l #SOUND_VOICE0,a5 + move.l #SOUND_VOICES,a5 move.l #mt_chan1temp,a6 move.w mt_nbVoices,d5 subq.w #1,d5 @@ -663,7 +663,7 @@ mt_SetDMA: move.w mt_nbVoices,d5 subq.w #1,d5 - move.l #SOUND_VOICE0,A5 + move.l #SOUND_VOICES,A5 move.l #mt_chan1temp,A6 .go_SetDMA: set_sample n_loopstart(a6),n_replen(a6)