From 7c30332427917ef85ebbf9c78d8b4dc21a632305 Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Mon, 18 Jul 2016 19:17:38 -0700 Subject: [PATCH] different test --- src/libsrc/tone.pla | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/src/libsrc/tone.pla b/src/libsrc/tone.pla index a2b46e4..ff53c52 100644 --- a/src/libsrc/tone.pla +++ b/src/libsrc/tone.pla @@ -66,33 +66,22 @@ export asm tone2(pitch1, pitch2, duration) end export asm tonePWM(sample, speed, len) STX ESP + LDY ESTKH,X LDA ESTKL,X BEQ + - INC ESTKH,X -+ LDA ESTKL+2,X + INY ++ STY DSTH + STA DSTL + LDA ESTKL+2,X STA SRCL LDA ESTKH+2,X STA SRCH - LDA ESTKL+1,X - BNE ++ - LDY #$00 -- LDA (SRC),Y - SEC --- SBC #$01 - BCS -- - LDA $C030 + LDY ESTKL+1,X INY - BNE + - INC SRCH -+ LDX ESP - DEC ESTKL,X - BNE - - DEC ESTKH,X - BNE - - INX - RTS -++ STA TMPL + STY TMPL LDY #$00 + PHP + SEI - LDA (SRC),Y SEC -- LDX TMPL @@ -104,18 +93,23 @@ export asm tonePWM(sample, speed, len) INY BNE + INC SRCH -+ LDX ESP - DEC ESTKL,X ++ DEC DSTL BNE - - DEC ESTKH,X + DEC DSTH BNE - + PLP + LDX ESP + INX INX RTS ++ end def toneTest byte t - tonePWM($D000, 0, $2000) + for t = 2 to 128 + tone2(t, t >> 1, 10) + tone(t, 50) + next end toneTest() done \ No newline at end of file