mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-08-21 06:29:07 +00:00
Add echo on/off to conio for Apple 3
This commit is contained in:
parent
d2566c89c0
commit
b56b57fa4d
@ -2,9 +2,12 @@ import conio
|
||||
const NORMAL = $FF
|
||||
const INVERSE = $3F
|
||||
const FLASH = $7F
|
||||
const ECHO_ON = $80
|
||||
const ECHO_OFF = $00
|
||||
struc t_conio
|
||||
word keypressed
|
||||
word getkey
|
||||
word echo
|
||||
word home
|
||||
word gotoxy
|
||||
word viewport
|
||||
|
@ -38,6 +38,7 @@ const ENV_REG = $FFDF
|
||||
struc t_conio
|
||||
word keypressed
|
||||
word getkey
|
||||
word echo
|
||||
word home
|
||||
word gotoxy
|
||||
word viewport
|
||||
@ -52,7 +53,7 @@ end
|
||||
//
|
||||
// Predefined functions.
|
||||
//
|
||||
predef a2keypressed,a2home,a2gotoxy(x,y),a2viewport(left, top, width, height),a2texttype(type)
|
||||
predef a2keypressed,a2home,a12echo(state),a2gotoxy(x,y),a2viewport(left, top, width, height),a2texttype(type)
|
||||
predef a2textmode(cols),a2grmode(mix),a2grcolor(color),a2grplot(x,y),a2tone(duration, delay),a2rnd
|
||||
//
|
||||
// Exported function table.
|
||||
@ -63,6 +64,7 @@ word conio[]
|
||||
//
|
||||
word = @a2keypressed
|
||||
word = @getc
|
||||
word = @a12echo
|
||||
word = @a2home
|
||||
word = @a2gotoxy
|
||||
word = @a2viewport
|
||||
@ -167,6 +169,9 @@ end
|
||||
def a1keypressed
|
||||
return ^$D011 >= 128
|
||||
end
|
||||
def a12echo(state)
|
||||
return 0
|
||||
end
|
||||
def a1home
|
||||
byte l
|
||||
for l = 0 to 23
|
||||
@ -292,6 +297,9 @@ def a3keypressed
|
||||
dev_status(cmdsys.devcons, 5, @count)
|
||||
return count
|
||||
end
|
||||
def a3echo(state)
|
||||
return dev_control(cmdsys.devcons, 11, @state)
|
||||
end
|
||||
def a3home
|
||||
//curshpos = 0
|
||||
//cursvpos = 0
|
||||
@ -386,6 +394,7 @@ when MACHID & MACHID_MODEL
|
||||
is MACHID_III
|
||||
conio:keypressed = @a3keypressed
|
||||
conio:getkey = @a13getkey
|
||||
conio:echo = @a3echo
|
||||
conio:home = @a3home
|
||||
conio:gotoxy = @a3gotoxy
|
||||
conio:viewport = @a3viewport
|
||||
|
@ -135,6 +135,7 @@ end
|
||||
export def fight(player, enemy)
|
||||
word p_atck, e_atck
|
||||
|
||||
conio:echo(ECHO_ON)
|
||||
repeat
|
||||
conio:home()
|
||||
conio:gotoxy(0, 0)
|
||||
@ -159,6 +160,7 @@ export def fight(player, enemy)
|
||||
next
|
||||
conio:gotoxy(12, 8); puts("F)ight or R)un?")
|
||||
if toupper(conio:getkey()) == 'R'
|
||||
conio:echo(ECHO_OFF)
|
||||
return 1
|
||||
else
|
||||
//
|
||||
@ -204,6 +206,7 @@ export def fight(player, enemy)
|
||||
fin
|
||||
fin
|
||||
until player->health == 0 or enemy->life == 0
|
||||
conio:echo(ECHO_OFF)
|
||||
return 0
|
||||
end
|
||||
|
||||
|
@ -625,6 +625,7 @@ if ^instr > 15
|
||||
^instr = 15
|
||||
fin
|
||||
memcpy(@player.name, instr, ^instr + 1)
|
||||
conio:echo(ECHO_OFF)
|
||||
while loadmap(level)
|
||||
puts(@prepstr)
|
||||
free_entities = heapmark()
|
||||
@ -650,6 +651,7 @@ while loadmap(level)
|
||||
break
|
||||
fin
|
||||
loop
|
||||
conio:echo(ECHO_ON)
|
||||
if player.health > 0
|
||||
puts(@youmadeitstr)
|
||||
puti(player.gold)
|
||||
|
@ -423,6 +423,7 @@ def inputKey#0
|
||||
byte inkey
|
||||
word pkeys
|
||||
|
||||
conio:echo(ECHO_OFF)
|
||||
while not quit
|
||||
pkeys = @keypad
|
||||
conio:gotoxy(18, 7)
|
||||
@ -441,6 +442,7 @@ def inputKey#0
|
||||
pkeys = pkeys + t_keyinput
|
||||
loop
|
||||
loop
|
||||
conio:echo(ECHO_ON)
|
||||
end
|
||||
initDisplay
|
||||
initState
|
||||
|
Loading…
Reference in New Issue
Block a user