From c80e470e923843174e6c2e13d00275e5d9049e49 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Tue, 26 Jul 2016 23:16:49 +0200 Subject: [PATCH] support for Pokemon Neo X / Neo Y --- patchimage.sh | 46 +++++++++++++++++++++++++ script.d/common.sh | 30 +++++++++++++++-- script.d/pokemonneox.sh | 75 +++++++++++++++++++++++++++++++++++++++++ script.d/pokemonneoy.sh | 75 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 223 insertions(+), 3 deletions(-) create mode 100644 script.d/pokemonneox.sh create mode 100644 script.d/pokemonneoy.sh diff --git a/patchimage.sh b/patchimage.sh index faf7b6f..f971eea 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -12,10 +12,12 @@ basedir=$(dirname ${basedir}) if [[ -d ${basedir}/script.d ]]; then PATCHIMAGE_SCRIPT_DIR=${basedir}/script.d PATCHIMAGE_PATCH_DIR=${basedir}/patches + PATCHIMAGE_DATA_DIR=${basedir}/data PATCHIMAGE_TOOLS_DIR=${basedir}/tools else PATCHIMAGE_SCRIPT_DIR=/usr/share/patchimage/script.d PATCHIMAGE_PATCH_DIR=/usr/share/patchimage/patches + PATCHIMAGE_DATA_DIR=/usr/share/patchimage/data PATCHIMAGE_TOOLS_DIR=/usr/share/patchimage/tools fi @@ -171,6 +173,14 @@ case ${GAME} in source ${PATCHIMAGE_SCRIPT_DIR}/tokyomiragesessionsfe.sh ;; + PKMN1 | NeoX ) + source ${PATCHIMAGE_SCRIPT_DIR}/pokemonneox.sh + ;; + + PKMN2 | NeoY ) + source ${PATCHIMAGE_SCRIPT_DIR}/pokemonneoy.sh + ;; + ZEL1 | ParallelWorlds | "The Legend of Zelda: Parallel Worlds" ) source ${PATCHIMAGE_SCRIPT_DIR}/parallelworlds.sh ;; @@ -280,6 +290,42 @@ case ${GAME_TYPE} in fi ;; + "HANS" ) + show_notes + echo -e "\n*** 1) check_input_rom" + check_input_rom + + rm -rf romfs/ romfs.bin ${RFS} + + echo -e "\n*** 2) check_hans_files" + check_hans_files + + echo -e "\n*** 3) unpack_3dsrom" + unpack_3dsrom "${CXI}" || exit 51 + + echo -e "\n*** 4) unpack_3dsromfs" + unpack_3dsromfs romfs.bin || exit 51 + + echo -e "\n*** 5) patch_romfs" + patch_romfs + + echo -e "\n*** 6) repack_romfs" + repack_3dsromfs romfs/ "${RFS}" || exit 51 + + echo " + *** succesfully created new romfs as \"${RFS}\" + + 1) place \"${RFS}\" into sd card > hans/ folder + 2) place all files from + + ${DAT} + + into the root of your sd card + + 3) select the game from Homebrew Launcher +" + ;; + "DELTA" ) show_notes diff --git a/script.d/common.sh b/script.d/common.sh index 6636945..f7749f1 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -1,7 +1,7 @@ #!/bin/bash -PATCHIMAGE_VERSION=6.2.2 -PATCHIMAGE_RELEASE=2016-07-03 +PATCHIMAGE_VERSION=6.3.0 +PATCHIMAGE_RELEASE=2016/07/25 [[ -e $HOME/.patchimage.rc ]] && source $HOME/.patchimage.rc @@ -19,6 +19,8 @@ setup_tools () { SZS=${PATCHIMAGE_TOOLS_DIR}/wszst.${SUFFIX} XD3=${PATCHIMAGE_TOOLS_DIR}/xdelta3.${SUFFIX} GDOWN=${PATCHIMAGE_TOOLS_DIR}/gdown.pl + CTRTOOL=${PATCHIMAGE_TOOLS_DIR}/ctrtool.${SUFFIX} + FDSTOOL=${PATCHIMAGE_TOOLS_DIR}/3dstool.${SUFFIX} } @@ -73,6 +75,10 @@ KAW1 Change first player's character <<<<<< Tokyo Mirage Sessions #FE >>>>>> TMS1 Uncensor US/EUR version +<<<<<< 3DS ROMS >>>>>> +PKMN1 Pokemon Neo X +PKMN2 Pokemon Neo Y + <<<<<< ROMS >>>>>> ZEL1 The Legend of Zelda: Parallel Worlds @@ -393,13 +399,31 @@ download_covers () { } +unpack_3dsrom () { + + ${CTRTOOL} -p --romfs=romfs.bin "${1}" &>/dev/null + +} + +unpack_3dsromfs () { + + ${CTRTOOL} -t romfs --romfsdir=romfs "${1}" &>/dev/null + +} + +repack_3dsromfs () { + + ${FDSTOOL} -ctf romfs "${2}" --romfs-dir "${1}" &>/dev/null + +} + optparse () { xcount=0 pcount=$# while [[ $xcount -lt $pcount ]]; do - case $1 in + case ${1} in --iso* ) ISO_PATH=${1/*=} diff --git a/script.d/pokemonneox.sh b/script.d/pokemonneox.sh new file mode 100644 index 0000000..200dcc3 --- /dev/null +++ b/script.d/pokemonneox.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +DOWNLOAD_LINK="http://www.mediafire.com/download/nd9z16t5nb92743/Neo+X+and+Y+Files.rar" +RIIVOLUTION_ZIP="Neo X and Y Files.rar" +RIIVOLUTION_DIR="Neo X and Y Files/Pokemon NeoXY1.4/Installation hub/data/" +GAMENAME="Pokemon Neo X" +GAME_TYPE=HANS + +CXI_MASK="*0004000000055[dD]00*cxi" +ROMFS="neox.romfs" +DATA="NeoX" + +show_notes () { + +echo -e \ +"************************************************ +${GAMENAME} + +Neo X & Neo Y are rom hacks of Pokemon X and Y designed to offer the player +greater difficulty through expanded trainers and better variety through edited +wild Pokemon encounters along with a plethora of other features. + +NeoX & NeoY are pretty much identical at this stage.​ + +Source: https://gbatemp.net/threads/pokemon-neo-x-neo-y.388272/ +Base ROM: Pokemon X +Supported Versions: US, EU, JAP +************************************************" + +} + +check_input_rom () { + + if [[ ! ${CXI} ]]; then + CXI=$(find . -name ${CXI_MASK} | sed -e 's,./,,') + if [[ -f ${CXI} ]]; then + CXI=${CXI} + RFS=${ROMFS} + DAT=${PATCHIMAGE_DATA_DIR}/${DATA} + else + echo -e "error: could not find suitable ROM, specify using --rom" + exit 15 + fi + fi + +} + +check_hans_files () { + + check_riivolution_patch + + echo " +*** Full vs. Lite Version *** +- Full version contains all the features mentioned in Homepage +- Lite version contains only edited trainers and wild Pokemon encounters + +enter either 'full' or 'lite': +" + + read choice + + case ${choice} in + [fF]ull ) HANS_PATH="${RIIVOLUTION_DIR}"/Full/romfs ;; + [lL]ite ) HANS_PATH="${RIIVOLUTION_DIR}"/Lite/romfs ;; + * ) echo "invalid choice made, using 'Full version'." + HANS_PATH="${RIIVOLUTION_DIR}"/Full/romfs ;; + esac + +} + +patch_romfs () { + + cp -r "${HANS_PATH}"/* romfs/ + + } diff --git a/script.d/pokemonneoy.sh b/script.d/pokemonneoy.sh new file mode 100644 index 0000000..9895a57 --- /dev/null +++ b/script.d/pokemonneoy.sh @@ -0,0 +1,75 @@ +#!/bin/bash + +DOWNLOAD_LINK="http://www.mediafire.com/download/nd9z16t5nb92743/Neo+X+and+Y+Files.rar" +RIIVOLUTION_ZIP="Neo X and Y Files.rar" +RIIVOLUTION_DIR="Neo X and Y Files/Pokemon NeoXY1.4/Installation hub/data/" +GAMENAME="Pokemon Neo Y" +GAME_TYPE=HANS + +CXI_MASK="*0004000000055[eE]00*cxi" +ROMFS="neoy.romfs" +DATA="NeoY" + +show_notes () { + +echo -e \ +"************************************************ +${GAMENAME} + +Neo X & Neo Y are rom hacks of Pokemon X and Y designed to offer the player +greater difficulty through expanded trainers and better variety through edited +wild Pokemon encounters along with a plethora of other features. + +NeoX & NeoY are pretty much identical at this stage.​ + +Source: https://gbatemp.net/threads/pokemon-neo-x-neo-y.388272/ +Base ROM: Pokemon X / Pokemon Y +Supported Versions: US, EU, JAP +************************************************" + +} + +check_input_rom () { + + if [[ ! ${CXI} ]]; then + CXI=$(find . -name ${CXI_MASK} | sed -e 's,./,,') + if [[ -f ${CXI} ]]; then + CXI=${CXI} + RFS=${ROMFS} + DAT=${PATCHIMAGE_DATA_DIR}/${DATA} + else + echo -e "error: could not find suitable ROM, specify using --rom" + exit 15 + fi + fi + +} + +check_hans_files () { + + check_riivolution_patch + + echo " +*** Full vs. Lite Version *** +- Full version contains all the features mentioned in Homepage +- Lite version contains only edited trainers and wild Pokemon encounters + +enter either 'full' or 'lite': +" + + read choice + + case ${choice} in + [fF]ull ) HANS_PATH="${RIIVOLUTION_DIR}"/Full/romfs ;; + [lL]ite ) HANS_PATH="${RIIVOLUTION_DIR}"/Lite/romfs ;; + * ) echo "invalid choice made, using 'Full version'." + HANS_PATH="${RIIVOLUTION_DIR}"/Full/romfs ;; + esac + +} + +patch_romfs () { + + cp -r "${HANS_PATH}"/* romfs/ + + }