From 242f7be1b9e65861f58f1fb9ac75fab18e9e043a Mon Sep 17 00:00:00 2001 From: David Schmenk Date: Fri, 19 Dec 2014 13:22:46 -0800 Subject: [PATCH] Fix cmd conflict with time card (and free up some bytes for soscmd too). add apple2 compatible sound to Apple3 rogue. --- src/samplesrc/rogue.map.pla | 14 +++++++++++--- src/vmsrc/cmd.pla | 29 +++++++++++++++-------------- src/vmsrc/soscmd.pla | 5 ++--- 3 files changed, 28 insertions(+), 20 deletions(-) diff --git a/src/samplesrc/rogue.map.pla b/src/samplesrc/rogue.map.pla index 75abdfc..37d0300 100644 --- a/src/samplesrc/rogue.map.pla +++ b/src/samplesrc/rogue.map.pla @@ -189,6 +189,8 @@ byte noapple1 = "APPLE 1 NOT SUPPORTED." byte apple2 = "Apple II " byte apple3 = "Apple /// " +const ENV_REG = $FFDF + const SPEAKER = $C030 const a2rndnum = $4E // ZP location of RND @@ -212,9 +214,6 @@ def a2getkb return getc() end -def a3tone(duration, pitch) -end - def a2tone(duration, delay) byte i @@ -226,6 +225,15 @@ def a2tone(duration, delay) loop end +def a3tone(duration, pitch) + byte env + + env = ^ENV_REG + ^ENV_REG = env | $C0 + a2tone(duration, pitch) + ^ENV_REG = env +end + // // Apple /// console routines // diff --git a/src/vmsrc/cmd.pla b/src/vmsrc/cmd.pla index 5a8f988..b428fb3 100644 --- a/src/vmsrc/cmd.pla +++ b/src/vmsrc/cmd.pla @@ -4,6 +4,7 @@ const databuff = $2000 const MODADDR = $1000 const symtbl = $0C00 const freemem = $0006 +const getlnbuf = $01FF // // System flags: memory allocator screen holes. // @@ -38,7 +39,7 @@ word heap word xheap = $0800 word lastsym = symtbl byte perr -word cmdptr = $01FF +byte[] cmdln // Overlay exported strings table // // Standard Library exported functions. // @@ -66,6 +67,7 @@ byte loadstr = "MODLOAD" byte execstr = "MODEXEC" byte modadrstr = "MODADDR" byte argstr = "ARGS" +byte[] prefix // overlay with exported symbols table word exports = @sysstr, @syscall word = @callstr, @call word = @putcstr, @cout @@ -87,7 +89,7 @@ word = @loadstr, @loadmod word = @execstr, @execmod word = @modadrstr, @lookupstrmod word = @machidstr, MACHID -word = @argstr, $01FF +word = @argstr, @cmdln word = 0 word stdlibsym = @exports // @@ -98,7 +100,6 @@ byte freestr = "MEM FREE:$" byte errorstr = "ERR:$" byte okstr = "OK" byte huhstr = "?\n" -byte[32] prefix = "" // // Utility functions // @@ -1275,10 +1276,11 @@ while *stdlibsym addsym(heap, stdlibsym=>2) stdlibsym = stdlibsym + 4 loop +memcpy(@cmdln, getlnbuf, 128) // // Print some startup info. // -if not ^cmdptr +if not cmdln prstr(@verstr) prbyte(version.1) cout('.') @@ -1287,33 +1289,32 @@ if not ^cmdptr prstr(@freestr) prword(availheap) crout -else - getpfx(@prefix) fin +getpfx(@prefix) perr = 0 while 1 - if ^cmdptr - when toupper(parsecmd(cmdptr)) + if cmdln + when toupper(parsecmd(@cmdln)) is 'Q' reboot() break is 'C' - catalog(cmdptr) + catalog(@cmdln) break is 'P' - setpfx(cmdptr) + setpfx(@cmdln) break is 'V' volumes() break is '-' - execsys(cmdptr) + execsys(@cmdln) break is '+' - execmod(cmdptr) + execmod(@cmdln) break otherwise - prstr(@huhstr) + prstr(@huhstr) wend if perr prstr(@errorstr) @@ -1325,6 +1326,6 @@ while 1 crout() fin prstr(getpfx(@prefix)) - cmdptr = rdstr($BA) + memcpy(@cmdln, rdstr($BA), 128) loop done diff --git a/src/vmsrc/soscmd.pla b/src/vmsrc/soscmd.pla index 4597672..e47b3c8 100644 --- a/src/vmsrc/soscmd.pla +++ b/src/vmsrc/soscmd.pla @@ -54,7 +54,6 @@ byte errorstr[] = "ERR:$" byte okstr[] = "OK" byte huhstr[] = "?\n" byte devtovol[] = " => /" -byte prefix[64] = "" byte textmode[] = 16, 0, 15 byte hexchar[] = '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' // @@ -92,6 +91,7 @@ byte loadstr[] = "MODLOAD" byte execstr[] = "MODEXEC" byte modadrstr[] = "MODADDR" byte argstr[] = "ARGS" +byte prefix[] // Overlay with exported symbols table word exports[] = @sysstr, @syscall word = @callstr, @call word = @putcstr, @cout @@ -1297,9 +1297,8 @@ if not ^cmdptr prstr(@freestr) prword(availheap) crout -else - getpfx(@prefix) fin +getpfx(@prefix) // // Handle commands. //