Open a window. Get initial resource file dropped in.

This commit is contained in:
Thomas Cherryhomes 2019-01-25 18:42:10 -06:00
parent 7ee21c7d1a
commit e0725ee975
5 changed files with 76 additions and 15 deletions

View File

@ -8,6 +8,7 @@
cmake_minimum_required(VERSION 2.8)
add_application(PLATOTERM
PLATOTERM.r
help.c
io.c
keyboard.c

1
PLATOTERM.r Executable file
View File

@ -0,0 +1 @@
data 'MENU' (128) { $"0080 0000 0000 0000 0000 FFFF FFFF 0114" /* .€........ .. */ $"00" /* . */ }; data 'MENU' (129) { $"0081 0000 0000 0000 0000 FFFF FFFF 0446" /* .<2E>........ .F */ $"696C 6504 5175 6974 0051 0000 00" /* ile.Quit.Q... */ }; data 'MBAR' (128) { $"0002 0080 0081" /* ....<2E> */ };

31
main.c
View File

@ -16,23 +16,24 @@ unsigned char running=false;
void main(void)
{
screen_init();
touch_init();
help_init();
NoEcho=padT;
ShowPLATO(splash,sizeof(splash));
NoEcho=padF;
terminal_initial_position();
io_init();
/* touch_init(); */
/* help_init(); */
/* NoEcho=padT; */
/* ShowPLATO(splash,sizeof(splash)); */
/* NoEcho=padF; */
/* terminal_initial_position(); */
/* io_init(); */
running=true;
screen_show_dial();
screen_greeting();
/* screen_show_dial(); */
/* screen_greeting(); */
while (running==true)
{
keyboard_main();
io_main();
touch_main();
screen_main();
/* keyboard_main(); */
/* io_main(); */
/* touch_main(); */
}
io_done();
touch_done();
screen_done();
/* io_done(); */
/* touch_done(); */
/* screen_done(); */
}

View File

@ -1,6 +1,12 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <Quickdraw.h>
#include <MacMemory.h>
#include <Sound.h>
#include <Events.h>
#include <Fonts.h>
#include <NumberFormatting.h>
#include "screen.h"
#include "font.h"
#include "protocol.h"
@ -34,12 +40,54 @@ padRGB current_foreground_rgb_backup={255,255,255};
padRGB current_background_rgb_backup={0,0,0};
int highest_color_index_backup;
unsigned char help_active=false;
Rect screenRect;
BitMap globalBitmap;
WindowPtr win;
EventRecord theEvent;
unsigned char is_mono=true;
SysEnvRec environment;
Handle menuBar;
/**
* screen_init() - Set up the screen
*/
void screen_init(void)
{
InitGraf(&qd.thePort);
InitFonts();
InitWindows();
InitMenus();
screenRect=qd.screenBits.bounds;
SetRect(&screenRect,screenRect.left+5,screenRect.top+45,screenRect.left+517,screenRect.top+557);
if (SysEnvirons(1,&environment) == noErr)
is_mono=!environment.hasColorQD;
else
is_mono=true;
if (is_mono==true)
{
NewWindow(NULL, &screenRect, "\pPLATOTerm", true, 0, (WindowPtr)-1, false, 0);
}
else
{
NewCWindow(NULL, &screenRect, "\pColor PLATOTerm", true, 0, (WindowPtr)-1, false, 0);
}
SetPort(win);
screenRect=win->portRect;
}
/**
* screen_main(void)
*/
void screen_main(void)
{
SystemTask();
if (GetNextEvent(everyEvent,&theEvent))
{
}
}
/**

View File

@ -17,6 +17,11 @@
*/
void screen_init(void);
/**
* screen_main(void)
*/
void screen_main(void);
/**
* screen_update_colors() - Set the terminal colors
*/
@ -93,6 +98,11 @@ void screen_background(padRGB* theColor);
*/
void screen_paint(padPt* Coord);
/**
* screen_show_status(msg)
*/
void screen_show_status(unsigned char* msg);
/**
* screen_show_baud_rate - Show baud rate
*/