1
0
mirror of https://github.com/cc65/cc65.git synced 2025-01-11 11:30:13 +00:00

Update sound driver

git-svn-id: svn://svn.cc65.org/cc65/trunk@5974 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
karri 2013-01-28 17:42:18 +00:00
parent 8a7b84247c
commit 0137681d77

View File

@ -1101,7 +1101,6 @@ set0: ldy SndOffsets,x
_ENDIF _ENDIF
rts rts
_lynx_snd_play: _lynx_snd_play:
sta ptr1 sta ptr1
stx ptr1+1 stx ptr1+1
@ -1123,8 +1122,8 @@ start0: lda SndActive,x
SndStartSoundx: SndStartSoundx:
php php
pha pha
start1:
start1: sei sei
pla pla
sta SndPtrLo,x sta SndPtrLo,x
tya tya
@ -1140,12 +1139,12 @@ start1: sei
rts rts
SndStartSound2: SndStartSound2:
pha pha
lda SndActive,x ; check default lda SndActive,x ; check default
beq start20 ; inactive => ok beq start20 ; inactive => ok
phx phx
ldx #3 ; search free channel ldx #3 ; search free channel
start21: lda SndActive,x start21:
lda SndActive,x
beq start22 ; found => beq start22 ; found =>
dex dex
bpl start21 bpl start21
@ -1153,18 +1152,19 @@ start21: lda SndActive,x
dec SndReqStop,x ; stop default-channel dec SndReqStop,x ; stop default-channel
lda #1 lda #1
sta SndDelay,x sta SndDelay,x
start23: lda SndActive,x start23:
lda SndActive,x
bne start23 bne start23
bra start20 bra start20
start22: pla ; clear stack start22:
pla ; clear stack
start20: pla start20:
pla
phx phx
jsr SndStartSoundx ; launch new sound jsr SndStartSoundx ; launch new sound
plx plx
rts rts
_lynx_snd_stop: _lynx_snd_stop:
ldx #3 ldx #3
lda SndActive,x lda SndActive,x
@ -1179,7 +1179,7 @@ stop1: lda SndActive,x
bpl stop0 bpl stop0
rts rts
SndStopChannel: _lynx_snd_stop_channel:
lda SndActive,x lda SndActive,x
_IFNE _IFNE
dec SndReqStop,x dec SndReqStop,x
@ -1190,7 +1190,7 @@ stopc1: lda SndActive,x
_ENDIF _ENDIF
rts rts
SndChannelsActive: _lynx_snd_active:
ldx #3 ldx #3
lda #0 lda #0
act0: ldy SndActive,x act0: ldy SndActive,x
@ -1201,8 +1201,8 @@ act0: ldy SndActive,x
bpl act0 bpl act0
rts rts
_lynx_snd_pause:
_lynx_snd_pause: php php
sei sei
lda STIMCTLA lda STIMCTLA
sta SndPauseOff1+1 sta SndPauseOff1+1
@ -1219,12 +1219,14 @@ _lynx_snd_pause: php
plp plp
rts rts
_lynx_snd_continue:
_lynx_snd_continue: php php
sei sei
SndPauseOff1: lda #0 ; Selbsmodifizierter Code!!! SndPauseOff1:
lda #0 ; Selbsmodifizierter Code!!!
sta STIMCTLA sta STIMCTLA
SndPauseOff2: lda #0 ; Selbsmodifizierter Code!!! SndPauseOff2:
lda #0 ; Selbsmodifizierter Code!!!
sta MSTEREO sta MSTEREO
lda #$18 lda #$18
@ -1238,7 +1240,8 @@ SndPauseOff2: lda #0 ; Selbsmodifizierter Code!!!
.rodata .rodata
SndMask: .byte 1,2,4,8 SndMask:
.byte 1,2,4,8
SndPrescaler: SndPrescaler:
.byte $00,$06,$06,$06,$06,$05,$05,$05,$05,$05,$05,$05,$04,$04,$04,$04 .byte $00,$06,$06,$06,$06,$05,$05,$05,$05,$05,$05,$05,$04,$04,$04,$04