From 5f825cfeabf0e1e95f0df2a381ec97eb91eaafe7 Mon Sep 17 00:00:00 2001 From: Joshua Bell Date: Mon, 5 Nov 2018 20:14:29 -0800 Subject: [PATCH] Move DESKTOP.SYSTEM a.k.a. DESKTOP1 to separate directory --- .travis.yml | 3 ++ CONTRIBUTING.md | 1 - desk.acc/Makefile | 5 -- desktop.system/.gitignore | 12 +++++ desktop.system/Makefile | 31 ++++++++++++ desktop.system/README.md | 14 ++++++ .../sys.s => desktop.system/desktop.system.s | 2 +- desktop.system/inc/README.md | 4 ++ {desktop => desktop.system}/inc/bs.dat | Bin .../orig/DESKTOP.SYSTEM.SYS | Bin desktop.system/res/go.sh | 44 ++++++++++++++++++ desktop/Makefile | 7 +-- desktop/README.md | 16 +------ desktop/inc/README.md | 11 ----- desktop/ovl2.s | 2 +- desktop/res/go.sh | 3 +- desktop/res/package.sh | 2 +- inc/README.md | 3 ++ {desktop/inc => inc}/pdload.dat | Bin 19 files changed, 117 insertions(+), 43 deletions(-) create mode 100644 desktop.system/.gitignore create mode 100644 desktop.system/Makefile create mode 100644 desktop.system/README.md rename desktop/sys.s => desktop.system/desktop.system.s (99%) create mode 100644 desktop.system/inc/README.md rename {desktop => desktop.system}/inc/bs.dat (100%) rename {desktop => desktop.system}/orig/DESKTOP.SYSTEM.SYS (100%) create mode 100755 desktop.system/res/go.sh create mode 100644 inc/README.md rename {desktop/inc => inc}/pdload.dat (100%) diff --git a/.travis.yml b/.travis.yml index 0052f2b..b0d03ec 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,9 @@ install: make -C /tmp/cc65 ca65 ld65 script: +- cd $TRAVIS_BUILD_DIR/desktop.system && + MAKE_FLAGS="CC65=/tmp/cc65/bin" res/go.sh + - cd $TRAVIS_BUILD_DIR/desktop && MAKE_FLAGS="CC65=/tmp/cc65/bin" res/go.sh diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3905e90..fdad6dd 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -37,7 +37,6 @@ modify. Here's a snapshot of the output for some files: ``` Stats: -sys.s unscoped: 20 scoped: 15 raw: 4 unrefed: 0 desktop_main.s unscoped: 246 scoped: 1109 raw: 60 unrefed: 29 desktop_res.s unscoped: 64 scoped: 0 raw: 4 unrefed: 64 desktop_aux.s unscoped: 83 scoped: 301 raw: 2 unrefed: 32 diff --git a/desk.acc/Makefile b/desk.acc/Makefile index ec920a4..0191a48 100644 --- a/desk.acc/Makefile +++ b/desk.acc/Makefile @@ -29,8 +29,3 @@ $(OUTDIR)/%.o: %.s $(HEADERS) # Desk Accessory Files $(OUTDIR)/%.built: $(OUTDIR)/%.o $(CC65)/ld65 $(CCFLAGS) -o '$@' $< - -# System Files .SYS -$(OUTDIR)/%.SYS: $(OUTDIR)/%.o - $(CC65)/ld65 $(CCFLAGS) -o '$@' $< - xattr -wx prodos.AuxType '00 20' $@ diff --git a/desktop.system/.gitignore b/desktop.system/.gitignore new file mode 100644 index 0000000..fe9fa07 --- /dev/null +++ b/desktop.system/.gitignore @@ -0,0 +1,12 @@ + +# Build directory +out + +# "Info" files guiding disassembly +*.info + +# Directory mounted in Virtual ][ as a ProDOS volume +mount + +# OS-specific files +.DS_Store diff --git a/desktop.system/Makefile b/desktop.system/Makefile new file mode 100644 index 0000000..e51dc04 --- /dev/null +++ b/desktop.system/Makefile @@ -0,0 +1,31 @@ + +CC65 = ~/dev/cc65/bin +CAFLAGS = --target apple2enh --list-bytes 0 +CCFLAGS = --config apple2-asm.cfg + +OUTDIR = out + +HEADERS = $(wildcard ../*.inc) + +TARGETS = $(OUTDIR)/desktop.system.SYS + +.PHONY: clean all +all: $(OUTDIR) $(TARGETS) + +$(OUTDIR): + mkdir -p $(OUTDIR) + +clean: + rm -f $(OUTDIR)/*.o + rm -f $(OUTDIR)/*.list + rm -f $(OUTDIR)/*.inc + rm -f $(OUTDIR)/*.built + rm -f $(OUTDIR)/*.SYS + +$(OUTDIR)/%.o: %.s $(HEADERS) + $(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $< + +# System Files .SYS +$(OUTDIR)/%.SYS: $(OUTDIR)/%.o + $(CC65)/ld65 $(CCFLAGS) -o '$@' $< + xattr -wx prodos.AuxType '00 20' $@ diff --git a/desktop.system/README.md b/desktop.system/README.md new file mode 100644 index 0000000..3dd72fc --- /dev/null +++ b/desktop.system/README.md @@ -0,0 +1,14 @@ +# DeskTop diassembly notes - DESKTOP.SYSTEM + +`desktop.system.s` + +A short (8k) loader program. This is responsible for copying the rest +to a RAM card (if available), then invoking the main app. The second +half is used to "Down load", i.e. copy Selector entries to RAMCard on +first boot. + +The file is present in the original distribution as `DESKTOP1` but is +renamed `DESKTOP.SYSTEM` in many disk images to be launched at boot. + +The main app (`DESKTOP2`) is invoked by loading only the first segment, +which in turn loads the rest of the segments of the file. diff --git a/desktop/sys.s b/desktop.system/desktop.system.s similarity index 99% rename from desktop/sys.s rename to desktop.system/desktop.system.s index e55eb45..ebd0095 100644 --- a/desktop/sys.s +++ b/desktop.system/desktop.system.s @@ -936,7 +936,7 @@ slot: .byte 0 prodos_loader_blocks: .assert * = $2C00, error, "Segment length mismatch" - .incbin "inc/pdload.dat" + .incbin "../inc/pdload.dat" .endproc ; copy_desktop_to_ramcard diff --git a/desktop.system/inc/README.md b/desktop.system/inc/README.md new file mode 100644 index 0000000..9fc540c --- /dev/null +++ b/desktop.system/inc/README.md @@ -0,0 +1,4 @@ +## `bs.dat` + +A chunk of BASIC.SYSTEM 1.1, inexplicably found padding out the end of +DESKTOP.SYSTEM.SYS. diff --git a/desktop/inc/bs.dat b/desktop.system/inc/bs.dat similarity index 100% rename from desktop/inc/bs.dat rename to desktop.system/inc/bs.dat diff --git a/desktop/orig/DESKTOP.SYSTEM.SYS b/desktop.system/orig/DESKTOP.SYSTEM.SYS similarity index 100% rename from desktop/orig/DESKTOP.SYSTEM.SYS rename to desktop.system/orig/DESKTOP.SYSTEM.SYS diff --git a/desktop.system/res/go.sh b/desktop.system/res/go.sh new file mode 100755 index 0000000..dc19bea --- /dev/null +++ b/desktop.system/res/go.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +function cecho { + case $1 in + red) tput setaf 1 ;; + green) tput setaf 2 ;; + yellow) tput setaf 3 ;; + esac + echo -e "$2" + tput sgr0 +} + +function do_make { + make $MAKE_FLAGS "$1" \ + && (cecho green "make $1 good") \ + || (tput blink ; cecho red "MAKE $1 BAD" ; return 1) +} + +function verify { + diff "orig/$1" "out/$2" \ + && (cecho green "diff $2 good" ) \ + || (tput blink ; cecho red "DIFF $2 BAD" ; return 1) +} + +function stats { + echo "$(printf '%-15s' $1)""$(../res/stats.pl < $1)" +} + +#do_make clean +do_make all + +SOURCES="desktop.system" + +# Verify original and output match +echo "Verifying diffs:" +verify "DESKTOP.SYSTEM.SYS" "desktop.system.SYS" + +# Compute stats +echo "Stats:" +for t in $SOURCES; do + stats "$t.s" +done; diff --git a/desktop/Makefile b/desktop/Makefile index 81230c2..bacd3fa 100644 --- a/desktop/Makefile +++ b/desktop/Makefile @@ -10,7 +10,7 @@ HEADERS = $(wildcard ../*.inc) $(wildcard ../inc/*.inc) $(wildcard *.inc) SEGMENTS = loader mgtk desktop invoker \ ovl1 ovl1a ovl1b ovl1c ovl2 ovl34567 -TARGETS = $(OUTDIR)/DESKTOP2.built $(OUTDIR)/sys.SYS +TARGETS = $(OUTDIR)/DESKTOP2.built .PHONY: clean all all: $(OUTDIR) $(TARGETS) @@ -45,8 +45,3 @@ $(OUTDIR)/%.built: $(OUTDIR)/%.o asm.cfg # DeskTop combined $(OUTDIR)/DESKTOP2.built: $(patsubst %,$(OUTDIR)/%.built,$(SEGMENTS)) cat $(patsubst %,$(OUTDIR)/%.built,$(SEGMENTS)) > $@ - -# System Files .SYS -$(OUTDIR)/%.SYS: $(OUTDIR)/%.o - $(CC65)/ld65 $(CCFLAGS) -o '$@' $< - xattr -wx prodos.AuxType '00 20' $@ diff --git a/desktop/README.md b/desktop/README.md index 94b062b..ee094c8 100644 --- a/desktop/README.md +++ b/desktop/README.md @@ -1,19 +1,5 @@ -# DeskTop diassembly notes - -## DESKTOP.SYSTEM - -`sys.s` - -A short (8k) loader program. This is responsible for copying -the rest to a RAM card (if available), then invoking the main app. -The second half is used to "Down load", i.e. copy -Selector entries to RAMCard on first boot. - -The file is present in the original distribution as `DESKTOP1` but -is renamed `DESKTOP.SYSTEM` in many disk images to be launched at boot. - -## DESKTOP2.$F1 +# DeskTop diassembly notes - DESKTOP2.$F1 This is large - 111k. It includes a loader and the DeskTop app with both main memory and aux memory segments, filling everything from diff --git a/desktop/inc/README.md b/desktop/inc/README.md index 21531d6..61ede2c 100644 --- a/desktop/inc/README.md +++ b/desktop/inc/README.md @@ -4,14 +4,3 @@ Header defining various resources in the language card area, used by overlays. TODO: Make the linker take care of this, use exports/imports instead. - - -## `pdload.dat` - -ProDOS Loader blocks, used when formatting a disk. - - -## `bs.dat` - -A chunk of BASIC.SYSTEM 1.1, inexplicably found padding out the end of -DESKTOP.SYSTEM.SYS. diff --git a/desktop/ovl2.s b/desktop/ovl2.s index 7b699bf..a8a572d 100644 --- a/desktop/ovl2.s +++ b/desktop/ovl2.s @@ -1409,7 +1409,7 @@ L14E5: .byte $00,$00,$00,$00,$00,$00,$00,$00 ;;; ============================================================ .proc prodos_loader_blocks - .incbin "inc/pdload.dat" + .incbin "../inc/pdload.dat" .endproc .assert .sizeof(prodos_loader_blocks) = $400, error, "Bad data" diff --git a/desktop/res/go.sh b/desktop/res/go.sh index c599155..5e1a649 100755 --- a/desktop/res/go.sh +++ b/desktop/res/go.sh @@ -33,7 +33,7 @@ do_make all COMMON="loader mgtk invoker ovl1 ovl1a ovl1b ovl1c ovl2" TARGETS="desktop $COMMON ovl34567" -SOURCES="sys desktop_main desktop_res desktop_aux $COMMON ovl3 ovl4 ovl5 ovl6 ovl7" +SOURCES="desktop_main desktop_res desktop_aux $COMMON ovl3 ovl4 ovl5 ovl6 ovl7" # Verify original and output match echo "Verifying diffs:" @@ -41,7 +41,6 @@ for t in $TARGETS; do verify "DESKTOP2_$t" "$t.built" done; verify "DESKTOP2.\$F1" "DESKTOP2.built" -verify "DESKTOP.SYSTEM.SYS" "sys.SYS" # Compute stats echo "Stats:" diff --git a/desktop/res/package.sh b/desktop/res/package.sh index e4df58d..94387ac 100755 --- a/desktop/res/package.sh +++ b/desktop/res/package.sh @@ -22,7 +22,7 @@ DESKTOP.SYSTEM=Type(FF),AuxType(0),VersionCreate(00),MinVersion(B9),Access(E3),F DESKTOP2=Type(F1),AuxType(0),VersionCreate(00),MinVersion(B9),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000) EOF -cp "out/sys.SYS" "$PACKDIR/DESKTOP.SYSTEM" +cp "../desktop.system/out/desktop.system.SYS" "$PACKDIR/DESKTOP.SYSTEM" cp "out/DESKTOP2.built" "$PACKDIR/DESKTOP2" # Create a new disk image. diff --git a/inc/README.md b/inc/README.md new file mode 100644 index 0000000..71659db --- /dev/null +++ b/inc/README.md @@ -0,0 +1,3 @@ +## `pdload.dat` + +ProDOS Loader blocks, used when formatting a disk. diff --git a/desktop/inc/pdload.dat b/inc/pdload.dat similarity index 100% rename from desktop/inc/pdload.dat rename to inc/pdload.dat