Skip to content

Commit

Permalink
separating Paula from MOD replay
Browse files Browse the repository at this point in the history
  • Loading branch information
sbriais committed May 16, 2012
1 parent bea3469 commit 34f1223
Show file tree
Hide file tree
Showing 5 changed files with 49 additions and 47 deletions.
4 changes: 2 additions & 2 deletions sound/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
39 changes: 0 additions & 39 deletions sound/paula.s
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
13 changes: 11 additions & 2 deletions sound/paula_def.s
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ __PAULA_DEF_H equ 1

.globl SOUND_DMA
.globl SOUND_VOICES

.globl _amiga_frequencies

; VOICEs
; ======
Expand Down Expand Up @@ -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

32 changes: 32 additions & 0 deletions sound/protracker.s
Original file line number Diff line number Diff line change
@@ -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

8 changes: 4 additions & 4 deletions sound/pt-play.s
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 34f1223

Please sign in to comment.