Add PLTO creator code, so icon works. Add more menu items to resource file. Temporarily comment out mono paint.

This commit is contained in:
Thomas Cherryhomes 2019-02-01 16:16:58 -06:00
parent 0b77f5bf80
commit b3610d1484
3 changed files with 77 additions and 57 deletions

View File

@ -18,6 +18,7 @@ add_application(PLATOTERM
terminal.c
touch.c
trace.c
CREATOR "PLTO"
)
target_link_libraries(PLATOTERM "-lm")

View File

@ -6,7 +6,7 @@
type 'PLTO' as 'STR ';
resource 'PLTO' (0, purgeable) {
"PLATOTerm 0.1"
"PLATOTerm 0.5"
};
resource 'MENU' (128) {
@ -22,8 +22,12 @@ resource 'MENU' (128) {
resource 'MENU' (129) {
129, textMenuProc;
allEnabled, enabled;
"File";
"Terminal";
{
"PLATO Mode", noIcon, "P", noMark, plain;
"TTY Mode", noIcon, "T", noMark, plain;
"-",noIcon, noKey, noMark, plain;
"Hang Up",noIcon, "H", noMark, plain;
"Quit", noIcon, "Q", noMark, plain;
}
};
@ -42,8 +46,23 @@ resource 'MENU' (130) {
}
};
resource 'MENU' (131) {
131, textMenuProc;
0, enabled;
"Settings";
{
"300 baud", noIcon, "3", noMark, plain;
"1200 baud", noIcon, "1", noMark, plain;
"2400 baud", noIcon, "2", noMark, plain;
"9600 baud", noIcon, "6", noMark, plain;
"19200 baud", noIcon, "9", noMark, plain;
"38400 baud", noIcon, "8", noMark, plain;
"57600 baud", noIcon, "7", noMark, plain;
}
};
resource 'MBAR' (128) {
{ 128, 129, 130 };
{ 128, 129, 130, 131 };
};
resource 'SIZE' (-1) {

108
screen.c
View File

@ -186,7 +186,7 @@ void screen_menu_command(long menu_command)
switch(menuItem)
{
case 1:
case 5:
done();
break;
}
@ -614,65 +614,65 @@ void screen_paint(padPt* Coord)
*/
void screen_mono_paint(padPt* Coord)
{
static unsigned short xStack[512];
static unsigned short yStack[512];
int x=screen_scale_x(Coord->x);
int y=screen_scale_y(Coord->y);
unsigned char stackentry = 1;
unsigned short spanAbove, spanBelow;
unsigned char oldColor=GetPixel(x,y);
/* static unsigned short xStack[512]; */
/* static unsigned short yStack[512]; */
/* int x=screen_scale_x(Coord->x); */
/* int y=screen_scale_y(Coord->y); */
/* unsigned char stackentry = 1; */
/* unsigned short spanAbove, spanBelow; */
/* unsigned char oldColor=GetPixel(x,y); */
if (oldColor==1)
return;
/* if (oldColor==1) */
/* return; */
do
{
unsigned short startx;
while (x > 0 && GetPixel(x-1,y)==oldColor)
--x;
/* do */
/* { */
/* unsigned short startx; */
/* while (x > 0 && GetPixel(x-1,y)==oldColor) */
/* --x; */
spanAbove = spanBelow = false;
startx=x;
/* spanAbove = spanBelow = false; */
/* startx=x; */
while(GetPixel(x,y)==oldColor)
{
if (y < (512))
{
unsigned char belowColor=GetPixel(x,y);
if (!spanBelow && belowColor==oldColor)
{
xStack[stackentry] = x;
yStack[stackentry] = y+1;
++stackentry;
spanBelow = true;
}
else if (spanBelow && belowColor!=oldColor)
spanBelow = false;
}
/* while(GetPixel(x,y)==oldColor) */
/* { */
/* if (y < (512)) */
/* { */
/* unsigned char belowColor=GetPixel(x,y); */
/* if (!spanBelow && belowColor==oldColor) */
/* { */
/* xStack[stackentry] = x; */
/* yStack[stackentry] = y+1; */
/* ++stackentry; */
/* spanBelow = true; */
/* } */
/* else if (spanBelow && belowColor!=oldColor) */
/* spanBelow = false; */
/* } */
if (y > 0)
{
unsigned char aboveColor=GetPixel(x,y);
if (!spanAbove && aboveColor==oldColor)
{
xStack[stackentry] = x;
yStack[stackentry] = y-1;
++stackentry;
spanAbove = true;
}
else if (spanAbove && aboveColor!=oldColor)
spanAbove = false;
}
++x;
}
MoveTo(startx,y);
LineTo(x-1,y);
--stackentry;
x = xStack[stackentry];
y = yStack[stackentry];
}
while (stackentry);
/* if (y > 0) */
/* { */
/* unsigned char aboveColor=GetPixel(x,y); */
/* if (!spanAbove && aboveColor==oldColor) */
/* { */
/* xStack[stackentry] = x; */
/* yStack[stackentry] = y-1; */
/* ++stackentry; */
/* spanAbove = true; */
/* } */
/* else if (spanAbove && aboveColor!=oldColor) */
/* spanAbove = false; */
/* } */
/* ++x; */
/* } */
/* MoveTo(startx,y); */
/* LineTo(x-1,y); */
/* --stackentry; */
/* x = xStack[stackentry]; */
/* y = yStack[stackentry]; */
/* } */
/* while (stackentry); */
}
/**