diff --git a/.gitignore b/.gitignore index 41c78f7..54c2cad 100644 --- a/.gitignore +++ b/.gitignore @@ -74,7 +74,6 @@ roms/SHARP_MZ80A_RFS_IMAGE_1.img roms/cmp tools/Master0.z80 tools/Master1.z80 -tools/assemble_rfs.sh src/tools/.flashmmcfg.c.swo src/tools/x CPM/1M44/DSK/CPM_1M44_RFS_1.DSK diff --git a/tools/assemble_rfs.sh b/tools/assemble_rfs.sh new file mode 100755 index 0000000..d05ff56 --- /dev/null +++ b/tools/assemble_rfs.sh @@ -0,0 +1,67 @@ +#!/bin/bash +######################################################################################################### +## +## Name: assemble_rfs.sh +## Created: August 2018 +## Author(s): Philip Smart +## Description: Sharp MZ series RFS ROM assembly tool +## This script takes Sharp MZ RFS ROMS in assembler format and compiles/assembles them +## into a ROM file using the GLASS Z80 assembler. +## +## Credits: +## Copyright: (c) 2018-23 Philip Smart +## +## History: August 2018 - Initial script written. +## February 2023 - Updated as RFS extracted into seperate repository. +## +######################################################################################################### +## This source file is free software: you can redistribute it and#or modify +## it under the terms of the GNU General Public License as published +## by the Free Software Foundation, either version 3 of the License, or +## (at your option) any later version. +## +## This source file is distributed in the hope that it will be useful, +## but WITHOUT ANY WARRANTY; without even the implied warranty of +## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +## GNU General Public License for more details. +## +## You should have received a copy of the GNU General Public License +## along with this program. If not, see . +######################################################################################################### + +ROOTDIR=`pwd | sed 's/\/tools//g'` +TOOLDIR=${ROOTDIR}/tools +JARDIR=${ROOTDIR}/tools +ASM=glass.jar +BUILDROMLIST="rfs rfs_mrom" +BUILDMZFLIST="" +ASMDIR=${ROOTDIR}/asm +ASMTMPDIR=${ROOTDIR}/tmp +INCDIR=${ROOTDIR}/asm/include +ROMDIR=${ROOTDIR}/roms +MZFDIR=${ROOTDIR}/MZB/Common + +# Go through list and build image. +# +for f in ${BUILDROMLIST} ${BUILDMZFLIST} +do + echo "Assembling: $f..." + + # Assemble the source. + echo "java -jar ${JARDIR}/${ASM} ${ASMDIR}/${f}.asm ${ASMTMPDIR}/${f}.obj ${ASMTMPDIR}/${f}.sym" + java -jar ${JARDIR}/${ASM} ${ASMDIR}/${f}.asm ${ASMTMPDIR}/${f}.obj ${ASMTMPDIR}/${f}.sym -I ${INCDIR} + + # On successful compile, perform post actions else go onto next build. + # + if [ $? = 0 ] + then + # The object file is binary, no need to link, copy according to build group. + if [[ ${BUILDROMLIST} = *"${f}"* ]]; then + echo "Copy ${ASMTMPDIR}/${f}.obj to ${ROMDIR}/${f}.rom" + cp ${ASMTMPDIR}/${f}.obj ${ROMDIR}/${f}.rom + else + echo "Copy ${ASMTMPDIR}/${f}.obj to ${MZFDIR}/${f}.mzf" + cp ${ASMTMPDIR}/${f}.obj ${MZFDIR}/${f}.mzf + fi + fi +done