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:
Christopher Roy Bratusek 2016-08-06 19:46:07 +02:00
parent b37dd75f84
commit 3f3894ddb0
18 changed files with 163 additions and 133 deletions

View File

@ -235,8 +235,8 @@ case ${GAME} in
esac
case ${GAME_TYPE} in
"RIIVOLUTION" )
patchimage_riivolution () {
show_notes
rm -rf "${WORKDIR}"
if [[ ${PATCHIMAGE_SOUNDTRACK_DOWNLOAD} == TRUE ]]; then
@ -296,29 +296,31 @@ case ${GAME_TYPE} in
echo -e "\nCovers downloaded to ${PATCHIMAGE_COVER_DIR}"
fi
;;
}
patchimage_mkwiimm () {
"MKWIIMM")
show_notes
echo -e "\n*** 1) check_input_image"
check_input_image
echo -e "\n*** 2) download_wiimm"
download_wiimm
echo -e "\n*** 3) patch_wiimm"
patch_wiimm
;;
"WII_GENERIC")
}
patchimage_generic () {
show_notes
echo -e "\n*** 1) check_input_image"
check_input_image_special
echo -e "\n*** 2) pi_action"
pi_action
;;
"IPS" )
}
patchimage_ips () {
show_notes
check_input_rom
@ -330,9 +332,10 @@ case ${GAME_TYPE} in
echo -e "error: patch (${PATCH}) could not be found"
exit 21
fi
;;
}
patchimage_hans () {
"HANS" )
show_notes
echo -e "\n*** 1) check_input_rom"
if [[ ${HANS_MULTI_SOURCE} ]]; then
@ -346,7 +349,7 @@ case ${GAME_TYPE} in
check_hans_files
echo -e "\n*** 3) unpack_3dsrom"
unpack_3dsrom "${CXI}" || exit 51
unpack_3dsrom "${ROM}" || exit 51
echo -e "\n*** 4) unpack_3dsromfs"
unpack_3dsromfs romfs.bin || exit 51
@ -370,16 +373,43 @@ case ${GAME_TYPE} in
into the root of your sd card
"
;;
"DELTA" )
}
patchimage_delta () {
show_notes
echo -e "\n*** 1) menu"
menu || exit 9
echo -e "\n*** 2) patch"
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

View File

@ -4,8 +4,8 @@ GAMENAME="Bravely Second Uncensored"
GAME_TYPE=HANS
HANS_MULTI_SOURCE=TRUE
CXI_MASK_EUR="*000400000017[bB][bB]00*cxi"
CXI_MASK_USA="*000400000017[bB][aA]00*cxi"
ROM_MASK_EUR="*000400000017[bB][bB]00*cxi"
ROM_MASK_USA="*000400000017[bB][aA]00*cxi"
UNP_EXTRA_ARGS="-pAsia81"
@ -27,19 +27,19 @@ Supported Versions: US, EU
check_input_rom_special () {
GAME_VERSION=EUR
CXI_MASK=${CXI_MASK_EUR}
ROM_MASK=${ROM_MASK_EUR}
echo "<< trying EUR game version"
check_input_rom
if [[ ! ${CXI} ]]; then
if [[ ! ${ROM} ]]; then
GAME_VERSION=USA
CXI_MASK=${CXI_MASK_USA}
ROM_MASK=${ROM_MASK_USA}
echo "<< trying USA game version"
check_input_rom
fi
if [[ ! ${CXI} ]]; then
if [[ ! ${ROM} ]]; then
echo -e "\nneither EUR nor USA version of Bravely Second found."
exit 15
fi

View File

@ -240,16 +240,16 @@ check_input_image () {
check_input_rom () {
x=5
if [[ ! ${CXI} ]]; then
CXI=$(find . -name "${CXI_MASK}" | sed -e 's,./,,')
if [[ -f ${CXI} ]]; then
if [[ ! ${ROM} ]]; then
ROM=$(find . -name "${ROM_MASK}" | sed -e 's,./,,')
if [[ -f ${ROM} ]]; then
x=6
CXI="${CXI}"
ROM="${ROM}"
else
CXI=$(find "${PATCHIMAGE_3DS_DIR}" -name "${CXI_MASK}")
if [[ -f ${CXI} ]]; then
ROM=$(find "${PATCHIMAGE_3DS_DIR}" -name "${ROM_MASK}")
if [[ -f ${ROM} ]]; then
x=7
CXI="${CXI}"
ROM="${ROM}"
else
if [[ ! ${HANS_MULTI_SOURCE} ]]; then
echo -e "error: could not find suitable ROM, specify using --rom"
@ -475,7 +475,7 @@ while [[ $xcount -lt $pcount ]]; do
ROM_PATH="${1/*=}"
if [[ -f "${ROM_PATH}" ]]; then
IMAGE="${ROM_PATH}"
ROM="${ROM_PATH}"
else
echo -e "ROM not found"
exit 15

View File

@ -1,6 +1,6 @@
#!/bin/bash
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="Kirby's Adventure Wii"
WBFS_MASK="SUK[PUJ]01"
PATH_HERO="files/g3d/step/chara/hero/"

View File

@ -1,6 +1,6 @@
#!/bin/bash
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="Mario Kart Wiimm"
FSZS="files/Scene/UI/Font.szs"
WBFS_MASK="RMC[PUJ]01"

View File

@ -1,6 +1,6 @@
#!/bin/bash
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="Mario Kart Wiimm"
CSZS="files/Race/Common.szs"
CSZD="files/Race/Common.d"

View File

@ -1,6 +1,6 @@
#!/bin/bash
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="Mario Kart Wiimm"
show_notes () {

View File

@ -1,7 +1,7 @@
#!/bin/bash
DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/mkw-wiimmfi-patcher-v3.7z"
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="Mario Kart Wiimmfi"
show_notes () {

View File

@ -1,6 +1,6 @@
#!/bin/bash
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="New Super Mario Bros. Wii"
show_notes () {

View File

@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Eternal X V1.3/Game Files/"
GAMENAME="Pokemon Eternal X"
GAME_TYPE=HANS
CXI_MASK="*0004000000055[dD]00*cxi"
ROM_MASK="*0004000000055[dD]00*cxi"
ROMFS="EternalX.romfs"
show_notes () {

View File

@ -6,7 +6,7 @@ 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"
ROM_MASK="*0004000000055[dD]00*cxi"
ROMFS="neox.romfs"
DATA="${PATCHIMAGE_DATA_DIR}/NeoX"

View File

@ -6,7 +6,7 @@ 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"
ROM_MASK="*0004000000055[eE]00*cxi"
ROMFS="neoy.romfs"
DATA="${PATCHIMAGE_DATA_DIR}/NeoY"

View File

@ -6,7 +6,7 @@ RIIVOLUTION_DIR="RRSSFiles 18-11-2015"
GAMENAME="Pokemon Rising Ruby"
GAME_TYPE=HANS
CXI_MASK="*000400000011[cC]400*cxi"
ROM_MASK="*000400000011[cC]400*cxi"
ROMFS="RisingRuby.romfs"
DATA="${PATCHIMAGE_DATA_DIR}/RisingRuby/"

View File

@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Rutile Ruby - Distribution"
GAMENAME="Pokemon Rutile Ruby"
GAME_TYPE=HANS
CXI_MASK="*000400000011[cC]400*cxi"
ROM_MASK="*000400000011[cC]400*cxi"
ROMFS="rruby.romfs"
DATA="${RIIVOLUTION_DIR}/HansPack/"

View File

@ -6,7 +6,7 @@ RIIVOLUTION_DIR="RRSSFiles 18-11-2015"
GAMENAME="Pokemon Sinking Sapphire"
GAME_TYPE=HANS
CXI_MASK="*000400000011[cC]500*cxi"
ROM_MASK="*000400000011[cC]500*cxi"
ROMFS="SinkingSapphire.romfs"
DATA="${PATCHIMAGE_DATA_DIR}/SinkingSapphire/"

View File

@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Star Sapphire - Distribution"
GAMENAME="Pokemon Star Sapphire"
GAME_TYPE=HANS
CXI_MASK="*000400000011[cC]500*cxi"
ROM_MASK="*000400000011[cC]500*cxi"
ROMFS="ssapphire.romfs"
DATA="${RIIVOLUTION_DIR}/HansPack/"

View File

@ -6,7 +6,7 @@ RIIVOLUTION_DIR="Wilting Y V1.3/Game Files/"
GAMENAME="Pokemon Wilting Y"
GAME_TYPE=HANS
CXI_MASK="*0004000000055[eE]00*cxi"
ROM_MASK="*0004000000055[eE]00*cxi"
ROMFS="WiltingY.romfs"
show_notes () {

View File

@ -1,7 +1,7 @@
#!/bin/bash
DOWNLOAD_LINK="http://download.wiimm.de/wiimmfi/patcher/wiimmfi-patcher-v3.7z"
GAME_TYPE="WII_GENERIC"
GAME_TYPE="GENERIC"
GAMENAME="Mario Kart Wiimmfi"
show_notes () {