mirror of
https://github.com/dschmenk/PLASMA.git
synced 2025-01-09 13:33:26 +00:00
Use CONIO for ?TERMINAL and KEY words. Prepare Apple /// support for FORTH
This commit is contained in:
parent
8985011207
commit
6e03017d25
Binary file not shown.
@ -80,6 +80,7 @@ word = $0850,$08D0,$0950,$09D0,$0A50,$0AD0,$0B50,$0BD0
|
||||
byte textbwmode[] = 2, 16, 0
|
||||
byte textclrmode[] = 2, 16, 1
|
||||
byte grcharset[] = 1, 0, $7F, $7F, $7F, $7F, $00, $00, $00, $00
|
||||
byte a3keyqueue = 0
|
||||
//
|
||||
// Random number for Apple 1 and III.
|
||||
//
|
||||
@ -153,6 +154,12 @@ end
|
||||
def a1keypressed
|
||||
return ^$D011 >= 128 ?? ^$D011 :: 0
|
||||
end
|
||||
def a1getkey
|
||||
while not a1keypressed
|
||||
randnum = randnum + 123
|
||||
loop
|
||||
return getc()
|
||||
end
|
||||
def a12echo(state)
|
||||
return 0
|
||||
end
|
||||
@ -278,8 +285,24 @@ def dev_status(devnum, code, list)
|
||||
end
|
||||
def a3keypressed
|
||||
byte count
|
||||
|
||||
dev_status(cmdsys.devcons, 5, @count)
|
||||
return count
|
||||
if count and !a3keyqueue
|
||||
a3keyqueue = getc
|
||||
fin
|
||||
return a3keyqueue | $80
|
||||
end
|
||||
def a3getkey
|
||||
byte keycode
|
||||
repeat
|
||||
randnum = randnum + 123
|
||||
if !a3keyqueue
|
||||
a3keypressed
|
||||
fin
|
||||
keycode = a3keyqueue
|
||||
until keycode
|
||||
a3keyqueue = 0
|
||||
return keycode
|
||||
end
|
||||
def a3echo(state)
|
||||
return dev_control(cmdsys.devcons, 11, @state)
|
||||
@ -362,12 +385,6 @@ end
|
||||
//
|
||||
// Apple 1 and III combined routines.
|
||||
//
|
||||
def a13getkey
|
||||
while not conio:keypressed()
|
||||
randnum = randnum + 123
|
||||
loop
|
||||
return getc()
|
||||
end
|
||||
def a13rnd
|
||||
randnum = (randnum << 1) + randnum + 123
|
||||
return randnum & $7FFF
|
||||
@ -378,7 +395,7 @@ end
|
||||
when MACHID & MACHID_MODEL
|
||||
is MACHID_III
|
||||
conio:keypressed = @a3keypressed
|
||||
conio:getkey = @a13getkey
|
||||
conio:getkey = @a3getkey
|
||||
conio:echo = @a3echo
|
||||
conio:home = @a3home
|
||||
conio:gotoxy = @a3gotoxy
|
||||
@ -391,7 +408,7 @@ when MACHID & MACHID_MODEL
|
||||
break
|
||||
is MACHID_I
|
||||
conio:keypressed = @a1keypressed
|
||||
conio:getkey = @a13getkey
|
||||
conio:getkey = @a1getkey
|
||||
conio:home = @a1home
|
||||
conio:gotoxy = @a1gotoxy
|
||||
conio:viewport = @a1viewport
|
||||
|
@ -107,7 +107,7 @@ predef _componly_#0, _interponly_#0, _immediate_#0, _exit_#0, _pad_#1, _trailing
|
||||
predef _tors_(a)#0, _fromrs_#1, _toprs_#1, _lookup_#1
|
||||
predef _cmove_(a,b,c)#0, _move_(a,b,c)#0, _fill_(a,b,c)#0, _plasma_(a)#0
|
||||
predef _var_(a)#0, _const_(a)#0, _lit_#1, _slit_#1, _find_(a)#2
|
||||
predef _tick_#0, _forget_#0, _terminal_#1, _prat_(a)#0
|
||||
predef _tick_#0, _forget_#0, _terminal_#1, _key_#1, _prat_(a)#0
|
||||
predef _blank_#0, _char_#0, _str_#0, _prstr_#0, _prpstr_#0
|
||||
predef _prval_(a)#0, _prbyte_(a)#0, _prhex_(a)#0, _accept_(a,b)#1, _type_(a,b)#0
|
||||
predef _vlist_#0, _tron_#0, _troff_#0, _stepon_#0, _stepoff_#0
|
||||
@ -508,7 +508,7 @@ word = @d_literal, 0, @_terminal_
|
||||
// KEY
|
||||
char d_key = "KEY"
|
||||
byte = 0
|
||||
word = @d_terminal, 0, @getc
|
||||
word = @d_terminal, 0, @_key_
|
||||
// ACCEPT
|
||||
char d_accept = "ACCEPT"
|
||||
byte = 0
|
||||
@ -932,18 +932,18 @@ end
|
||||
def _execword_(dentry)#0
|
||||
when conio:keypressed()
|
||||
is $83 // CTRL-C
|
||||
getc // Clear KB
|
||||
conio:getkey() // Clear KB
|
||||
brkhandle(dentry)
|
||||
break
|
||||
is $94 // CTRL-T
|
||||
getc // Clear KB strobe
|
||||
conio:getkey() // Clear KB
|
||||
state = state ^ trace_flag
|
||||
break
|
||||
wend
|
||||
if state & trace_flag
|
||||
showtrace(dentry)
|
||||
if state & step_flag
|
||||
if getc == $03 // CTRL-C
|
||||
if conio:getkey() == $03 // CTRL-C
|
||||
brkhandle(dentry)
|
||||
fin
|
||||
fin
|
||||
@ -1539,7 +1539,10 @@ def _accept_(a,b)#1
|
||||
return len
|
||||
end
|
||||
def _terminal_#1
|
||||
return ^$C000 > 127
|
||||
return conio:keypressed() > 127
|
||||
end
|
||||
def _key_#1
|
||||
return conio:getkey()
|
||||
end
|
||||
def _word_(a)#1
|
||||
word wordptr
|
||||
@ -1747,7 +1750,7 @@ def _show_#0
|
||||
w = *pfa
|
||||
fin
|
||||
if conio:keypressed()
|
||||
getc; getc
|
||||
conio:getkey(); conio:getkey()
|
||||
fin
|
||||
loop
|
||||
fin
|
||||
@ -1847,7 +1850,7 @@ def typelist(typestr, typemask, type)#0
|
||||
puts(" ")
|
||||
fin
|
||||
puts(d)
|
||||
if conio:keypressed(); getc; getc; fin
|
||||
if conio:keypressed(); conio:getkey(); conio:getkey(); fin
|
||||
fin
|
||||
d = *_lfa_(d)
|
||||
loop
|
||||
|
Loading…
x
Reference in New Issue
Block a user