diff --git a/make/orca-macgen b/make/orca-macgen new file mode 100755 index 0000000..6afcdc8 --- /dev/null +++ b/make/orca-macgen @@ -0,0 +1,50 @@ +#!/bin/bash + +TMPFILE=/tmp/orca-macgen.$$ + +MACGENFLAGS="$1" +FILENAME="$2" +shift +shift + +if echo $FILENAME | grep -v '\.s$' > /dev/null +then + echo Expected second argument to be a *.s file but got $FILENAME + exit 1 +fi + +BASENAME=`echo $FILENAME | sed 's/\.s$//'` +MACROSNAME="${BASENAME}.macros" +DEPSNAME="${MACROSNAME}.d" + +$ORCA --trace-gsos macgen $MACGENFLAGS "$FILENAME" $* < /dev/null 2> $TMPFILE +RESULT=$? + +sed '/^[A-Za-z][A-Za-z]*(.*)$/d' $TMPFILE >&2 + +if [ "$RESULT" -ne 0 ] +then + rm -f $TMPFILE + rm -f $MACROSNAME + exit $RESULT +fi + +DEPS=`awk ' + /^FastFileLoad/ { + sub(/^FastFileLoad\(/, ""); + sub(/\)$/, ""); + print}' $TMPFILE | sort -u | while read FILE + do + if [ -f "$FILE" ] + then + echo $FILE + fi + done | tr '\012' ' '` + +rm -f $TMPFILE + +cat > $DEPSNAME << EOF +$MACROSNAME: $DEPS +EOF + +exit 0 diff --git a/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/TemplateInfo.plist new file mode 100644 index 0000000..7b8675f --- /dev/null +++ b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/TemplateInfo.plist @@ -0,0 +1,132 @@ + + + + + Nodes + + main.c + main.h + main.rez + Makefile + make/head.mk + make/orca-asm + make/orca-cc + make/orca-macgen + make/orca-rez + make/tail.mk + + Definitions + + main.c + + Path + main.c + + main.h + + Path + main.h + + main.rez + + Path + main.rez + + make/head.mk + + Group + make + Path + make/head.mk + + make/orca-asm + + Group + make + Path + make/orca-asm + + make/orca-cc + + Group + make + Path + make/orca-cc + + make/orca-macgen + + Group + make + Path + make/orca-macgen + + make/orca-rez + + Group + make + Path + make/orca-rez + + make/tail.mk + + Group + make + Path + make/tail.mk + + Makefile + + Path + Makefile + + + Kind + Xcode.Xcode3.ProjectTemplateUnitKind + Identifier + com.halcyontouch.apple2gsCCDev + Ancestors + + com.apple.dt.unit.externalBuildSystem + + Concrete + + Description + This template creates an Apple IIgs C code project to build a control panel. The project starts with a single C file which you can modify. You can also add more assembly or C files as you may like. + Options + + Targets + + + TargetType + Legacy + TargetIdentifier + com.apple.dt.cocoaLegacyTarget + BuildToolPath + ___VARIABLE_buildToolPath___ + BuildToolArgsString + -C ___PACKAGENAME___ $(ACTION) + SharedSettings + + OTHER_CFLAGS + + OTHER_LDFLAGS + + + Configurations + + Debug + + DEBUGGING_SYMBOLS + YES + GCC_GENERATE_DEBUGGING_SYMBOLS + YES + GCC_OPTIMIZATION_LEVEL + 0 + + Release + + + + + + diff --git a/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.c b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.c new file mode 100644 index 0000000..139d50a --- /dev/null +++ b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.c @@ -0,0 +1,177 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + + +#pragma cdev entry + +#include +#include +#include +#include + +#include "main.h" + + +/* CDev Message Numbers + * (Why aren't these in an include file somewhere?) + * Check out FTN.C7.XXXX in the file type tech notes for + * more information about CDevs. + */ +#define machineCDev 1 +#define bootCDev 2 +#define reservedCDev 3 +#define initCDev 4 +#define closeCDev 5 +#define eventsCDev 6 +#define createCDev 7 +#define aboutCDev 8 +#define rectCDev 9 +#define hitCDev 10 +#define runCDev 11 +#define editCDev 12 + + + +long doMachine(void) +{ + /* Return non-zero if you cannot be opened on this machine + * (and maybe display an alert explaining why). + */ + return 1; +} + + +void doBoot(int *flag) +{ + /* Set bit 0 to 1 in flag if you want to draw at X through + * the icon at boot time to indicate that this CDev will not + * load. + */ + +#if 0 + /* Enable this line to set bit 0 to 1. */ + *flag |= 1; +#endif +} + + +void doInit(GrafPortPtr windowPtr) +{ +} + + +void doClose(GrafPortPtr windowPtr) +{ +} + + +void doEvents(GrafPortPtr windowPtr, EventRecord *eventPtr) +{ +} + + +void doAbout(GrafPortPtr windowPtr) +{ + NewControl2(windowPtr, resourceToResource, HELP_RESOURCE); +} + + +void doCreate(GrafPortPtr windowPtr) +{ + NewControl2(windowPtr, resourceToResource, MAIN_RESOURCE); +} + + +void doRect(Rect *rectPtr) +{ +} + + +void doHit(Handle controlHandle, long controlID) +{ +} + + +void doRun(GrafPortPtr windowPtr) +{ +} + + +void doEdit(GrafPortPtr windowPtr, int action) +{ + switch (action) { + case undoAction: + break; + + case cutAction: + break; + + case copyAction: + break; + + case pasteAction: + break; + + case clearAction: + break; + } +} + + +long entry(long data2, long data1, int message) + +{ + GrafPortPtr windowPtr = (void *) data1; + + switch (message) { + case machineCDev: + return doMachine(); + + case bootCDev: + doBoot((int *)data1); + break; + + case initCDev: + doInit((GrafPortPtr)data1); + break; + + case closeCDev: + doClose((GrafPortPtr)data1); + break; + + case eventsCDev: + doEvents((GrafPortPtr)data2, (EventRecord *)data1); + break; + + case createCDev: + doCreate((GrafPortPtr)data1); + break; + + case aboutCDev: + doAbout((GrafPortPtr)data1); + break; + + case rectCDev: + doRect((Rect *)data1); + break; + + case hitCDev: + doHit((Handle)data1, data2); + break; + + case runCDev: + doRun((GrafPortPtr)data1); + break; + + case editCDev: + doEdit((GrafPortPtr)data2, (int)(data1 & 0xffff)); + break; + } + return 1; +} diff --git a/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.h b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.h new file mode 100644 index 0000000..0ba70f5 --- /dev/null +++ b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.h @@ -0,0 +1,19 @@ +/* + * ___FILENAME___ + * ___PACKAGENAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved. + * + */ + +#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ +#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____ + + +#define CDEV_RESOURCE 0x1 +#define MAIN_RESOURCE 0x100 +#define HELP_RESOURCE 0x101 + + +#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */ diff --git a/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.rez b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.rez new file mode 100644 index 0000000..3bf09c5 --- /dev/null +++ b/pkg/Templates/Apple IIgs/Control Panel in C.xctemplate/main.rez @@ -0,0 +1,130 @@ +/* + * ___FILENAME___ + * ___PROJECTNAME___ + * + * Created by ___FULLUSERNAME___ on ___DATE___. + * ___COPYRIGHT___ + */ + + +#include "types.rez" + +#include "___FILEBASENAME___.h" + + +/* This is the required resource to tell the control panel about the CDev */ +resource rCDEVFlags (CDEV_RESOURCE) { + 0x00C0, /* This sets the wantCreate and wantAbout bits */ + /* Set more bits if you want other messages */ + 1, + 1, + 1, + 0, + {0, 0, 110, 200}, + "___PROJECTNAME___", + "___FULLUSERNAME___", + "1.0" +}; + + +/* Code resource; the executable part of the CDev */ +read rCDevCode (CDEV_RESOURCE,convert) "___PROJECTNAME___.bin"; + + +/* This is the icon displayed by the control panel */ +resource rIcon (CDEV_RESOURCE) { + 0x8000, /* color icon */ + 20, /* height in pixels */ + 28, /* width in pixels */ + $"FFFFFFFFFFFFFFFFFFFFFFFFFFFF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FF888888888888888888888888FF" + $"FFFFFFFFFFFFFFFFFFFFFFFFFFFF", + + $"0000000000000000000000000000" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"00FFFFFFFFFFFFFFFFFFFFFFFF00" + $"0000000000000000000000000000" +}; + + +/* The following resources define the various controls in the main display */ +resource rControlList (MAIN_RESOURCE) { + { + MAIN_RESOURCE, + }; +}; + +resource rControlTemplate (MAIN_RESOURCE) { + 0x00000001, /* control id */ + {38,5,49,205}, /* control rectangle */ + statTextControl {{ /* control type */ + 0x0000, /* flags */ + 0x1002, /* more flags */ + 0, /* ref con */ + MAIN_RESOURCE, /* text reference */ + 13 /* text length */ + }}; +}; + + +resource rTextForLETextBox2 (MAIN_RESOURCE) { + "Hello, world!" +}; + +/* The following resources define the controls for the help screen */ +resource rControlList (HELP_RESOURCE) { + { + HELP_RESOURCE, + }; +}; + +resource rControlTemplate (HELP_RESOURCE) { + 0x00000002, /* control id */ + {38,5,49,205}, /* control rectangle */ + statTextControl {{ /* control type */ + 0x0000, /* flags */ + 0x1002, /* more flags */ + 0, /* ref con */ + HELP_RESOURCE, /* text reference */ + 19 /* text length */ + }}; +}; + +resource rTextForLETextBox2 (HELP_RESOURCE) { + "Put help info here." +}; +