mirror of
https://github.com/mi57730/a2d.git
synced 2024-11-26 02:49:18 +00:00
Factor mount/ directory population into separate script
This commit is contained in:
parent
dd38940fe0
commit
f3ac302764
@ -10,7 +10,7 @@ HEADERS = $(wildcard ../*.inc) $(wildcard ../inc/*.inc) $(wildcard *.inc)
|
|||||||
DAS = calculator show.text.file date puzzle sort.directory \
|
DAS = calculator show.text.file date puzzle sort.directory \
|
||||||
show.image.file this.apple eyes
|
show.image.file this.apple eyes
|
||||||
|
|
||||||
TARGETS = $(patsubst %,$(OUTDIR)/%.$$F1,$(DAS))
|
TARGETS = $(patsubst %,$(OUTDIR)/%.built,$(DAS))
|
||||||
|
|
||||||
.PHONY: clean all
|
.PHONY: clean all
|
||||||
all: $(OUTDIR) $(TARGETS)
|
all: $(OUTDIR) $(TARGETS)
|
||||||
@ -22,21 +22,15 @@ clean:
|
|||||||
rm -f $(OUTDIR)/*.o
|
rm -f $(OUTDIR)/*.o
|
||||||
rm -f $(OUTDIR)/*.list
|
rm -f $(OUTDIR)/*.list
|
||||||
rm -f $(OUTDIR)/*.built
|
rm -f $(OUTDIR)/*.built
|
||||||
rm -f $(OUTDIR)/*.\$$F1
|
|
||||||
rm -f $(OUTDIR)/*.sys
|
rm -f $(OUTDIR)/*.sys
|
||||||
|
|
||||||
$(OUTDIR)/%.o: %.s $(HEADERS)
|
$(OUTDIR)/%.o: %.s $(HEADERS)
|
||||||
$(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $<
|
$(CC65)/ca65 $(CAFLAGS) --listing $(basename $@).list -o $@ $<
|
||||||
|
|
||||||
# Built DeskTop segments
|
# Desk Accessory Files
|
||||||
$(OUTDIR)/%.built: $(OUTDIR)/%.o asm.cfg
|
$(OUTDIR)/%.built: $(OUTDIR)/%.o
|
||||||
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
||||||
|
|
||||||
# Desk Accessories .$F1
|
|
||||||
$(OUTDIR)/%.$$F1: $(OUTDIR)/%.o
|
|
||||||
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
|
||||||
xattr -wx prodos.AuxType '40 06' '$@'
|
|
||||||
|
|
||||||
# System Files .SYS
|
# System Files .SYS
|
||||||
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
||||||
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
||||||
|
@ -28,9 +28,9 @@ New desk accessories:
|
|||||||
|
|
||||||
On Unix-like systems (including Mac OS X) `make all` should build
|
On Unix-like systems (including Mac OS X) `make all` should build
|
||||||
build the desk accessory files (original and new) into `out/`
|
build the desk accessory files (original and new) into `out/`
|
||||||
output with a `.$F1` suffix, representing the $F1 file type required.
|
output with a `.built` suffix.
|
||||||
|
|
||||||
For the original DAs, the `.$F1` and `.bin` files can be compared
|
For the original DAs, the `.built` and `.bin` files can be compared
|
||||||
using `diff` to ensure that no changes have been introduced by the
|
using `diff` to ensure that no changes have been introduced by the
|
||||||
disassembly process.
|
disassembly process.
|
||||||
|
|
||||||
@ -67,21 +67,25 @@ below.
|
|||||||
If you use [Virtual \]\[](http://www.virtualii.com/) as your emulator,
|
If you use [Virtual \]\[](http://www.virtualii.com/) as your emulator,
|
||||||
you can skip creating a disk image.
|
you can skip creating a disk image.
|
||||||
|
|
||||||
With `desk.acc` as your current directory, create a `mount` folder,
|
With `desk.acc` as your current directory, run the `res/mount.sh`
|
||||||
run the `res/go.sh` script, and the built files will automatically be
|
script. This will create a `desk.acc/mount` folder and the built files
|
||||||
copied in. Then run Virtual ]\[ and use the **Media** > **Mount Folder
|
will automatically be copied in. Then run Virtual ]\[ and use the
|
||||||
as ProDOS Disk...** menu item. A new ProDOS volume called `/MOUNT` will
|
**Media** > **Mount Folder as ProDOS Disk...** menu item, then select
|
||||||
be available.
|
the `desk.acc/mount` folder. A new ProDOS volume called `/MOUNT` will
|
||||||
|
be available. (Tip: use the **Special** > **Check Drives** command in
|
||||||
|
A2D to make it appear.)
|
||||||
|
|
||||||
|
(The `res/go.sh` script will helpfully run `res/mount.sh`
|
||||||
|
automatically if the `mount` folder already exists.)
|
||||||
|
|
||||||
### Other
|
### Other
|
||||||
|
|
||||||
If you need to copy the files some other way (e.g. via
|
If you need to copy the files some other way (e.g. via
|
||||||
[CiderPress](http://a2ciderpress.com/)), you need to do the following:
|
[CiderPress](http://a2ciderpress.com/)), you need to do the following:
|
||||||
|
|
||||||
Transfer the `.$F1` files in the `out` directory, ensuring you:
|
Transfer the `.built` files in the `out` directory, ensuring you:
|
||||||
|
|
||||||
* Drop the suffix
|
* Drop the `.built` suffix
|
||||||
* Replace `.` in the name with spaces
|
|
||||||
* Ensure they have ProDOS file type `$F1`
|
* Ensure they have ProDOS file type `$F1`
|
||||||
* Ensure they have start address `$800`
|
* Ensure they have start address `$800`
|
||||||
* Ensure they have auxtype `$0640` (to match the originals)
|
* Ensure they have auxtype `$0640` (to match the originals)
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Run this from the desk.acc directory
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
function cecho {
|
function cecho {
|
||||||
@ -19,7 +21,7 @@ function do_make {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function verify {
|
function verify {
|
||||||
diff "orig/$1.bin" "out/$1.\$F1" \
|
diff "orig/$1.bin" "out/$1.built" \
|
||||||
&& (cecho green "diff $1 good" ) \
|
&& (cecho green "diff $1 good" ) \
|
||||||
|| (tput blink ; cecho red "DIFF $1 BAD" ; return 1)
|
|| (tput blink ; cecho red "DIFF $1 BAD" ; return 1)
|
||||||
}
|
}
|
||||||
@ -28,13 +30,6 @@ function stats {
|
|||||||
echo "$(printf '%-20s' $1)""$(../res/stats.pl < $1)"
|
echo "$(printf '%-20s' $1)""$(../res/stats.pl < $1)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function mount {
|
|
||||||
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
|
|
||||||
cp "out/$1" "mount/$uppercase" \
|
|
||||||
&& (cecho green "mounted $uppercase" ) \
|
|
||||||
|| (cecho red "failed to mount $uppercase" ; return 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
#do_make clean
|
#do_make clean
|
||||||
do_make all
|
do_make all
|
||||||
|
|
||||||
@ -54,10 +49,7 @@ stats "date.s"
|
|||||||
stats "puzzle.s"
|
stats "puzzle.s"
|
||||||
stats "sort.directory.s"
|
stats "sort.directory.s"
|
||||||
|
|
||||||
# Mountable directory
|
# Mountable directory for Virtual ][
|
||||||
if [ -d mount ]; then
|
if [ -d mount ]; then
|
||||||
echo "Copying files to mount/"
|
res/mount.sh
|
||||||
mount 'show.image.file.$F1'
|
|
||||||
mount 'this.apple.$F1'
|
|
||||||
mount 'eyes.$F1'
|
|
||||||
fi
|
fi
|
||||||
|
31
desk.acc/res/mount.sh
Executable file
31
desk.acc/res/mount.sh
Executable file
@ -0,0 +1,31 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Run this from the desk.acc directory
|
||||||
|
|
||||||
|
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 mount {
|
||||||
|
uppercase=$(echo "$1" | tr /a-z/ /A-Z/)
|
||||||
|
src="out/$1.built"
|
||||||
|
dst="mount/$uppercase.\$F1"
|
||||||
|
cp "$src" "$dst" \
|
||||||
|
&& xattr -wx prodos.AuxType '40 06' "$dst" \
|
||||||
|
&& (cecho green "mounted $dst" ) \
|
||||||
|
|| (cecho red "failed to mount $dst" ; return 1)
|
||||||
|
}
|
||||||
|
|
||||||
|
mkdir -p mount
|
||||||
|
echo "Copying files to mount/"
|
||||||
|
mount 'show.image.file'
|
||||||
|
mount 'this.apple'
|
||||||
|
mount 'eyes'
|
@ -24,7 +24,7 @@ echo "" > "$FINFO"
|
|||||||
for file in $DAS; do
|
for file in $DAS; do
|
||||||
ucfile=$(echo $file | tr a-z A-Z)
|
ucfile=$(echo $file | tr a-z A-Z)
|
||||||
echo "$ucfile=Type(F1),AuxType(0640),VersionCreate(00),MinVersion(B9),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)" >> "$FINFO"
|
echo "$ucfile=Type(F1),AuxType(0640),VersionCreate(00),MinVersion(B9),Access(E3),FolderInfo1(000000000000000000000000000000000000),FolderInfo2(000000000000000000000000000000000000)" >> "$FINFO"
|
||||||
cp "out/$file.\$F1" "out/package/$ucfile"
|
cp "out/$file.built" "out/package/$ucfile"
|
||||||
done
|
done
|
||||||
|
|
||||||
# Create a new disk image.
|
# Create a new disk image.
|
||||||
|
@ -22,7 +22,6 @@ clean:
|
|||||||
rm -f $(OUTDIR)/*.o
|
rm -f $(OUTDIR)/*.o
|
||||||
rm -f $(OUTDIR)/*.list
|
rm -f $(OUTDIR)/*.list
|
||||||
rm -f $(OUTDIR)/*.built
|
rm -f $(OUTDIR)/*.built
|
||||||
rm -f $(OUTDIR)/*.\$$F1
|
|
||||||
rm -f $(OUTDIR)/*.sys
|
rm -f $(OUTDIR)/*.sys
|
||||||
|
|
||||||
$(OUTDIR)/ovl34567.o: ovl34567.s $(HEADERS) ovl3.s ovl4.s ovl5.s ovl6.s ovl7.s
|
$(OUTDIR)/ovl34567.o: ovl34567.s $(HEADERS) ovl3.s ovl4.s ovl5.s ovl6.s ovl7.s
|
||||||
@ -35,11 +34,6 @@ $(OUTDIR)/%.o: %.s $(HEADERS)
|
|||||||
$(OUTDIR)/%.built: $(OUTDIR)/%.o asm.cfg
|
$(OUTDIR)/%.built: $(OUTDIR)/%.o asm.cfg
|
||||||
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
||||||
|
|
||||||
# Desk Accessories .$F1
|
|
||||||
$(OUTDIR)/%.$$F1: $(OUTDIR)/%.o
|
|
||||||
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
|
||||||
xattr -w prodos.AuxType '@' '$@'
|
|
||||||
|
|
||||||
# System Files .SYS
|
# System Files .SYS
|
||||||
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
$(OUTDIR)/%.SYS: $(OUTDIR)/%.o
|
||||||
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
$(CC65)/ld65 $(CCFLAGS) -o '$@' $<
|
||||||
|
Loading…
Reference in New Issue
Block a user