diff --git a/pkg/Templates/Apple IIgs/ORCAC Classic Desk Accessory.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAC Classic Desk Accessory.xctemplate/TemplateInfo.plist
index e47722c..a9001ab 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Classic Desk Accessory.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAC Classic Desk Accessory.xctemplate/TemplateInfo.plist
@@ -170,6 +170,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/TemplateInfo.plist
index 4d1815e..68ba9d2 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/TemplateInfo.plist
@@ -182,6 +182,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/main.h b/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/main.h
index 0ba70f5..4aaad7b 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/main.h
+++ b/pkg/Templates/Apple IIgs/ORCAC Control Panel.xctemplate/main.h
@@ -7,8 +7,8 @@
*
*/
-#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
-#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
+#ifndef _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
+#define _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
#define CDEV_RESOURCE 0x1
@@ -16,4 +16,4 @@
#define HELP_RESOURCE 0x101
-#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */
+#endif /* defined(_GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____) */
diff --git a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/TemplateInfo.plist
index bc5009c..3bfb740 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/TemplateInfo.plist
@@ -182,6 +182,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.c b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.c
index 2c8685e..2f1f5c1 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.c
+++ b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.c
@@ -8,7 +8,8 @@
*/
-#include
+#include
+#include
#include
#include
#include
@@ -21,6 +22,7 @@
BOOLEAN done;
EventRecord myEvent;
+unsigned int userid;
void DoAbout(void)
@@ -99,8 +101,12 @@ void InitMenus(void)
int main(void)
{
int event;
+ Ref toolStartupRef;
+
+ userid = MMStartUp();
+ TLStartUp();
+ toolStartupRef = StartUpTools(userid, refIsResource, toolStartup);
- startdesk(640);
InitMenus();
InitCursor();
@@ -118,6 +124,9 @@ int main(void)
break;
}
}
- enddesk();
+
+ ShutDownTools(refIsHandle, toolStartupRef);
+ TLShutDown();
+ MMShutDown(userid);
}
diff --git a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.h b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.h
index a7b42f9..18e9773 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.h
+++ b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.h
@@ -7,8 +7,8 @@
*
*/
-#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
-#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
+#ifndef _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
+#define _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
#define menuBar 1
@@ -34,5 +34,7 @@
#define windowRes 1001
+#define toolStartup 1
-#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */
+
+#endif /* defined(_GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____) */
diff --git a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.rez b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.rez
index 46be5fd..8481352 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.rez
+++ b/pkg/Templates/Apple IIgs/ORCAC Desktop Application.xctemplate/main.rez
@@ -187,21 +187,45 @@ resource rAlertString (aboutAlertString) {
resource rWindParam1 (windowRes) {
- $DDA5, /* wFrameBits */
- nil, /* wTitle */
- 0, /* wRefCon */
- {0, 0, 0, 0}, /* ZoomRect */
- nil, /* wColor ID */
- {0, 0}, /* Origin */
- {1, 1}, /* data size */
- {0, 0}, /* max height-width */
- {8, 8}, /* scroll ver hors */
- {0, 0}, /* page ver horiz */
- 0, /* winfoRefCon */
- 10, /* wInfoHeight */
- {30, 10, 183, 602}, /* wposition */
- infront, /* wPlane */
- nil, /* wStorage */
- $0000 /* wInVerb */
+ $DDA5, /* wFrameBits */
+ nil, /* wTitle */
+ 0, /* wRefCon */
+ {0, 0, 0, 0}, /* ZoomRect */
+ nil, /* wColor ID */
+ {0, 0}, /* Origin */
+ {1, 1}, /* data size */
+ {0, 0}, /* max height-width */
+ {8, 8}, /* scroll ver hors */
+ {0, 0}, /* page ver horiz */
+ 0, /* winfoRefCon */
+ 10, /* wInfoHeight */
+ {30, 10, 183, 602}, /* wposition */
+ infront, /* wPlane */
+ nil, /* wStorage */
+ $0000 /* wInVerb */
};
+
+resource rToolStartup (toolStartup) {
+ mode640,
+ {
+ 3,$0100, /* Misc Tool */
+ 4,$0100, /* Quickdraw */
+ 5,$0100, /* Desk Manager */
+ 6,$0100, /* Event Manager */
+ 11,$0100, /* Int Math */
+ 14,$0300, /* Window Manager */
+ 15,$0300, /* Menu Manager */
+ 16,$0300, /* Control Manager */
+ 18,$0200, /* QD Aux */
+ 19,$0100, /* Print Manager */
+ 20,$0100, /* LineEdit Tool */
+ 21,$0100, /* Dialog Manager */
+ 22,$0100, /* Scrap Manager */
+ 23,$0100, /* Standard File */
+ 27,$0100, /* Font Manager */
+ 28,$0100, /* List Manager */
+ 30,$0100, /* Resource Manager */
+ 34,$0100 /* TextEdit */
+ }
+};
diff --git a/pkg/Templates/Apple IIgs/ORCAC GNO Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAC GNO Shell Command.xctemplate/TemplateInfo.plist
index 2744f21..439e0cd 100644
--- a/pkg/Templates/Apple IIgs/ORCAC GNO Shell Command.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAC GNO Shell Command.xctemplate/TemplateInfo.plist
@@ -138,6 +138,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/TemplateInfo.plist
index 54f3b18..d9f22ed 100644
--- a/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/TemplateInfo.plist
@@ -182,6 +182,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.c b/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.c
index 3234d04..9efc8be 100644
--- a/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.c
+++ b/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.c
@@ -28,7 +28,6 @@
static BOOLEAN ndaActive;
static GrafPortPtr winPtr;
static unsigned int userId;
-static unsigned int resourceId;
void NDAClose(void)
@@ -39,7 +38,6 @@ void NDAClose(void)
ndaActive = FALSE;
}
- CloseResourceFile(resourceId);
ResourceShutDown();
}
diff --git a/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.h b/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.h
index 1d030cf..7e8bdb1 100644
--- a/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.h
+++ b/pkg/Templates/Apple IIgs/ORCAC New Desk Accessory.xctemplate/main.h
@@ -7,8 +7,8 @@
*
*/
-#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
-#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
+#ifndef _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
+#define _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
#define linedColors 1
@@ -16,4 +16,4 @@
#define windowRes 1001
-#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */
+#endif /* defined(_GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____) */
diff --git a/pkg/Templates/Apple IIgs/ORCAC Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAC Shell Command.xctemplate/TemplateInfo.plist
index a01b368..7970286 100644
--- a/pkg/Templates/Apple IIgs/ORCAC Shell Command.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAC Shell Command.xctemplate/TemplateInfo.plist
@@ -138,6 +138,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAM Classic Desk Accessory.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAM Classic Desk Accessory.xctemplate/TemplateInfo.plist
index 2094a13..04c4d47 100644
--- a/pkg/Templates/Apple IIgs/ORCAM Classic Desk Accessory.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAM Classic Desk Accessory.xctemplate/TemplateInfo.plist
@@ -170,6 +170,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAM Control Panel.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAM Control Panel.xctemplate/TemplateInfo.plist
index 18699ef..54c7b22 100644
--- a/pkg/Templates/Apple IIgs/ORCAM Control Panel.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAM Control Panel.xctemplate/TemplateInfo.plist
@@ -176,6 +176,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/TemplateInfo.plist
new file mode 100644
index 0000000..4aa7b7e
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/TemplateInfo.plist
@@ -0,0 +1,211 @@
+
+
+
+
+ Nodes
+
+ main.s
+ main.rez
+ Makefile
+ make/config.txt
+ make/createDiskImage
+ make/head.mk
+ make/launchEmulator
+ make/orca-asm
+ make/orca-cc
+ make/orca-macgen
+ make/orca-rez
+ make/system601.2mg
+ make/tail.mk
+ ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme
+
+ Definitions
+
+ main.s
+
+ Path
+ main.s
+
+ main.rez
+
+ Path
+ main.rez
+
+ make/config.txt
+
+ Group
+ make
+ Path
+ make/config.txt
+
+ make/createDiskImage
+
+ Group
+ make
+ Path
+ make/createDiskImage
+
+ make/head.mk
+
+ Group
+ make
+ Path
+ make/head.mk
+
+ make/launchEmulator
+
+ Group
+ make
+ Path
+ make/launchEmulator
+
+ 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/system601.2mg
+
+ Group
+ make
+ Path
+ make/system601.2mg
+
+ make/tail.mk
+
+ Group
+ make
+ Path
+ make/tail.mk
+
+ Makefile
+
+ Path
+ Makefile
+
+ ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme
+
+ Group
+
+ Supporting Files
+
+ Path
+ ___PACKAGENAME___.xcscheme
+
+
+ Kind
+ Xcode.Xcode3.ProjectTemplateUnitKind
+ Identifier
+ com.halcyontouch.apple2gsOrcaMDesktopApp
+ Ancestors
+
+ com.apple.dt.unit.externalBuildSystem
+
+ Concrete
+
+ Description
+ This template creates an Apple IIgs ORCA/M code project to build desktop application. The project starts with a single assembly 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
+
+
+
+
+ ProductType
+ com.apple.product-type.tool
+ TargetIdentifier
+ com.apple.dt.commandLineToolTarget
+ Name
+ doNotBuild
+ SharedSettings
+
+ PRODUCT_NAME
+ doNotBuild
+ GCC_PREPROCESSOR_DEFINITIONS
+ inline(X,Y)=""
+ extended=double
+ pascal=""
+ HEADER_SEARCH_PATHS
+ $GOLDEN_GATE/Libraries/ORCACDefs
+ ~/Library/GoldenGate/Libraries/ORCACDefs
+ /Library/GoldenGate/Libraries/ORCACDefs
+ ~/GoldenGate/Libraries/ORCACDefs
+
+ BuildPhases
+
+
+ Class
+ Sources
+
+
+ Class
+ Frameworks
+
+
+ Class
+ CopyFiles
+ DstPath
+ /usr/share/man/man1/
+ DstSubfolderSpec
+ 0
+ RunOnlyForDeploymentPostprocessing
+ YES
+
+
+
+
+
+
diff --git a/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/___PACKAGENAME___.xcscheme
new file mode 100644
index 0000000..61815a2
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/___PACKAGENAME___.xcscheme
@@ -0,0 +1,98 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/main.rez b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/main.rez
new file mode 100644
index 0000000..74a2b70
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/main.rez
@@ -0,0 +1,256 @@
+/*
+ * ___FILENAME___
+ * ___PROJECTNAME___
+ *
+ * Created by ___FULLUSERNAME___ on ___DATE___.
+ * ___COPYRIGHT___
+ */
+
+
+#include "types.rez"
+
+
+#define menuBar 1
+
+#define appleMenu 3
+#define fileMenu 4
+#define editMenu 5
+
+#define editUndo 250
+#define editCut 251
+#define editCopy 252
+#define editPaste 253
+#define editClear 254
+
+#define fileNew 401
+#define fileOpen 402
+#define fileClose 255
+#define fileQuit 256
+
+#define appleAbout 301
+
+#define aboutAlertString 1
+
+#define windowRes 1001
+
+#define toolStartup 1
+
+
+resource rMenuBar (menuBar) {
+ {
+ appleMenu,
+ fileMenu,
+ editMenu
+ };
+};
+
+
+resource rMenu (appleMenu) {
+ appleMenu,
+ refIsResource * menuTitleRefShift
+ + refIsResource * itemRefShift
+ + fAllowCache,
+ appleMenu,
+ {
+ appleAbout
+ };
+};
+
+
+resource rMenu (fileMenu) {
+ fileMenu,
+ refIsResource * menuTitleRefShift
+ + refIsResource * itemRefShift
+ + fAllowCache,
+ fileMenu,
+ {
+ fileNew,
+ fileOpen,
+ fileClose,
+ fileQuit
+ };
+};
+
+
+resource rMenu (editMenu) {
+ editMenu,
+ refIsResource * menuTitleRefShift
+ + refIsResource * itemRefShift
+ + fAllowCache,
+ editMenu,
+ {
+ editUndo,
+ editCut,
+ editCopy,
+ editPaste,
+ editClear
+ };
+};
+
+
+resource rMenuItem (editUndo) {
+ editUndo,
+ "Z", "z",
+ 0,
+ refIsResource * itemTitleRefShift
+ + fDivider,
+ editUndo
+};
+
+
+resource rMenuItem (editCut) {
+ editCut,
+ "X", "x",
+ 0,
+ refIsResource * itemTitleRefShift,
+ editCut
+};
+
+
+resource rMenuItem (editCopy) {
+ editCopy,
+ "C", "c",
+ 0,
+ refIsResource * itemTitleRefShift,
+ editCopy
+};
+
+
+resource rMenuItem (editPaste) {
+ editPaste,
+ "V", "v",
+ 0,
+ refIsResource * itemTitleRefShift,
+ editPaste
+};
+
+
+resource rMenuItem (editClear) {
+ editClear,
+ "", "",
+ 0,
+ refIsResource * itemTitleRefShift,
+ editClear
+};
+
+
+resource rMenuItem (fileNew) {
+ fileNew,
+ "N", "n",
+ 0,
+ refIsResource * itemTitleRefShift,
+ fileNew
+};
+
+
+resource rMenuItem (fileOpen) {
+ fileOpen,
+ "O", "o",
+ 0,
+ refIsResource * itemTitleRefShift
+ + fDivider,
+ fileOpen
+};
+
+
+resource rMenuItem (fileClose) {
+ fileClose,
+ "W", "w",
+ 0,
+ refIsResource * itemTitleRefShift
+ + fDivider,
+ fileClose
+};
+
+
+resource rMenuItem (fileQuit) {
+ fileQuit,
+ "Q", "q",
+ 0,
+ refIsResource * itemTitleRefShift,
+ fileQuit
+};
+
+
+resource rMenuItem (appleAbout) {
+ appleAbout,
+ "", "",
+ 0,
+ refIsResource * itemTitleRefShift
+ + fDivider,
+ appleAbout
+};
+
+
+resource rPString (appleMenu, noCrossBank) {"@"};
+resource rPString (fileMenu, noCrossBank) {" File "};
+resource rPString (editMenu, noCrossBank) {" Edit "};
+
+resource rPString (editUndo, noCrossBank) {"Undo"};
+resource rPString (editCut, noCrossBank) {"Cut"};
+resource rPString (editCopy, noCrossBank) {"Copy"};
+resource rPString (editPaste, noCrossBank) {"Paste"};
+resource rPString (editClear, noCrossBank) {"Clear"};
+
+resource rPString (fileNew, noCrossBank) {"New"};
+resource rPString (fileOpen, noCrossBank) {"Open"};
+resource rPString (fileClose, noCrossBank) {"Close"};
+resource rPString (fileQuit, noCrossBank) {"Quit"};
+
+resource rPString (appleAbout, noCrossBank) {"About ___PROJECTNAME___..."};
+
+
+resource rAlertString (aboutAlertString) {
+ "43/"
+ "___PROJECTNAME___\n"
+ " by ___FULLUSERNAME___\n"
+ "\n"
+ "Contains libraries from ORCA M,\n"
+ "Copyright 1991, Byte Works Inc."
+ "/^#0\$00";
+};
+
+
+resource rWindParam1 (windowRes) {
+ $DDA5, /* wFrameBits */
+ nil, /* wTitle */
+ 0, /* wRefCon */
+ {0, 0, 0, 0}, /* ZoomRect */
+ nil, /* wColor ID */
+ {0, 0}, /* Origin */
+ {1, 1}, /* data size */
+ {0, 0}, /* max height-width */
+ {8, 8}, /* scroll ver hors */
+ {0, 0}, /* page ver horiz */
+ 0, /* winfoRefCon */
+ 10, /* wInfoHeight */
+ {30, 10, 183, 602}, /* wposition */
+ infront, /* wPlane */
+ nil, /* wStorage */
+ $0000 /* wInVerb */
+};
+
+
+resource rToolStartup (toolStartup) {
+ mode640,
+ {
+ 3,$0100, /* Misc Tool */
+ 4,$0100, /* Quickdraw */
+ 5,$0100, /* Desk Manager */
+ 6,$0100, /* Event Manager */
+ 11,$0100, /* Int Math */
+ 14,$0300, /* Window Manager */
+ 15,$0300, /* Menu Manager */
+ 16,$0300, /* Control Manager */
+ 18,$0200, /* QD Aux */
+ 19,$0100, /* Print Manager */
+ 20,$0100, /* LineEdit Tool */
+ 21,$0100, /* Dialog Manager */
+ 22,$0100, /* Scrap Manager */
+ 23,$0100, /* Standard File */
+ 27,$0100, /* Font Manager */
+ 28,$0100, /* List Manager */
+ 30,$0100, /* Resource Manager */
+ 34,$0100 /* TextEdit */
+ }
+};
diff --git a/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/main.s b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/main.s
new file mode 100644
index 0000000..53c5780
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/ORCAM Desktop Application.xctemplate/main.s
@@ -0,0 +1,258 @@
+;
+; ___FILENAME___
+; ___PACKAGENAME___
+;
+; Created by ___FULLUSERNAME___ on ___DATE___.
+; Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
+;
+
+ mcopy main.macros
+ keep main
+
+
+menuBar gequ 1
+
+appleMenu gequ 3
+fileMenu gequ 4
+editMenu gequ 5
+
+editUndo gequ 250
+editCut gequ 251
+editCopy gequ 252
+editPaste gequ 253
+editClear gequ 254
+
+fileNew gequ 401
+fileOpen gequ 402
+fileClose gequ 255
+fileQuit gequ 256
+
+appleAbout gequ 301
+
+aboutAlertString gequ 1
+
+windowRes gequ 1001
+
+toolStartup gequ 1
+
+refIsHandle gequ 1
+refIsResource gequ 2
+
+wInMenuBar gequ $11
+wInGoAway gequ $16
+wInSpecial gequ $19
+
+
+
+main start
+
+ phb
+ phk
+ plb
+
+ pha
+ ~MMStartUp
+ pl2 userid
+
+ ~TLStartUp
+
+ pha
+ pha
+ lda userid
+ pha userid
+ pea refIsResource
+ ~StartUpTools *,*,#toolStartup
+ pl4 toolStartupRef
+
+ jsl InitMenus
+ ~InitCursor
+
+loop anop
+ pha
+ ~TaskMaster #$ffff,#eventRec
+ pla
+
+ cmp #wInMenuBar
+ bne notInMenuBar
+ jsl HandleMenu
+ bra loop
+
+notInMenuBar anop
+ cmp #wInSpecial
+ bne notInSpecial
+ jsl HandleMenu
+ bra loop
+
+notInSpecial anop
+ cmp #wInGoAway
+ bne notInGoAway
+; Put the low word of the grafport pointer to close in X and the high word in Y
+ ldx wmTaskData
+ ldy wmTaskData+2
+ jsl CloseDocument
+
+notInGoAway anop
+ bra loop
+
+
+InitMenus entry
+
+ pha
+ pha
+ ~NewMenuBar2 #refIsResource,#menuBar,#0
+ ~SetSysBar *
+ ~SetMenuBar #0
+ ~FixAppleMenu #appleMenu
+
+ pha
+ ~FixMenuBar
+ pla
+
+ ~DrawMenuBar
+
+ rtl
+
+
+HandleMenu entry
+; The low word of the wmTaskData has the menu item number
+ lda wmTaskData
+
+ cmp #appleAbout
+ bne notAbout
+ jsl DoAbout
+ bra menuDone
+
+notAbout anop
+ cmp #fileNew
+ bne notNew
+ jsl NewDocument
+ bra menuDone
+
+notNew anop
+ cmp #fileOpen
+ bne notOpen
+ jsl NewDocument
+ bra menuDone
+
+notOpen anop
+ cmp #fileClose
+ bne notClose
+ pha
+ pha
+ ~FrontWindow
+ plx
+ ply
+ jsl CloseDocument
+ bra menuDone
+
+notClose anop
+ cmp #fileQuit
+ bne notQuit
+ jsl DoQuit
+ bra menuDone
+
+notQuit anop
+ cmp #editUndo
+ bne notUndo
+; Handle undo here
+ bra menuDone
+
+notUndo anop
+ cmp #editCut
+ bne notCut
+; Handle cut here
+ bra menuDone
+
+notCut anop
+ cmp #editCopy
+ bne notCopy
+; Handle copy here
+ bra menuDone
+
+notCopy anop
+ cmp #editPaste
+ bne notPaste
+; Handle paste here
+ bra menuDone
+
+notPaste anop
+ cmp #editClear
+ bne notClear
+; Handle clear here
+ bra menuDone
+
+notClear anop
+menuDone anop
+ pea $0000
+ lda wmTaskData+2
+ pha
+ ~HiliteMenu *,*
+
+ rtl
+
+
+CloseDocument entry
+; X has the low word of the grafport pointer, Y has the high word
+ phy
+ phx
+ ~CloseWindow *
+
+ rtl
+
+
+NewDocument entry
+ pha
+ pha
+ ~NewWindow2 #winName,#0,#0,#0,#2,#windowRes,#$800E
+ pla
+ pla
+
+ rtl
+
+
+DoAbout entry
+ pha
+ ~AlertWindow #4,#0,#aboutAlertString
+ pla
+ rtl
+
+
+DoQuit entry
+
+ ~ShutDownTools #refIsHandle,toolStartupRef
+ ~TLShutDown
+ ~MMShutDown userid
+
+ plb
+
+ _quitGS quitDCB
+ rtl
+
+; Global data
+
+userid dc i2'0'
+toolStartupRef dc i4'0'
+winName dw 'MyWindow'
+
+eventRec anop
+what dc i2'0'
+message dc i4'0'
+when dc i4'0'
+where_vert dc i2'0'
+where_horiz dc i2'0'
+modifiers dc i2'0'
+wmTaskData dc i4'0'
+wmTaskMask dc i4'$001f7fff'
+wmLastClickTick dc i4'0'
+wmClickCount dc i2'0'
+wmTaskData2 dc i4'0'
+wmTaskData3 dc i4'0'
+wmTaskData4 dc i4'0'
+wmLastClickPt_vert dc i2'0'
+wmLastClickPt_horiz dc i2'0'
+
+; Used by doQuit
+quitDCB dc i2'0'
+
+ end
+
diff --git a/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/TemplateInfo.plist
index 72ae7b0..f25db01 100644
--- a/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/TemplateInfo.plist
@@ -176,6 +176,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/main.s b/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/main.s
index 2822d60..f18bf5a 100644
--- a/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/main.s
+++ b/pkg/Templates/Apple IIgs/ORCAM New Desk Accessory.xctemplate/main.s
@@ -11,6 +11,21 @@
windowRes gequ 1001
+eventAction gequ $0001
+runAction gequ $0002
+cursorAction gequ $0003
+undoAction gequ $0005
+cutAction gequ $0006
+copyAction gequ $0007
+pasteAction gequ $0008
+clearAction gequ $0009
+
+updateEvt gequ $0006
+wInControl gequ $0021
+keyDownEvt gequ $0003
+autoKeyEvt gequ $0005
+
+
main start
dc i4'NDAOpen' ; Open callback
dc i4'NDAClose' ; Close callback
@@ -92,7 +107,7 @@ DrawContents entry
~PenNormal
~MoveTo #7,#10
- ~DrawString #message
+ ~DrawString #messageStr
plb
@@ -113,7 +128,6 @@ NDAClose entry
stz ndaActive
closeNotActive anop
- ~CloseResourceFile resourceId
~ResourceShutdown
plb
@@ -125,27 +139,27 @@ NDAAction entry
phk
plb
- cmp #1
+ cmp #eventAction
bne notEvent
jsl HandleEvent
bra actionDone
notEvent anop
- cmp #2
+ cmp #runAction
bne notRun
jsl HandleRun
bra actionDone
notRun anop
- cmp #3
+ cmp #cursorAction
bne notCursor
jsl HandleCursor
bra actionDone
notCursor anop
- cmp #5
+ cmp #undoAction
blt notEdit
- cmp #10
+ cmp #clearAction+1
bge notEdit
jsl HandleEdit
lda #1
@@ -182,17 +196,11 @@ HandleEvent entry
lda #15 ; Copy 16 bytes
moveIns mvn 0,0
-; Set the wmTaskData field to $1fffff
- lda #$ffff
- sta localEvent+20
- lda #$001f
- sta localEvent+22
-
pha
~TaskMasterDA 0,#localEvent
pla
- cmp #$6
+ cmp #updateEvt
bne notUpdate
~BeginUpdate winPtr
jsl DrawContents
@@ -200,15 +208,15 @@ moveIns mvn 0,0
bra eventDone
notUpdate anop
- cmp #$21
+ cmp #wInControl
bne notControl
jsl HandleControl
bra eventDone
notControl anop
- cmp #$3
+ cmp #keyDownEvt
beq isKey
- cmp #$5
+ cmp #autoKeyEvt
beq isKey
eventDone anop
@@ -266,9 +274,8 @@ initReturn anop
ndaActive dc i2'0'
winPtr dc i4'0'
userId dc i2'0'
-resourceId dc i2'0'
winName dw ' ___PACKAGENAME___ '
-message dw 'Hello, world!'
+messageStr dw 'Hello, world!'
; Used by NDAOpen to access resources
oldResApp dc i2'0'
@@ -283,6 +290,22 @@ prefsDCB dc i2'1' ; GSOS control block to get/set preferences
prefs dc i2'0'
; Used by HandleEvent
-localEvent ds 46
+localEvent anop
+what dc i2'0'
+message dc i4'0'
+when dc i4'0'
+where_vert dc i2'0'
+where_horiz dc i2'0'
+modifiers dc i2'0'
+wmTaskData dc i4'0'
+wmTaskMask dc i4'$001fffff'
+wmLastClickTick dc i4'0'
+wmClickCount dc i2'0'
+wmTaskData2 dc i4'0'
+wmTaskData3 dc i4'0'
+wmTaskData4 dc i4'0'
+wmLastClickPt_vert dc i2'0'
+wmLastClickPt_horiz dc i2'0'
+
end
diff --git a/pkg/Templates/Apple IIgs/ORCAM Shell Command.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/ORCAM Shell Command.xctemplate/TemplateInfo.plist
index d4d23eb..104c71e 100644
--- a/pkg/Templates/Apple IIgs/ORCAM Shell Command.xctemplate/TemplateInfo.plist
+++ b/pkg/Templates/Apple IIgs/ORCAM Shell Command.xctemplate/TemplateInfo.plist
@@ -138,6 +138,7 @@
doNotBuild
GCC_PREPROCESSOR_DEFINITIONS
inline(X,Y)=""
+ extended=double
pascal=""
HEADER_SEARCH_PATHS
$GOLDEN_GATE/Libraries/ORCACDefs
diff --git a/pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.h b/pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.h
index db8ba8c..74d3b10 100644
--- a/pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.h
+++ b/pkg/Templates/File Templates/Apple IIgs/Rez File.xctemplate/WithHeader/___FILEBASENAME___.h
@@ -6,9 +6,9 @@
* ___COPYRIGHT___
*/
-#ifndef _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
-#define _____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____
+#ifndef _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
+#define _GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____
-#endif /* defined(_____PROJECTNAMEASIDENTIFIER________FILEBASENAMEASIDENTIFIER_____) */
+#endif /* defined(_GUARD_PROJECT___PROJECTNAMEASIDENTIFIER____FILE___FILEBASENAMEASIDENTIFIER____) */
diff --git a/pkg/createPackage b/pkg/createPackage
index 50c3a9c..9a2c0d6 100755
--- a/pkg/createPackage
+++ b/pkg/createPackage
@@ -14,6 +14,7 @@ cda:orca:ORCAM Classic Desk Accessory
cdev:orca:ORCAC Control Panel
cdev:orca:ORCAM Control Panel
desktop:orca:ORCAC Desktop Application
+desktop:orca:ORCAM Desktop Application
shell:gno:ORCAC GNO Shell Command
nda:orca:ORCAC New Desk Accessory
nda:orca:ORCAM New Desk Accessory