From 12268c63afcb6fdfdda1ba6a3fe3c518bf5adf83 Mon Sep 17 00:00:00 2001 From: Christopher Roy Bratusek Date: Wed, 14 May 2014 20:38:48 +0200 Subject: [PATCH] support for mkwiimm distributions --- ChangeLog | 20 +++++++++ patchimage.sh | 6 ++- script.d/common.sh | 3 +- script.d/mkwiimm.sh | 105 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 132 insertions(+), 2 deletions(-) create mode 100644 script.d/mkwiimm.sh diff --git a/ChangeLog b/ChangeLog index e44cc0e..6643cd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +v4.94: +- wiimmfi generic: use correct version of wit +- wiimmfi mario kart: major code simplification and major speed-up + (as we now symlink the old images rather than copying) +- mkwiimm support. Download and build any Mario Kart Wiimm distribution + and patch it to use Wiimms custom server (thus patching process takes + longer as there are two steps now). The old patchers will all work, + because the outdated versions of the provided tools will be overriden. +- new patchimage.rc options: + MKWIIMM_GAME_LANG either de (german) or en (english) + mkwiimm game language + MKWIIMM_MSG_LANG either de, de+ (german) or en, en+ (english) + mkwiimm message language. de+ and en+ also change all + other languages to german or english + MKWIIMM_SHARE_SAVE either 1=ja (yes) or 2=nein (no) + whether to share save with the original game + YOU MUST SET THOSE VAlUES (patchimage will tell Wiimm's patcher to use + them and thus allows full automatic creating of mkwiimm without any + further user interaction needed). See README.RC for example config. + v4.93: - various fixups - wiimmfi generic: show game titles next to id when showing available images diff --git a/patchimage.sh b/patchimage.sh index 4a18bab..137c0f6 100755 --- a/patchimage.sh +++ b/patchimage.sh @@ -99,7 +99,11 @@ case ${GAME} in source ${PATCHIMAGE_SCRIPT_DIR}/wiimmfi_generic.sh ;; - p | P | Sykland ) + p | P | Mkwiimm ) + source ${PATCHIMAGE_SCRIPT_DIR}/mkwiimm.sh + ;; + + q | Q | Sykland ) source ${PATCHIMAGE_SCRIPT_DIR}/skyland.sh ;; diff --git a/script.d/common.sh b/script.d/common.sh index e1426d4..d8897ff 100644 --- a/script.d/common.sh +++ b/script.d/common.sh @@ -60,9 +60,10 @@ M Awesomer Super Luigi Mini <<<>>> N Wiimfi Patcher. Patch Mario Kart to use Wiimm's server O Wiimfi Patcher. Patch WFC games to use Wiimm's server (exp) +P Mario Kart Wiimm. Custom Mario Kart Distribution <<<>>> -P Super Mario Skyland +Q Super Mario Skyland 1 The Legend of Zelda: Parallel Worlds " diff --git a/script.d/mkwiimm.sh b/script.d/mkwiimm.sh new file mode 100644 index 0000000..135dafd --- /dev/null +++ b/script.d/mkwiimm.sh @@ -0,0 +1,105 @@ +#!/bin/bash + +GAME_TYPE="MKWIIMM" +GAME_NAME="Mario Kart Wiimm" + +show_notes () { + +echo -e \ +"************************************************ +${GAMENAME} + +Custom Mario Kart Wii + +Source: http://wiiki.wii-homebrew.com/Wiimms_Mario_Kart_Fun +Base Image: Mario Kart Wii (RMC?01) +Supported Versions: EUR, JAP, USA +************************************************" + +} + +check_input_image_special () { + + check_input_image_mkwiimm + +} + +download_wiimm () { + + echo "Choose a Mario Kart Wiimm Distribution + +ALL Build all distributions." + gawk -F \: 'NR>1 {print $1 "\t" $2}' < script.d/mkwiimm.db + echo " +type in ALL or an ID" + read ID + +} + +build_mkwiimm () { + + DIST=$(gawk -F \: "/^${1}/"'{print $2}' < ${PATCHIMAGE_SCRIPT_DIR}/mkwiimm.db) + DOWNLOAD=$(gawk -F \: "/^${1}/"'{print $3}' < ${PATCHIMAGE_SCRIPT_DIR}/mkwiimm.db) + FILENAME=$(gawk -F \: "/^${1}/"'{split($3, a, "/") ; print a[3]}' < ${PATCHIMAGE_SCRIPT_DIR}/mkwiimm.db) + + if [[ ${FILENAME} != mkw* ]]; then + echo "wrong ID passed from user-input, exiting." + exit 1 + fi + + if [[ -f ${PATCHIMAGE_RIIVOLUTION_DIR}/${FILENAME} ]]; then + ${UNP} ${PATCHIMAGE_RIIVOLUTION_DIR}/${FILENAME} >/dev/null + elif [[ -f ${PWD}/${FILENAME} ]]; then + ${UNP} ${PWD}/${FILENAME} >/dev/null + else + wget -O ${PATCHIMAGE_RIIVOLUTION_DIR}/${FILENAME} ${DOWNLOAD} + ${UNP} ${PATCHIMAGE_RIIVOLUTION_DIR}/${FILENAME} >/dev/null + fi + + cd ${FILENAME/.7z} + ln -s ${IMAGE} . + REG=${IMAGE##*/} + REG=${REG:3:1} + chmod +x *.sh + + cp -r ${PATCHIMAGE_SCRIPT_DIR}/../override/* ${PWD}/bin/ + + echo "LANGUAGE=${MKWIIMM_GAME_LANG} +MSGLANG=${MKWIIMM_MSG_LANG} +ISOMODE=wbfs +SPLITISO= +PRIV_SAVEGAME=${MKWIIMM_OWN_SAVE}" > ${PWD}/config.def + + echo "creating >${DIST}<, stand by..." + ./create-image.sh --dest=${PWD}/RMC${REG}${ID}.wbfs #>/dev/null + + echo "patching >${DIST}< to use custom server..." + ${WIT} cp ${PWD}/RMC${REG}${ID}.wbfs --DEST \ + ${PATCHIMAGE_GAME_DIR}/RMC${REG}${ID}.wbfs \ + --update --psel=data --wiimmfi >/dev/null + + echo "cleaning up workdir..." + cd .. + rm -rf ${FILENAME/.7z} + + if [[ ${PATCHIMAGE_COVER_DOWNLOAD} == TRUE ]]; then + echo "\n*** Z) download_covers" + download_covers ${ID/.*} + fi + + echo "*** SUCCESS ***" + +} + +patch_wiimm () { + + if [[ ${ID} == ALL ]]; then + for ID in {06..24}; do + build_mkwiimm ${ID} + done + else + + build_mkwiimm ${ID} + + fi +}