From 82dfc856c2909fab52e777c32c2bb9fcf8abca12 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Sat, 22 Jun 2013 19:15:29 +0200 Subject: [PATCH] --rom/--patch params, support rar-archives --- patchimage.sh | 10 +++++++--- script.d/common.sh | 41 ++++++++++++++++++++++++++++++++++++----- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/patchimage.sh b/patchimage.sh index 987309d..e79d8c5 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -72,9 +72,13 @@ case ${GAME_TYPE} in "IPS" ) show_notes check_input_rom - check_input_rom_special - check_ips_patch - ${IPS} a ${PATCH} ${ROM} + if [[ -f ${PATCH} ]]; then + ext=${ROM/*.} + cp "${ROM}" "${GAMENAME}.${ext}" + ${IPS} a "${PATCH}" "${GAMENAME}.${ext}" + else + echo -e "error: patch (${PATCH}) could not be found" + fi ;; esac diff --git a/script.d/common.sh b/script.d/common.sh index 1c43994..72a248a 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -107,7 +107,7 @@ while [[ $xcount -lt $pcount ]]; do ISO_EXT=${ISO_PATH//*./} if [[ -e "${ISO_PATH}" ]]; then - ln -sf "${ISO_PATH}" ./BASE.${ISO_EXT} + ln -sf "${ISO_PATH}" BASE.${ISO_EXT} IMAGE=BASE.${ISO_EXT} else echo -e "ISO not found" @@ -115,16 +115,47 @@ while [[ $xcount -lt $pcount ]]; do fi ;; + --rom* ) + ROM_PATH=${1/*=} + ROM_EXT=${ROM_PATH//*./} + + if [[ -e "${ROM_PATH}" ]]; then + ln -sf "${ROM_PATH}" BASE.${ROM_EXT} + IMAGE=BASE.${ROM_EXT} + else + echo -e "ROM not found" + exit 1 + fi + ;; + --riivolution* ) RIIVOLUTION=${1/*=} if [[ -e "${RIIVOLUTION}" ]]; then - unzip "${RIIVOLUTION}" >/dev/null + if [[ "${RIIVOLUTION}" == *.zip ]]; then + unzip "${RIIVOLUTION}" >/dev/null + elif [[ "${RIIVOLUTION}" == *.rar ]]; then + unrar e "${RIIVOLUTION}" >/dev/null + fi else echo -e "Riivolution patch ${RIIVOLUTION} not found." exit 1 fi ;; + --patch* ) + PATCH=${1/*=} + if [[ -e "${PATCH}" ]]; then + if [[ "${PATCH}" == *.zip ]]; then + unzip "${PATCH}" >/dev/null + elif [[ "${PATCH}" == *.rar ]]; then + unrar e "${PATCH}" >/dev/null + fi + else + echo -e "PATCH patch ${PATCH} not found." + exit 1 + fi + ;; + --customid* ) CUSTOMID=${1/*=} if [[ ${#CUSTOMID} != 6 ]]; then @@ -183,10 +214,10 @@ while [[ $xcount -lt $pcount ]]; do echo -e "create wbfs images from riivolution patches.\n ***** using this script is only allowed, if you own an original copy of the game. ***** if you don't, no one can be blamed but you. Shame on you.\n ---game={NewerSMB;NewerSummerSun;AnotherSMB;HolidaySpecial} +--game={NewerSMB;NewerSummerSun;AnotherSMB;HolidaySpecial;ParallelWorlds} | specify game you want to create ---iso=/home/test/.wbfs | specify which ISO to use for building ---riivolution=/home/test/.zip | specify path to Riivolution files +--iso/--rom=/home/test/ | specify which ISO/ROM to use for building +--riivolution/--patch= | specify path to Riivolution/Patch files --version=EURv1,EURv2,USAv1,USAv2,JPNv1 | specify your game version --customdid=SMNP02 | specify a custom ID to use for the game --sharesave | let modified game share savegame with original game