From 51f8ff55747164afc55a804b42f2c32bc3d12877 Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Tue, 22 Jun 2021 23:56:19 -0400 Subject: [PATCH] Remove the work on trying to support a BabelFish translator. Chris Vavruska has picked it up because I was struggling with dealing with the 64K code resource limit. His code is here: https://github.com/vavruska/markdownGS My plan is to go forward with just a shell command which is focused only on markdown to Teach file conversion, intended to be used in my build engine under Golden Gate. --- md2teach.xcodeproj/project.pbxproj | 58 ++--- .../xcschemes/xcschememanagement.plist | 4 +- md2teach/Makefile | 182 ++++++++++++++-- md2teach/babelfish.mk | 201 ------------------ md2teach/babelfish/babelfish_defs.h | 60 ------ md2teach/babelfish/babelfish_rez.h | 30 --- md2teach/babelfish/babelfish_types.h | 113 ---------- md2teach/babelfish/filter.s | 114 ---------- md2teach/babelfish/init.s | 26 --- md2teach/babelfish/markdown.rez | 54 ----- md2teach/babelfish/request.c | 129 ----------- md2teach/{shell => }/io.c | 6 +- md2teach/{shell => }/io.h | 0 md2teach/{shell => }/main.c | 6 +- md2teach/{shell => }/main.h | 0 md2teach/make/tail.mk | 4 +- md2teach/shell.mk | 178 ---------------- md2teach/{shell => }/style.c | 6 +- md2teach/{shell => }/style.h | 0 md2teach/{shell => }/translate.c | 8 +- md2teach/{shell => }/translate.h | 0 21 files changed, 196 insertions(+), 983 deletions(-) delete mode 100644 md2teach/babelfish.mk delete mode 100644 md2teach/babelfish/babelfish_defs.h delete mode 100644 md2teach/babelfish/babelfish_rez.h delete mode 100644 md2teach/babelfish/babelfish_types.h delete mode 100644 md2teach/babelfish/filter.s delete mode 100644 md2teach/babelfish/init.s delete mode 100644 md2teach/babelfish/markdown.rez delete mode 100644 md2teach/babelfish/request.c rename md2teach/{shell => }/io.c (99%) rename md2teach/{shell => }/io.h (100%) rename md2teach/{shell => }/main.c (97%) rename md2teach/{shell => }/main.h (100%) delete mode 100644 md2teach/shell.mk rename md2teach/{shell => }/style.c (99%) rename md2teach/{shell => }/style.h (100%) rename md2teach/{shell => }/translate.c (99%) rename md2teach/{shell => }/translate.h (100%) diff --git a/md2teach.xcodeproj/project.pbxproj b/md2teach.xcodeproj/project.pbxproj index e245256..5b54e7d 100644 --- a/md2teach.xcodeproj/project.pbxproj +++ b/md2teach.xcodeproj/project.pbxproj @@ -8,7 +8,7 @@ /* Begin PBXBuildFile section */ 9D6532ED2626240800105D50 /* main.c in Sources */ = {isa = PBXBuildFile; fileRef = 9D6532EC2626240800105D50 /* main.c */; }; - 9D6532EF2626240800105D50 /* shell.mk in Sources */ = {isa = PBXBuildFile; fileRef = 9D6532EE2626240800105D50 /* shell.mk */; }; + 9D6532EF2626240800105D50 /* Makefile in Sources */ = {isa = PBXBuildFile; fileRef = 9D6532EE2626240800105D50 /* Makefile */; }; 9D6532F22626240800105D50 /* head.mk in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9D6532F12626240800105D50 /* head.mk */; }; 9D6532F42626240800105D50 /* orca-asm in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9D6532F32626240800105D50 /* orca-asm */; }; 9D6532F62626240800105D50 /* orca-cc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9D6532F52626240800105D50 /* orca-cc */; }; @@ -40,19 +40,10 @@ /* End PBXCopyFilesBuildPhase section */ /* Begin PBXFileReference section */ - 9D406AA12644E8CF00747EE9 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; - 9D406AB12644EB6500747EE9 /* babelfish.mk */ = {isa = PBXFileReference; lastKnownFileType = text; path = babelfish.mk; sourceTree = ""; }; - 9D406AC4264A2AD400747EE9 /* babelfish_defs.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = babelfish_defs.h; sourceTree = ""; }; - 9D406ACB264A2B5800747EE9 /* babelfish_rez.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = babelfish_rez.h; sourceTree = ""; }; - 9D406ACD264A2BD300747EE9 /* markdown.rez */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.rez; path = markdown.rez; sourceTree = ""; }; - 9D406AD8264C50E400747EE9 /* request.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = request.c; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.c; }; - 9D406AD9264C50F700747EE9 /* filter.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = filter.s; sourceTree = ""; xcLanguageSpecificationIdentifier = xcode.lang.asm.orcam; }; - 9D406B2D2652155B00747EE9 /* babelfish_types.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = babelfish_types.h; sourceTree = ""; }; - 9D406B312652D2C800747EE9 /* init.s */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.asm; path = init.s; sourceTree = ""; }; 9D6532E42626240800105D50 /* md2teach */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = md2teach; sourceTree = BUILT_PRODUCTS_DIR; }; 9D6532EA2626240800105D50 /* doNotBuild */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = doNotBuild; sourceTree = BUILT_PRODUCTS_DIR; }; 9D6532EC2626240800105D50 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; - 9D6532EE2626240800105D50 /* shell.mk */ = {isa = PBXFileReference; lastKnownFileType = text; path = shell.mk; sourceTree = ""; }; + 9D6532EE2626240800105D50 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 9D6532F12626240800105D50 /* head.mk */ = {isa = PBXFileReference; lastKnownFileType = text; path = head.mk; sourceTree = ""; }; 9D6532F32626240800105D50 /* orca-asm */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "orca-asm"; sourceTree = ""; }; 9D6532F52626240800105D50 /* orca-cc */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "orca-cc"; sourceTree = ""; }; @@ -90,35 +81,6 @@ /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ - 9D406A9C2644E80100747EE9 /* shell */ = { - isa = PBXGroup; - children = ( - 9D6532EC2626240800105D50 /* main.c */, - 9D8125DA2634A539002F05F5 /* main.h */, - 9D8125DB2634A584002F05F5 /* io.h */, - 9D8125DC2634A584002F05F5 /* io.c */, - 9D8125E22634AC4A002F05F5 /* translate.h */, - 9D8125E32634AC4A002F05F5 /* translate.c */, - 9D8125F12634B4D4002F05F5 /* style.h */, - 9D8125F22634B4D4002F05F5 /* style.c */, - ); - path = shell; - sourceTree = ""; - }; - 9D406AB02644EB4E00747EE9 /* babelfish */ = { - isa = PBXGroup; - children = ( - 9D406AC4264A2AD400747EE9 /* babelfish_defs.h */, - 9D406ACB264A2B5800747EE9 /* babelfish_rez.h */, - 9D406B2D2652155B00747EE9 /* babelfish_types.h */, - 9D406ACD264A2BD300747EE9 /* markdown.rez */, - 9D406AD8264C50E400747EE9 /* request.c */, - 9D406B312652D2C800747EE9 /* init.s */, - 9D406AD9264C50F700747EE9 /* filter.s */, - ); - path = babelfish; - sourceTree = ""; - }; 9D6532DD2626240800105D50 = { isa = PBXGroup; children = ( @@ -141,13 +103,17 @@ 9D6532EB2626240800105D50 /* md2teach */ = { isa = PBXGroup; children = ( - 9D406AA12644E8CF00747EE9 /* Makefile */, 9D65330C2626246700105D50 /* md4c.c */, 9D65330B2626246700105D50 /* md4c.h */, - 9D6532EE2626240800105D50 /* shell.mk */, - 9D406A9C2644E80100747EE9 /* shell */, - 9D406AB12644EB6500747EE9 /* babelfish.mk */, - 9D406AB02644EB4E00747EE9 /* babelfish */, + 9D6532EC2626240800105D50 /* main.c */, + 9D8125DA2634A539002F05F5 /* main.h */, + 9D8125DB2634A584002F05F5 /* io.h */, + 9D8125DC2634A584002F05F5 /* io.c */, + 9D8125E22634AC4A002F05F5 /* translate.h */, + 9D8125E32634AC4A002F05F5 /* translate.c */, + 9D8125F12634B4D4002F05F5 /* style.h */, + 9D8125F22634B4D4002F05F5 /* style.c */, + 9D6532EE2626240800105D50 /* Makefile */, 9DDFC7B42627E081006D6E71 /* test.md */, 9D6532F02626240800105D50 /* make */, 9D6532FB2626240800105D50 /* Supporting Files */, @@ -276,7 +242,7 @@ buildActionMask = 2147483647; files = ( 9D8125E42634AC4A002F05F5 /* translate.c in Sources */, - 9D6532EF2626240800105D50 /* shell.mk in Sources */, + 9D6532EF2626240800105D50 /* Makefile in Sources */, 9D8125DD2634A584002F05F5 /* io.c in Sources */, 9D8125F32634B4D4002F05F5 /* style.c in Sources */, 9D6532ED2626240800105D50 /* main.c in Sources */, diff --git a/md2teach.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist b/md2teach.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist index 38f213f..a1d7f13 100644 --- a/md2teach.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/md2teach.xcodeproj/xcuserdata/jrand.xcuserdatad/xcschemes/xcschememanagement.plist @@ -7,12 +7,12 @@ Binary.xcscheme_^#shared#^_ orderHint - 1 + 2 doNotBuild.xcscheme_^#shared#^_ orderHint - 2 + 1 md2teach.xcscheme_^#shared#^_ diff --git a/md2teach/Makefile b/md2teach/Makefile index 6fcb6cb..8002e39 100644 --- a/md2teach/Makefile +++ b/md2teach/Makefile @@ -5,24 +5,174 @@ include make/head.mk -DISKIMAGE=$(TARGETDIR)/md2teach.2mg -ARCHIVE=$(TARGETDIR)/md2teach.shk -DESTBOOTIMAGE=$(TARGETDIR)/$(BOOTIMAGE) +# Customize this file to control what kind of project you are working on, +# where to find files, etc. -MAMEARGS=apple2gs -skip_gameinfo -speed 3 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 +# The name of your system or binary file to build goes here: +PGM=md2teach + +# Set the target type you would like to build. The options are: +# shell - A shell command for ORCA, GNO or other GS shell +# desktop - A full desktop application +# cda - A classic desk accessory +# cdev - A control panel device +# nba - A HyperStudio new button action +# nda - A new desk accessory +# xcmd - A HyperCard XCMD or XCFN +# +TARGETTYPE=shell +# TARGETTYPE=desktop +# TARGETTYPE=cda +# TARGETTYPE=cdev +# TARGETTYPE=nba +# TARGETTYPE=nda +# TARGETTYPE=xcmd + +# Uncomment one of the following lines to force a particular GS emulator. +# By default, specific paths are tested for these emulators in the below +# order and the first found is what will be used. You can overrride that +# here: +# +# EMULATOR=gsplus EMULATOR=mame +# EMULATOR=gsport +# By default, the build provides a single boot environment to test with. +# You can put other .2mg files into the make directory and override this +# variable to change what boot disk you want to use when you launch the +# emulator. The disk image you specify must be found in the make directory: +# +# BOOTIMAGE=system601.2mg + +# Add any other directories where you are putting C or assembly source +# files to this list: +SRCDIRS+= + +# If you put your main entry point for your project in a file called main.c +# Then you don't need to change this value. If you want to call your entry +# point something other than main.c, set this variable to point to this file. +ROOTCFILE=main.c + +# Add any arguments you want passed to the C compiler to this variable: +CFLAGS+=+O + +# Add any arguments you want passed to the resource compiler to this variable: +REZFLAGS+= + +# Uncomment the following line if you have installed rlint as found here: +# https://github.com/ksherlock/rlint/releases +# Assuming that it is in the path that ORCA searches (the Utilities directory is +# probably a good choice), you can just leave the value unchanged. If you have +# put the rlint somewhere weird, you can set this to the correct path +# RLINT_PATH=rlint + +# Add any arguments you want passed to the macro generator to this variable: +MACGENFLAGS+= + +# Add any other macro libraries to include in this variable: +MACGENMACROS+= + +# Add any arguments you want passed to the assembler to this variable: +ASMFLAGS+= + +# Add any arguments you want passed to the linker to this variable: +LDFLAGS+= + +# Uncomment the following line if you want to build against the GNO libraries +# export ORCA=$(ORCA_BINDIR)/gno + +# If you want to copy one or more files or directories to the distribution disk +# image, add the root directory to this variable. Any directories under +# the source directory which don't exist in the target disk image will be +# created. All files will be copied from the source to the target using +# the same path from the source. +# +# For example, if you set COPYDIRS to dir and in your project you have +# the following files: +# dir/Icons/myIconFile +# dir/newDir/anotherFile +# Then, during the copy phase, myIconFile will be copied into the Icons +# folder and a folder newDir will be created and anotherFile will be copied +# into there. +COPYDIRS= + +# If you want to copy one or more files or directories to the boot disk +# image, add the root directory to this variable. Any directories under +# the source directory which don't exist in the boot disk image will be +# created. All files will be copied from the source to the target using +# the same path from the source. +# +# For example, if you set COPYBOOTDIRS to dir and in your project you have +# the following files: +# dir/System/mySystemFile +# dir/newDir/anotherFile +# Then, during the copy phase, mySystemFile will be copied into the System +# folder and a folder newDir will be created and anotherFile will be copied +# into there. +COPYBOOTDIRS= + +# By default, the build expects that you have GSplus in the path: +# /Applications/GSplus.app/Contents/MacOS/gsplus +# If you have it in a different location, specify that here. +# GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus + +# By default, the build uses no arguments with GSplus. If you would like to +# use different arguments, specify that here. +GSPLUSARGS=-mem 4194304 + +# By default, the build expects that you have GSport in the path: +# /Applications/GSport/GSport.app/Contents/MacOS/GSport +# If you have it in a different location, specify that here. +# GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport + +# By default, the build uses no arguments with GSport. If you would like to +# use different arguments, specify that here. +# GSPORTARGS= + +# By default, the build expects that you have Ample/mame in the path: +# /Applications/Ample.app/Contents/MacOS/mame64 +# If you have it in a different location, specify that here. +# MAME=/Applications/Ample.app/Contents/MacOS/mame64 + +# By default, the build expects that you have the mame ROMs/libs in the path: +# $(HOME)/Library/Application Support/Ample +# If you have it in a different location, specify that here. +# MAMELIB=$(HOME)/Library/Application Support/Ample + +# By default, the build uses these arguments with mame: +# apple2gs -skip_gameinfo -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 +# If you would like to use different arguments, specify that here. +MAMEARGS=apple2gs -skip_gameinfo -speed 3 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 + +# For a desktop application, it can operate in 640x200 or 320x200 +# resolution. This setting is used to define which horizontal +# resolution you want to use for a desktop application. Other +# target types ignore this value. +# DESKTOP_RES_MODE=640 + +# For a desktop application, it can support opening and printing +# files based on paths sent to it by the message center. This +# option controls if that is or is not supported in the +# application (note: only the C desktop template supports message +# center today) +# MESSAGE_CENTER=0 + +# Add any rules you want to execute before any compiles or assembly +# commands are called here, if any. You can generate .c, .s or .h +# files for example. You can generate data files. Whatever you +# might need. You should generate these files in the $(GENDIR) +# directory or within a subdirectory under $(GENDIR) which you create +# yourself. +# +# All of your commands associated with a rule _must_ start with a tab +# character. Xcode makes it a bit tough to type a tab character by +# default. Press option-tab within Xcode to insert a tab character. gen: -build: - make -f shell.mk - make -f babelfish.mk - -clean: - make -f shell.mk clean - make -f babelfish.mk clean - -execute: - make -f shell.mk execute - make/createDiskImage "$(DISKIMAGE)" $(DESTBOOTIMAGE) "$(TARGETDIR)/Markdown" "$(TARGETDIR)/md2teach" "$(TARGETDIR)/outfile.txt" test.md - make/launchEmulator "$(DISKIMAGE)" "$(DESTBOOTIMAGE)" +# For any files you generated in the gen target above, you should +# add rules in genclean to remove those generated files when you +# clean your build. +genclean: + +# Do not change anything else below here... +include make/tail.mk diff --git a/md2teach/babelfish.mk b/md2teach/babelfish.mk deleted file mode 100644 index 5092ae6..0000000 --- a/md2teach/babelfish.mk +++ /dev/null @@ -1,201 +0,0 @@ -# -# Makefile -# Apple //GS Build Engine for ORCA and Merlin -# - -include make/head.mk - -# Customize this file to control what kind of project you are working on, -# where to find files, etc. - -# The name of your system or binary file to build goes here: -PGM=notused - -# Set the target type you would like to build. The options are: -# shell - A shell command for ORCA, GNO or other GS shell -# desktop - A full desktop application -# cda - A classic desk accessory -# cdev - A control panel device -# nba - A HyperStudio new button action -# nda - A new desk accessory -# xcmd - A HyperCard XCMD or XCFN -# -# TARGETTYPE=shell -# TARGETTYPE=desktop -# TARGETTYPE=cda -# TARGETTYPE=cdev -# TARGETTYPE=nba -# TARGETTYPE=nda -# TARGETTYPE=xcmd -TARGETTYPE=babelfish - -# Uncomment one of the following lines to force a particular GS emulator. -# By default, specific paths are tested for these emulators in the below -# order and the first found is what will be used. You can overrride that -# here: -# -# EMULATOR=gsplus -# EMULATOR=mame -# EMULATOR=gsport - -# By default, the build provides a single boot environment to test with. -# You can put other .2mg files into the make directory and override this -# variable to change what boot disk you want to use when you launch the -# emulator. The disk image you specify must be found in the make directory: -# -# BOOTIMAGE=system601.2mg - -# Add any other directories where you are putting C or assembly source -# files to this list: -SRCDIRS+=babelfish - -# If you put your main entry point for your project in a file called main.c -# Then you don't need to change this value. If you want to call your entry -# point something other than main.c, set this variable to point to this file. -ROOTCFILE=shell/main.c - -# Add any arguments you want passed to the C compiler to this variable: -CFLAGS+=+O - -# Add any arguments you want passed to the resource compiler to this variable: -REZFLAGS+= - -# Uncomment the following line if you have installed rlint as found here: -# https://github.com/ksherlock/rlint/releases -# Assuming that it is in the path that ORCA searches (the Utilities directory is -# probably a good choice), you can just leave the value unchanged. If you have -# put the rlint somewhere weird, you can set this to the correct path -# RLINT_PATH=rlint - -# Add any arguments you want passed to the macro generator to this variable: -MACGENFLAGS+= - -# Add any other macro libraries to include in this variable: -MACGENMACROS+= - -# Add any arguments you want passed to the assembler to this variable: -ASMFLAGS+= - -# Add any arguments you want passed to the linker to this variable: -LDFLAGS+= - -# Uncomment the following line if you want to build against the GNO libraries -# export ORCA=$(ORCA_BINDIR)/gno - -# If you want to copy one or more files or directories to the distribution disk -# image, add the root directory to this variable. Any directories under -# the source directory which don't exist in the target disk image will be -# created. All files will be copied from the source to the target using -# the same path from the source. -# -# For example, if you set COPYDIRS to dir and in your project you have -# the following files: -# dir/Icons/myIconFile -# dir/newDir/anotherFile -# Then, during the copy phase, myIconFile will be copied into the Icons -# folder and a folder newDir will be created and anotherFile will be copied -# into there. -COPYDIRS= - -# If you want to copy one or more files or directories to the boot disk -# image, add the root directory to this variable. Any directories under -# the source directory which don't exist in the boot disk image will be -# created. All files will be copied from the source to the target using -# the same path from the source. -# -# For example, if you set COPYBOOTDIRS to dir and in your project you have -# the following files: -# dir/System/mySystemFile -# dir/newDir/anotherFile -# Then, during the copy phase, mySystemFile will be copied into the System -# folder and a folder newDir will be created and anotherFile will be copied -# into there. -COPYBOOTDIRS= - -# By default, the build expects that you have GSplus in the path: -# /Applications/GSplus.app/Contents/MacOS/gsplus -# If you have it in a different location, specify that here. -# GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus - -# By default, the build uses no arguments with GSplus. If you would like to -# use different arguments, specify that here. -# GSPLUSARGS= - -# By default, the build expects that you have GSport in the path: -# /Applications/GSport/GSport.app/Contents/MacOS/GSport -# If you have it in a different location, specify that here. -# GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport - -# By default, the build uses no arguments with GSport. If you would like to -# use different arguments, specify that here. -# GSPORTARGS= - -# By default, the build expects that you have Ample/mame in the path: -# /Applications/Ample.app/Contents/MacOS/mame64 -# If you have it in a different location, specify that here. -# MAME=/Applications/Ample.app/Contents/MacOS/mame64 - -# By default, the build expects that you have the mame ROMs/libs in the path: -# $(HOME)/Library/Application Support/Ample -# If you have it in a different location, specify that here. -# MAMELIB=$(HOME)/Library/Application Support/Ample - -# By default, the build uses these arguments with mame: -# apple2gs -skip_gameinfo -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 -# If you would like to use different arguments, specify that here. -# MAMEARGS=apple2gs -skip_gameinfo -speed 2 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 - -# For a desktop application, it can operate in 640x200 or 320x200 -# resolution. This setting is used to define which horizontal -# resolution you want to use for a desktop application. Other -# target types ignore this value. -# DESKTOP_RES_MODE=640 - -# For a desktop application, it can support opening and printing -# files based on paths sent to it by the message center. This -# option controls if that is or is not supported in the -# application (note: only the C desktop template supports message -# center today) -# MESSAGE_CENTER=0 - -# Add any rules you want to execute before any compiles or assembly -# commands are called here, if any. You can generate .c, .s or .h -# files for example. You can generate data files. Whatever you -# might need. You should generate these files in the $(GENDIR) -# directory or within a subdirectory under $(GENDIR) which you create -# yourself. -# -# All of your commands associated with a rule _must_ start with a tab -# character. Xcode makes it a bit tough to type a tab character by -# default. Press option-tab within Xcode to insert a tab character. -gen: - -# For any files you generated in the gen target above, you should -# add rules in genclean to remove those generated files when you -# clean your build. -genclean: - - -FILTERTARGET=$(TARGETDIR)/filter.bin -INITTARGET=$(TARGETDIR)/init.bin -REZFLAGS+= rez='-d TARGETDIR="$(TARGETDIR)"' - -$(OBJDIR)/babelfish/markdown.r: $(FILTERTARGET) $(INITTARGET) - -$(FILTERTARGET): $(OBJDIR)/babelfish/filter.ROOT - cd $(OBJDIR); $(LINK) $(LDFLAGS) babelfish/filter keep="$(abspath $@)" - -$(INITTARGET): $(OBJDIR)/babelfish/init.ROOT $(OBJDIR)/babelfish/request.a $(OBJDIR)/md4c.a - cd $(OBJDIR); $(LINK) $(LDFLAGS) babelfish/init babelfish/request keep="$(abspath $@)" || rm "$(abspath $@)" - -$(TARGETDIR)/Markdown: $(OBJDIR)/babelfish/markdown.r - $(MKDIR) $(TARGETDIR) - $(RM) $@ - $(CP) $< $@ - $(CHTYP) -t $(FILETYPE) $(AUXTYPE) $@ - -target: $(TARGETDIR)/Markdown - true - -# Do not change anything else below here... -include make/tail.mk diff --git a/md2teach/babelfish/babelfish_defs.h b/md2teach/babelfish/babelfish_defs.h deleted file mode 100644 index 375ea93..0000000 --- a/md2teach/babelfish/babelfish_defs.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * babelfish_defs.h - * md2teach - * - * Created by Jeremy Rand on 2021-05-10. - * - */ - -#ifndef _GUARD_PROJECTmd2teach_FILEbabelfish_defs_ -#define _GUARD_PROJECTmd2teach_FILEbabelfish_defs_ - -#define rTrData 0x5472 - -// Flags -#define bf320 0x0001 -#define bf640 0x0002 -#define bfCanImport 0x0001 -#define bfCanExport 0x0001 -#define bfImportOptions 0x0002 -#define bfExportOptions 0x0002 - -//Translator IDs -#define TrVersion 0x0001 //rVersion -#define TrAbout 0x0001 //rComment -#define TrCantLauch 0x0002 - -#define TrData 0x0001 //rTrData - -#define TrInit 0x0001 //rCodeResource -#define TrImportOptions 0x0002 //rCodeResource -#define TrExportOptions 0x0003 -#define TrFilter 0x0004 - -#define TrImportInfo 0x0002 //rText -#define TrExportInfo 0x0003 //rText - -#define TrFormatNone 0x0000 -#define TrFormatText 0x0001 -#define TrFormatPixelMap 0x0002 -#define TrFormatTrueColorImage 0x0003 -#define TrFormatQD2Picture 0x0004 -#define TrFormatFont 0x0005 -#define TrFormatSound 0x0006 - -#define TrStartUp 0x9101 -#define TrShutDown 0x9102 -#define TrRead 0x9103 - -#define bfContinue 0 -#define bfDone 0x8000 -#define bfUserAbort 0x8001 -#define bfBadFileErr 0x8002 -#define bfReadErr 0x8003 -#define bfWriteErr 0x8004 -#define bfMemErr 0x8005 - -#define bfTextGetSettings 1 -#define bfTextBody 8 - -#endif /* define _GUARD_PROJECTmd2teach_FILEbabelfish_defs_ */ diff --git a/md2teach/babelfish/babelfish_rez.h b/md2teach/babelfish/babelfish_rez.h deleted file mode 100644 index ffbbefa..0000000 --- a/md2teach/babelfish/babelfish_rez.h +++ /dev/null @@ -1,30 +0,0 @@ -/* - * babelfish_rez.h - * md2teach - * - * Created by Jeremy Rand on 2021-05-10. - * - */ - -#ifndef _GUARD_PROJECTmd2teach_FILEbabelfish_rez_ -#define _GUARD_PROJECTmd2teach_FILEbabelfish_rez_ - - -type rTrData -{ - _mybase_ integer = 0; //revision - _mybase_ integer; //general flags - _mybase_ integer; //Import Flags - array[8] - { - hex byte; //Import Kinds - }; - _mybase_ integer; //Export Flags - array[8] - { - hex byte; //Export Kinds - }; -}; - - -#endif /* define _GUARD_PROJECTmd2teach_FILEbabelfish_rez_ */ diff --git a/md2teach/babelfish/babelfish_types.h b/md2teach/babelfish/babelfish_types.h deleted file mode 100644 index f3d4bab..0000000 --- a/md2teach/babelfish/babelfish_types.h +++ /dev/null @@ -1,113 +0,0 @@ -/* - * babelfish_types.h - * md2teach - * - * Created by Jeremy Rand on 2021-05-16. - * - */ - -#ifndef _GUARD_PROJECTmd2teach_FILEbabelfish_types_ -#define _GUARD_PROJECTmd2teach_FILEbabelfish_types_ - -#include - - -// The actual data record varies based on the file format. -typedef struct TrDataRecord -{ - Word parmCount; -} TrDataRecord; - - -typedef struct TrTextDataRecord -{ - Word parmCount; - Word actionCode; - Word responseCode; - Long textStreamLength; - char * textStreamPtr; - Handle textStreamHandle; - Word familyId; - Word fontSize; - Word fontStyle; - Word foreColor; - Word backColor; - Word position; - Word charSpacing; - Word lineSpacing; - Word spaceBefore; - Word spaceAfter; - Word firstIndent; - Word leftIndent; - Word rightIndent; - Word justification; - unsigned char tabArray[64]; - Word options; - Long border; - Word pageLength; - Word pageWidth; - Rect sectionRect; - Word columns; - Word gutter; - Handle picHandle; -} TrTextDataRecord; - - -typedef struct TrTransferRecord -{ - Word parmCount; - Word status; - Word miscFlags; - unsigned char dataKinds[8]; - Word transNum; - Word userId; - Word progressAction; - Word fullTherm; - Word currentTherm; - char * msgPtr; - TrDataRecord * dataRecordPtr; - GSString255 * filePathPtr; - char * fileNamePtr; /* P string */ -} TrTransferRecord; - - -typedef struct TrStartUpDataIn -{ - TrTransferRecord * xferRecPtr; -} TrStartUpDataIn; - - -typedef struct TrStartUpDataOut -{ - Word recvCount; - Word trResult; -} TrStartUpDataOut; - - -typedef struct TrShutDownDataIn -{ - TrTransferRecord * xferRecPtr; -} TrShutDownDataIn; - - -typedef struct TrShutDownDataOut -{ - Word recvCount; - Word trResult; -} TrShutDownDataOut; - - -typedef struct TrReadDataIn -{ - TrTransferRecord * xferRecPtr; -} TrReadDataIn; - - -typedef struct TrReadDataOut -{ - Word recvCount; - Word trResult; -} TrReadDataOut; - - -#endif /* define _GUARD_PROJECTmd2teach_FILEbabelfish_types_ */ diff --git a/md2teach/babelfish/filter.s b/md2teach/babelfish/filter.s deleted file mode 100644 index 3f946e2..0000000 --- a/md2teach/babelfish/filter.s +++ /dev/null @@ -1,114 +0,0 @@ -; -; filter.s -; md2teach -; -; Created by Jeremy Rand on 2021-05-12. -; Based on bfish_asoft by Kelvin Sherlock. -; - - mcopy filter.macros - keep filter - - -offset_fileName gequ 10 - -; SFFilter -; -; in stack: -; -; (3) |rtl -; |---- -; (4) |DirEntryRecPtr -; |---- -; (2) |returnval -; |---- -; |......... - -; out stack: -; -; |returnval -; |---- -; |......... - - -; -; Returns 0 if it's not an markdown file, or 4 if it is. -; - -filter start - -_b equ 1 -ptr equ _b+2 -_d equ ptr+4 -_rtlb equ _d+1 -DirPtr equ _rtlb+3 -retval equ DirPtr+4 - - phb ;even up the stack - pha - pha - phd - tsc - tcd - - stz -#include - -#include -#include -#include - -#include "babelfish/babelfish_defs.h" -#include "babelfish/babelfish_types.h" -#include "md4c.h" - - -#pragma memorymodel 1 - - -static uint16_t myUserId; -static TrTextDataRecord textRecord; - - -void DoStartUp(TrStartUpDataIn * dataIn, TrStartUpDataOut * dataOut) -{ - static recvCount = 0; - TrTransferRecord * xferRecPtr = dataIn->xferRecPtr; - - asm { - stz |lb1 - lb1: nop - nop - }; - - xferRecPtr->dataKinds[0] = TrFormatText; - xferRecPtr->dataKinds[1] = TrFormatNone; - xferRecPtr->dataKinds[2] = TrFormatNone; - xferRecPtr->dataKinds[3] = TrFormatNone; - xferRecPtr->dataKinds[4] = TrFormatNone; - xferRecPtr->dataKinds[5] = TrFormatNone; - xferRecPtr->dataKinds[6] = TrFormatNone; - xferRecPtr->dataKinds[7] = TrFormatNone; - xferRecPtr->fullTherm = 512; - xferRecPtr->currentTherm = 0; - xferRecPtr->dataRecordPtr = (TrDataRecord *)&textRecord; - - textRecord.parmCount = 10; - textRecord.actionCode = bfTextGetSettings; - textRecord.responseCode = 0; - textRecord.textStreamLength = 0; - textRecord.textStreamPtr = NULL; - textRecord.textStreamHandle = NULL; - textRecord.familyId = helvetica; - textRecord.fontSize = 12; - textRecord.foreColor = 0x0000; - textRecord.backColor = 0xffff; - textRecord.position = 0; - - recvCount++; - dataOut->recvCount = recvCount; - dataOut->trResult = bfContinue; -} - - -void DoShutDown(TrShutDownDataIn * dataIn, TrShutDownDataOut * dataOut) -{ - static recvCount = 0; - - recvCount++; - dataOut->recvCount = recvCount; - dataOut->trResult = bfContinue; -} - - -void DoRead(TrReadDataIn * dataIn, TrReadDataOut * dataOut) -{ - static recvCount = 0; - - recvCount++; - dataOut->recvCount = recvCount; - dataOut->trResult = bfContinue; -} - - -#pragma databank 1 -#pragma toolparms 1 - -pascal unsigned MyRequestProc(uint16_t request, uint32_t dataIn, uint32_t dataOut) -{ - switch (request) { - case TrStartUp: - DoStartUp((TrStartUpDataIn *)dataIn, (TrStartUpDataOut *)dataOut); - break; - - case TrShutDown: - DoShutDown((TrShutDownDataIn *)dataIn, (TrShutDownDataOut *)dataOut); - break; - - case TrRead: - DoRead((TrReadDataIn *)dataIn, (TrReadDataOut *)dataOut); - break; - - default: - break; - } - - return 0; -} - -#pragma toolparms 0 -#pragma databank 0 - -void setup(void) -{ - static char myName[48]; - - myUserId = MMStartUp(); - sprintf(myName+1, "Babelfish~Jeremy~MarkdownTrans%04x", myUserId); - *myName = strlen(myName+1); - - AcceptRequests(myName, myUserId, MyRequestProc); - - // return 0; -} diff --git a/md2teach/shell/io.c b/md2teach/io.c similarity index 99% rename from md2teach/shell/io.c rename to md2teach/io.c index 90c969f..f53471f 100644 --- a/md2teach/shell/io.c +++ b/md2teach/io.c @@ -16,9 +16,9 @@ #include #include -#include "shell/io.h" -#include "shell/main.h" -#include "shell/style.h" +#include "io.h" +#include "main.h" +#include "style.h" // Defines diff --git a/md2teach/shell/io.h b/md2teach/io.h similarity index 100% rename from md2teach/shell/io.h rename to md2teach/io.h diff --git a/md2teach/shell/main.c b/md2teach/main.c similarity index 97% rename from md2teach/shell/main.c rename to md2teach/main.c index d1b7c96..983c9a3 100644 --- a/md2teach/shell/main.c +++ b/md2teach/main.c @@ -11,9 +11,9 @@ #include #include -#include "shell/io.h" -#include "shell/main.h" -#include "shell/translate.h" +#include "io.h" +#include "main.h" +#include "translate.h" // GS_TODO - How big does the stack need to be? In looking over the code, diff --git a/md2teach/shell/main.h b/md2teach/main.h similarity index 100% rename from md2teach/shell/main.h rename to md2teach/main.h diff --git a/md2teach/make/tail.mk b/md2teach/make/tail.mk index 9509791..51d9e61 100644 --- a/md2teach/make/tail.mk +++ b/md2teach/make/tail.mk @@ -196,7 +196,9 @@ executeGUI: all make/launchEmulator "$(DISKIMAGE)" "$(DESTBOOTIMAGE)" executeShell: all - $(ORCA) --mem $(TARGETDIR)/$(PGM) -d test.md $(TARGETDIR)/outfile.txt + $(ORCA) --mem $(TARGETDIR)/$(PGM) -d test.md $(TARGETDIR)/test.txt + make/createDiskImage "$(DISKIMAGE)" $(DESTBOOTIMAGE) "$(TARGETDIR)/md2teach" "$(TARGETDIR)/test.txt" + make/launchEmulator "$(DISKIMAGE)" "$(DESTBOOTIMAGE)" $(OBJDIR)/%.a: %.c $(COMPILE) $< $(@:.a=) $(CFLAGS) --noroot diff --git a/md2teach/shell.mk b/md2teach/shell.mk deleted file mode 100644 index 617cd05..0000000 --- a/md2teach/shell.mk +++ /dev/null @@ -1,178 +0,0 @@ -# -# Makefile -# Apple //GS Build Engine for ORCA and Merlin -# - -include make/head.mk - -# Customize this file to control what kind of project you are working on, -# where to find files, etc. - -# The name of your system or binary file to build goes here: -PGM=md2teach - -# Set the target type you would like to build. The options are: -# shell - A shell command for ORCA, GNO or other GS shell -# desktop - A full desktop application -# cda - A classic desk accessory -# cdev - A control panel device -# nba - A HyperStudio new button action -# nda - A new desk accessory -# xcmd - A HyperCard XCMD or XCFN -# -TARGETTYPE=shell -# TARGETTYPE=desktop -# TARGETTYPE=cda -# TARGETTYPE=cdev -# TARGETTYPE=nba -# TARGETTYPE=nda -# TARGETTYPE=xcmd - -# Uncomment one of the following lines to force a particular GS emulator. -# By default, specific paths are tested for these emulators in the below -# order and the first found is what will be used. You can overrride that -# here: -# -# EMULATOR=gsplus -EMULATOR=mame -# EMULATOR=gsport - -# By default, the build provides a single boot environment to test with. -# You can put other .2mg files into the make directory and override this -# variable to change what boot disk you want to use when you launch the -# emulator. The disk image you specify must be found in the make directory: -# -# BOOTIMAGE=system601.2mg - -# Add any other directories where you are putting C or assembly source -# files to this list: -SRCDIRS+=shell - -# If you put your main entry point for your project in a file called main.c -# Then you don't need to change this value. If you want to call your entry -# point something other than main.c, set this variable to point to this file. -ROOTCFILE=shell/main.c - -# Add any arguments you want passed to the C compiler to this variable: -CFLAGS+=+O - -# Add any arguments you want passed to the resource compiler to this variable: -REZFLAGS+= - -# Uncomment the following line if you have installed rlint as found here: -# https://github.com/ksherlock/rlint/releases -# Assuming that it is in the path that ORCA searches (the Utilities directory is -# probably a good choice), you can just leave the value unchanged. If you have -# put the rlint somewhere weird, you can set this to the correct path -# RLINT_PATH=rlint - -# Add any arguments you want passed to the macro generator to this variable: -MACGENFLAGS+= - -# Add any other macro libraries to include in this variable: -MACGENMACROS+= - -# Add any arguments you want passed to the assembler to this variable: -ASMFLAGS+= - -# Add any arguments you want passed to the linker to this variable: -LDFLAGS+= - -# Uncomment the following line if you want to build against the GNO libraries -# export ORCA=$(ORCA_BINDIR)/gno - -# If you want to copy one or more files or directories to the distribution disk -# image, add the root directory to this variable. Any directories under -# the source directory which don't exist in the target disk image will be -# created. All files will be copied from the source to the target using -# the same path from the source. -# -# For example, if you set COPYDIRS to dir and in your project you have -# the following files: -# dir/Icons/myIconFile -# dir/newDir/anotherFile -# Then, during the copy phase, myIconFile will be copied into the Icons -# folder and a folder newDir will be created and anotherFile will be copied -# into there. -COPYDIRS= - -# If you want to copy one or more files or directories to the boot disk -# image, add the root directory to this variable. Any directories under -# the source directory which don't exist in the boot disk image will be -# created. All files will be copied from the source to the target using -# the same path from the source. -# -# For example, if you set COPYBOOTDIRS to dir and in your project you have -# the following files: -# dir/System/mySystemFile -# dir/newDir/anotherFile -# Then, during the copy phase, mySystemFile will be copied into the System -# folder and a folder newDir will be created and anotherFile will be copied -# into there. -COPYBOOTDIRS= - -# By default, the build expects that you have GSplus in the path: -# /Applications/GSplus.app/Contents/MacOS/gsplus -# If you have it in a different location, specify that here. -# GSPLUS=/Applications/GSplus.app/Contents/MacOS/gsplus - -# By default, the build uses no arguments with GSplus. If you would like to -# use different arguments, specify that here. -GSPLUSARGS=-mem 4194304 - -# By default, the build expects that you have GSport in the path: -# /Applications/GSport/GSport.app/Contents/MacOS/GSport -# If you have it in a different location, specify that here. -# GSPORT=/Applications/GSport/GSport.app/Contents/MacOS/GSport - -# By default, the build uses no arguments with GSport. If you would like to -# use different arguments, specify that here. -# GSPORTARGS= - -# By default, the build expects that you have Ample/mame in the path: -# /Applications/Ample.app/Contents/MacOS/mame64 -# If you have it in a different location, specify that here. -# MAME=/Applications/Ample.app/Contents/MacOS/mame64 - -# By default, the build expects that you have the mame ROMs/libs in the path: -# $(HOME)/Library/Application Support/Ample -# If you have it in a different location, specify that here. -# MAMELIB=$(HOME)/Library/Application Support/Ample - -# By default, the build uses these arguments with mame: -# apple2gs -skip_gameinfo -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 -# If you would like to use different arguments, specify that here. -MAMEARGS=apple2gs -skip_gameinfo -speed 3 -mouse -window -resolution 1408x1056 -ramsize 4M -sl7 cffa202 - -# For a desktop application, it can operate in 640x200 or 320x200 -# resolution. This setting is used to define which horizontal -# resolution you want to use for a desktop application. Other -# target types ignore this value. -# DESKTOP_RES_MODE=640 - -# For a desktop application, it can support opening and printing -# files based on paths sent to it by the message center. This -# option controls if that is or is not supported in the -# application (note: only the C desktop template supports message -# center today) -# MESSAGE_CENTER=0 - -# Add any rules you want to execute before any compiles or assembly -# commands are called here, if any. You can generate .c, .s or .h -# files for example. You can generate data files. Whatever you -# might need. You should generate these files in the $(GENDIR) -# directory or within a subdirectory under $(GENDIR) which you create -# yourself. -# -# All of your commands associated with a rule _must_ start with a tab -# character. Xcode makes it a bit tough to type a tab character by -# default. Press option-tab within Xcode to insert a tab character. -gen: - -# For any files you generated in the gen target above, you should -# add rules in genclean to remove those generated files when you -# clean your build. -genclean: - -# Do not change anything else below here... -include make/tail.mk diff --git a/md2teach/shell/style.c b/md2teach/style.c similarity index 99% rename from md2teach/shell/style.c rename to md2teach/style.c index 7b7932a..650fc31 100644 --- a/md2teach/shell/style.c +++ b/md2teach/style.c @@ -13,9 +13,9 @@ #include #include -#include "shell/io.h" -#include "shell/main.h" -#include "shell/style.h" +#include "io.h" +#include "main.h" +#include "style.h" // Defines diff --git a/md2teach/shell/style.h b/md2teach/style.h similarity index 100% rename from md2teach/shell/style.h rename to md2teach/style.h diff --git a/md2teach/shell/translate.c b/md2teach/translate.c similarity index 99% rename from md2teach/shell/translate.c rename to md2teach/translate.c index f913a00..f337082 100644 --- a/md2teach/shell/translate.c +++ b/md2teach/translate.c @@ -9,10 +9,10 @@ #include #include -#include "shell/translate.h" -#include "shell/io.h" -#include "shell/main.h" -#include "shell/style.h" +#include "translate.h" +#include "io.h" +#include "main.h" +#include "style.h" // Typedefs diff --git a/md2teach/shell/translate.h b/md2teach/translate.h similarity index 100% rename from md2teach/shell/translate.h rename to md2teach/translate.h