2013-06-13 20:12:19 +02:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
2013-06-15 19:25:15 +02:00
|
|
|
# create wbfs image from riivolution patch
|
2013-06-13 20:12:19 +02:00
|
|
|
#
|
|
|
|
# Christopher Roy Bratusek <nano@tuxfamily.org>
|
|
|
|
#
|
|
|
|
# License: GPL v3
|
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
source ./script.d/common.sh
|
2013-06-15 19:58:07 +02:00
|
|
|
setup_tools
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
optparse "${@}"
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
if [[ ! ${GAME} ]]; then
|
|
|
|
ask_game
|
2013-06-13 20:12:19 +02:00
|
|
|
fi
|
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
case ${GAME} in
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
A | NewerSMB )
|
|
|
|
source ./script.d/newersmb.sh
|
|
|
|
;;
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:58:07 +02:00
|
|
|
B | NewerSummerSun )
|
|
|
|
source ./script.d/newersummersun.sh
|
|
|
|
;;
|
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
* )
|
|
|
|
echo -e "specified Game ${GAME} not recognized"
|
|
|
|
exit 1
|
|
|
|
;;
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
esac
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
cleanup_prebuild
|
|
|
|
check_input_image
|
|
|
|
check_input_image_special
|
|
|
|
check_riivolution_patch
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
${WIT} extract "${IMAGE}" ${WORKDIR} --psel=DATA -vv || exit 1
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
detect_game_version
|
|
|
|
place_files
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:58:07 +02:00
|
|
|
if [[ ${XML} ]]; then
|
2013-06-15 20:19:18 +02:00
|
|
|
wit dolpatch ${DOL} xml="${XML_FILE}" --source "${XML_SOURCE}" || exit 1
|
2013-06-15 19:58:07 +02:00
|
|
|
else
|
2013-06-15 20:19:18 +02:00
|
|
|
${PPF} a ${DOL} ${PATCH} || exit 1
|
2013-06-15 19:58:07 +02:00
|
|
|
fi
|
2013-06-13 20:12:19 +02:00
|
|
|
|
2013-06-15 19:25:15 +02:00
|
|
|
if [[ ${CUSTOMID} ]]; then
|
|
|
|
${WIT} cp -v -B ${WORKDIR} ./${CUSTOMID}.wbfs -vv --disc-id=${CUSTOMID} ${TMD_OPTS} --name "${GAMENAME}"
|
|
|
|
else
|
|
|
|
${WIT} cp -v -B ${WORKDIR} ./${GAMEID}.wbfs -vv --disc-id=${GAMEID} ${TMD_OPTS} --name "${GAMENAME}"
|
2013-06-13 20:12:19 +02:00
|
|
|
fi
|