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