#!/bin/bash
#########################################################################################################
##
## Name:            make_roms.sh
## Created:         August 2018
## Author(s):       Philip Smart
## Description:     Sharp MZ series Flash ROM Packaging tool
##                  This is a very basic script to package programs into ROM images suitable for
##                  programming into the Flash ROMS. It needs a rewrite but for now please
##                  manually edit the list below to select the programs you want, run the script
##                  and flash the images created into the Flast ROMS.
##
## Credits:         
## Copyright:       (c) 2020-23 Philip Smart <philip.smart@net2net.org>
##
## History:         January 2020  - Initial script written.
##                  March 2021    - Updates for the RFS v2.1 board.
##                  April 2021    - Removed the CPM ROM Drive functionality as it provided no benefit
##                                  over SD card and SD cards are larger.
##                  February 2023 - Updated as RFS extracted into seperate repository.
##                  June 2023     - Updated to make the Kuma version of the monitor.
##                  November 2023 - Updated to build seperate SFD700 Version of ROM.
##                  February 2026 - Updated to make picoZ80 Version of ROMDISK ROMs.
##
#########################################################################################################
## 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 <http://www.gnu.org/licenses/>.
#########################################################################################################

ROOTDIR=`pwd | sed 's/\/tools//g'`
MZB_PATH=${ROOTDIR}/MZB
ROM_PATH=${ROOTDIR}/roms/
ROM_LIST_FILE=/tmp/ROMLIST
SECTORSIZE=256
#CPMDISKMODE=SPLIT
MZFTOOL=${ROOTDIR}/tools/mzftool.pl
MONITOR_ROM_ROMDISK=/tmp/mrom_romdisk.rom
USER_ROM_I_ROMDISK=/tmp/user_romdisk.rom
USER_ROM_II_ROMDISK=/tmp/user2_romdisk.rom
USER_ROM_III_ROMDISK=/tmp/user3_romdisk.rom
SFD700_ROM=/tmp/sfd700.rom
MONITOR_ROM_PICOZ80=/tmp/mrom_picoz80.rom
USER_ROM_I_PICOZ80=/tmp/user_picoz80.rom
USER_ROM_II_PICOZ80=/tmp/user2_picoz80.rom
USER_ROM_III_PICOZ80=/tmp/user3_picoz80.rom

function addMZFToROMImageList
{
    local INCLUDE_RFS=$1
    local INCLUDE_SFD700=$2
    local INCLUDE_PICOZ80=$3
    local INCLUDE_RSV1=$4
    local MZFFILE=$5
 
    if [[ ${INCLUDE_RFS} -eq 1 ]]; then
        ROM_INCLUDE+="${MZFFILE}:"
    fi
    if [[ ${INCLUDE_SFD700} -eq 1 ]]; then
        ROM_INCLUDE_SFD700+="${MZFFILE}:"
    fi
    if [[ ${INCLUDE_PICOZ80} -eq 1 ]]; then
        ROM_INCLUDE_PICOZ80+="${MZFFILE}:"
    fi
    if [[ ${INCLUDE_RSV1} -eq 1 ]]; then
        ROM_INCLUDE_RSV1+="${MZFFILE}:"
    fi
}

# Monitor/User ROM 1/2/3, SFD700 = empty.
> ${MONITOR_ROM_ROMDISK}
> ${USER_ROM_I_ROMDISK}
> ${USER_ROM_II_ROMDISK}
> ${USER_ROM_III_ROMDISK}
> ${SFD700_ROM}
> ${MONITOR_ROM_PICOZ80}
> ${USER_ROM_I_PICOZ80}
> ${USER_ROM_II_PICOZ80}
> ${USER_ROM_III_PICOZ80}

# Create a file with a list of programs placed into the ROM. This list can then be used by the SD
# card script to ensure no duplication occurs when building the SD RFS program directory.
rm -f ${ROM_LIST_FILE}

