mirror of
https://github.com/tschak909/platotermClassicMac.git
synced 2025-01-15 15:30:39 +00:00
Open a window. Get initial resource file dropped in.
This commit is contained in:
parent
7ee21c7d1a
commit
e0725ee975
@ -8,6 +8,7 @@
|
|||||||
cmake_minimum_required(VERSION 2.8)
|
cmake_minimum_required(VERSION 2.8)
|
||||||
|
|
||||||
add_application(PLATOTERM
|
add_application(PLATOTERM
|
||||||
|
PLATOTERM.r
|
||||||
help.c
|
help.c
|
||||||
io.c
|
io.c
|
||||||
keyboard.c
|
keyboard.c
|
||||||
|
1
PLATOTERM.r
Executable file
1
PLATOTERM.r
Executable 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
31
main.c
@ -16,23 +16,24 @@ unsigned char running=false;
|
|||||||
void main(void)
|
void main(void)
|
||||||
{
|
{
|
||||||
screen_init();
|
screen_init();
|
||||||
touch_init();
|
/* touch_init(); */
|
||||||
help_init();
|
/* help_init(); */
|
||||||
NoEcho=padT;
|
/* NoEcho=padT; */
|
||||||
ShowPLATO(splash,sizeof(splash));
|
/* ShowPLATO(splash,sizeof(splash)); */
|
||||||
NoEcho=padF;
|
/* NoEcho=padF; */
|
||||||
terminal_initial_position();
|
/* terminal_initial_position(); */
|
||||||
io_init();
|
/* io_init(); */
|
||||||
running=true;
|
running=true;
|
||||||
screen_show_dial();
|
/* screen_show_dial(); */
|
||||||
screen_greeting();
|
/* screen_greeting(); */
|
||||||
while (running==true)
|
while (running==true)
|
||||||
{
|
{
|
||||||
keyboard_main();
|
screen_main();
|
||||||
io_main();
|
/* keyboard_main(); */
|
||||||
touch_main();
|
/* io_main(); */
|
||||||
|
/* touch_main(); */
|
||||||
}
|
}
|
||||||
io_done();
|
/* io_done(); */
|
||||||
touch_done();
|
/* touch_done(); */
|
||||||
screen_done();
|
/* screen_done(); */
|
||||||
}
|
}
|
||||||
|
48
screen.c
48
screen.c
@ -1,6 +1,12 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.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 "screen.h"
|
||||||
#include "font.h"
|
#include "font.h"
|
||||||
#include "protocol.h"
|
#include "protocol.h"
|
||||||
@ -34,12 +40,54 @@ padRGB current_foreground_rgb_backup={255,255,255};
|
|||||||
padRGB current_background_rgb_backup={0,0,0};
|
padRGB current_background_rgb_backup={0,0,0};
|
||||||
int highest_color_index_backup;
|
int highest_color_index_backup;
|
||||||
unsigned char help_active=false;
|
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
|
* screen_init() - Set up the screen
|
||||||
*/
|
*/
|
||||||
void screen_init(void)
|
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))
|
||||||
|
{
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
10
screen.h
10
screen.h
@ -17,6 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
void screen_init(void);
|
void screen_init(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* screen_main(void)
|
||||||
|
*/
|
||||||
|
void screen_main(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* screen_update_colors() - Set the terminal colors
|
* screen_update_colors() - Set the terminal colors
|
||||||
*/
|
*/
|
||||||
@ -93,6 +98,11 @@ void screen_background(padRGB* theColor);
|
|||||||
*/
|
*/
|
||||||
void screen_paint(padPt* Coord);
|
void screen_paint(padPt* Coord);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* screen_show_status(msg)
|
||||||
|
*/
|
||||||
|
void screen_show_status(unsigned char* msg);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* screen_show_baud_rate - Show baud rate
|
* screen_show_baud_rate - Show baud rate
|
||||||
*/
|
*/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user