#!/bin/sh
# make by G.R.H

bfile=/mnt/mmc/Backup/saves.zip
mkdir -p /mnt/mmc/Backup
if grep -q "简体中文" /mnt/mmc/CFW/language.flag; then
	/mnt/mmc/CFW/bin/printstr "     首次启动，请稍等...     "
else
	/mnt/mmc/CFW/bin/printstr "     First boot, please wait...     "
fi
for dir in PS VARCADE CPS1 CPS2 CPS3 NEOGEO FBNEO ARCADE GBA FC SFC SMS MD GBC GB PCE NGP GG WS
do
	for file in *.sav
	do
		find /mnt/mmc/Roms/$dir -name "${file}" -type f  | while read -r savefils
		do
			zip -g -m "${bfile}" "${savefils}"
		done
	done
done
rm -f $0
sync
