change storage to pager zero

fix bug that kills keyboard.
This commit is contained in:
Mariano Dominguez
2023-01-15 17:00:05 -08:00
parent 42c39c6bfc
commit 6236e82850

View File

@@ -7,11 +7,13 @@
.include "atari.inc" .include "atari.inc"
.export __sound .export __sound
.import popa .import popa
.importzp tmp1,tmp2
; play sound, arguments: voice, pitch, distortion, volume. same as BASIC ; play sound, arguments: voice, pitch, distortion, volume. same as BASIC
.proc __sound .proc __sound
sta STORE2 ;save volume sta tmp2 ;save volume
jsr popa ;get distortion jsr popa ;get distortion
sta STORE1 ;save distortion sta tmp1 ;save distortion
jsr popa ;get pitch jsr popa ;get pitch
pha ;save in stack pha ;save in stack
jsr popa ;get voice jsr popa ;get voice
@@ -22,18 +24,14 @@
lda #0 lda #0
sta AUDCTL sta AUDCTL
lda #3 lda #3
stx SKCTL ;init sound sta SKCTL ;init sound
lda STORE1 ;get distortion lda tmp1 ;get distortion
asl a ;ignore the high nibble asl a ;ignore the high nibble
asl a asl a
asl a asl a
asl a asl a
clc ;setup for adding volume clc ;setup for adding volume
adc STORE2 ;add volume adc tmp2 ;add volume
sta AUDC1,x ;volume + distortion in control channel sta AUDC1,x ;volume + distortion in control channel
rts rts
.endproc .endproc
;reserve 2 bytes for temp storage
.bss
STORE1: .res 1
STORE2: .res 1