Fix paint. Get first pass of keyboard mapping done.

This commit is contained in:
Thomas Cherryhomes 2019-01-27 22:05:53 -06:00
parent 0f2063340f
commit 295bb33813
3 changed files with 17 additions and 8 deletions

8
io.c
View File

@ -25,13 +25,13 @@ void io_init(void)
done(); done();
handshake.fXOn=0; handshake.fXOn=0;
handshake.fCTS=0; handshake.fCTS=1;
handshake.errs=0; handshake.errs=0;
handshake.evts=0; handshake.evts=0;
handshake.fInX=0; handshake.fInX=0;
SerHShake(driverIn,&handshake); SerHShake(driverIn,&handshake);
SerReset(driverOut,baud1200+stop10+noParity+data8); SerReset(driverOut,baud19200+stop10+noParity+data8);
serial_buffer=NewPtr(SERIAL_BUFFER_SIZE); serial_buffer=NewPtr(SERIAL_BUFFER_SIZE);
if (serial_buffer!=noErr) if (serial_buffer!=noErr)
@ -43,8 +43,8 @@ void io_init(void)
void io_send_byte(unsigned char b) void io_send_byte(unsigned char b)
{ {
long count=1; long count=1;
if (NoEcho==padF) /* if (NoEcho==padF) */
return; /* return; */
FSWrite(driverOut,&count,&b); FSWrite(driverOut,&count,&b);
} }

View File

@ -31,19 +31,27 @@ void keyboard_out(int platoKey)
void keyboard_main(EventRecord* e) void keyboard_main(EventRecord* e)
{ {
unsigned char key;
key=e->message&0x7F;
if (TTY) if (TTY)
{ {
keyboard_out_tty(e->message&0x7F); keyboard_out_tty(key);
} }
else 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) void keyboard_out_tty(padByte ch)
{ {
ShowPLATO(&ch,1);
io_send_byte(ch); io_send_byte(ch);
} }

View File

@ -83,6 +83,7 @@ void screen_init(void)
windowRect.top=45; windowRect.top=45;
windowRect.bottom=windowRect.top+512; windowRect.bottom=windowRect.top+512;
windowRect.left+=5; /* scooch the content area inward slightly. */ windowRect.left+=5; /* scooch the content area inward slightly. */
windowRect.right+=5; /* scooch */
} }
verticalScaleFactor=((double)windowRect.bottom-(double)windowRect.top)/(double)512.0; 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) void screen_paint(padPt* Coord)
{ {
static unsigned short xStack[512]; static unsigned short xStack[512];
static unsigned char yStack[512]; static unsigned short yStack[512];
int x=screen_scale_x(Coord->x); int x=screen_scale_x(Coord->x);
int y=screen_scale_y(Coord->y); int y=screen_scale_y(Coord->y);
unsigned char stackentry = 1; unsigned char stackentry = 1;