VolksForth/8080/CPM/emulator/run-in-runcpm.sh
Philip Zembrod 0062c769c7 First make-controlled loading of an fb file in CPM VolksForth with logfile output.
Also make rules to convert .fb files to .fth and to run the msdos editor
2022-04-30 23:11:58 +02:00

33 lines
876 B
Bash
Executable File

#!/bin/bash
set -e
emulatordir="$(realpath --relative-to="$PWD" "$(dirname "${BASH_SOURCE[0]}")")"
basedir="$(realpath --relative-to="$PWD" "${emulatordir}/..")"
cpmfilesdir="${basedir}/cpmfiles"
runcpmdir="${basedir}/runcpm"
runcpm_a0="${runcpmdir}/A/0"
toolsdir="${basedir}/../../tools"
logfile="${runcpmdir}/output.log"
scriptfile="${runcpmdir}/input.script"
rm -f "${logfile}"
test -d "${runcpm_a0}" || mkdir -p "${runcpm_a0}"
for pathname in ${cpmfilesdir}/*
do
echo $pathname
filename="$(realpath --relative-to="${cpmfilesdir}" "${pathname}")"
echo $filename
uppercase_filename="$("${toolsdir}/echo-toupper.py" "${filename}")"
echo $uppercase_filename
cp "${pathname}" "${runcpm_a0}/${uppercase_filename}"
done
if [[ -f "${scriptfile}" ]]; then
"${runcpmdir}/RunCPM" -i "${scriptfile}" -o "${logfile}"
else
"${runcpmdir}/RunCPM" -o "${logfile}"
fi