mirror of
https://github.com/dschmenk/PLASMA.git
synced 2024-06-11 23:29:29 +00:00
Add some terminal control to Apple1 emulation
This commit is contained in:
parent
82a1632bfd
commit
31d5b8a5ec
|
@ -156,9 +156,16 @@ int cout(M6502 *mpu, word addr, byte data) { if (mpu->registers->a == 0x8D) putc
|
|||
unsigned keypending = 0;
|
||||
unsigned char keypressed(void)
|
||||
{
|
||||
unsigned char cin;
|
||||
unsigned char cin, cext[2];
|
||||
if (read(STDIN_FILENO, &cin, 1) > 0)
|
||||
{
|
||||
if (cin == 0x1B) // Look for left arrow
|
||||
{
|
||||
if (read(STDIN_FILENO, cext, 2) == 2 && cext[0] == '[' && cext[1] == 'D')
|
||||
cin = 0x08;
|
||||
}
|
||||
keypending = cin | 0x80;
|
||||
}
|
||||
return keypending & 0x80;
|
||||
}
|
||||
unsigned char keyin(void)
|
||||
|
|
|
@ -788,6 +788,9 @@ def rdstr(prompt)#1
|
|||
if ^inbuff
|
||||
cout('\\')
|
||||
cout(^(inbuff + ^inbuff))
|
||||
cout($08); cout($08); cout($08) // backspace if supported
|
||||
prstr(" ")
|
||||
cout($08); cout($08); cout($08)
|
||||
inbuff.0--
|
||||
fin
|
||||
break
|
||||
|
|
Loading…
Reference in New Issue
Block a user