From 23cf0fc935b6324b85644b626635dba4fe4f699e Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Tue, 6 Aug 2013 23:53:43 +0200 Subject: [PATCH] make patchimage respect PATCHIMAGE_WBFS_DIR make patchimage check for system-installed tools, else use bundled ones make it possible to install patchimage (+ debian packaging scripts) version 3.0 --- ChangeLog | 11 ++++++- Makefile | 14 +++++++++ patchimage.sh | 36 ++++++++++++++-------- script.d/anothersmb.sh | 15 ++-------- script.d/cannon.sh | 15 ++-------- script.d/common.sh | 59 ++++++++++++++++++++++++++++++------- script.d/epicbowserworld.sh | 15 ++-------- script.d/koopacountry.sh | 19 ++++-------- script.d/newerholiday.sh | 15 ++-------- script.d/newersmb.sh | 15 ++-------- script.d/newersummersun.sh | 15 ++-------- script.d/nsmbw3.sh | 15 ++-------- script.d/nsmbw4.sh | 19 ++++-------- script.d/retroremix.sh | 11 +------ script.d/wintermoon.sh | 15 ++-------- 15 files changed, 131 insertions(+), 158 deletions(-) create mode 100644 Makefile diff --git a/ChangeLog b/ChangeLog index aef18db..60ae996 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -v2.6: +v3.0: - bugfix: don't exit with error on check_input_image as we will call check_input_image_special aswell - bugfix: WIT got the image name wrong if the image was detected @@ -7,6 +7,15 @@ v2.6: was not honoured by the script - bugfix: if riivolution patch existed in PATCHIMAGE_RIIVOLUTION_DIR (set by $HOME/.patchimage.rc) it was not properly handled +- bugfix: actually utilize PATCHIMAGE_WBFS_DIR if set from + $HOME/.patchimage.rc +- move Newer Super Mario Bros. Wii image detection into own function, + so that the function is duplicated over all NSMB patch scripts +- make it possible to use system-wide installed wit, uips, unp and + applyppf3 (if installed, else use the ones in tools/) +- make it possible to install patchimage system-wide (running from + unpacked archive as before still works aswell) +- added debian packaging scripts - support for Super Mario: Mushroom Adventure PLUS - Winter Moon - support for NSMBW3: The Final Levels diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..abe167d --- /dev/null +++ b/Makefile @@ -0,0 +1,14 @@ +all: + @echo "nothing to do" + +install: + mkdir -p $(DESTDIR)/usr/bin/ + mkdir -p $(DESTDIR)/usr/share/patchimage/ + cp -rv patches tools script.d $(DESTDIR)/usr/share/patchimage/ + install -m755 patchimage.sh $(DESTDIR)/usr/bin/patchimage + +uninstall: + rm -rf $(DESTDIR)/usr/share/patchimage + rm -f $(DESTDIR)/usr/bin/patchimage + +clean: diff --git a/patchimage.sh b/patchimage.sh index c7252d5..58e28a9 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -6,7 +6,17 @@ # # License: GPL v3 -source script.d/common.sh +if [[ -d ${PWD}/script.d ]]; then + PATCHIMAGE_SCRIPT_DIR=${PWD}/script.d + PATCHIMAGE_PATCH_DIR=${PWD}/patches + PATCHIMAGE_TOOLS_DIR=${PWD}/tools +else + PATCHIMAGE_SCRIPT_DIR=/usr/share/patchimage/script.d + PATCHIMAGE_PATCH_DIR=/usr/share/patchimage/patches + PATCHIMAGE_TOOLS_DIR=/usr/share/patchimage/tools +fi + +source ${PATCHIMAGE_SCRIPT_DIR}/common.sh setup_tools optparse "${@}" @@ -18,51 +28,51 @@ fi case ${GAME} in a | A | NewerSMB | NewerSMBW ) - source script.d/newersmb.sh + source ${PATCHIMAGE_SCRIPT_DIR}/newersmb.sh ;; b | B | NewerSummerSun ) - source script.d/newersummersun.sh + source ${PATCHIMAGE_SCRIPT_DIR}/newersummersun.sh ;; c | C | ASMBW | AnotherSMBW ) - source script.d/anothersmb.sh + source ${PATCHIMAGE_SCRIPT_DIR}/anothersmb.sh ;; d | D | HolidaySpecial | "Newer: Holiday Special" ) - source script.d/newerholiday.sh + source ${PATCHIMAGE_SCRIPT_DIR}/newerholiday.sh ;; e | E | Cannon | "Cannon SMBW" ) - source script.d/cannon.sh + source ${PATCHIMAGE_SCRIPT_DIR}/cannon.sh ;; f | F | ESBW | "Epic Super Bowser World" ) - source script.d/epicbowserworld.sh + source ${PATCHIMAGE_SCRIPT_DIR}/epicbowserworld.sh ;; g | G | Koopa | "Koopa Country" ) - source script.d/koopacountry.sh + source ${PATCHIMAGE_SCRIPT_DIR}/koopacountry.sh ;; h | H | NSMBW4 | "New Super Mario Bros. 4" ) - source script.d/nsmbw4.sh + source ${PATCHIMAGE_SCRIPT_DIR}/nsmbw4.sh ;; i | I | Retro | "Retro Remix" ) - source script.d/retroremix.sh + source ${PATCHIMAGE_SCRIPT_DIR}/retroremix.sh ;; j | J | WinterMoon | "Super Mario: Mushroom Adventure PLUS - Winter Moon" ) - source script.d/wintermoon.sh + source ${PATCHIMAGE_SCRIPT_DIR}/wintermoon.sh ;; k | K | NSMBW3 | "NSMBW3: The Final Levels" ) - source script.d/nsmbw3.sh + source ${PATCHIMAGE_SCRIPT_DIR}/nsmbw3.sh ;; 1 | ParallelWorlds | "The Legend of Zelda: Parallel Worlds" ) - source script.d/parallelworlds.sh + source ${PATCHIMAGE_SCRIPT_DIR}/parallelworlds.sh ;; * ) diff --git a/script.d/anothersmb.sh b/script.d/anothersmb.sh index 91bcf7f..511f82a 100644 --- a/script.d/anothersmb.sh +++ b/script.d/anothersmb.sh @@ -32,16 +32,7 @@ Supported Versions: EURv1, USAv1, USAv2 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -122,7 +113,7 @@ dolpatch () { sed -e 's/80001800/803482C0/g' -i "${XML_FILE}".new XML_FILE="${XML_FILE}".new - ${WIT} dolpatch ${DOL} xml="${XML_FILE}" -s "${XML_SOURCE}" xml="patches/AnotherSMB-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + ${WIT} dolpatch ${DOL} xml="${XML_FILE}" -s "${XML_SOURCE}" xml="${PATCHIMAGE_PATCH_DIR}/AnotherSMB-Loader.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/cannon.sh b/script.d/cannon.sh index 97c3a35..942d00d 100644 --- a/script.d/cannon.sh +++ b/script.d/cannon.sh @@ -31,16 +31,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -106,9 +97,9 @@ dolpatch () { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/Cannon-Loader.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/Cannon-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/common.sh b/script.d/common.sh index d9fb519..4acbd65 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -16,13 +16,33 @@ fi setup_tools () { if [[ $(uname -m) == "x86_64" ]]; then - WIT=tools/wit.64 - PPF=tools/applyppf3.64 - IPS=tools/uips.64 + SUFFIX=64 else - WIT=tools/wit.32 - PPF=tools/applyppf3.32 - IPS=tools/uips.32 + SUFFIX=32 + fi + + if [[ $(which wit) ]]; then + WIT=$(which wit) + else + WIT=${PATCHIMAGE_TOOLS_DIR}/wit.${SUFFIX} + fi + + if [[ $(which applyppf3) ]]; then + PPF=$(which applyppf3) + else + PPF=${PATCHIMAGE_TOOLS_DIR}/applyppf3.${SUFFIX} + fi + + if [[ $(which uips) ]]; then + IPS=$(which uips) + else + IPS=${PATCHIMAGE_TOOLS_DIR}/uips.${SUFFIX} + fi + + if [[ $(which unp) ]]; then + UNP=$(which unp) + else + UNP=${PATCHIMAGE_TOOLS_DIR}/unp fi } @@ -137,16 +157,35 @@ check_input_image () { } +check_input_image_nsmb () { + + if [[ ! ${IMAGE} ]]; then + if test -f SMN?01.wbfs; then + IMAGE=$(eval echo SMN?01.wbfs) + elif test -f SMN?01.iso; then + IMAGE=$(eval echo SMN?01.iso) + elif test -f ${PATCHIMAGE_WBFS_DIR}/SMN?01.iso; then + IMAGE=$(eval echo ${PATCHIMAGE_WBFS_DIR}/SMN?01.iso) + elif test -f ${PATCHIMAGE_WBFS_DIR}/SMN?01.wbfs; then + IMAGE=$(eval echo ${PATCHIMAGE_WBFS_DIR}/SMN?01.wbfs) + else + echo -e "please specify image to use with --iso=" + exit 1 + fi + fi + +} + check_riivolution_patch () { if [[ ! -d ${RIIVOLUTION_DIR} ]]; then if [[ -f "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" ]]; then - tools/unp "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null + ${UNP} "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null elif [[ ${PATCHIMAGE_RIIVOLUTION_DOWNLOAD} == "TRUE" ]]; then if [[ ${DOWNLOAD_LINK} ]]; then if [[ ! -f "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" ]]; then wget --no-check-certificate ${DOWNLOAD_LINK} -O "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" - tools/unp "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null + ${UNP} "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${RIIVOLUTION_ZIP}" >/dev/null fi else echo "no download link for ${GAMENAME} available." @@ -197,7 +236,7 @@ while [[ $xcount -lt $pcount ]]; do --riivolution* ) RIIVOLUTION=${1/*=} if [[ -e "${RIIVOLUTION}" ]]; then - tools/unp "${RIIVOLUTION}" >/dev/null + ${UNP} "${RIIVOLUTION}" >/dev/null else echo -e "Riivolution patch ${RIIVOLUTION} not found." exit 1 @@ -207,7 +246,7 @@ while [[ $xcount -lt $pcount ]]; do --patch* ) PATCH=${1/*=} if [[ -e "${PATCH}" ]]; then - tools/unp "${PATCH}" >/dev/null + ${UNP} "${PATCH}" >/dev/null else echo -e "PATCH patch ${PATCH} not found." exit 1 diff --git a/script.d/epicbowserworld.sh b/script.d/epicbowserworld.sh index f3dcddd..3a2c1e7 100644 --- a/script.d/epicbowserworld.sh +++ b/script.d/epicbowserworld.sh @@ -28,16 +28,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -108,8 +99,8 @@ dolpatch() { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/EpicSuperBowserWorld-Loader.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/EpicSuperBowserWorld-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/koopacountry.sh b/script.d/koopacountry.sh index b055024..f956767 100644 --- a/script.d/koopacountry.sh +++ b/script.d/koopacountry.sh @@ -36,16 +36,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -99,8 +90,8 @@ place_files () { cp "${RIIVOLUTION_DIR}"/Object/* ${WORKDIR}/files/Object/ cp -r "${RIIVOLUTION_DIR}"/Layout/preGame.arc ${WORKDIR}/files/Layout/preGame/ # fixes - cp patches/01-03.arc ${WORKDIR}/files/Stage/ - cp patches/08-01.arc ${WORKDIR}/files/Stage/ + cp ${PATCHIMAGE_PATCH_DIR}/01-03.arc ${WORKDIR}/files/Stage/ + cp ${PATCHIMAGE_PATCH_DIR}/08-01.arc ${WORKDIR}/files/Stage/ } @@ -115,8 +106,8 @@ dolpatch() { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/KoopaCountry-Loader.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/KoopaCountry-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/newerholiday.sh b/script.d/newerholiday.sh index 0c3c7f4..368976c 100644 --- a/script.d/newerholiday.sh +++ b/script.d/newerholiday.sh @@ -32,16 +32,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -103,7 +94,7 @@ dolpatch () { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/HolidaySpecial-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/HolidaySpecial-Loader.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/newersmb.sh b/script.d/newersmb.sh index 3dd4a07..140afdb 100644 --- a/script.d/newersmb.sh +++ b/script.d/newersmb.sh @@ -32,16 +32,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -135,7 +126,7 @@ dolpatch () { sed -e 's/80001800/803482C0/g' -i "${XML_FILE}".new XML_FILE="${XML_FILE}".new - ${WIT} dolpatch ${DOL} xml="${XML_FILE}" -s "${XML_SOURCE}" xml="patches/NewerSMBW-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + ${WIT} dolpatch ${DOL} xml="${XML_FILE}" -s "${XML_SOURCE}" xml="${PATCHIMAGE_PATCH_DIR}/NewerSMBW-Loader.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/newersummersun.sh b/script.d/newersummersun.sh index a7655d1..3f85946 100644 --- a/script.d/newersummersun.sh +++ b/script.d/newersummersun.sh @@ -31,16 +31,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -109,8 +100,8 @@ dolpatch () { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/SummerSun-Loader.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/SummerSun-Loader.xml" -q - ${WIT} dolpatch ${DOL} xml="patches/NSMBW_AP.xml" -q + ${WIT} dolpatch ${DOL} xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/nsmbw3.sh b/script.d/nsmbw3.sh index f46c19d..16ed2b1 100644 --- a/script.d/nsmbw3.sh +++ b/script.d/nsmbw3.sh @@ -9,7 +9,7 @@ GAMENAME="NSMBW3: The Final Levels" XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/NSMBW3.XML GAME_TYPE=RIIVOLUTION -BANNER_LOCATION="" +BANNER_LOCATION=${WORKDIR}/files/opening.bnr show_notes () { @@ -28,16 +28,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -91,7 +82,7 @@ dolpatch () { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/NSMBW_AP.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/nsmbw4.sh b/script.d/nsmbw4.sh index df3886a..9082374 100644 --- a/script.d/nsmbw4.sh +++ b/script.d/nsmbw4.sh @@ -27,16 +27,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -52,11 +43,11 @@ place_files () { case ${VERSION} in EURv* ) - patches/openingTitle_nsmbw4.arc ${WORKDIR}/files/EU/Layout/openingTitle/openingTitle.arc + ${PATCHIMAGE_PATCH_DIR}/openingTitle_nsmbw4.arc ${WORKDIR}/files/EU/Layout/openingTitle/openingTitle.arc ;; USAv* ) - patches/openingTitle_nsmbw4.arc ${WORKDIR}/files/US/Layout/openingTitle/openingTitle.arc + ${PATCHIMAGE_PATCH_DIR}/openingTitle_nsmbw4.arc ${WORKDIR}/files/US/Layout/openingTitle/openingTitle.arc ;; # JPNv* ) @@ -69,7 +60,7 @@ place_files () { cp "${RIIVOLUTION_DIR}"/*.brsar ${WORKDIR}/files/Sound/ cp "${RIIVOLUTION_DIR}"/bgA*.arc ${WORKDIR}/files/Object/ # fix - cp patches/05-04.arc ${WORKDIR}/files/Stage/ + cp ${PATCHIMAGE_PATCH_DIR}/05-04.arc ${WORKDIR}/files/Stage/ } @@ -80,6 +71,6 @@ dolpatch () { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/NSMBW_AP.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q } diff --git a/script.d/retroremix.sh b/script.d/retroremix.sh index 661480c..fc2b2f4 100644 --- a/script.d/retroremix.sh +++ b/script.d/retroremix.sh @@ -29,16 +29,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } diff --git a/script.d/wintermoon.sh b/script.d/wintermoon.sh index 5833b4b..a5b7b65 100644 --- a/script.d/wintermoon.sh +++ b/script.d/wintermoon.sh @@ -9,7 +9,7 @@ GAMENAME="SMMA+: Winter Moon" XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/WinterMoon.xml GAME_TYPE=RIIVOLUTION -BANNER_LOCATION="" +BANNER_LOCATION=${WORKDIR}/files/opening.bnr show_notes () { @@ -39,16 +39,7 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 check_input_image_special () { - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - IMAGE=$(eval echo SMN?01.wbfs) - elif test -f SMN?01.iso; then - IMAGE=$(eval echo SMN?01.iso) - else - echo -e "please specify image to use with --iso=" - exit 1 - fi - fi + check_input_image_nsmb } @@ -114,7 +105,7 @@ dolpatch () { "802F148C=53756D6D53756E#7769696D6A3264" \ "802F118C=53756D6D53756E#7769696D6A3264" \ "802F0F8C=53756D6D53756E#7769696D6A3264" \ - xml="patches/NSMBW_AP.xml" -q + xml="${PATCHIMAGE_PATCH_DIR}/NSMBW_AP.xml" -q }