Make rules & scripts to run vf-lite-x16 in x16emu with sdcard attached

This commit is contained in:
Philip Zembrod 2020-11-04 23:37:27 +01:00
parent a680fb282c
commit d1a6435700
4 changed files with 77 additions and 3 deletions

View File

@ -27,7 +27,7 @@ clean:
rm -f cbmfiles/*.fr cbmfiles/*.fth cbmfiles/*.log
rm -f *.log *.result *.golden
rm -f cbmfiles/c??-testbase
rm -f disks/scratch.d64
rm -f disks/scratch.d64 emulator/sdcard.img
# Convenience targets
@ -129,6 +129,13 @@ test-lite-c16-.log: emulator/vf-lite-c16-.T64
"include run-lite-tests.fth\n1234567890\n"
petscii2ascii cbmfiles/test.log $@
test-lite-x16.log: cbmfiles/vf-lite-x16 emulator/sdcard.img
rm -f cbmfiles/test.log
emulator/run-in-x16emu.sh vf-lite-x16 \
"include run-lite-tests.fth\n1234567890\n"
mcopy -i emulator/sdcard.img ::TEST.LOG cbmfiles/test.log
petscii2ascii cbmfiles/test.log $@
test-%.result: test-%.log test-%.golden tests/evaluate-test.sh
rm -f $@
tests/evaluate-test.sh $(basename $@)
@ -136,6 +143,12 @@ test-%.result: test-%.log test-%.golden tests/evaluate-test.sh
disks/scratch.d64: disks/empty.d64
cp $< $@
emulator/sdcard.img: emulator/sdcard.sfdisk
rm -f $@ $@.tmp
dd if=/dev/zero of=$@.tmp count=64 bs=1M
sfdisk -w always -W always $@.tmp < $<
mformat -i $@.tmp -F
mv $@.tmp $@
test-full-c64.golden: $(patsubst %, tests/golden/%.golden, \
prelim core coreext double block report-blk)

View File

@ -18,7 +18,7 @@ keybuf=""
warp=""
if [ -n "$2" ]
then
keybuf="${2}" # dos s0:notdone\n"
keybuf="${2}"
# The following could also just be a cp.
ascii2petscii "${emulatordir}/notdone" "${basedir}/cbmfiles/notdone"
warp="-warp"
@ -51,7 +51,7 @@ then
sleep 0.5
kill9log="${basedir}/kill-9.log"
vicepid=$(jobs -p %1)
vicepid="$(jobs -p %1)"
kill %1
(sleep 20; ps -q "${vicepid}" -f --no-headers && \
(kill -9 "${vicepid}" ; date)) >> "${kill9log}" 2>&1 &

View File

@ -0,0 +1,55 @@
#!/bin/bash
set -e
#set -x
emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")"
basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")"
cbmfilesdir="${basedir}/cbmfiles"
sdcard="${emulatordir}/sdcard.img"
mformat -i "${sdcard}" -F
for asciifile in $(cd "${cbmfilesdir}" && ls *.fth *fr)
do
petsciifile="$(echo ${asciifile} | ascii2petscii - |tr -d '\r')"
mcopy -i "${sdcard}" "${cbmfilesdir}/$asciifile" "::${petsciifile}"
done
autostart=""
if [ -n "$1" ]
then
autostart="-prg ${cbmfilesdir}/${1} -run"
fi
keybuf=""
warp=""
if [ -n "$2" ]
then
keybuf="${2}"
mcopy -i "${sdcard}" "${emulatordir}/notdone" "::NOTDONE"
# warp="-warp"
fi
x16emu \
-keymap de \
-scale 2 \
-debug \
-sdcard "${sdcard}" \
$autostart \
$warp \
&
if [ -n "$keybuf" ]
then
while mtype -i "${sdcard}" "::NOTDONE" > /dev/null
do sleep 1
done
sleep 0.5
kill9log="${basedir}/kill-9.log"
x16emupid="$(jobs -p %1)"
kill %1
(sleep 20; ps -q "${x16emupid}" -f --no-headers && \
(kill -9 "${x16emupid}" ; date)) >> "${kill9log}" 2>&1 &
fi
wait %1 || echo "x16emu returned $?"

View File

@ -0,0 +1,6 @@
label: dos
label-id: 0x00000000
device: emulator/my-image.fat
unit: sectors
emulator/my-image.fat1 : start= 1, size= 131040, type=c, bootable