From 295bb33813eed455bb2913a7d9905daa1e600820 Mon Sep 17 00:00:00 2001 From: Thomas Cherryhomes Date: Sun, 27 Jan 2019 22:05:53 -0600 Subject: [PATCH] Fix paint. Get first pass of keyboard mapping done. --- io.c | 8 ++++---- keyboard.c | 14 +++++++++++--- screen.c | 3 ++- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/io.c b/io.c index a98fe68..cac1f13 100755 --- a/io.c +++ b/io.c @@ -25,13 +25,13 @@ void io_init(void) done(); handshake.fXOn=0; - handshake.fCTS=0; + handshake.fCTS=1; handshake.errs=0; handshake.evts=0; handshake.fInX=0; SerHShake(driverIn,&handshake); - SerReset(driverOut,baud1200+stop10+noParity+data8); + SerReset(driverOut,baud19200+stop10+noParity+data8); serial_buffer=NewPtr(SERIAL_BUFFER_SIZE); if (serial_buffer!=noErr) @@ -43,8 +43,8 @@ void io_init(void) void io_send_byte(unsigned char b) { long count=1; - if (NoEcho==padF) - return; + /* if (NoEcho==padF) */ + /* return; */ FSWrite(driverOut,&count,&b); } diff --git a/keyboard.c b/keyboard.c index 4192455..cb4ca1f 100755 --- a/keyboard.c +++ b/keyboard.c @@ -31,19 +31,27 @@ void keyboard_out(int platoKey) void keyboard_main(EventRecord* e) { + unsigned char key; + key=e->message&0x7F; if (TTY) { - keyboard_out_tty(e->message&0x7F); + keyboard_out_tty(key); } else { - + if (e->modifiers & 4096) /* CTRL key*/ + { + if (e->modifiers & 512) + key|=0x80; + keyboard_out(ctrl_key_to_pkey[key]); + } + else + keyboard_out(key_to_pkey[key]); } } void keyboard_out_tty(padByte ch) { - ShowPLATO(&ch,1); io_send_byte(ch); } diff --git a/screen.c b/screen.c index 8068bdd..684117f 100644 --- a/screen.c +++ b/screen.c @@ -83,6 +83,7 @@ void screen_init(void) windowRect.top=45; windowRect.bottom=windowRect.top+512; windowRect.left+=5; /* scooch the content area inward slightly. */ + windowRect.right+=5; /* scooch */ } verticalScaleFactor=((double)windowRect.bottom-(double)windowRect.top)/(double)512.0; @@ -596,7 +597,7 @@ unsigned char screen_pixel_colors_same(RGBColor* firstColor, RGBColor* secondCol void screen_paint(padPt* Coord) { static unsigned short xStack[512]; - static unsigned char yStack[512]; + static unsigned short yStack[512]; int x=screen_scale_x(Coord->x); int y=screen_scale_y(Coord->y); unsigned char stackentry = 1;