~vdupras/collapseos

1a48ff047f152adfb8a5461a27cd48e721579b07 — Virgil Dupras 1 year, 5 months ago 475caf3
trs80: make (key?) non-blocking
2 files changed, 8 insertions(+), 3 deletions(-)

M arch/z80/trs80/blk.fs
M emul/z80/trs80.c
M arch/z80/trs80/blk.fs => arch/z80/trs80/blk.fs +3 -3
@@ 11,10 11,10 @@ There is also the RECV program at B612.
( ----- 602 )
1 8 LOADR+
( ----- 603 )
CODE (key?) ( -- c? f ) ( TODO: make non-blocking )
    A 0x01 LDri, ( @KEY )
CODE (key?) ( -- c? f )
    A 0x08 LDri, ( @KBD )
    0x28 RST,
    PUSHA, PUSH1,
    IFZ, PUSHA, THEN, PUSHZ,
;CODE
CODE (emit) EXX, ( protect BC )
    BC POP, ( c == @DSP arg ) chkPS,

M emul/z80/trs80.c => emul/z80/trs80.c +5 -0
@@ 41,6 41,11 @@ static void pchookfunc(Machine *m)
            wmove(w, y, x-1);
        }
        break;
    case 0x08: // @KBD TODO: make non-blocking
        debug_panel();
        m->cpu.R1.br.A = wgetch(w);
        m->cpu.R1.br.F |= F_Z;
        break;
    case 0x0f: // @VDCTL
        wmove(w, m->cpu.R1.br.H, m->cpu.R1.br.L);
        break;