diff --git a/make/tail.mk b/make/tail.mk
index ff999d5..5d4032b 100644
--- a/make/tail.mk
+++ b/make/tail.mk
@@ -161,6 +161,7 @@ $(BINTARGET): $(BUILD_OBJS)
# resources # also.
$(BINTARGET): $(BUILD_OBJS) $(ASM_SRCS)
$(MERLIN_BIN) -V $(MERLIN_LIB) linkscript.s
+ $(MV) $(PGM) $(BINTARGET)
endif
diff --git a/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/TemplateInfo.plist b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/TemplateInfo.plist
new file mode 100644
index 0000000..cb30819
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/TemplateInfo.plist
@@ -0,0 +1,209 @@
+
+
+
+
+ Nodes
+
+ main.s
+ linkscript.s
+ main.rez
+ Makefile
+ make/config.txt
+ make/createDiskImage
+ make/head.mk
+ make/launchEmulator
+ make/orca-asm
+ make/orca-cc
+ make/orca-rez
+ make/system601.2mg
+ make/tail.mk
+ ../___PACKAGENAME___.xcodeproj/xcshareddata/xcschemes/___PACKAGENAME___.xcscheme
+
+ Definitions
+
+ main.s
+
+ Path
+ main.s
+
+ linkscript.s
+
+ Path
+ linkscript.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-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.apple2gsMerlinCDev
+ Ancestors
+
+ com.apple.dt.unit.externalBuildSystem
+
+ Concrete
+
+ Description
+ This template creates an Apple IIgs Merlin code project to build a control panel. The project starts with a single assembly file which you can modify. You can also add more assembly 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/Merlin Control Panel.xctemplate/___PACKAGENAME___.xcscheme b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/___PACKAGENAME___.xcscheme
new file mode 100644
index 0000000..ef0c34f
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/___PACKAGENAME___.xcscheme
@@ -0,0 +1,110 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/linkscript.s b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/linkscript.s
new file mode 100644
index 0000000..55ac440
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/linkscript.s
@@ -0,0 +1,18 @@
+*
+* ___FILENAME___
+* ___PROJECTNAME___
+*
+* Created by ___FULLUSERNAME___ on ___DATE___.
+* ___COPYRIGHT___
+*
+
+ dsk ___PROJECTNAME___
+ typ $B9
+ xpl
+
+ asm main.s
+ ds 0
+ knd #$1100
+ ali None
+ LNA ___PROJECTNAME___.S16
+ sna main
diff --git a/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/main.rez b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/main.rez
new file mode 100644
index 0000000..1b40449
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/main.rez
@@ -0,0 +1,147 @@
+/*
+ * ___FILENAME___
+ * ___PROJECTNAME___
+ *
+ * Created by ___FULLUSERNAME___ on ___DATE___.
+ * ___COPYRIGHT___
+ */
+
+
+#include "types.rez"
+
+
+#define CDEV_RESOURCE 0x1
+#define MAIN_RESOURCE 0x100
+#define HELP_RESOURCE 0x101
+
+
+resource rVersion (1) {
+ {
+ 0, /* Major version number in BCD */
+ 1, /* Minor version number in BCD */
+ 0, /* Bug version number in BCD */
+ development,/* Development phase */
+ 0 /* Release number */
+ },
+ verUS,
+ "___PROJECTNAME___",
+ "Copyright \$A9 ___YEAR___ ___FULLUSERNAME___"
+};
+
+
+/* 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___",
+ "0.1"
+};
+
+
+/* Code resource; the executable part of the CDev */
+read rCDevCode (CDEV_RESOURCE,convert) BINTARGET;
+
+
+/* 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."
+};
+
diff --git a/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/main.s b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/main.s
new file mode 100644
index 0000000..34fded3
--- /dev/null
+++ b/pkg/Templates/Apple IIgs/Merlin Control Panel.xctemplate/main.s
@@ -0,0 +1,247 @@
+*
+* ___FILENAME___
+* ___PACKAGENAME___
+*
+* Created by ___FULLUSERNAME___ on ___DATE___.
+* Copyright (c) ___YEAR___ ___ORGANIZATIONNAME___. All rights reserved.
+*
+
+
+]XCODESTART ; Keep this at the start and put your code after this
+
+ mx %00
+
+ use 4/Util.Macs
+ use 4/Ctl.Macs
+
+* Resource numbers
+cdevResource = $1
+mainResource = $100
+helpResource = $101
+
+* CDEV Message Numbers
+machineCDev = 1
+bootCDev = 2
+reservedCDev = 3
+initCDev = 4
+closeCDev = 5
+eventsCDev = 6
+createCDev = 7
+aboutCDev = 8
+rectCDev = 9
+hitCDev = 10
+runCDev = 11
+editCDev = 12
+
+* Edit menu actions
+undoAction = 5
+cutAction = 6
+copyAction = 7
+pasteAction = 8
+clearAction = 9
+
+* Offsets in direct page from the stack
+message = $0c
+data1 = $08
+data2 = $04
+
+main
+ tsc
+ phd
+ tcd
+ lda message
+ cmp #machineCDev
+ bne notMachine
+* Return zero if you cannot be opened on this machine
+* (and maybe display an alert explaining why).
+ lda $02
+ sta $0c
+ lda $01
+ sta $0b
+ pld
+ tsc
+ clc
+ adc #$a
+ tcs
+ lda #$1
+ rtl
+
+notMachine
+ cmp #bootCDev
+ bne notBoot
+ jsl doBoot
+ bra done
+
+notBoot
+ cmp #initCDev
+ bne notInit
+ jsl doInit
+ bra done
+
+notInit
+ cmp #closeCDev
+ bne notClose
+ jsl doClose
+ bra done
+
+notClose
+ cmp #eventsCDev
+ bne notEvents
+ jsl doEvents
+ bra done
+
+notEvents
+ cmp #createCDev
+ bne notCreate
+ jsl doCreate
+ bra done
+
+notCreate
+ cmp #aboutCDev
+ bne notAbout
+ jsl doAbout
+ bra done
+
+notAbout
+ cmp #rectCDev
+ bne notRect
+ jsl doRect
+ bra done
+
+notRect
+ cmp #hitCDev
+ bne notHit
+ jsl doHit
+ bra done
+
+notHit
+ cmp #runCDev
+ bne notRun
+ jsl doRun
+ bra done
+
+notRun
+ cmp #editCDev
+ bne notEdit
+ jsl doEdit
+ bra done
+
+notEdit
+
+done
+ lda $02
+ sta $0c
+ lda $01
+ sta $0b
+ pld
+ tsc
+ clc
+ adc #$a
+ tcs
+ lda #$1
+ rtl
+
+doBoot
+* data1 is a pointer to a flag. Set bit 0 to 1 in this flag if you want to
+* draw an X through the icon at boot time to indicate that this CDev will not
+* load.
+ rtl
+
+
+doInit
+* data1 is a pointer to the grafport.
+ rtl
+
+
+doClose
+* data1 is a pointer to the grafport.
+ rtl
+
+
+doEvents
+* data1 is a pointer to the event record.
+* data2 is a pointer to the grafport.
+ rtl
+
+
+doCreate
+* data1 is a pointer to the grafport.
+ pha
+ pha
+ PushLong data1
+ PushWord #9
+ PushLong #mainResource
+ _NewControl2
+ pla
+ pla
+ rtl
+
+
+doAbout
+* data1 is a pointer to the grafport.
+ pha
+ pha
+ PushLong data1
+ PushWord #9
+ PushLong #helpResource
+ _NewControl2
+ pla
+ pla
+ rtl
+
+
+doRect
+* data1 is a pointer to the grafport.
+ rtl
+
+
+doHit
+* data1 is a handle to the control which was hit
+* data2 is the controlID of the control which was hit
+ rtl
+
+
+doRun
+* data1 is a pointer to the grafport.
+ rtl
+
+
+doEdit
+* The lower 16 bits of data1 is the edit action
+* data2 is a pointer to the grafport.
+
+ lda data1
+ cmp #undoAction
+ bne notUndo
+* Handle undo here
+ bra doneEdit
+
+notUndo
+ cmp #cutAction
+ bne notCut
+* Handle cut here
+ bra doneEdit
+
+notCut
+ cmp #copyAction
+ bne notCopy
+* Handle copy here
+ bra doneEdit
+
+notCopy
+ cmp #pasteAction
+ bne notPaste
+* Handle paste here
+ bra doneEdit
+
+notPaste
+ cmp #clearAction
+ bne notClear
+* Handle clear here
+ bra doneEdit
+
+notClear
+
+doneEdit
+ rtl
+
diff --git a/pkg/createPackage b/pkg/createPackage
index f4e70cc..d05b368 100755
--- a/pkg/createPackage
+++ b/pkg/createPackage
@@ -14,6 +14,7 @@ cda:orca:ORCAM Classic Desk Accessory:0:0
cda:merlin:Merlin Classic Desk Accessory:0:0
cdev:orca:ORCAC Control Panel:0:0
cdev:orca:ORCAM Control Panel:0:0
+cdev:merlin:Merlin Control Panel:0:0
desktop:orca:ORCAC Desktop Application:1:1
desktop:orca:ORCAM Desktop Application:1:0
shell:gno:ORCAC GNO Shell Command:0:0