diff --git a/patchimage.sh b/patchimage.sh index 49eb912..93c98c4 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -298,11 +298,9 @@ case ${GAME_TYPE} in echo -e "\n*** 1) check_input_image" check_input_image - echo -e "\n*** 2) check_input_image_special" - check_input_image_special - echo -e "\n*** 3) download_wiimm" + echo -e "\n*** 2) download_wiimm" download_wiimm - echo -e "\n*** 4) patch_wiimm" + echo -e "\n*** 3) patch_wiimm" patch_wiimm ;; @@ -310,7 +308,7 @@ case ${GAME_TYPE} in show_notes echo -e "\n*** 1) check_input_image" - check_input_image + check_input_image_special echo -e "\n*** 2) pi_action" pi_action ;; diff --git a/script.d/common.sh b/script.d/common.sh index 795b59c..9416929 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -201,88 +201,23 @@ check_directories () { } + check_input_image () { x=0 if [[ ! ${IMAGE} ]]; then - if [[ -f BASE.wbfs ]]; then + if test -f ${WBFS_MASK}.wbfs; then x=1 - IMAGE=BASE.wbfs - elif [[ -f BASE.iso ]]; then - x=1 - IMAGE=BASE.iso - fi - fi - echo "*** >> status: ${x}" - -} - -check_input_image_nsmb () { - - x=0 - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - x=1 - IMAGE=SMN?01.wbfs - elif test -f SMN?01.iso; then + IMAGE=${WBFS_MASK}.wbfs + elif test -f ${WBFS_MASK}.iso; then x=2 - IMAGE=SMN?01.iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/SMN?01.iso; then + IMAGE=${WBFS_MASK}.iso + elif test -f "${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.iso; then x=3 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/SMN?01.iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/SMN?01.wbfs; then + IMAGE="${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.iso + elif test -f "${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.wbfs; then x=4 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/SMN?01.wbfs - else - echo -e "please specify image to use with --iso=" - exit 15 - fi - fi - echo "*** >> status: ${x}" - -} - -check_input_image_kirby () { - - x=0 - if [[ ! ${IMAGE} ]]; then - if test -f SMN?01.wbfs; then - x=1 - IMAGE=SMN?01.wbfs - elif test -f SMN?01.iso; then - x=2 - IMAGE=SMN?01.iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/SUK?01.iso; then - x=3 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/SUK?01.iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/SUK?01.wbfs; then - x=4 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/SUK?01.wbfs - else - echo -e "please specify image to use with --iso=" - exit 15 - fi - fi - echo "*** >> status: ${x}" - -} - -check_input_image_mkwiimm () { - - x=0 - if [[ ! ${IMAGE} ]]; then - if test -f RMC?01.wbfs; then - x=1 - IMAGE=RMC?01.wbfs - elif test -f RMC?01.iso; then - x=2 - IMAGE=RMC?01.iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/RMC?01.iso; then - x=3 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/RMC?01.iso - elif test -f "${PATCHIMAGE_WBFS_DIR}"/RMC?01.wbfs; then - x=4 - IMAGE="${PATCHIMAGE_WBFS_DIR}"/RMC?01.wbfs + IMAGE="${PATCHIMAGE_WBFS_DIR}"/${WBFS_MASK}.wbfs else echo -e "please specify image to use with --iso=" exit 15 @@ -339,10 +274,8 @@ ask_input_image_mkwiimm () { ALL patch all images" - for image in ${1}/RMC???.{iso,wbfs}; do - if [[ -e ${image} ]]; then - echo " ${image##*/} $(show_mkwiimm_db ${image##*/})" - fi + for image in ${1}/RMC???.{iso,wbfs} ${PATCHIMAGE_WBFS_DIR}/RMC???.{iso,wbfs}; do + [[ -f ${image} ]] && echo " ${image##*/} $(show_mkwiimm_db ${image##*/})" done echo "" @@ -355,10 +288,17 @@ ask_input_image_nsmb () { ALL patch all images" - for image in ${1}/SMN???.{iso,wbfs} ${1}/SLF???.{iso,wbfs} ${1}/SMM???.{iso,wbfs} ${1}/SMV???.{iso,wbfs} ${1}/MRR???.{iso,wbfs}; do - if [[ -e ${image} ]]; then - echo " ${image##*/} $(show_nsmb_db ${image##*/})" - fi + for image in ${1}/SMN???.{iso,wbfs} \ + ${1}/SLF???.{iso,wbfs} \ + ${1}/SMM???.{iso,wbfs} \ + ${1}/SMV???.{iso,wbfs} \ + ${1}/MRR???.{iso,wbfs} \ + ${PATCHIMAGE_WBFS_DIR}/SMN???.{iso,wbfs} \ + ${PATCHIMAGE_WBFS_DIR}/SLF???.{iso,wbfs} \ + ${PATCHIMAGE_WBFS_DIR}/SMM???.{iso,wbfs} \ + ${PATCHIMAGE_WBFS_DIR}/SMV???.{iso,wbfs} \ + ${PATCHIMAGE_WBFS_DIR}/MRR???.{iso,wbfs}; do + [[ -f ${image} ]] && echo " ${image##*/} $(show_nsmb_db ${image##*/})" done echo "" @@ -388,7 +328,7 @@ ask_input_image_wiimmfi () { echo "Choose Wii Game Image to wiimmfi" - for image in ${1}/*.{iso,wbfs}; do + for image in ${PWD}/*.{iso,wbfs} ${PATCHIMAGE_WBFS_DIR}/*.${iso,wbfs}; do if [[ -e ${image} && ! ${image} == "*/RMC*" && $(check_wfc ${image##*/}) == TRUE ]]; then echo " ${image##*/} $(show_titles_db ${image##*/})" fi diff --git a/script.d/kirbywii.sh b/script.d/kirbywii.sh index 6caa672..0903565 100644 --- a/script.d/kirbywii.sh +++ b/script.d/kirbywii.sh @@ -2,6 +2,8 @@ GAME_TYPE="WII_GENERIC" GAME_NAME="Kirby's Adventure Wii" +WBFS_MASK="SUK[PUJ]01" +PATH_HERO="files/g3d/step/chara/hero/" show_notes () { @@ -15,7 +17,11 @@ Supported Versions: EUR, JAP, USA } -PATH_HERO="files/g3d/step/chara/hero/" +check_input_image_special () { + + check_input_image + +} exchange_kirby () { @@ -47,8 +53,6 @@ exchange_hero () { pi_action () { - check_input_image_kirby - echo "Choose character for first player 1 Kirby (blue) diff --git a/script.d/mkwii/mkwiimm.sh b/script.d/mkwii/mkwiimm.sh index 26f103e..7399e32 100644 --- a/script.d/mkwii/mkwiimm.sh +++ b/script.d/mkwii/mkwiimm.sh @@ -3,6 +3,7 @@ GAME_TYPE="MKWIIMM" GAME_NAME="Mario Kart Wiimm" DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/mkw-wiimmfi-patcher-v3.7z" +WBFS_MASK="RMC[PUJ]01" show_notes () { @@ -19,12 +20,6 @@ Supported Versions: EUR, JAP, USA } -check_input_image_special () { - - check_input_image_mkwiimm - -} - download_wiimm () { echo "Choose a Mario Kart Wiimm Distribution diff --git a/script.d/mkwii/mkwiimm_fonts.sh b/script.d/mkwii/mkwiimm_fonts.sh index 5398ab7..3066b50 100644 --- a/script.d/mkwii/mkwiimm_fonts.sh +++ b/script.d/mkwii/mkwiimm_fonts.sh @@ -1,8 +1,9 @@ #!/bin/bash -GAME_TYPE="MKWIIMM" +GAME_TYPE="WII_GENERIC" GAME_NAME="Mario Kart Wiimm" FSZS="files/Scene/UI/Font.szs" +WBFS_MASK="RMC[PUJ]01" show_notes () { @@ -21,13 +22,15 @@ Supported Versions: EUR, JAP, USA check_input_image_special () { - check_input_image_mkwiimm - ask_input_image_mkwiimm ${IMAGE%/*} - echo -e "type RMC???.wbfs:\n" + ask_input_image_mkwiimm + echo -e "type ALL or RMC???.wbfs:\n" read ID - if [[ ! -f ${IMAGE%/*}/${ID} ]]; then - echo "wrong id from user-input given." + if [[ -f ${PWD}/${ID} ]]; then + GAMEDIR=${PWD} + elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then + GAMEDIR=${PATCHIMAGE_WBFS_DIR} + else echo "invalid user input." exit 75 fi @@ -79,8 +82,9 @@ build_mkwiimm () { } -patch_wiimm () { +pi_action () { + download_wiimm build_mkwiimm } diff --git a/script.d/mkwii/mkwiimm_items.sh b/script.d/mkwii/mkwiimm_items.sh index d9c84df..ec8efae 100644 --- a/script.d/mkwii/mkwiimm_items.sh +++ b/script.d/mkwii/mkwiimm_items.sh @@ -1,6 +1,6 @@ #!/bin/bash -GAME_TYPE="MKWIIMM" +GAME_TYPE="WII_GENERIC" GAME_NAME="Mario Kart Wiimm" CSZS="files/Race/Common.szs" CSZD="files/Race/Common.d" @@ -22,14 +22,16 @@ Supported Versions: EUR, JAP, USA check_input_image_special () { - check_input_image_mkwiimm - ask_input_image_mkwiimm ${IMAGE%/*} - echo -e "type RMC???.wbfs:\n" + ask_input_image_mkwiimm + echo -e "type ALL or RMC???.wbfs:\n" read ID - if [[ ! -f ${IMAGE%/*}/${ID} ]]; then - echo "wrong id from user-input given." - exit 1 + if [[ -f ${PWD}/${ID} ]]; then + GAMEDIR=${PWD} + elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then + GAMEDIR=${PATCHIMAGE_WBFS_DIR} + else echo "invalid user input." + exit 75 fi } @@ -144,8 +146,9 @@ build_mkwiimm () { } -patch_wiimm () { +pi_action () { + download_wiimm build_mkwiimm } diff --git a/script.d/mkwii/mkwiimm_karts.sh b/script.d/mkwii/mkwiimm_karts.sh index 48e2370..e77c6f1 100644 --- a/script.d/mkwii/mkwiimm_karts.sh +++ b/script.d/mkwii/mkwiimm_karts.sh @@ -1,6 +1,6 @@ #!/bin/bash -GAME_TYPE="MKWIIMM" +GAME_TYPE="WII_GENERIC" GAME_NAME="Mario Kart Wiimm" show_notes () { @@ -20,13 +20,15 @@ Supported Versions: EUR, JAP, USA check_input_image_special () { - check_input_image_mkwiimm - ask_input_image_mkwiimm ${IMAGE%/*} - echo -e "type RMC???.wbfs:\n" + ask_input_image_mkwiimm + echo -e "type ALL or RMC???.wbfs:\n" read ID - if [[ ! -f ${IMAGE%/*}/${ID} ]]; then - echo "wrong id from user-input given." + if [[ -f ${PWD}/${ID} ]]; then + GAMEDIR=${PWD} + elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then + GAMEDIR=${PATCHIMAGE_WBFS_DIR} + else echo "invalid user input." exit 75 fi @@ -121,8 +123,9 @@ build_mkwiimm () { } -patch_wiimm () { +pi_action () { + download_wiimm build_mkwiimm } diff --git a/script.d/mkwii/wiimmfi.sh b/script.d/mkwii/wiimmfi.sh index d56fc54..04d9b7a 100644 --- a/script.d/mkwii/wiimmfi.sh +++ b/script.d/mkwii/wiimmfi.sh @@ -1,7 +1,7 @@ #!/bin/bash DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/mkw-wiimmfi-patcher-v3.7z" -GAME_TYPE="MKWIIMM" +GAME_TYPE="WII_GENERIC" GAME_NAME="Mario Kart Wiimmfi" show_notes () { @@ -21,11 +21,19 @@ Supported Versions: EUR, JAP, USA check_input_image_special () { - check_input_image_mkwiimm - ask_input_image_mkwiimm ${IMAGE%/*} + ask_input_image_mkwiimm echo -e "type ALL or RMC???.wbfs:\n" read ID + if [[ -f ${PWD}/${ID} ]]; then + GAMEDIR=${PWD} + elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then + GAMEDIR=${PATCHIMAGE_WBFS_DIR} + else echo "invalid user input." + exit 75 + fi + + } download_wiimm () { @@ -69,3 +77,10 @@ patch_wiimm () { rm -rf ${HOME}/.patchimage/tools/wiimfi-patcher/ } + +pi_action () { + + download_wiimm + patch_wiimm + +} diff --git a/script.d/nsmbw/anothersmb.sh b/script.d/nsmbw/anothersmb.sh index 511f82a..92be997 100644 --- a/script.d/nsmbw/anothersmb.sh +++ b/script.d/nsmbw/anothersmb.sh @@ -12,6 +12,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="Riivolution/Another.xml" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -30,12 +31,6 @@ Supported Versions: EURv1, USAv1, USAv2 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { diff --git a/script.d/nsmbw/awesomersuperluigi.sh b/script.d/nsmbw/awesomersuperluigi.sh index f70c1ff..ebea53b 100644 --- a/script.d/nsmbw/awesomersuperluigi.sh +++ b/script.d/nsmbw/awesomersuperluigi.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}"/AwesomerSLM XML_FILE="${RIIVOLUTION_DIR}"/riivolution/ASLMriivo.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -29,12 +30,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/cannon.sh b/script.d/nsmbw/cannon.sh index 942d00d..13851fe 100644 --- a/script.d/nsmbw/cannon.sh +++ b/script.d/nsmbw/cannon.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}"/Cannon/ XML_FILE="${RIIVOLUTION_DIR}"/riivolution/CannonP.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -29,12 +30,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/darkumbrasmb.sh b/script.d/nsmbw/darkumbrasmb.sh index e18ad08..7d6f62d 100644 --- a/script.d/nsmbw/darkumbrasmb.sh +++ b/script.d/nsmbw/darkumbrasmb.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/dusmbaePAL.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/devilmariowinterspecial.sh b/script.d/nsmbw/devilmariowinterspecial.sh index 0293f0d..f3ac6fc 100644 --- a/script.d/nsmbw/devilmariowinterspecial.sh +++ b/script.d/nsmbw/devilmariowinterspecial.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}/../riivolution/Devil SMWSP-Eng.xml" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/epicbowserworld.sh b/script.d/nsmbw/epicbowserworld.sh index 3a2c1e7..88bb46f 100644 --- a/script.d/nsmbw/epicbowserworld.sh +++ b/script.d/nsmbw/epicbowserworld.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}"/ESBW/ XML_FILE="${RIIVOLUTION_DIR}"/riivolution/ESBWP.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -26,12 +27,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/ghostlysuperghostbooswii.sh b/script.d/nsmbw/ghostlysuperghostbooswii.sh index d479d7c..5c8d1f0 100644 --- a/script.d/nsmbw/ghostlysuperghostbooswii.sh +++ b/script.d/nsmbw/ghostlysuperghostbooswii.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}/../riivolution/Ghostly" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/koopacountry.sh b/script.d/nsmbw/koopacountry.sh index f956767..cf7edf7 100644 --- a/script.d/nsmbw/koopacountry.sh +++ b/script.d/nsmbw/koopacountry.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/KoopaP.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -34,12 +35,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/luigissuperyoshibros.sh b/script.d/nsmbw/luigissuperyoshibros.sh index 8265c4a..320ddfa 100644 --- a/script.d/nsmbw/luigissuperyoshibros.sh +++ b/script.d/nsmbw/luigissuperyoshibros.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/LSYB GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -28,12 +29,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv1, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/midissupermariowii.sh b/script.d/nsmbw/midissupermariowii.sh index bdc28ab..9c2df1b 100644 --- a/script.d/nsmbw/midissupermariowii.sh +++ b/script.d/nsmbw/midissupermariowii.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/MSMBWIIJALA.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/newerapocalypse.sh b/script.d/nsmbw/newerapocalypse.sh index 5b30927..683b97a 100644 --- a/script.d/nsmbw/newerapocalypse.sh +++ b/script.d/nsmbw/newerapocalypse.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/NewerApocalypse.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -35,12 +36,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/newerfallingleaf.sh b/script.d/nsmbw/newerfallingleaf.sh index b789d42..dccb004 100644 --- a/script.d/nsmbw/newerfallingleaf.sh +++ b/script.d/nsmbw/newerfallingleaf.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/NewerFALLING.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -28,12 +29,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/newerholiday.sh b/script.d/nsmbw/newerholiday.sh index 368976c..cfb1cf4 100644 --- a/script.d/nsmbw/newerholiday.sh +++ b/script.d/nsmbw/newerholiday.sh @@ -12,6 +12,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="riivolution/Xmas" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -30,12 +31,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/newersmb.sh b/script.d/nsmbw/newersmb.sh index d522bad..8636016 100644 --- a/script.d/nsmbw/newersmb.sh +++ b/script.d/nsmbw/newersmb.sh @@ -12,6 +12,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/NewerSMBW.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -30,12 +31,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/newersummersun.sh b/script.d/nsmbw/newersummersun.sh index 3f85946..daf6e5c 100644 --- a/script.d/nsmbw/newersummersun.sh +++ b/script.d/nsmbw/newersummersun.sh @@ -12,6 +12,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}"/SumSun/ XML_FILE="${RIIVOLUTION_DIR}"/riivolution/SumSunP.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -29,12 +30,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/newsmbwotherworld.sh b/script.d/nsmbw/newsmbwotherworld.sh index feb4c7c..9a2e636 100644 --- a/script.d/nsmbw/newsmbwotherworld.sh +++ b/script.d/nsmbw/newsmbwotherworld.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}/../riivolution/OtherWorld" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -28,12 +29,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/nsmbw3.sh b/script.d/nsmbw/nsmbw3.sh index 4912d50..4fce65a 100644 --- a/script.d/nsmbw/nsmbw3.sh +++ b/script.d/nsmbw/nsmbw3.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/NSMBW3.XML GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -26,12 +27,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/nsmbw4.sh b/script.d/nsmbw/nsmbw4.sh index 17a5050..3ad9254 100644 --- a/script.d/nsmbw/nsmbw4.sh +++ b/script.d/nsmbw/nsmbw4.sh @@ -8,6 +8,7 @@ RIIVOLUTION_DIR="nsmb" GAMENAME="New Super Mario Bros. 4" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -25,12 +26,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/nsmbw_characters.sh b/script.d/nsmbw/nsmbw_characters.sh index 5372c4f..38a502a 100644 --- a/script.d/nsmbw/nsmbw_characters.sh +++ b/script.d/nsmbw/nsmbw_characters.sh @@ -20,13 +20,16 @@ Supported Versions: EUR, JAP, USA check_input_image_special () { - check_input_image_nsmb - ask_input_image_nsmb ${IMAGE%/*} - echo -e "type SMN???.wbfs:\n" + ask_input_image_nsmb + + echo -e "type ??????.wbfs (or ??????.iso):\n" read ID - if [[ ! -f ${IMAGE%/*}/${ID} ]]; then - echo "wrong id from user-input given." + if [[ -f ${PWD}/${ID} ]]; then + GAMEDIR=${PWD} + elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then + GAMEDIR=${PATCHIMAGE_WBFS_DIR} + else echo "invalid user input." exit 75 fi @@ -34,8 +37,6 @@ check_input_image_special () { pi_action () { - check_input_image_special - if [[ -f ${HOME}/.patchimage.choice ]]; then echo "Your choices from last time can be re-used." echo "y (yes) or n (no)" diff --git a/script.d/nsmbw/remixedsupermariobroswii.sh b/script.d/nsmbw/remixedsupermariobroswii.sh index 2a9d3a2..9a55ab3 100644 --- a/script.d/nsmbw/remixedsupermariobroswii.sh +++ b/script.d/nsmbw/remixedsupermariobroswii.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}/../riivolution/NSMBtemplate.xml" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/retroremix.sh b/script.d/nsmbw/retroremix.sh index 6d83d11..50b6fa9 100644 --- a/script.d/nsmbw/retroremix.sh +++ b/script.d/nsmbw/retroremix.sh @@ -8,6 +8,7 @@ RIIVOLUTION_DIR="Retro Remix" GAMENAME="New Super Mario Bros. Wii Retro Remix" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -27,12 +28,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/revisedsupermariobroswii.sh b/script.d/nsmbw/revisedsupermariobroswii.sh index 6dcae5e..7355925 100644 --- a/script.d/nsmbw/revisedsupermariobroswii.sh +++ b/script.d/nsmbw/revisedsupermariobroswii.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}/" XML_FILE="${RIIVOLUTION_DIR}/../riivolution/RSMBW.xml" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/rvlution.sh b/script.d/nsmbw/rvlution.sh index 352ead7..86c8ac2 100644 --- a/script.d/nsmbw/rvlution.sh +++ b/script.d/nsmbw/rvlution.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/rvlwii.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -30,12 +31,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/skyland.sh b/script.d/nsmbw/skyland.sh index d62a3d5..783bb17 100644 --- a/script.d/nsmbw/skyland.sh +++ b/script.d/nsmbw/skyland.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/Skyland.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -30,12 +31,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/summervacation.sh b/script.d/nsmbw/summervacation.sh index b476841..194a4fd 100644 --- a/script.d/nsmbw/summervacation.sh +++ b/script.d/nsmbw/summervacation.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}"/Vacation XML_FILE="${RIIVOLUTION_DIR}"/riivolution/Vacation GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -26,12 +27,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/nsmbw/thelegendofyoshi.sh b/script.d/nsmbw/thelegendofyoshi.sh index bc6c954..722930e 100644 --- a/script.d/nsmbw/thelegendofyoshi.sh +++ b/script.d/nsmbw/thelegendofyoshi.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}/../riivolution/TLOY (" GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -24,12 +25,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/wintermoon.sh b/script.d/nsmbw/wintermoon.sh similarity index 98% rename from script.d/wintermoon.sh rename to script.d/nsmbw/wintermoon.sh index 9a19553..c405384 100644 --- a/script.d/wintermoon.sh +++ b/script.d/nsmbw/wintermoon.sh @@ -10,6 +10,7 @@ XML_SOURCE="${RIIVOLUTION_DIR}" XML_FILE="${RIIVOLUTION_DIR}"/../riivolution/WinterMoon.xml GAME_TYPE=RIIVOLUTION BANNER_LOCATION=${WORKDIR}/files/opening.bnr +WBFS_MASK="SMN[PUJ]01" show_notes () { @@ -37,12 +38,6 @@ Supported Versions: EURv1, EURv2, USAv1, USAv2, JPNv1 } -check_input_image_special () { - - check_input_image_nsmb - -} - detect_game_version () { nsmbw_version diff --git a/script.d/wiimmfi_generic.sh b/script.d/wiimmfi_generic.sh index 0b3d741..a50e6ea 100644 --- a/script.d/wiimmfi_generic.sh +++ b/script.d/wiimmfi_generic.sh @@ -1,7 +1,7 @@ #!/bin/bash DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/wiimmfi-patcher-v3.7z" -GAME_TYPE="MKWIIMM" +GAME_TYPE="WII_GENERIC" GAME_NAME="Mario Kart Wiimmfi" show_notes () { @@ -21,32 +21,23 @@ Supported Versions: EUR, JAP, USA check_input_image_special () { - if [[ ${IMAGE} ]]; then - ask_input_image_wiimmfi ${PWD} - GAMEDIR=${PWD} - else - ask_input_image_wiimmfi ${PATCHIMAGE_WBFS_DIR} - GAMEDIR=${PATCHIMAGE_WBFS_DIR} - fi + ask_input_image_wiimmfi echo -e "type ??????.wbfs (or ??????.iso):\n" read ID -} - -download_wiimm () { - - return 0 - -} - -patch_wiimm () { - - if [[ ! -f ${GAMEDIR}/${ID} ]]; then - echo "unvalid game passed from user-input. exit" + if [[ -f ${PWD}/${ID} ]]; then + GAMEDIR=${PWD} + elif [[ -f ${PATCHIMAGE_WBFS_DIR}/${ID} ]]; then + GAMEDIR=${PATCHIMAGE_WBFS_DIR} + else echo "invalid user input." exit 75 fi +} + +pi_action () { + cp -v ${GAMEDIR}/${ID} . 2>/dev/null ${WIT} cp -o ${ID} --DEST "${PATCHIMAGE_GAME_DIR}"/${ID} \ --update --psel=data --wiimmfi >/dev/null || \