diff --git a/desk.acc/.gitignore b/desk.acc/.gitignore index cb59be2..3c793f5 100644 --- a/desk.acc/.gitignore +++ b/desk.acc/.gitignore @@ -1,2 +1,12 @@ + +# Object files (assembler output, pre-linking) *.o + +# Listing files (to review offsets) *.list + +# Output files (ProDOS file type F1) +*.F1 + +# Directory mounted in Virtual ][ as a ProDOS volume +mount diff --git a/desk.acc/Makefile b/desk.acc/Makefile new file mode 100644 index 0000000..f223661 --- /dev/null +++ b/desk.acc/Makefile @@ -0,0 +1,22 @@ + +CC65 = ~/dev/cc65/bin +CAFLAGS = --target apple2enh --list-bytes 0 +CCFLAGS = --config apple2-asm.cfg + +# ProDOS file type is $F1 ($ is pesky) +TARGETS = show_text_file.F1 show_dhr_file.F1 + +.PHONY: clean all +all: $(TARGETS) + +HEADERS = $(wildcard ../*.h) + +clean: + rm -f *.o + rm -f $(TARGETS) + +%.o: %.s $(HEADERS) + $(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $< + +%.F1: %.o + $(CC65)/ld65 $(CCFLAGS) -o $@ $< diff --git a/desk.acc/README.md b/desk.acc/README.md index 71a2fc7..602ff63 100644 --- a/desk.acc/README.md +++ b/desk.acc/README.md @@ -6,18 +6,20 @@ Disassembly of the desk accessories: * [Show Text File](show_text_file.s) - in progress! * Sort Directory - _not started_ +New desk accessories: +* [Show DHR File](show_dhr_file.s) - in progress! + ## Desk Accessory Details * Loaded at $800 through (at least) $14FF * Copy themselves from Main into Aux memory (same location) * Can call into ProDOS MLI and A2D entry points ($4000, etc) -## Process +## Files -* `go.sh` - bash script used to drive the initial disassembly - (now commented out) and building +* `Makefile` - cleans/builds targets +* `go.sh` - bash script to build, verify, and copy files * `*.bin` - original binary (type $F1, start $800) * `*.info` - da65 "info" file - used to inform disassembly * `*.s` - source (originally generated using da65, now modified) -* `*` - linked target - byte-for-byte identical with original diff --git a/desk.acc/go.sh b/desk.acc/go.sh index c28ae45..8ca0429 100755 --- a/desk.acc/go.sh +++ b/desk.acc/go.sh @@ -2,36 +2,16 @@ set -e -CC65=~/dev/cc65/bin - -original=show_text_file.bin -disasm=show_text_file.d - -src=show_text_file.s -obj=show_text_file.o -list=show_text_file.list -out=show_text_file - -# Origin of STF -#echo ' .org $800' > $disasm - -# Disassemble original source -#$CC65/da65 $original --info show_text_file.info >> $disasm - -#cp $disasm $src - -# Assemble -$CC65/ca65 --target apple2enh --listing $list --list-bytes 0 -o $obj $src - -# Link -$CC65/ld65 --config apple2-asm.cfg -o $out $obj +make clean +make all # Verify original and output match -diff $original $out +diff show_text_file.bin show_text_file.F1 \ + && echo "Files match" -$CC65/ca65 --target apple2enh --listing dhr.list --list-bytes 0 -o dhr.o dhr.s -$CC65/ld65 --config apple2-asm.cfg -o dhr dhr.o +cat show_dhr_file.F1 > mount/SHOW.DHR.FILE.\$F1 \ + && echo "Updated mounted file" # Show output for review #less $list -less dhr.list +#less dhr.list diff --git a/desk.acc/dhr.s b/desk.acc/show_dhr_file.s similarity index 100% rename from desk.acc/dhr.s rename to desk.acc/show_dhr_file.s diff --git a/desk.acc/stf b/desk.acc/stf deleted file mode 100644 index 79c30bc..0000000 Binary files a/desk.acc/stf and /dev/null differ