mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-04-05 03:37:43 +00:00
Include conio inside plforth for keypress()
This commit is contained in:
parent
a15658a714
commit
6bb7a9dca9
@ -151,7 +151,7 @@ end
|
||||
// Apple 1 routines.
|
||||
//
|
||||
def a1keypressed
|
||||
return ^$D011 >= 128
|
||||
return ^$D011 >= 128 ?? ^$D011 :: 0
|
||||
end
|
||||
def a12echo(state)
|
||||
return 0
|
||||
@ -198,7 +198,7 @@ end
|
||||
// Apple II routines.
|
||||
//
|
||||
def a2keypressed
|
||||
return ^keyboard >= 128
|
||||
return ^keyboard >= 128 ?? ^keyboard :: 0
|
||||
end
|
||||
def a2home
|
||||
//curshpos = 0
|
||||
|
@ -202,7 +202,7 @@ cp samplesrc/lz4cat.pla prodos/bld/samples/LZ4CAT.PLA.TXT
|
||||
cp samplesrc/sfm.pla prodos/bld/samples/SFM.PLA.TXT
|
||||
cp samplesrc/sfmsprt.pla prodos/bld/samples/SFMSPRT.PLA.TXT
|
||||
cp samplesrc/fppow.pla prodos/bld/samples/FPPOW.PLA.TXT
|
||||
cp samplesrc/cmdsys.4th prodos/bld/samples/CMDSYS.4TH.TXT
|
||||
cp samplesrc/plasma.4th prodos/bld/samples/PLASMA.4TH.TXT
|
||||
cp samplesrc/bounce.4th prodos/bld/samples/BOUNCE.4TH.TXT
|
||||
cp utilsrc/apple/mon.pla prodos/bld/samples/MON.PLA.TXT
|
||||
cp utilsrc/apple/zipchip.pla prodos/bld/samples/ZIPCHIP.PLA.TXT
|
||||
|
@ -1,7 +1,6 @@
|
||||
SRC" CMDSYS.4TH"
|
||||
SRC" PLASMA.4TH"
|
||||
|
||||
" CONIO" EXECMOD
|
||||
." Load module returns " . CR
|
||||
( LOADMOD" CONIO" CONIO is already available in plforth )
|
||||
|
||||
LOOKUP CONIO CONSTANT CONIOAPI
|
||||
CONIOAPI 3 IFACE PLASMA HOME
|
||||
@ -45,3 +44,5 @@ CONIOAPI 12 IFACE PLASMA RAND
|
||||
KEY
|
||||
40 TEXTMODE DROP
|
||||
;
|
||||
|
||||
BOUNCE
|
||||
|
@ -1,12 +0,0 @@
|
||||
: IFACE 2 * + @ ;
|
||||
|
||||
LOOKUP CMDSYS 3 IFACE PLASMA EXECMOD
|
||||
LOOKUP CMDSYS 2 IFACE CONSTANT CMDLINE
|
||||
LOOKUP STRCPY PLASMA STRCPY
|
||||
LOOKUP STRCAT PLASMA STRCAT
|
||||
|
||||
: EDIT"
|
||||
CMDLINE " ED " STRCPY
|
||||
CMDLINE 34 WORD STRCAT
|
||||
" ED" EXECMOD
|
||||
;
|
26
src/samplesrc/plasma.4th
Normal file
26
src/samplesrc/plasma.4th
Normal file
@ -0,0 +1,26 @@
|
||||
: IFACE 2 * + @ ;
|
||||
|
||||
LOOKUP CMDSYS 3 IFACE PLASMA EXECMOD
|
||||
LOOKUP CMDSYS 2 IFACE CONSTANT CMDLINE
|
||||
LOOKUP STRCPY PLASMA STRCPY
|
||||
LOOKUP STRCAT PLASMA STRCAT
|
||||
|
||||
: CPYCMD
|
||||
CMDLINE " . " STRCPY DROP ( Need a dummy value for the module name )
|
||||
34 WORD CMDLINE SWAP STRCAT DROP ( Quote deliminted string )
|
||||
;
|
||||
|
||||
: CMDEXEC
|
||||
CPYCMD
|
||||
EXECMOD 0< IF ." Failed to exec module" CR THEN
|
||||
;
|
||||
|
||||
: LOADMOD"
|
||||
34 WORD ( Quote deliminted string )
|
||||
EXECMOD 0< IF ." Failed to load module" CR THEN
|
||||
;
|
||||
|
||||
: EDIT"
|
||||
CPYCMD
|
||||
" ED" EXECMOD 0< IF ." Failed to run ED" CR ABORT THEN
|
||||
;
|
@ -1,6 +1,7 @@
|
||||
include "inc/cmdsys.plh"
|
||||
include "inc/args.plh"
|
||||
include "inc/fileio.plh"
|
||||
include "inc/conio.plh"
|
||||
include "inc/longjmp.plh"
|
||||
//
|
||||
// FORTH dictionary layout
|
||||
@ -731,16 +732,16 @@ end
|
||||
//
|
||||
def execword(dentry)#0
|
||||
|
||||
if ^$C000 & $80
|
||||
if ^$C000 == $83 // CTRL-C
|
||||
^$C010 // Clear KB strobe
|
||||
when conio:keypressed()
|
||||
is $83 // CTRL-C
|
||||
getc // Clear KB
|
||||
brkhandle(dentry)
|
||||
fin
|
||||
if ^$C000 == $94 // CTRL-T
|
||||
^$C010 // Clear KB strobe
|
||||
break
|
||||
is $94 // CTRL-T
|
||||
getc // Clear KB strobe
|
||||
state = state ^ trace_flag
|
||||
fin
|
||||
fin
|
||||
break
|
||||
wend
|
||||
if state & trace_flag
|
||||
showtrace(dentry)
|
||||
fin
|
||||
|
Loading…
x
Reference in New Issue
Block a user