mirror of
https://gitlab.com/Nanolx/patchimage.git
synced 2024-12-28 02:01:47 +01:00
code review, unification:
- rename CXI to ROM (makes --rom command line flag work for 3DS ROMs, too) - rename CXI_MASK to ROM_MASK - rename WII_GENERIC to GENERIC - split functions in patchimage.sh - other minor changes
This commit is contained in:
parent
b37dd75f84
commit
3f3894ddb0
@ -235,8 +235,8 @@ case ${GAME} in
|
|||||||
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
case ${GAME_TYPE} in
|
patchimage_riivolution () {
|
||||||
"RIIVOLUTION" )
|
|
||||||
show_notes
|
show_notes
|
||||||
rm -rf "${WORKDIR}"
|
rm -rf "${WORKDIR}"
|
||||||
if [[ ${PATCHIMAGE_SOUNDTRACK_DOWNLOAD} == TRUE ]]; then
|
if [[ ${PATCHIMAGE_SOUNDTRACK_DOWNLOAD} == TRUE ]]; then
|
||||||
@ -296,29 +296,31 @@ case ${GAME_TYPE} in
|
|||||||
echo -e "\nCovers downloaded to ${PATCHIMAGE_COVER_DIR}"
|
echo -e "\nCovers downloaded to ${PATCHIMAGE_COVER_DIR}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
;;
|
}
|
||||||
|
|
||||||
|
patchimage_mkwiimm () {
|
||||||
|
|
||||||
"MKWIIMM")
|
|
||||||
show_notes
|
show_notes
|
||||||
|
|
||||||
echo -e "\n*** 1) check_input_image"
|
echo -e "\n*** 1) check_input_image"
|
||||||
check_input_image
|
check_input_image
|
||||||
echo -e "\n*** 2) download_wiimm"
|
echo -e "\n*** 2) download_wiimm"
|
||||||
download_wiimm
|
download_wiimm
|
||||||
echo -e "\n*** 3) patch_wiimm"
|
echo -e "\n*** 3) patch_wiimm"
|
||||||
patch_wiimm
|
patch_wiimm
|
||||||
;;
|
|
||||||
|
|
||||||
"WII_GENERIC")
|
}
|
||||||
|
|
||||||
|
patchimage_generic () {
|
||||||
|
|
||||||
show_notes
|
show_notes
|
||||||
|
|
||||||
echo -e "\n*** 1) check_input_image"
|
echo -e "\n*** 1) check_input_image"
|
||||||
check_input_image_special
|
check_input_image_special
|
||||||
echo -e "\n*** 2) pi_action"
|
echo -e "\n*** 2) pi_action"
|
||||||
pi_action
|
pi_action
|
||||||
;;
|
|
||||||
|
|
||||||
"IPS" )
|
}
|
||||||
|
|
||||||
|
patchimage_ips () {
|
||||||
show_notes
|
show_notes
|
||||||
check_input_rom
|
check_input_rom
|
||||||
|
|
||||||
@ -330,9 +332,10 @@ case ${GAME_TYPE} in
|
|||||||
echo -e "error: patch (${PATCH}) could not be found"
|
echo -e "error: patch (${PATCH}) could not be found"
|
||||||
exit 21
|
exit 21
|
||||||
fi
|
fi
|
||||||
;;
|
}
|
||||||
|
|
||||||
|
patchimage_hans () {
|
||||||
|
|
||||||
"HANS" )
|
|
||||||
show_notes
|
show_notes
|
||||||
echo -e "\n*** 1) check_input_rom"
|
echo -e "\n*** 1) check_input_rom"
|
||||||
if [[ ${HANS_MULTI_SOURCE} ]]; then
|
if [[ ${HANS_MULTI_SOURCE} ]]; then
|
||||||
@ -346,7 +349,7 @@ case ${GAME_TYPE} in
|
|||||||
check_hans_files
|
check_hans_files
|
||||||
|
|
||||||
echo -e "\n*** 3) unpack_3dsrom"
|
echo -e "\n*** 3) unpack_3dsrom"
|
||||||
unpack_3dsrom "${CXI}" || exit 51
|
unpack_3dsrom "${ROM}" || exit 51
|
||||||
|
|
||||||
echo -e "\n*** 4) unpack_3dsromfs"
|
echo -e "\n*** 4) unpack_3dsromfs"
|
||||||
unpack_3dsromfs romfs.bin || exit 51
|
unpack_3dsromfs romfs.bin || exit 51
|
||||||
@ -370,16 +373,43 @@ case ${GAME_TYPE} in
|
|||||||
|
|
||||||
into the root of your sd card
|
into the root of your sd card
|
||||||
"
|
"
|
||||||
;;
|
|
||||||
|
|
||||||
"DELTA" )
|
}
|
||||||
|
|
||||||
|
patchimage_delta () {
|
||||||
|
|
||||||
show_notes
|
show_notes
|
||||||
|
|
||||||
echo -e "\n*** 1) menu"
|
echo -e "\n*** 1) menu"
|
||||||
menu || exit 9
|
menu || exit 9
|
||||||
|
|
||||||
echo -e "\n*** 2) patch"
|
echo -e "\n*** 2) patch"
|
||||||
patch || exit 51
|
patch || exit 51
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
case ${GAME_TYPE} in
|
||||||
|
"RIIVOLUTION" )
|
||||||
|
patchimage_riivolution
|
||||||
|
;;
|
||||||
|
|
||||||
|
"MKWIIMM")
|
||||||
|
patchimage_mkwiimm
|
||||||
|
;;
|
||||||
|
|
||||||
|
"GENERIC")
|
||||||
|
patchimage_generic
|
||||||
|
;;
|
||||||
|
|
||||||
|
"IPS" )
|
||||||
|
patchimage_ips
|
||||||
|
;;
|
||||||
|
|
||||||
|
"HANS" )
|
||||||
|
patchimage_hans
|
||||||
|
;;
|
||||||
|
|
||||||
|
"DELTA" )
|
||||||
|
patchimage_delta
|
||||||
;;
|
;;
|
||||||
|
|
||||||
esac
|
esac
|
||||||
|
@ -4,8 +4,8 @@ GAMENAME="Bravely Second Uncensored"
|
|||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
HANS_MULTI_SOURCE=TRUE
|
HANS_MULTI_SOURCE=TRUE
|
||||||
|
|
||||||
CXI_MASK_EUR="*000400000017[bB][bB]00*cxi"
|
ROM_MASK_EUR="*000400000017[bB][bB]00*cxi"
|
||||||
CXI_MASK_USA="*000400000017[bB][aA]00*cxi"
|
ROM_MASK_USA="*000400000017[bB][aA]00*cxi"
|
||||||
|
|
||||||
UNP_EXTRA_ARGS="-pAsia81"
|
UNP_EXTRA_ARGS="-pAsia81"
|
||||||
|
|
||||||
@ -27,19 +27,19 @@ Supported Versions: US, EU
|
|||||||
check_input_rom_special () {
|
check_input_rom_special () {
|
||||||
|
|
||||||
GAME_VERSION=EUR
|
GAME_VERSION=EUR
|
||||||
CXI_MASK=${CXI_MASK_EUR}
|
ROM_MASK=${ROM_MASK_EUR}
|
||||||
echo "<< trying EUR game version"
|
echo "<< trying EUR game version"
|
||||||
check_input_rom
|
check_input_rom
|
||||||
|
|
||||||
|
|
||||||
if [[ ! ${CXI} ]]; then
|
if [[ ! ${ROM} ]]; then
|
||||||
GAME_VERSION=USA
|
GAME_VERSION=USA
|
||||||
CXI_MASK=${CXI_MASK_USA}
|
ROM_MASK=${ROM_MASK_USA}
|
||||||
echo "<< trying USA game version"
|
echo "<< trying USA game version"
|
||||||
check_input_rom
|
check_input_rom
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! ${CXI} ]]; then
|
if [[ ! ${ROM} ]]; then
|
||||||
echo -e "\nneither EUR nor USA version of Bravely Second found."
|
echo -e "\nneither EUR nor USA version of Bravely Second found."
|
||||||
exit 15
|
exit 15
|
||||||
fi
|
fi
|
||||||
|
@ -240,16 +240,16 @@ check_input_image () {
|
|||||||
check_input_rom () {
|
check_input_rom () {
|
||||||
|
|
||||||
x=5
|
x=5
|
||||||
if [[ ! ${CXI} ]]; then
|
if [[ ! ${ROM} ]]; then
|
||||||
CXI=$(find . -name "${CXI_MASK}" | sed -e 's,./,,')
|
ROM=$(find . -name "${ROM_MASK}" | sed -e 's,./,,')
|
||||||
if [[ -f ${CXI} ]]; then
|
if [[ -f ${ROM} ]]; then
|
||||||
x=6
|
x=6
|
||||||
CXI="${CXI}"
|
ROM="${ROM}"
|
||||||
else
|
else
|
||||||
CXI=$(find "${PATCHIMAGE_3DS_DIR}" -name "${CXI_MASK}")
|
ROM=$(find "${PATCHIMAGE_3DS_DIR}" -name "${ROM_MASK}")
|
||||||
if [[ -f ${CXI} ]]; then
|
if [[ -f ${ROM} ]]; then
|
||||||
x=7
|
x=7
|
||||||
CXI="${CXI}"
|
ROM="${ROM}"
|
||||||
else
|
else
|
||||||
if [[ ! ${HANS_MULTI_SOURCE} ]]; then
|
if [[ ! ${HANS_MULTI_SOURCE} ]]; then
|
||||||
echo -e "error: could not find suitable ROM, specify using --rom"
|
echo -e "error: could not find suitable ROM, specify using --rom"
|
||||||
@ -475,7 +475,7 @@ while [[ $xcount -lt $pcount ]]; do
|
|||||||
ROM_PATH="${1/*=}"
|
ROM_PATH="${1/*=}"
|
||||||
|
|
||||||
if [[ -f "${ROM_PATH}" ]]; then
|
if [[ -f "${ROM_PATH}" ]]; then
|
||||||
IMAGE="${ROM_PATH}"
|
ROM="${ROM_PATH}"
|
||||||
else
|
else
|
||||||
echo -e "ROM not found"
|
echo -e "ROM not found"
|
||||||
exit 15
|
exit 15
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="Kirby's Adventure Wii"
|
GAMENAME="Kirby's Adventure Wii"
|
||||||
WBFS_MASK="SUK[PUJ]01"
|
WBFS_MASK="SUK[PUJ]01"
|
||||||
PATH_HERO="files/g3d/step/chara/hero/"
|
PATH_HERO="files/g3d/step/chara/hero/"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="Mario Kart Wiimm"
|
GAMENAME="Mario Kart Wiimm"
|
||||||
FSZS="files/Scene/UI/Font.szs"
|
FSZS="files/Scene/UI/Font.szs"
|
||||||
WBFS_MASK="RMC[PUJ]01"
|
WBFS_MASK="RMC[PUJ]01"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="Mario Kart Wiimm"
|
GAMENAME="Mario Kart Wiimm"
|
||||||
CSZS="files/Race/Common.szs"
|
CSZS="files/Race/Common.szs"
|
||||||
CSZD="files/Race/Common.d"
|
CSZD="files/Race/Common.d"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="Mario Kart Wiimm"
|
GAMENAME="Mario Kart Wiimm"
|
||||||
|
|
||||||
show_notes () {
|
show_notes () {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/mkw-wiimmfi-patcher-v3.7z"
|
DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/mkw-wiimmfi-patcher-v3.7z"
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="Mario Kart Wiimmfi"
|
GAMENAME="Mario Kart Wiimmfi"
|
||||||
|
|
||||||
show_notes () {
|
show_notes () {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="New Super Mario Bros. Wii"
|
GAMENAME="New Super Mario Bros. Wii"
|
||||||
|
|
||||||
show_notes () {
|
show_notes () {
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Eternal X V1.3/Game Files/"
|
|||||||
GAMENAME="Pokemon Eternal X"
|
GAMENAME="Pokemon Eternal X"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*0004000000055[dD]00*cxi"
|
ROM_MASK="*0004000000055[dD]00*cxi"
|
||||||
ROMFS="EternalX.romfs"
|
ROMFS="EternalX.romfs"
|
||||||
|
|
||||||
show_notes () {
|
show_notes () {
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Neo X and Y Files/Pokemon NeoXY1.4/Installation hub/data/"
|
|||||||
GAMENAME="Pokemon Neo X"
|
GAMENAME="Pokemon Neo X"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*0004000000055[dD]00*cxi"
|
ROM_MASK="*0004000000055[dD]00*cxi"
|
||||||
ROMFS="neox.romfs"
|
ROMFS="neox.romfs"
|
||||||
DATA="${PATCHIMAGE_DATA_DIR}/NeoX"
|
DATA="${PATCHIMAGE_DATA_DIR}/NeoX"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Neo X and Y Files/Pokemon NeoXY1.4/Installation hub/data/"
|
|||||||
GAMENAME="Pokemon Neo Y"
|
GAMENAME="Pokemon Neo Y"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*0004000000055[eE]00*cxi"
|
ROM_MASK="*0004000000055[eE]00*cxi"
|
||||||
ROMFS="neoy.romfs"
|
ROMFS="neoy.romfs"
|
||||||
DATA="${PATCHIMAGE_DATA_DIR}/NeoY"
|
DATA="${PATCHIMAGE_DATA_DIR}/NeoY"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="RRSSFiles 18-11-2015"
|
|||||||
GAMENAME="Pokemon Rising Ruby"
|
GAMENAME="Pokemon Rising Ruby"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*000400000011[cC]400*cxi"
|
ROM_MASK="*000400000011[cC]400*cxi"
|
||||||
ROMFS="RisingRuby.romfs"
|
ROMFS="RisingRuby.romfs"
|
||||||
DATA="${PATCHIMAGE_DATA_DIR}/RisingRuby/"
|
DATA="${PATCHIMAGE_DATA_DIR}/RisingRuby/"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Rutile Ruby - Distribution"
|
|||||||
GAMENAME="Pokemon Rutile Ruby"
|
GAMENAME="Pokemon Rutile Ruby"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*000400000011[cC]400*cxi"
|
ROM_MASK="*000400000011[cC]400*cxi"
|
||||||
ROMFS="rruby.romfs"
|
ROMFS="rruby.romfs"
|
||||||
DATA="${RIIVOLUTION_DIR}/HansPack/"
|
DATA="${RIIVOLUTION_DIR}/HansPack/"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="RRSSFiles 18-11-2015"
|
|||||||
GAMENAME="Pokemon Sinking Sapphire"
|
GAMENAME="Pokemon Sinking Sapphire"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*000400000011[cC]500*cxi"
|
ROM_MASK="*000400000011[cC]500*cxi"
|
||||||
ROMFS="SinkingSapphire.romfs"
|
ROMFS="SinkingSapphire.romfs"
|
||||||
DATA="${PATCHIMAGE_DATA_DIR}/SinkingSapphire/"
|
DATA="${PATCHIMAGE_DATA_DIR}/SinkingSapphire/"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Star Sapphire - Distribution"
|
|||||||
GAMENAME="Pokemon Star Sapphire"
|
GAMENAME="Pokemon Star Sapphire"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*000400000011[cC]500*cxi"
|
ROM_MASK="*000400000011[cC]500*cxi"
|
||||||
ROMFS="ssapphire.romfs"
|
ROMFS="ssapphire.romfs"
|
||||||
DATA="${RIIVOLUTION_DIR}/HansPack/"
|
DATA="${RIIVOLUTION_DIR}/HansPack/"
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Wilting Y V1.3/Game Files/"
|
|||||||
GAMENAME="Pokemon Wilting Y"
|
GAMENAME="Pokemon Wilting Y"
|
||||||
GAME_TYPE=HANS
|
GAME_TYPE=HANS
|
||||||
|
|
||||||
CXI_MASK="*0004000000055[eE]00*cxi"
|
ROM_MASK="*0004000000055[eE]00*cxi"
|
||||||
ROMFS="WiltingY.romfs"
|
ROMFS="WiltingY.romfs"
|
||||||
|
|
||||||
show_notes () {
|
show_notes () {
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/wiimmfi-patcher-v3.7z"
|
DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/wiimmfi-patcher-v3.7z"
|
||||||
GAME_TYPE="WII_GENERIC"
|
GAME_TYPE="GENERIC"
|
||||||
GAMENAME="Mario Kart Wiimmfi"
|
GAMENAME="Mario Kart Wiimmfi"
|
||||||
|
|
||||||
show_notes () {
|
show_notes () {
|
||||||
|
Loading…
Reference in New Issue
Block a user