#!/bin/bash

ROM=$2
EMU=$1

if [[ ! -z "$ROM" ]] && [[ ! -z "$EMU" ]]
	then
		cd BIN/
		./download_graphical.py $EMU $ROM
	else
		for RomConfigLine in `cat ../ROM_CONFIG_FILES.csv  | sort  | grep ','`
			do
				EMU=`echo $RomConfigLine| cut -d"," -f2`
				ROM=`echo $RomConfigLine| cut -d"," -f1`
				if [[ $EMU != "SYS" ]]
					then
						./download_graphical.py $EMU $ROM
				fi
			done
fi