# Place the monitor roms into the MROM at the beginning for banked page usage.
echo "cat ${ROM_PATH}/monitor_sa1510.rom ${ROM_PATH}/monitor_80c_sa1510.rom  ${ROM_PATH}/cbios.rom ${ROM_PATH}/rfs_mrom.rom ${ROM_PATH}/monitor_1z-013a.rom ${ROM_PATH}/monitor_80c_1z-013a.rom ${ROM_PATH}/ipl.rom ${ROM_PATH}/blank_mrom.rom > /tmp/mrom.rom"
#cat ${ROM_PATH}/monitor_1Z-013A.rom ${ROM_PATH}/monitor_1Z-013A.rom \
#cat ${ROM_PATH}/monitor_1Z-009B.rom ${ROM_PATH}/monitor_1Z-009B.rom \
#
# ROMDISK
cat ${ROM_PATH}/monitor_sa1510.rom \
    ${ROM_PATH}/monitor_80c_sa1510.rom \
    ${ROM_PATH}/cbios.rom \
    ${ROM_PATH}/rfs_mrom.rom \
    ${ROM_PATH}/monitor_1z-013a.rom \
    ${ROM_PATH}/monitor_80c_1z-013a.rom \
    ${ROM_PATH}/rfs_mrom_bank6.rom \
    ${ROM_PATH}/rfs_mrom_bank7.rom \
    ${ROM_PATH}/ipl.rom \
    ${ROM_PATH}/rfs_mrom_bank9.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    >> ${MONITOR_ROM_ROMDISK}

# picoZ80
echo "cat ${ROM_PATH}/monitor_1z-013a.rom ${ROM_PATH}/monitor_80c_1z-013a.rom ${ROM_PATH}/cbios.rom ${ROM_PATH}/rfs_mrom.rom ${ROM_PATH}/monitor_sa1510.rom ${ROM_PATH}/monitor_80c_sa1510.rom ${ROM_PATH}/rfs_mrom_bank6.rom ${ROM_PATH}/rfs_mrom_bank7.rom ${ROM_PATH}/ipl.rom ${ROM_PATH}/rfs_mrom_bank9.rom > ${MONITOR_ROM_PICOZ80}"
cat ${ROM_PATH}/monitor_1z-013a.rom \
    ${ROM_PATH}/monitor_80c_1z-013a.rom \
    ${ROM_PATH}/cbios.rom \
    ${ROM_PATH}/rfs_mrom.rom \
    ${ROM_PATH}/monitor_sa1510.rom \
    ${ROM_PATH}/monitor_80c_sa1510.rom \
    ${ROM_PATH}/rfs_mrom_bank6.rom \
    ${ROM_PATH}/rfs_mrom_bank7.rom \
    ${ROM_PATH}/ipl.rom \
    ${ROM_PATH}/rfs_mrom_bank9.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    ${ROM_PATH}/blank_mrom.rom \
    >> ${MONITOR_ROM_PICOZ80}

# Place the RFS rom into the User ROM at the beginning as it contains all the banked pages.
echo "cat ${ROM_PATH}/rfs.rom ${ROM_PATH}/cbios_bank1.rom ${ROM_PATH}/cbios_bank2.rom ${ROM_PATH}/cbios_bank3.rom ${ROM_PATH}/cbios_bank4.rom > ${USER_ROM_I_ROMDISK}"
cat ${ROM_PATH}/rfs.rom \
    ${ROM_PATH}/cbios_bank1.rom \
    ${ROM_PATH}/cbios_bank2.rom \
    ${ROM_PATH}/cbios_bank3.rom \
    ${ROM_PATH}/cbios_bank4.rom \
    >> ${USER_ROM_I_ROMDISK}

# The SFD700 ROM is built as follows:
# 0x00000 : 0x00FFF  - MZ80A Floppy ROM MZ80AFI.rom (duplicated ROM at 0x00400)
# 0x01000 : 0x01FFF  - MZ-1E05 MZ700 Floppy ROM mz-1e05.rom
# 0x02000 : 0x0BFFF  - RFS rfs.rom
# 0x0C000 : 0x7FFFF  - USER / ROM File System
cat ${ROM_PATH}/mz80afi_sfd700.rom ${ROM_PATH}/mz80afi_sfd700.rom ${ROM_PATH}/mz-1e05.rom ${ROM_PATH}/rfs.rom \
    >> ${SFD700_ROM}

