various improvements for HANS, IPS, PPF and BPS patching functions

This commit is contained in:
Christopher Roy Bratusek 2016-08-13 19:04:34 +02:00
parent d765da7017
commit 2590fe98da

View File

@ -130,11 +130,17 @@ patchimage_generic () {
patchimage_ips () {
show_notes
check_input_rom
check_riivolution_patch --nofail
if [[ -f ${PATCH} ]]; then
ext="${ROM/*.}"
cp "${ROM}" "${GAMENAME}.${ext}"
"${IPS}" a "${PATCH}" "${GAMENAME}.${ext}" || exit 51
elif [[ -f ${PATCHIMAGE_RIIVOLUTION_DIR}/${PATCH} ]]; then
ext="${ROM/*.}"
cp "${ROM}" "${GAMENAME}.${ext}"
"${IPS}" a "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${PATCH}" \
"${GAMENAME}.${ext}" || exit 51
else
echo -e "error: patch (${PATCH}) could not be found"
exit 21
@ -144,11 +150,17 @@ patchimage_ips () {
patchimage_bps () {
show_notes
check_input_rom
check_riivolution_patch --nofail
if [[ -f ${PATCH} ]]; then
ext="${ROM/*.}"
cp "${ROM}" "${GAMENAME}.${ext}"
"${BPS}" -decode -t "${GAMENAME}.${ext}" "${PATCH}" || exit 51
elif [[ -f ${PATCHIMAGE_RIIVOLUTION_DIR}/${PATCH} ]]; then
ext="${ROM/*.}"
cp "${ROM}" "${GAMENAME}.${ext}"
"${BPS}" -decode -t "${GAMENAME}.${ext}" \
"${PATCHIMAGE_RIIVOLUTION_DIR}"/"${PATCH}" || exit 51
else
echo -e "error: patch (${PATCH}) could not be found"
exit 21
@ -158,11 +170,17 @@ patchimage_bps () {
patchimage_ppf () {
show_notes
check_input_rom
check_riivolution_patch --nofail
if [[ -f ${PATCH} ]]; then
ext="${ROM/*.}"
cp "${ROM}" "${GAMENAME}.${ext}"
"${PPF}" a "${PATCH}" "${GAMENAME}.${ext}" || exit 51
elif [[ -f ${PATCHIMAGE_RIIVOLUTION_DIR}/${PATCH} ]]; then
ext="${ROM/*.}"
cp "${ROM}" "${GAMENAME}.${ext}"
"${PPF}" a "${PATCHIMAGE_RIIVOLUTION_DIR}"/"${PATCH}" \
"${GAMENAME}.${ext}" || exit 51
else
echo -e "error: patch (${PATCH}) could not be found"
exit 21
@ -186,6 +204,23 @@ patchimage_hans () {
echo "*** 3) unpack_3dsrom"
unpack_3dsrom "${ROM}" || exit 51
if [[ ${HANS_DELTA} ]]; then
echo "*** 4) apply_delta"
if [[ -f ${PATCH} ]]; then
"${XD3}" -d -f -s romfs.bin \
"${PATCH}" "${ROMFS}" || exit 51
elif [[ -f ${PATCHIMAGE_RIIVOLUTION_DIR}/${PATCH} ]]; then
"${XD3}" -d -f -s romfs.bin \
"${PATCHIMAGE_RIIVOLUTION_DIR}"/"${PATCH}" \
"${ROMFS}" || exit 51
else
echo -e "error: patch (${PATCH}) could not be found"
exit 21
fi
echo "*** 5) storing game"
else
echo "*** 4) unpack_3dsromfs"
unpack_3dsromfs romfs.bin || exit 51
@ -196,6 +231,8 @@ patchimage_hans () {
repack_3dsromfs romfs/ "${ROMFS}" || exit 51
echo "*** 7) storing game"
fi
mv "${ROMFS}" "${PATCHIMAGE_ROM_DIR}"
echo "
@ -210,7 +247,11 @@ patchimage_hans () {
into the root of your sd card
"
echo "*** 8) remove workdir"
if [[ ${HANS_DELTA} ]]; then
echo "*** 6) remove workdir"
else echo "*** 8) remove workdir"
fi
rm -rf romfs/ romfs.bin
}
@ -408,6 +449,10 @@ for game in ${GAME[@]}; do
source "${PATCHIMAGE_SCRIPT_DIR}/pokemon/pokemonsinkingsapphire.sh"
;;
PKMN9 | DeltaEmeraldAS )
source "${PATCHIMAGE_SCRIPT_DIR}/pokemon/pokemondeltaemerald-as.sh"
;;
BSECU | BravelySecondUncensored )
source "${PATCHIMAGE_SCRIPT_DIR}/bravelyseconduncensored.sh"
;;