From 1f0c6fbe278426a111315fee9a30bc8dc22a6f2c Mon Sep 17 00:00:00 2001 From: Luxferre Date: Tue, 6 Jan 2026 15:51:54 +0200 Subject: [PATCH] Upgraded build system, tested Atari 8-bit support --- README.md | 2 +- c/Makefile | 43 +++++++++++++++++++++++++++---------------- c/scoundrel.c | 2 +- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 19cb999..f7f61ba 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This is a collection of my own ports of the [Scoundrel](http://stfj.net/art/2011 ## Ports included in this repo -* [ANSI C89 port](c/scoundrel.c) - also compatible with CC65 (use the provided Makefile to build Scoundrel for Commodore 16/64/128/Plus-4/PET; Apple II/IIe support is being debugged, JRE installation on the host system is required to build disk images) +* [ANSI C89 port](c/scoundrel.c) - also compatible with CC65 (use the provided Makefile to build Scoundrel for Commodore 16/64/128/Plus-4/PET and Atari 400/800/XL; Apple II/IIe support is being debugged, JRE installation on the host system is required to build Apple disk images) ## Ports NOT included in this repo for various reasons diff --git a/c/Makefile b/c/Makefile index efea962..f326821 100644 --- a/c/Makefile +++ b/c/Makefile @@ -4,42 +4,53 @@ PROJNAME=scoundrel CFILES=scoundrel.c PBTDIR=platform-build-tools CCBUILD=cl65 --standard c89 -O -Os +BUILDDIR=build -$(PROJNAME): - $(CC) -std=c89 -O2 -o scoundrel $(CFILES) +$(PROJNAME): bdir + $(CC) -std=c89 -O2 -o $(BUILDDIR)/scoundrel $(CFILES) + +bdir: + mkdir -p $(BUILDDIR) a2-build: $(CCBUILD) -t apple2 -C apple2-system.cfg -o $(PROJNAME).apple2 $(CFILES) -a2: a2-build +a2: a2-build bdir cp $(PBTDIR)/apple2/tpl.dsk $(PROJNAME).dsk java -jar $(PBTDIR)/apple2/ac.jar -p $(PROJNAME).dsk $(PROJNAME).system sys < $$(cl65 --print-target-path)/apple2/util/loader.system java -jar $(PBTDIR)/apple2/ac.jar -as $(PROJNAME).dsk $(PROJNAME) bin < $(PROJNAME).apple2 + mv $(PROJNAME).dsk $(BUILDDIR)/ + rm $(PROJNAME).apple2 a2e-build: $(CCBUILD) -t apple2enh -C apple2enh-system.cfg -o $(PROJNAME).a2enh $(CFILES) -a2e: a2e-build +a2e: a2e-build bdir cp $(PBTDIR)/apple2/tpl.dsk $(PROJNAME)-enh.dsk java -jar $(PBTDIR)/apple2/ac.jar -p $(PROJNAME)-enh.dsk $(PROJNAME).system sys < $$(cl65 --print-target-path)/apple2enh/util/loader.system java -jar $(PBTDIR)/apple2/ac.jar -as $(PROJNAME)-enh.dsk $(PROJNAME) bin < $(PROJNAME).a2enh + mv $(PROJNAME)-enh.dsk $(BUILDDIR)/ + rm $(PROJNAME).a2enh -c64: - $(CCBUILD) -t c64 -o $(PROJNAME).c64 $(CFILES) +atari8bit: bdir + $(CCBUILD) -t atari -o $(BUILDDIR)/$(PROJNAME)-atari.bin $(CFILES) -c16: - $(CCBUILD) -t c16 -o $(PROJNAME).c16 $(CFILES) +c64: bdir + $(CCBUILD) -t c64 -o $(BUILDDIR)/$(PROJNAME)-c64.bin $(CFILES) -c128: - $(CCBUILD) -t c128 -o $(PROJNAME).c128 $(CFILES) +c16: bdir + $(CCBUILD) -t c16 -o $(BUILDDIR)/$(PROJNAME)-c16.bin $(CFILES) -pet: - $(CCBUILD) -t pet -o $(PROJNAME).pet $(CFILES) +c128: bdir + $(CCBUILD) -t c128 -o $(BUILDDIR)/$(PROJNAME)-c128.bin $(CFILES) -plus4: - $(CCBUILD) -t plus4 -o $(PROJNAME).plus4 $(CFILES) +pet: bdir + $(CCBUILD) -t pet -o $(BUILDDIR)/$(PROJNAME)-pet.bin $(CFILES) -all: $(PROJNAME) a2 a2e c64 c16 c128 pet plus4 +plus4:bdir + $(CCBUILD) -t plus4 -o $(BUILDDIR)/$(PROJNAME)-plus4.bin $(CFILES) + +all: $(PROJNAME) a2 a2e atari8bit c64 c16 c128 pet plus4 clean: - rm -f ./$(PROJNAME) *.dsk *.o *.apple2 *.a2enh *.c64 *.c128 *.c16 *.pet *.plus4 + rm -rf $(BUILDDIR) *.o diff --git a/c/scoundrel.c b/c/scoundrel.c index 3626e4f..f397d97 100644 --- a/c/scoundrel.c +++ b/c/scoundrel.c @@ -327,7 +327,7 @@ int main() { srand(time(NULL)); #endif while(1) { - print_msg("===============\nScoundrel--2026\n by Luxferre\n===============\n Good luck!"); + print_msg("\n===============\nScoundrel--2026\n by Luxferre\n===============\n Good luck!"); score = game(); if(score > 0) { printf("You win! Your score: %d\n", score);