# For CPM, to be safe, we manually copy the required files rather than use the list below. The CP/M boot image must be in User ROM 1.
echo "cat ${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin >> ${USER_ROM_I_ROMDISK}"
cat ${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin >> ${USER_ROM_I_ROMDISK}

# picoZ80 USER ROM I is a copy of the ROMDISK at the moment, no special processing needed.
echo "cat ${ROM_PATH}/rfs.rom ${ROM_PATH}/cbios_bank1.rom ${ROM_PATH}/cbios_bank2.rom ${ROM_PATH}/cbios_bank3.rom ${ROM_PATH}/cbios_bank4.rom > ${USER_ROM_I_PICOZ80}"
cat ${ROM_PATH}/rfs.rom \
    ${ROM_PATH}/cbios_bank1.rom \
    ${ROM_PATH}/cbios_bank2.rom \
    ${ROM_PATH}/cbios_bank3.rom \
    ${ROM_PATH}/cbios_bank4.rom \
    >> ${USER_ROM_I_PICOZ80}
echo "cat ${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin >> ${USER_ROM_I_PICOZ80}"
cat ${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin >> ${USER_ROM_I_PICOZ80}

# According to flag set above, either put the CPM Disks in the first ROM, or place one in each ROM allowing for better write spread and larger disks.
#
#if [ "${CPMDISKMODE}" != "SPLIT" ]; then
#    # CPM RFS Disks currently only in User ROM.
#    for f in 1 2
#    do
#        if [ -f ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin ]; then
#            echo "cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I_ROMDISK}"
#            cat ${MZB_PATH}/Common/CPM_RFS_${f}.${SECTORSIZE}.bin >> ${USER_ROM_I_ROMDISK}
#            basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
#        fi
#    done
#else
#    if [ -f ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin ]; then
#        echo "cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I_ROMDISK}"
#        cat ${MZB_PATH}/Common/CPM_RFS_1.${SECTORSIZE}.bin >> ${USER_ROM_I_ROMDISK}
#        basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
#    fi
#
#    if [ -f ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin ]; then
#        echo "cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II_ROMDISK}"
#        cat ${MZB_PATH}/Common/CPM_RFS_2.${SECTORSIZE}.bin >> ${USER_ROM_II_ROMDISK}
#        basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
#    fi
#fi

# Manually choose the programs you want installed into the ROMS. 
# For RFS on the ROMDISK:
#    The files will be first placed into the USER ROM and when full into the Monitor ROM. Thus order is important 
#    if you want a particular program in a particular ROM.
# For RFS on the SFD700:
#    The files will be added onto the end of the SFD700 ROM in order first placed.
#
# NB: A Double Hash (##) indicates a program found not to work on the Sharp MZ-80A.
#
# addMZFToROMImageList <Add to ROMDISK ROMs> <Add to SFD700 ROM> <Reserved 1> <Reserved 2>
#
#
ROM_INCLUDE=""
ROM_INCLUDE_SFD700=""
ROM_INCLUDE_PICOZ80=""
ROM_INCLUDE_RSV1=""
#
# Common Programs between MZ Series Machines.
#
#                    |----------- Include in ROMDISK Build
#                    | |--------- Include in SFD700 Build
#                    | | |------- Include in PICOZ80 Build
#                    | | | |----- Reserved
#                    | | | |  |-- Name and path of the sectored version of the MZF file.
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/sa-5510_rfs.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/1z-013b.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/mz2z009e.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/mz5z008.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/mz5z009.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/msbasic_mz80a.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/msbasic_rfs40.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/msbasic_rfs80.${SECTORSIZE}.bin"
#
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/basic_sa5510.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/basic_sa6510.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/sa-5510_compiler.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/bas_mod_v374.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/xpatch_5510_v2.2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/basic_sp5025.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/basic_sp5030.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/basic_sp-5035mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/solo_basic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/basic_om-500.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/basic_om-1000.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/basic_om-1001.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/hu-basic_v1.3_k.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/hucompilmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/compiler_a2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/express_compiler.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/k_a_converter.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/hisoft_pascal4.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/z80assembler2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/editor-assembler_sp2202mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/zen.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/8048_cpu_disas.mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/6502betrmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/6502demo2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/6502demomc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/fortransosz80.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/mz700_forth1.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/kniforth.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/tinylispmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/apollo_word_1.9mmc_.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/hucalc_80a_m.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/Common/send-1.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/Common/apollo_chess_v2a.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/Common/5z009-1b.mzf"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/Common/basic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/Common/cpm22.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/Common/cpm223.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/Common/sharpmz-test.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/Common/testtz.${SECTORSIZE}.bin"
#
# MZ-80A
#
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/sa-6510.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/3-d_maze.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/80a_pencil.a2_c2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/80a_pencil.a2_s.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/a-basic_sa-5510.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/adventuregame.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/air_lander.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/alien_attack.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/alien_attack_machinecode.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/alien_eagle.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/alligator.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/apollo_chess_v2a.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/basic80a.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/basic_sa-5510.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/basic.sa-5510.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/blocking.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/bouncing_ball.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/breakout.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/breakout_mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/brickstop.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/bytesaver_sa5510.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/cells_and_serps.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/colony.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/cosmiad-a.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/cosmiad-k.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/cursedchamber.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/dcs_mz80a_append.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/dcs_mz80a_renum.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/defender(2).${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/MZ-80A/defender.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/defender_bizzarri.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/diamond.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/digger.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/dog_and_flea.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/dog_star_2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/duck_shoot.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/epidemic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/escape.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/escape_force.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/flying_mission.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/forest_of_doom.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/fruit_machine.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/galaxy_invaders.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/greedy_gremlins.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/hangman2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/horse_race2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/hucalc_80a_c2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/hucalc_80a_m.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/hucalc_80a_s.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/land_escape.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/laser_defence.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/le_mans.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/ludo.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/lunarlander.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/mad_max_2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/man-hunt.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/m_c_breakout_2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/m_c_race_chase.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/minotaur.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/missile_attack.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/munchers_2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/MZ-80A_galactic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/navvy.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/new_invaders.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/noughts_crosses.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/numbercrunch.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/obstacles.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/pinball.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/puckman.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/qbert.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/quest.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/race_chase.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/ribbit_v2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/sa-5510_compiler.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/sa-5510_kn.comm.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/sargon_2.71.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/scramble_a.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/send-1.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/serendipity.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/ski_run.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/space_combat.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/space_fighter.${SECTORSIZE}.bin"
addMZFToROMImageList 1 1 1 0 "${MZB_PATH}/MZ-80A/space_invaders.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/spooks.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/starship_mk2.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/star_wars.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/super_tilt.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/the_lily_pond.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/the_meanies.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/tunnel_run.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/ufo.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/wiggly_worm.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80A/witches.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80A/xpatch_5510_v2.2.${SECTORSIZE}.bin"
#
# MZ-80K
#
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/3dspacecbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/3-d_way_out_bbg_software.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/6502betrmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/6502demo2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/6502demomc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/8048_cpu_disas.mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/a-basic_sa-5510.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/abenteuebasic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/advance-guardmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/advance_guard_wics_1983.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/aimemc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/alienmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/andromedamc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/apollo_word_1.9mmc_.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/ascii_gamebasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/atcf_datamc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/attackerscramblemc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/barcode_reader_1basic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/barcode_reader_2basic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/barcode_reader_3basic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/barcode_reader_4basic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/base_ballbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/baseballbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/basic_sp-5035mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/block_kuzushimc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/bomberbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/bomberman_hudson_soft_1983.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/boueisakusenbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/boxing_mzmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/breakout_sharp_corporation.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/bugfire_1.1_wics.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/bugfire-newmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/bugfire-oldmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/bugfire_wics.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/cannon_ball_hudson_soft_1983.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/car-racemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/clever_cribber.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/code_hu_convertmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/cosmic_cruiser1mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/cosmic_cruiser2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/cosmic_cruiser3pr1mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/cowboy_duelmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/crazy-climber_pt1mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/crazy-climber_pt2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/crystallmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/daikaisenbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/d-day_sharp_corporation.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/defendermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/defend_the_citybasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/don_chackbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/donkey_derby.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/editor-assembler_sp2202mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/elektronic_musicmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/empire_climbermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/empire_climber_wics.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/executivebasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/f-1_racemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/fdcontromc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/filecardmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/form_map-listmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/formmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/forth_simulatorbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/fortressmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/galacticabasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/galaxianbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/gens3_1mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/gokiburibasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/goldminebasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/gomokumc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/hat_the_boxbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/home_budget_mk2basic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/hucompilermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/hucompilmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/identi-kit.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/jampacmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/jintorimc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/jumping_bunnymc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/ladybugmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/laser_commandmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/loaderckmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/lunar_lander.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/lunar_landingmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/machine_language_sp2001mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/machin_lang.monmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/mannenbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/master_mindbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/mazemanmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/micropedemc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/minotaur's_cavemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/miz-mazebasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/mogurabasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/monaco-gpmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/monitormc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/monitorrmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/munchiesmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/nautic_crisisbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/neptunmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/notutoribasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/nsc-rallymc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/one_key_organmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/othellomc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/otori_attackmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/pacmanmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/pascal_sp-6610mc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/phoenixmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/printmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/puckmanmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/racemc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/ralleymc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/ranger_specialpacmanmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/sargonchessmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/scashbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/schlogesmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/scramble.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/scramblemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/shooting-ufobasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/shougibasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_defendermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_drivescramblemc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/space_fighter_sharp_corporation_1979.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_invader1mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_invader.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_invader2intro-jpnmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_invader2no_intromc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_invader3mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_invader4mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space-invadermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_mouse2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_mousemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_mouse_wics.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_panicmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_ruinerdeffendermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/space_ruiner_wics_1982.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/spider_maze.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/startrekbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/star_trek_jpnbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/star_trek_sharp_corporation.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/star_warsmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/star-warsmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/stoneworldbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/sub-monitor_48kmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/superdefendermc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/super-monitormc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/supertargmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/superwurmmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/survivemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/tankwarmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/tapecopymc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/ten-pin_bowling.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/test_match.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/the_munchies_c_smith.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/time_bombbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/tinylispmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/tomahawk_hiroshi_masuko.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/tomahawkmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/toweringmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/trapmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/turtlegdemo1mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/turtlegdemo2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/turtle-grafikmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/tycoonbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/ubootjagmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/ufo_cavesmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/ufo_huntermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/undameshibasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/videoflippermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/view-findermc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/view_finder_wics_1983.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/vikingmc.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-80K/voicemc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/war_of_conbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/westernmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/western_wics_1983.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/wilhelm-tellmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/willhelm_tellmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/yakyukenbasic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/z80assembler2mc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/zardosmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/zardos_mz_soft_group.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/zeichengmc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-80K/zeroidmc.${SECTORSIZE}.bin"
#
# MZ-700
#
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-700/1z-013b.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/2z009e.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/3-d_car_race.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/3-d_graphikpaket.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/3dmuehle.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/3d-way_out.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/6502_betriebssys.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/700_poker.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/ace_racer.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/advancedchess.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/airbus_a_310.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/aliens.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/amityville.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/antares.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/anthill_raider.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/apollo.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/apollo2_8-200785.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/apprentissage_nombres.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/asteroid_belt.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/astro-blaster.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/attack-a-tank.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/auto_run.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/backgammon.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/bas700tutorial.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/basezero.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 1 0 "${MZB_PATH}/MZ-700/basic_1z-013b.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/basic_700-vers.4.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/basic_mz-5z008_2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/basic_mz-5z008.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/battle_game.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/bio-700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/blastoff.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/bloktekeningen.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/bomberman_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/boulder_dash.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/breuken_1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/cadre_diabolique.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/calendrier.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/cannon_ball.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/catacombes.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/caterpillar.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/centro-anl.disk.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/centro-anleitung.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/circus_star.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/club_golf.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/c-master.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/codewoord.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/commando_plain.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/competitie.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/comput-a-slot.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/computertekenen.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/connect_four.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/converter_a_700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/conveyor.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/copy-cf.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 0 0 "${MZB_PATH}/MZ-700/cosmo_blaster_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/cribbage.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/croaker.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/cyfax.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/database_filer.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/datei_universal.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/dbp-701.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/delete.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/demasaso.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/demo-lissajou.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/demo_sin-berg.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/descente_aux_enfers.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/destructeurs.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/domination.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/donkey_gorilla.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/exploding_atoms.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/express_bas_700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/f1200.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/fantastic_grove.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/fdcopy.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/fd_editor_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/fighter_command.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/fire!!!.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/fisherman_fred.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/flugsim_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/flugsimulator.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/fortransosz80.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/full_speed.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/gate-crasher.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/gdp9-ba.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/geboortedatum.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/global_war_3.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/globule.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/gobbler.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/greedy_gremlins.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/grid.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/guerre_spatiale.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/hdc_orgel.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/hp4tmz7.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/hp4tmz7l.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/hunchy.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/impossible_mission.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/isola.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/jeux_intergalactiques.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/jumping_runner.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/jungle-jinks.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kalender.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kamertje.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kasboek.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/k-basic_v.5.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kentucky_derby.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/kniforth.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/knight's_castle.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/knights_ufo.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kp_dbasic.800b.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/k.s.m._pt._1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/k.s.m._pt._2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/k.s.m._pt._3.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-700/kuma_interpr..${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kup80z354.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/kup80z355.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/lady-bug.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/land_escape.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/le_mans.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/lightning_patrol.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/lijnenspel.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/logo_v30.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mac_pac.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mad_maze.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/man-hunt.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/manza.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mastermind.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/math_pendu.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/maze_escape.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/messing.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mission_a.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mission_alpha.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mission_delta.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/ml-sp_8002_bbg.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/moleatta.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/monitor.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/monitor3.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/monitor6.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/morpion.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/morpius.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/moty.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/moving_searcher.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mucmac700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/munroe_manor.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/music.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/musique_suisse.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/mz-1p01.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/mz-2z009.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/mz700bas.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/MZ-700_demo.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/mz700_forth1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/MZ-700_forth.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/MZ-700_klavier.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/MZ-700_plot.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nakamoto.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nakamoto_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nibbler_part1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nibbler_part2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nightmare_park2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nightmare_park.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nightm_prk.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/nite_flite.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/octopussy.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/pac-man.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/painful_man.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/panique.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/para_shoot.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 1 0 "${MZB_PATH}/MZ-700/pascal_sp-4015.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/pascal_sp-4015_c.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/patrol_alpha.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/pcgaid.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/pcgaid_europe.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/pcg_basic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/pcg_basic_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/pendu.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/printerfiguren1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/puissance_4.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/puzzle.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/qd_bas_5z008_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/qdcopy.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/qd-pascal_c.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/quixi.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/realfort.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/rebond.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/rescue_plane.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/reverse.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/rollsroyce1906.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/round_shoot.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/safe-cracker.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/s-basic-cent-2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/s-basic-comp-cnt.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 1 0 "${MZB_PATH}/MZ-700/s-basic-compiler.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 1 0 "${MZB_PATH}/MZ-700/s-basic-compiler-original.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/s-basicode_2.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/schach2_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/schach700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 1 0 "${MZB_PATH}/MZ-700/send-1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/send-1_mz700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sh7ced1.3g.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/shogun.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sky_chaos.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 0 0 "${MZB_PATH}/MZ-700/s-master.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 1 0 "${MZB_PATH}/MZ-700/snake-and-snake.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/snake_snake_exp1.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/soudard.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/south_pacific.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/space_fighter.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/space_guerilla.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/space_invaders.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/spa_data.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/squash_700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/star_fighter.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/startrek.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/stkeeper2bas700a.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/strip_poker.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/submarine_shooter.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sub-monitor-700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/suicide_run.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/super-bandit.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/super_biorhythm.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/super_helicopter.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/super_puck-man.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/super_spy_obj.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/supertypen.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/super_vrac.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sutam1f.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sutamc9.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sutapeba.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/sutapemo.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/systeme_expert.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/tapeworm.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/tbasic_bm_pk.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/t-basic_(uitleg).${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/telefontarieven.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/three_card_brag.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/tomahawk.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/tracker.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/trans.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/trucker.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/typen.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/ufo.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/uni700basic.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/urania_ii.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/uras-700.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/vicious_viper.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/vol_676.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/vragendmaken.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/wizard_castle.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/wonderhouse.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/wookya.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/wookyb.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/xanagrams.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/xbc.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/xbc_f_1_02.${SECTORSIZE}.bin"
addMZFToROMImageList 0 0 0 0 "${MZB_PATH}/MZ-700/yams.${SECTORSIZE}.bin"
addMZFToROMImageList 1 0 1 0 "${MZB_PATH}/MZ-700/z80_desassembleur.${SECTORSIZE}.bin"
addMZFToROMImageList 0 1 0 0 "${MZB_PATH}/MZ-700/zen.${SECTORSIZE}.bin"

# Set the pointer which indicates the next ROM to be filled with applications.
GENROM=0

# Add files into the ROMDISK Rom set, incrementing to next ROM when previous is full.
IFS=":"; for f in ${ROM_INCLUDE}
do
    if [ -f ${f} ]; then

        # Identify type of file.
        ${MZFTOOL} --command=IDENT --mzffile=${f} >/dev/null
        FILETYPE=$?

        if [ ${FILETYPE} == 1 ]; then

            # Fill the User ROM as these get listed first.
            if (( ${GENROM} == 0 )); then
                cat ${USER_ROM_I_ROMDISK} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to ROMDISK User I Rom"
                    cat "${f}" >> ${USER_ROM_I_ROMDISK}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=1
                fi
            fi

            if (( ${GENROM} == 1 )); then
                cat ${MONITOR_ROM_ROMDISK} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to ROMDISK Monitor Rom"
                    cat "${f}" >> ${MONITOR_ROM_ROMDISK}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=2
                fi
            fi

            # User ROM II and III are optional.
            if (( ${GENROM} == 2 )); then
                cat ${USER_ROM_II_ROMDISK} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to ROMDISK User II Rom"
                    cat "${f}" >> ${USER_ROM_II_ROMDISK}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=3
                fi
            fi

            if (( ${GENROM} == 3 )); then
                cat ${USER_ROM_III_ROMDISK} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to ROMDISK User III Rom"
                    cat "${f}" >> ${USER_ROM_III_ROMDISK}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=4
                fi
            fi

            if (( ${GENROM} == 4 )); then
                echo "Limit reached ROMS full, skipping from ${f}..."
                break
            fi
        else
            echo "File:${f},Type:${FILETYPE} is not machine code, skipping.."
        fi
    else
        echo "ALERT! File:${f} not found."
    fi
done

# Add files into the SFD700 ROM, discard images when ROM is near full and image wont fit.
IFS=":"; for f in ${ROM_INCLUDE_SFD700}
do
    if [ -f ${f} ]; then

        # Identify type of file.
        ${MZFTOOL} --command=IDENT --mzffile=${f} >/dev/null
        FILETYPE=$?

        if [ ${FILETYPE} == 1 ]; then

            cat ${SFD700_ROM} "${f}" > /tmp/tmp.size
            FILESIZE=$(stat -c%s "/tmp/tmp.size")
            if (( ${FILESIZE} < 524288 )); then
                echo "Adding $f to SFD700 ROM"
                cat "${f}" >> ${SFD700_ROM}
                basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
            else
                echo "Limit reached ROM full, skipping from ${f}..."
                break
            fi
        else
            echo "File:${f},Type:${FILETYPE} is not machine code, skipping.."
        fi
    else
        echo "ALERT! File:${f} not found."
    fi
done

# Set the pointer which indicates the next ROM to be filled with applications.
GENROM=0

# Add files into the picoZ80 ROMDISK Rom set, incrementing to next ROM when previous is full.
IFS=":"; for f in ${ROM_INCLUDE_PICOZ80}
do
    if [ -f ${f} ]; then

        # Identify type of file.
        ${MZFTOOL} --command=IDENT --mzffile=${f} >/dev/null
        FILETYPE=$?

        if [ ${FILETYPE} == 1 ]; then

            # Fill the User ROM as these get listed first.
            if (( ${GENROM} == 0 )); then
                cat ${USER_ROM_I_PICOZ80} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to picoZ80 User I Rom"
                    cat "${f}" >> ${USER_ROM_I_PICOZ80}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=1
                fi
            fi

            if (( ${GENROM} == 1 )); then
                cat ${MONITOR_ROM_PICOZ80} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to picoZ80 Monitor Rom"
                    cat "${f}" >> ${MONITOR_ROM_PICOZ80}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=2
                fi
            fi

            # User ROM II and III are optional.
            if (( ${GENROM} == 2 )); then
                cat ${USER_ROM_II_PICOZ80} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to picoZ80 User II Rom"
                    cat "${f}" >> ${USER_ROM_II_PICOZ80}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=3
                fi
            fi

            if (( ${GENROM} == 3 )); then
                cat ${USER_ROM_III_PICOZ80} "${f}" > /tmp/tmp.size
                FILESIZE=$(stat -c%s "/tmp/tmp.size")
                if (( ${FILESIZE} < 524288 )); then
                    echo "Adding $f to picoZ80 User III Rom"
                    cat "${f}" >> ${USER_ROM_III_PICOZ80}
                    basename "${f}" .${SECTORSIZE}.bin >> ${ROM_LIST_FILE}
                else
                    GENROM=4
                fi
            fi

            if (( ${GENROM} == 4 )); then
                echo "Limit reached ROMS full, skipping from ${f}..."
                break
            fi
        else
            echo "File:${f},Type:${FILETYPE} is not machine code, skipping.."
        fi
    else
        echo "ALERT! File:${f} not found."
    fi
done

echo "--------------------------------------------------------------------------------------------------------"
echo "-- ROM Images                                                                                         --"
echo "--                                                                                                    --"
if [ -f ${USER_ROM_I_ROMDISK} ]; then
    mv ${USER_ROM_I_ROMDISK} ${ROM_PATH}/USER_ROM_ROMDISK_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_ROMDISK_${SECTORSIZE}.bin")
    echo "-- ROMDISK USER ROM I SIZE   (${ROM_PATH}USER_ROM_ROMDISK_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
if [ -f ${USER_ROM_II_ROMDISK} ]; then
    mv ${USER_ROM_II_ROMDISK} ${ROM_PATH}/USER_ROM_II_ROMDISK_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_II_ROMDISK_${SECTORSIZE}.bin")
    echo "-- ROMDISK USER ROM II SIZE  (${ROM_PATH}USER_ROM_II_ROMDISK_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
if [ -f ${USER_ROM_III_ROMDISK} ]; then
    mv ${USER_ROM_III_ROMDISK} ${ROM_PATH}/USER_ROM_III_ROMDISK_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_III_ROMDISK_${SECTORSIZE}.bin")
    echo "-- ROMDISK USER ROM III SIZE (${ROM_PATH}USER_ROM_III_ROMDISK_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
if [ -f ${MONITOR_ROM_ROMDISK} ]; then
    mv ${MONITOR_ROM_ROMDISK} ${ROM_PATH}/MROM_ROMDISK_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}/MROM_ROMDISK_${SECTORSIZE}.bin")
    echo "-- ROMDISK MROM SIZE         (${ROM_PATH}/MROM_ROMDISK_${SECTORSIZE}.bin) = ${FILESIZE} Bytes           --"
fi
if [ -f ${SFD700_ROM} ]; then
    mv ${SFD700_ROM} ${ROM_PATH}/SFD700_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}/SFD700_${SECTORSIZE}.bin")
    echo "-- SFD700 SIZE               (${ROM_PATH}/SFD700_${SECTORSIZE}.bin) = ${FILESIZE} Bytes           --"
fi
if [ -f ${USER_ROM_I_PICOZ80} ]; then
    mv ${USER_ROM_I_PICOZ80} ${ROM_PATH}/USER_ROM_PICOZ80_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_PICOZ80_${SECTORSIZE}.bin")
    echo "-- PICOZ80 USER ROM I SIZE   (${ROM_PATH}USER_ROM_PICOZ80_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
if [ -f ${USER_ROM_II_PICOZ80} ]; then
    mv ${USER_ROM_II_PICOZ80} ${ROM_PATH}/USER_ROM_II_PICOZ80_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_II_PICOZ80_${SECTORSIZE}.bin")
    echo "-- PICOZ80 USER ROM II SIZE  (${ROM_PATH}USER_ROM_II_PICOZ80_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
if [ -f ${USER_ROM_III_PICOZ80} ]; then
    mv ${USER_ROM_III_PICOZ80} ${ROM_PATH}/USER_ROM_III_PICOZ80_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}USER_ROM_III_PICOZ80_${SECTORSIZE}.bin")
    echo "-- PICOZ80 USER ROM III SIZE (${ROM_PATH}USER_ROM_III_PICOZ80_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
if [ -f ${MONITOR_ROM_PICOZ80} ]; then
    mv ${MONITOR_ROM_PICOZ80} ${ROM_PATH}/MROM_PICOZ80_${SECTORSIZE}.bin
    FILESIZE=$(stat -c%s "${ROM_PATH}/MROM_PICOZ80_${SECTORSIZE}.bin")
    echo "-- PICOZ80 MROM SIZE         (${ROM_PATH}/MROM_PICOZ80_${SECTORSIZE}.bin) = ${FILESIZE} Bytes --"
fi
echo "--------------------------------------------------------------------------------------------------------"
echo ""
exit 0
