From f11a1470f08e1dc4dd3629307a9dcbcae3303ede Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Thu, 29 Mar 2018 21:44:40 -0700 Subject: [PATCH] Allocate seq buffer on heap and keep ints disabled durin aux memory move --- src/libsrc/apple/jit.pla | 2 +- src/samplesrc/playseq.pla | 10 ++++++---- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/libsrc/apple/jit.pla b/src/libsrc/apple/jit.pla index bc25216..3d91ba2 100644 --- a/src/libsrc/apple/jit.pla +++ b/src/libsrc/apple/jit.pla @@ -75,7 +75,7 @@ def compiler(defptr)#0 *$003C = defptr=>bytecodeaddr *$003E = *$003C + defptr->bytecodesize *$0042 = bytecode - call($C311, 0, 0, 0, $00) // CALL XMOVE with carry clear (AUX->MAIN) + call($C311, 0, 0, 0, $04) // CALL XMOVE with carry clear (AUX->MAIN) and ints disabled //^$C053 // MIX TEXT //puts("Addr Xlate: $"); puth(addrxlate); putln //puts("Bytecode: $"); puth(bytecode); putln diff --git a/src/samplesrc/playseq.pla b/src/samplesrc/playseq.pla index 087dad9..2671eb8 100644 --- a/src/samplesrc/playseq.pla +++ b/src/samplesrc/playseq.pla @@ -6,8 +6,8 @@ include "inc/sndseq.plh" // // These are utility sequences/routines needed to test the music sequencer code. // -word arg -word ref +word arg, seq, len +byte ref // // Sample background process to show it's working // @@ -19,9 +19,11 @@ arg = argNext(argFirst) if ^arg ref = fileio:open(arg) if ref - fileio:read(ref, heapmark(), heapavail()) + seq = heapalloc(heapavail - 256) + len = fileio:read(ref, seq, heapmark - seq) fileio:close(ref) - musicPlay(heapmark(), TRUE) + heaprelease(seq + len) + musicPlay(seq, TRUE) musicGetKey(8, @backgroundProc) // Yield every 8/16 second musicStop else