Patchimage

Aus Wiiki
Wechseln zu: Navigation, Suche

patchimage ist ein flexibles Patch-Skript für GNU/Linux, welches aus einem Wii-Image und einem Riivolution-Patch eine vorgepatchte WBFS-Datei erzeugt.

Beschreibung

patchimage erstellt eine WBFS-Datei unter Verwendung eines (legal gedumpten) Wii-Images und einem Riivolution-Patch, oder eine gepatchte ROM unter Verwendung der Original-Dateien und eines IPS-, PPF-, oder Xdelta-Patches. Das Skript ist flexibel aufgebaut, sodass neue Spiele leicht hinzugefügt werden können, ohne dass sich der Verwaltungsaufwand für das Skripte erhöht.

Das Programm wurde von Nano als GNU/Linux-Äquivalent zu damysterymans NSBW-ISO-Builder für Windows konzipiert, die von patchimage verwendeten Loader-Patches wurden von damysteryman erstellt. Patchimage verwendet das exzellente wit, von Wiimm, um die Wii-Images zu bearbeiten.

Neben dem einfachen Erstellen einer vorgepatchten WBFS-Datei, einer vorgepatchter ROM, verfügt patchimage über Komfortfunktionen, wie das Herunterladen von Riivolution-Patches, Custom-Bannern oder Soundtracks mit wget. Im WHB-Forum gibt es ebenfalls einen Thread zum Skript.

Mit Version 5.0 bringt das Skript ein überarbeitetes Menü, Unterstützung für Wiimmfi and Mario Kart Wii. Mittels Wiimmfi können Nintendo-WFC-Spiele nach Server-Abschaltung funktionieren. Welche Spiele dies sind und weitere Informationen hier im Forum. Für Mario Kart Wii gibt es die Möglichkeit die Spiele auf Wiimmfi zu patchen, Beliebige Mario Kart Wiimm Distributionen zu generieren (automatisch auf Wiimmfi gepatcht), sowie Items und Schriftart auszutauschen.

Mit Version 6.0 kann das Skript den De-Zensur-Patch für Tokyo Mirage Sessions #FE anwenden, mit Version 6.3 bringt das Skript auch Unterstützung für das patchen von Nintendo 3DS-Spielen, unter anderem Pokemon X, Pokemon Y, Pokemon Omega Ruby, Pokemon Alpha Sapphire und Bravely Second. In Version 7.0.0 wurde patchimage generalüberholt, mit vielen Korrekturen und Verbesserungen.

Voraussetzungen

patchimage benötigt mit Ausnahme von wget und perl keine weiteren Programme vorinstalliert. applyppf, wit, wszst, xdelta3, titledumper, unp und uips werden mitgebracht (jeweils in 32 als auch 64 Bit).

patchimage verwendet die Datei/Ordnerstruktur, wie unzip bzw. unrar diese nach dem Entpacken der Dateien hinterlassen, eine Modifikation der Struktur ist nicht nötig.

Unterstützte Spiele

patchimage unterstützt in Version 7.0 folgende Spiele (vorne: die generierte ID):

New Super Mario Bros. Wii

### New Super Mario Bros. Wii ###

>> Suchpfade:

a) ${PWD}
b) ${PATCHIMAGE_WBFS_DIR}

>> erwartete Dateinamen

a) SMN?01.iso
b) SMN?01.wbfs

MRR?01		New Super Mario Bros. Wii Retro Remix
SCL?01		Cliff Super Mario Bros. Wii
SFL?01		NSMBW3: The Final Levels
SLB?01		MLG Super Luigi Bros. Wii
SMN?03		Newer Super Mario Bros. Wii
SMN?04		Canon Super Mario Bros. Wii
SMN?05		Another Super Mario Bros. Wii
SMN?06		Newer Summer Sun
SMN?07		Newer Holiday Special
SMN?08		Epic Super Bowser World
SMN?10		Koopa Country
SMN?11		New Super Mario Bros. 4
SMN?12		Awesomer Super Luigi Mini
SMN?31		New Super Mario Bros. Wii - Other World
SMN?41		Devil Mario Winter Special
SMN?60		Remixed Super Mario Bros. Wii
SMN?65		Ghostly Super Ghost Boos. Wii
SMN?66		The Legend of Yoshi
SMN?69		Revised Super Mario Bros. Wii
SMN?DU		DarkUmbra Super Mario Bros: Anniversary Edition
SMN?FL		Newer: Falling Leaf
SMN?MI		Midi's Super Mario Bros Wii - Just A Little Adventure
SMN?RV		RVLution Wii (NewSMB Mod)
SMN?YL		Luigi's Super Yoshi Bros.
SMN?ZA		Newer Apocalypse
SMN?ZC		Challenging Super Mario Bros. Wii: Virtual Special
SMN?ZY		Super Mario Skyland
SMM?02		Super Mario: Mushroom Adventure PLUS - Winter Moon
SMV?01		Super Mario Vacation

### Mario Kart Wii ###

>> Suchpfade:

a) ${PWD}
b) ${PATCHIMAGE_WBFS_DIR}

>> erwartete Dateinamen

a) RMC?01.iso
b) RMC?01.wbfs

RMC?06		Wiimms MKW Fun 2010-12
RMC?07		Wiimms MKW Retro 2011-02
RMC?08		Wiimms MKW Fun 2011-03
RMC?09		Wiimms MKW Fun 2011-06
RMC?10		Wiimms MKW Fun 2011-07
RMC?11		Wiimms MKW Fun 2011-08
RMC?12		Wiimms MKW Fun 2011-11
RMC?13		Wiimms MKW Fun 2012-01
RMC?14		Wiimms MKW Revival 2012-02
RMC?15		Wiimms MKW Boost 2012-03
RMC?16		Wiimms MKW Fun 2012-05
RMC?17		Wiimms MKW Fun 2012-09
RMC?18		Wiimms MKW N64 2012-10
RMC?19		Wiimms MKW Fun 2012-12
RMC?20		Wiimms MKW Fun 2013-04
RMC?21		Wiimms MKW Fun 2013-09
RMC?22		Wiimms MKW Fun 2013-10
RMC?23		Wiimms MKW-Fun 2014-01
RMC?24		Wiimms MKW Retro 2014-02
RMC?25		Wiimms MKW-Fun 2014-04
RMC?26		Wiimms MKW-Fun 2014-11
RMC?27		Wiimms MKW-Fun 2015-03
RMC?28		Wiimms MKW-Fun 2015-05
RMC?29		Wiimms MKW-Fun 2015-08
RMC?30		Wiimms MKW-Fun 2015-12
RMC?31		Wiimms MKW-Fun 2016-02
RMC?32		Wiimms MKW-Fun 2016-07

### Kirby's Adventure Wii ###

>> Suchpfade:

a) ${PWD}
b) ${PATCHIMAGE_WBFS_DIR}

>> erwartete Dateinamen

a) SUK?01.iso
b) SUK?01.wbfs

SUK?01		Kirby's Adventure Wii
		* exchange first player's character

### Pokemon ###

>> Suchpfade:

a) ${PWD}
b) ${PATCHIMAGE_3DS_DIR}

>> erwartete Dateinamen

a) GAMEID.cxi

0004000000055D00	Pokemon X
			* Pokemon Neo X
			* Pokemon Eternal X
0004000000055E00	Pokemon Y
			* Pokemon Neo Y
			* Pokemon Wilting Y
000400000011C400	Pokemon Omega Ruby
			* Pokemon Rutile Ruby
			* Pokemon Rising Ruby
			* Pokemon Red Ruby
000400000011C500	Pokemon Alpha Sapphire
			* Pokemon Star Sapphire
			* Pokemon Sinking Sapphire
			* Pokemon Delta Emerald (Alpha Saphhire)

### Bravely ###

>> Suchpfade:

a) ${PWD}
b) ${PATCHIMAGE_3DS_DIR}

>> erwartete Dateinamen

a) GAMEID.cxi

000400000017BB00	Bravely Second
			* De-Censoring the game

### Toyko Mirage Sessions #FE ###

>> Suchpfade:

keiner (Benutzer-spezifiziert)

>> erwartete Dateinamen

keiner (Benutzer-spezifiziert)

ASE?01		De-Censoring the game

Das Fragezeichen ergibt P für PAL, E für NTSC-U und J für NTSC-J bei der Erstellung der Abbilder.

Parameter

patchimage verfügt über diverse Parameter.

*** General parameters ***
--help						| show this message
--game=<ID/Short Name>				| specify game you want to create
--game=<ID1/Short Name1> <ID2/Short Name2>	| specify multiple games you want to create
--show-download					| only show download link for required files

*** List games ***
--list-games					| show possible options for --game
--list-games-nsmb				| show possible New Super Mario Bros. Wii options for --game
--list-games-mkwiimmfi				| show possible Mario Kart Wii / Wiimmfi options for --game
--list-games-tokyo				| show possible Tokyo Mirage Sessions #FE options for --game
--list-games-kirby				| show possible for Kirby's Adventure Wii options for --game
--list-games-pokemon				| show possible Pokemon options for --game
--list-games-3ds				| show possible 3DS options for --game
--list-games-other				| show possible other options for --game

*** List requirements ***
--list-requirements				| show required image and patch files all games
--list-requirements-nsmb			| show required image and patch files for New Super Mario Bros. Wii
--list-requirements-mkwiimmfi			| show required image and patch files for Mario Kart Wii / Wiimmfi
--list-requirements-tokyo			| show required files and patches for Tokyo Mirage Sessions #FE
--list-requirements-kirby			| show required image and patch files for Kirby's Adventure Wii
--list-requirements-pokemon			| show required image and patch files for Pokemon games
--list-requirements-3ds				| show required image and patch files for other 3DS games
--list-requirements-other			| show required image and patch files for other games

*** Wii game parameters ***
--iso=/home/test/RMCP01.iso			| specify path to Wii iso or wbfs image to use
--riivolution=/home/test/MyMod.zip		| specify path to Wii Riivolution archive
--version=EURv1,EURv2,USAv1,USAv2,JPNv1		| specify your game version (New Super Mario Bros. Wii)
--customdid=SMNP02				| specify a custom ID to use for the modified Wii game
--sharesave					| let modified Wii games share savegame with the original game
--download					| download Riivolution or HANS patch archives (if possible)
--soundtrack					| download soundtrack (if available)
--only-soundtrack				| download soundtrack only (if available) and exit
--covers					| download covers (if available)
--only-covers=SMNP02				| download covers only (if available)
--banner=<banner.bnr>				| use a custom banner (Riivolution games)
--download-banner				| download a custom banner (if available)
--override-szs					| override wit and szs in Wiimms Mario Kart Fun distributions
						| [use this if the originals fail due to incompatible library versions]

*** 3DS game parameters ***
--rom=/home/test/0004000000055e00.cxi		| specify path to 3DS ROM to use for building
--hans=/home/test/MyModdedGame.zip		| specify path to 3DS HANS archive

*** Wii U game parameters ***
--xdelta=/home/test/xdelta			| specify path to Tokyo Mirage Sessions #FE xdelta patches
--cpk=/home/test/cpk				| specify path to original Tokyo Mirage Mirage Sessions #FE files

*** Other game parameters ***
--rom=/home/test/MyGame.rom			| specify path to ROM to use for building
--patch=/home/test/MyModdedGame.ips		| specify path to IPS Patch file

*** Batch-Building shortcuts ***
--game=NSMB_ALL					| build all mods of New Super Mario Bros. Wii
--game=PKMN_ALL					| build all mods of Pokemon X, Y, Omega Ruby, Alpha Sapphire
--game=PKMN_X					| build all mods of Pokemon X
--game=PKMN_Y					| build all mods of Pokemon Y
--game=PKMN_OR					| build all mods of Pokemon Omega Ruby
--game=PKMN_AS					| build all mods of Pokemon Alpha Sapphire

Beispiel-Aufrufe

patchimage kann wie folgt verwendet werden:

Newer Super Mario Bros. Wii

patchimage --game=NewerSMBW --download --iso=/home/test/NSMBW.iso

Newer Summer Sun Soundtrack

patchimage --soundtrack --game=NewerSummerSun

Cannon SMBW

patchimage --iso=/home/test/NSMBW.iso --riivolution=/home/test/Cannon.zip --game=Cannon

Mehrere Mods auf einmal (hier: Newer Super Mario Bros. Wii und Cannon SMBW)

patchimage --iso=/home/test/NSMBW.iso --download --game="NewerSMBW Cannon"

De-Zensur von Tokyo Mirage Sessions #FE

patchimage --game=TMSFE --xdelta=<pfad-zu-xdelta-dateien> --cpk=<pfad-zu-cpk-dateien>

Patches

patchimage integriert folgende Patches für die Spiele, eine Modifkation der heruntergeladenen Riivolution-Patches ist nicht nötig:

  • Koopa Country: aktualisierte Level-Dateien für Welt 1, Level 3 und Welt 8, Level 1
  • New Super Mario Bros. 4: aktualisierte Level-Datei für Welt 5, Level 4, PAL-kompatibler openingTitle
  • Retro Remix: PAL-kompatibler openingTitle
  • Epic Super Bowser World: Fehler im Spiel, der das erreichen von Welt 8-1 verhindert wird umgangen
  • Wiimmfi für Mario Kart Wiimm: Beim Generieren einer Custom-MKW-Distribution von Wiimm, wird automatisch auf den Wiimmfi-Server gepatcht [nur vor-wiimmfii Versionen]
  • Wiimmfi (generisch): Möglichkeit NWFC-kompatible Spiele auf wiimmfi zu patchen

Debugging

Status Codes

Das Skript gibt diverse Status-Codes aus. Anhand derer kann die durchgeführte Aktion besser rekonstruiert werden.

Phase 1 (Überprüfung des Eingabe-Abbildes)
Status Code
  0 keine <GAMEID>.iso oder <GAMEID>.wbfs gefunden
  1 <GAMEID>.iso in ${PWD} gefunden
  2 <GAMEID>.wbfs in ${PWD} gefunden
  3 <GAMEID>.iso in ${PATCHIMAGE_WBFS_DIR} gefunden
  4 <GAMEID>.wbfs in ${PATCHIMAGE_WBFS_DIR} gefunden
  5 keine <GAMEID>.cxi gefunden
  6 <GAMEID>.cxi in ${PWD} gefunden
  7 <GAMEID>.cxi in ${PATCHIMAGE_3DS_DIR} gefunden
  8 xdelta/cpk anhand interaktiver Benutzer-Eingabe gefunden
  9 xdelta/cpk anhand nicht-interaktiver Benutzer-Eingabe gefunden

Phase 2 (Überrprüfung des Riivolution-Hacks)
  0 keine entpackten Riivolution-Dateien in ${PWD} gefunden
  1 keine Riivolution-Dateien in ${PWD} gefunden
  2 Riivolution-Dateien in ${PWD} gefunden
  3 Riivolution-Dateien in ${PATCHIMAGE_RIIVOLUTION_DIR} gefunden
  4 Patchimage wurde angewiesen die Dateien herunterzuladen, aber es gibt keinen Link
  5 Patchimage lädt die Dateien herunter
  6 Patchimage wurde angewiesen die Dateien herunterzuladen, aber es muss manuell heruntergeladen werden

Exit-Codes

Sollte das Skript abbrechen, werden Exit-Codes abgegeben. Dieser kann direkt nach dem Fehlschlag wie folgt abgefragt werden:

$?

Die daraufhin erscheinede Zahl ist der Exit-Code. Dessen Bedeutung kann nachfolgender Tabelle entnommen werden:

0        alles in Ordnung
1        nicht abgefangener (sonstiger) Fehler
9        spezifiertes Spiel ist nicht bekannt
15       spezifierte ISO oder ROM existiert nicht (--iso/--rom Parameter)
21       spezifierte Riivolution-Datei/Patch existiert nicht (--patch/--riivolution Parameter)
27       New Super Mario Bros. Wii Version konnte nicht erkannt werden
33       spezifizierter Banner ist keine .bnr-Datei (--banner Parameter)
39       spezifierte GameID ist kein 6-stelliger alpha-numerischer Wert (--customid Parameter)
45       Fehler beim Kopieren neuer Dateien
51       wit/szs/applyppf/ips/xdelta3/ctrtool/3dstool mit Fehler abgebrochen
57       wget-Fehler beim Herunterladen
63       unp-Fehler beim Entpacken
69       wiimmfi-Fehler beim Patchen
75       Benutzer-Eingabe fehlerhaft
81       New Super Mario Bros. Wii Version vom Hack nicht unterstützt

Download

patchimage steht unter GNU GPL v3. Mitgelieferte Werkzeuge können eine andere Lizenz haben (siehe Datei "LICENSES.EXTRA")

GIT Repositorium
Webansicht

git clone https://github.com/Nanolx/patchimage.git

Veröffentlichungen
Download-Verzeichnis

Debian
Download-Verzeichnis

Konfigurationsdatei

Seit Version 2.5 unterstützt Patchimage eine Konfigurationsdatei, mit der sich diverse Einstellungen vorab setzen lassen. Die Verwendung dieser Datei wird wärmstens empfohlen:

$HOME/.patchimage.rc

Beispiel-Datei mit Kommentaren:

##################
#  patchimage rc #
##################

# globales Verzeichnis in dem die Riivolution-Hacks gesucht
# werden, oder dorthin heruntergeladen:
PATCHIMAGE_RIIVOLUTION_DIR=${HOME}/Hacks

# globales Verzeichnis in dem die modifzieren WBFS-Abbilder
# gespeichert werden
PATCHIMAGE_GAME_DIR=/media/WiiHDD/wbfs

# gloables Verzeichnis in dem die Original-Wii-Abbilder gesucht
# werden
PATCHIMAGE_WBFS_DIR=/media/WiiHDD/wbfs

# globales Verzeichnis in dem die modifzieren 3DS-ROMs
# gespeichert werden
PATCHIMAGE_3DS_DIR=/media/sde1/

# global directory where your rom files will be saved to
PATCHIMAGE_ROM_DIR=/media/sde1/hans/

# gloabes Verzeichnis in das die Soundtracks heruntergeladen
# werden
PATCHIMAGE_AUDIO_DIR=${HOME}/Music

# globales Verzeichnis in das die Cover heruntergeladen werden
PATCHIMAGE_COVER_DIR=${HOME}/Covers

# (versuche) immer die Riivolution-Dateien herunterzuladen,
# falls diese nicht gefunden wurden
PATCHIMAGE_RIIVOLUTION_DOWNLOAD=TRUE

# (versuche) immer Custom-Banner herunterzuladen (sofern
# für das jeweilige Spiel verfügbar)
PATCHIMAGE_BANNER_DOWNLOAD=TRUE

# (versucher immer Soundtracks herunterzuladen (sofern verfügbar)
PATCHIMAGE_COVER_DOWNLOAD=TRUE

# (versuche) immer Cover herunterzuladen (sofern vergübar)
PATCHIMAGE_COVER_DOWNLOAD=TRUE

# Spielstand mit dem Original-Spiel teilen
PATCHIMAGE_SHARE_SAVE=TRUE

#####################
# Mario Kart Wiimmm #
#####################

# message language for Mario Kart Wiimm
# de  = german
# de+ = all languages will be german
# en  = english
# en+ = all languages will be english
MKWIIMM_MSG_LANG="de"

# Eigenes Savegame verwenden
# 1=ja    (use own save, no sharing)
# 0=nein  (share save with original game)
MKWIIMM_OWN_SAVE="1=ja"

# szs von MKWiimm überschreiben
MKWIIMM_OVERRIDE_SZS="FALSE"

# Custom Track-Namen übersetzen
# 1=ja
# 0=nein
MKWIIMM_CTRENAME="0=nein"

# Custom Tracks alphabetisch sortieren
# 1=ja
# 0=nein
MKWIIMM_CTREORDER="1=ja"

Variabler Einhängepunkt

In manchen Desktop-Umgebungen werden den Geräten dynamisch die Einhängepunkte zugewiesen (anhand des Geräteknotens und nicht der UUID), sodass diese nicht konstant sind. Wenn man in obige Konfigurationsdatei seine USB-Festplatte eintragen will und solch eine dynamische Zuweisung hat, kann man anhand des Disk-Labels oder der UUID dieses Problem umgehen und den Einhängepunkt vom Skript zur Laufzeit auswerten lassen.

Für das Disk-Label trägt man folgendes in die Konfigurationsdatei ein (im Beispiel ist das Label "WiiHDDX"):

# look for mountpoint by disk label
temp=$(basename $(readlink -m /dev/disk/by-label/WiiHDDX))
usb=$(gawk '/\/dev\/'"$temp"'/{print $3}' <(mount))

Nun kann man die Variabel ${usb} anstelle eines festen Einhängepunktes nutzen, bspw.:

# globales Verzeichnis in dem die modifzieren WBFS-Abbilder
# gespeichert werden
PATCHIMAGE_GAME_DIR=${usb}/wbfs

Für die UUID trägt man folgendes in die Konfigurationsdatei ein (im Beispiel ist die UUID "406A-C8B7"):

# look for mountpoint by disk label
temp=$(basename $(readlink -m /dev/disk/by-uuid/406A-C8B7))
usb=$(gawk '/\/dev\/'"$temp"'/{print $3}' <(mount))

Nun kann man die Variabel ${usb} anstelle eines festen Einhängepunktes nutzen, bspw.:

# globales Verzeichnis in dem die modifzieren WBFS-Abbilder
# gespeichert werden
PATCHIMAGE_GAME_DIR=${usb}/wbfs

Wenn man das Disk-Label oder die UUID nicht kennt, erhält man mittels

mount

Alle eingehängten Geräte. In der ersten Spalte steht der Geräteknoten. Im Beispiel ist folgendes die relevante Zeile:

/dev/sdi1 on /media/sdi1 type vfat (rw,nosuid,nodev,noexec,relatime,uid=1000,gid=1000,fmask=0177,dmask=0077,codepage=437,iocharset=iso8859-1,shortname=mixed,quiet,utf8,errors=remount-ro,user)

Also /dev/sdi1, mittels folgendem Befehl erhält man dann das Disk-Label:

ls -l /dev/disk/by-label/ | gawk '/..\/sdi1/{print $9}'

bzw. die UUID:

ls -l /dev/disk/by-uuid/ | gawk '/..\/sdi1/{print $9}'

Versionshinweise

v7.5.0 (20160927):
::game additions:
- add support for Super Mario Bros. Frozen Editon

::game updates:
- Pokemon Rising Ruby: support version 2.0
- Pokemon Sinking Sapphire: support version 2.0

::misc. changes:
- fix ID6 for NSMBW3: The Final Levels in README.GAMEIDS
- other minor changes

v7.4.0 (20160903):
::Tokyo Mirage Sessions #FE Restoration Patcher
- use 'Restoration' instead of 'Uncensored' as Name
- more failsafe build-directory name
- add support for downloading xdelta files with --download
- check whether files have already been downloaded and use those
- for xdelta patches and original cpk files, now check whether every single
  file exists, rather than just one of them
- for cpk file path support both the top level directory of the dump as well
  as the sub level directory which holds the cpk files, read: when your dump
  is in /home/test/TMSFE you were previously required to set the cpk path to
  /home/test/TMSFE/vol/content/Pack now using /home/test/TMSFE will work, too,
  as the script will look for the sub directory vol/content/Pack on it's own

::game updates:
- update Cliff Super Mario Bros. Wii to version 1.1.1
- update Revised Super Mario Bros. Wii to version 1.1
- update The Legend of Yoshi to version 2016-08-31

::misc. changes:
- use 'wget -nv' instead of 'wget -q'
  - except for cover downloader

v7.3.1:
::bug fixes
- fixed that --iso, --rom, --patch, --xdelta, --cpk and --riivolution command
  line flags failed when relative paths were given (regression from 7.2.2)
- fixed that temporary files were kept when downloads failed, causing required
  user-input for wget when trying again
- fixed that --cpk and --xdelta command line flags never actually checked wether
  the given directory does exist, before trying to patch the game [the game
  patcher does, too, but it should fail immediately upon wrong user-input]
- remove build directory before trying to build a game, not afterwards, so that
  in case a build failed in batch-mode, the next one can be tried without issues
- fixed that character mods were not applicable to Cliff Super Mario Bros. Wii

::misc. changes:
- drop support for Awesomer Super Luigi Mini (broken and offline)
- update Cliff Super Mario Bros. to version 1.1

v7.3.0 (20160827):
::internal changes:
- modularize common.sh
- supply megadl (32 and 64 bit)

::downloader changes:
- changed download links to Mediafire so that they can automatically be
  downloaded using wget, this makes Cliff Super Mario Bros., Ghostly Super
  Mario Boos Wii, MLG Super Mario Bros. Wii, Pokemon Neo X, Pokemon Neo Y
  and Pokemon Red Ruby auto-downloadable
- changed download links to Sendspace so that they can automatically be
  downloaded using wget, this makes Challenging Super Mario Bros. Wii:
  Virtual Special auto-downloadable
- include megadl a tool that can download files from Mega using commandline,
  this makes Pokemon Delta Emerald, Pokemon Rutile Ruby, Pokemon Star Sapphire
  and Bravely Second Uncensored auto-downloadable

::misc. changes:
- update Cliff Super Mario Bros. to version 1.0.5

v7.2.2 (20160823):
::bug fixes
- fix PATCHIMAGE_3DS_DIR setup when no ${HOME}/.patchimage.rc exists
- fix PATCHIMAGE_ROM_DIR setup when no ${HOME}/.patchimage.rc exists
- fixed that the script expected wrong parameter --show-downloadlink
  instead of correct --show-download
- fix error messages or required user-input during batch-build by
  creating a separate build directory, then create the mod and before
  the next build is done that build directory is removed and re-created
  - when ${PWD} is writable that will be ${PWD}/patchimage_build, else
    it will be ${HOME}/patchimage_build

::misc. changes
- use 'read -er' instead of 'read -r' so that during user-input readline
  features like path-completion can be used.
- in game information fix link to Pokemon Star Sapphire Thread
- update Cliff Super Mario Bros. to version 1.0.4

v7.2.1:
::bug fixes
- fix ID for Kirby's Adventure Wii and Mario Kart Wii for US versions

v7.2.0:
::internal changes
- functions for applying IPS, PPF and BPS patches now check for patch zip files
  in ${PWD} and ${PACHIMAGE_RIIVOLUTION_DIR}, just like all other functions and
  unpack them, if found
- functions for applying IPS, PPF and BPS patches now look in ${PWD} and
  ${PATCHIMAGE_RIIVOLUTION_DIR} for patch files
- functions for applying IPS, PPF and BPS patches thus only fail when they
  neither find a zip archive containing the patch, or the bare patch file
- HANS patcher now supports applying DELTA patches
- split out messages into message.sh
- automatic downloading is not possible from SendSpace, update downloader
  function to inform user to manually download from there

::bug fixes
- Pokemon Star Sapphire was accidently called Alpha Sapphire in the menu,
  also had wrong Short ID
- fixed that Opening Title for US version was applied to EU version in
  MLG Super Mario Bros. Wii (fixes black screen on start)
- fixed regression from version 7.1.0 that made it impossible to patch
  US version of New Super Mario Bros. Wii because it was looking for wrong
  ID SMNU01 instead of correct ID SMNE01
- fixed black screen in Devil Mario Winter Special by not applying the custom
  openingTitle.arc for PAL New Super Mario Bros. Wii
- fixed black screen in Remixed Super Mario Bros. Wii by not applying the custom
  openingTitle.arc for PAL and JAP New Super Mario Bros. Wii
- fixed that the script did try to automatically download from mediafire instead
  of informing user to manually download

::command line parameters
- add batch building short cuts for --game parameter:
  * NSMB_ALL	build all NSMB Mods
  * PKMN_ALL	build all Pokemon X, Y, Omega Ruby and Alpha Sapphire Mod
  * PKMN_X	build all Pokemon X Mods
  * PKMN_Y	build all Pokemon Y Mods
  * PKMN_OR	build all Pokemon Omega Ruby Mods
  * PKMN_AS	build all Pokemon Alpha Sapphire Mods
- add --list-requirements ; show a detailed list of expected game images and
  Riivolution or HANS archives or Patches required for building
- add --list-requirements-nsmb, --list-requirements-mkwiimmfi,
  --list-requirements-tokyo, --list-requirements-kirby,
  --list-requirements-pokemon, --list-requirements-3ds,
  --list-requirements-other, to show only requirements for mods of specific
  base games
- add --show-download ; only show download like for games choosen in menu or
  given using --game parameter
- added --list-games-nsmb, --list-games-mkwiimmfi, --list-games-tokyo,
  --list-games-kirby, --list-games-pokemon, --list-games-3ds, --list-games-other
  to show only mods for specific base games

::misc. changes
- new download link for The Legend of Yoshi
- update to version 2016-05-28 of The Legend of Yoshi
- update to version 1.02 of New Super Mario Bros. Wii - Other World

::mod additions:
- Mario Kart Wii Fonts:
  - added Super Mario Font
  - added Chalky Font
  - added UmePlus Font
  - sort files alphabetically in list
- Mario Kart Wii Karts:
  - update Sonic the Hedgehog on Foot to version 1.5
  - add Black Mage on Wii Remote
  - add White Mage on Wii Remote
  - add Kirby on Wheelie
  - add Nabbit on Flame Runner
  - add Skull Kid on Bullet Bike
  - add Super Sonic on Mach Bike
  - add Wolf Link on Mach Bike

::game additions

:::New Super Mario Bros. Wii
- add support for Cliff Super Mario Bros. Wii (SCL[PUJ]01)
- add support for Challenging Super Mario Bros. Wii: Virtual Special (SMN[PUJ]ZC)

:::Pokemon
- add support for Pokemon Red Ruby
  - supply HANS configuration files for Red Ruby
- add support for Pokemon Delta Emerald (patch for Alpha Sapphire)
  - supply HANS configuration files for Delta Emerald
  - since the author of Delta Emerald is working on a patch for Omega Ruby
    aswell, the game and created files are called "DeltaEmerald-AS"
    [obviously they will be "DeltaEmerald-OR" for patched Omega Ruby]

v7.1.0:
::internal changes
- rewrite downloader function
- supply beat BPS patcher (32 and 64 bit)
- add (yet unused) patching functions for PPF patches
- add (yet unused) patching functions for BPS patches
- code cleanup, remove duplicated code

::bugfixes
- fixup The Legend of Zelda - Parallel Worlds patcher
- fixup --patch command line parameter

::misc. changes
- removed download link for Awesomer Super Luigi Mini (down)
- new download link for RVLution Wii
- new download link for Newer Falling Leaf
- fix download link for Midi's Super Mario Wii
- fix download link for Newer Apocalypse
- New Super Mario Bros. Wii character mod: allow only restoring
  original characters without further changes
- update nsmbw.db

::game additions

:::New Super Mario Bros. Wii
- add support for MLG Super Luigi Bros. Wii

v7.0.0:
::internal changes
- add PATCHIMAGE_DIR new internal variable
- add PATCHIMAGE_DATABASE_DIR new internal variable
- add PATCHIMAGE_OVERRIDE_DIR new internal variable
- add UNP_EXTRA_ARGS new internal variable
- make check_input_rom a common.sh function, prevent duplicated code
- shift around some paths
- update database with New Super Mario Bros. Wii mods
- code review and improvements
- improved Debian GNU/Linux packaging
- install pre-compiled tools to /usr/lib/ARCH/patchimage (FHS compliance)
- improved --help message
- add --list-games parameter (show buildable games)
- --list-games and menu now show ID / Short Name and Full Name of all games
- add --override-szs to override Wiims Mario Kart Fun wit and szs with
  the ones supplied by patchimage. Use this if building Wiims Mario Kart Fun
  fails due to incompatible library versions being installed.
- add batch mode for generating more than one mod at once

::bug fixes
- several minor bugfixes and improvements
- before creating any of the directories defined in ${HOME}/.patchimage.rc
  check whether the parent directory is writeable, else fallback to ${HOME}
- when setting destination directory for created files, check if they are
  writeable, else fallback to ${HOME}
- fix telling user path to Hans Files for all Pokemon game hacks
- make the script more robust against directories with spaces in their names
- use gdown.pl for drive.google.* download links
- for download links on Mega tell user where to download manually
- for download links on Mediafire tell user where to download manually
- patchimage menu showed TMS1 as ID for Tokyo Mirage Sessions #FE restoration
  patcher, while TMSFE was the actual (but wrong ID), thus TMS1 was reported
  as unknown game / wrong user input. Now TMS1 works as expected.
- archive name for Newer Super Mario Bros. Wii has changed

::configuration file changes
- new configuration variable PATCHIMAGE_3DS_DIR, global directory
  where to look for unmodified 3DS ROM files
- new configuration variable PATCHIMAGE_ROM_DIR, global directory
  where to store your modified 3DS ROM files

::documentation
- update REAMDE
- update README.RC
- update README.STATUS_CODES
- update README.GAMEIDS
  - now includes game search paths
  - now includes expected filenames

::misc. changes
- make check_input_rom search in both ${PATCHIMAGE_3DS_DIR} and ${PWD}
- show full path for Hans Files for all games, instead of relative
- only show path to Hans files if they exist
- when downloading covers for Wii games fail, retry with the US cover
- don't re-download covers that already exist
- don't re-download soundtracks that already exist
- for NSMBW character mods, Mario Kart Wii font, item and kart mods,
  don't download the files from the interwebs, instead use files supplied
  and installed with patchimage

::game additions

::::New Super Mario Bros. Wii
- add support for Revised Super Mario Bros. Wii

::::Pokemon
- add support for Pokemon Eternal X
  - choose between legal, rebalanced and insanity version
  - for legal and rebalanced, choose whether to nerf first gym leader
- add support for Pokemon Wilting Y
  - choose between legal, rebalanced and insanity version
  - for legal and rebalanced, choose whether to nerf first gym leader
- add support for Pokemon Rising Ruby
  - provide custom Hans banner and launcher
- add support for Pokemon Sinking Sapphire
  - provide custom Hans banner and launcher

::::Other
- add support for Bravely Second Uncensored
  - fully supports both EUR and USA game version
  - auto-detects provided game version in ${PWD} or ${PATCHIMAGE_3DS_DIR}
  - provide Hans configuration

::game changes and updates
- update download link for Pokemon Rutile Ruby to v2.1
- update download link for Pokemon Star Sapphire to v2.1

v6.3.0:
- supply ctrtool (32 and 64 bit versions)
- supply 3dstool (32 and 64 bit versions)
- add support for Pokemon Neo X
- add support for Pokemon Neo Y
- add support for Pokemon Rutile Ruby
- add support for Pokemon Star Sapphire

v6.2.2:
- when running patchimage from git, use it's tools, scripts and stuff,
  instead of system-wide (if) installed
- simple progress [x/y] visualization for Tokyo Mirage Sessions #FE
- minor internal changes

v6.2.1:
- support for MKWiimm 2016-07
- update MKWiimm 2016-02 to v2
- update Tokyo Mirage Sessions #FE patcher for version
  0.9.4 of the patch
- update szs to 1.52

v6.2.0:
- code improvements for MKWiimm
- supply xdelta3 (32 and 64 bit versions)
- supply titledumper (32 and 64 bit versions), for use with ddd
- add support for Tokyo Mirage Sessions #FE US/EUR decensoring
  - add --xdelta and --cpk parameters
- use ${WIT} instead of wit when checking image region for
  MKWiimm and Kirbys Adventure Wii
- minor internal changes

v6.1.0:
- update szs to version 1.50a
- update title database
- show "Enter ID (...)" message at the end of menu
- show "ID	Name" header/footer in menu
- show proper version number in --help
- support for new MKWiimm config.def variables ID >= 29
  - default set:
    - MSGLANG1 = -
    - MSGLANG2 = E
  - set from ~/.patchimage.rc
    - TRACKLANG = x,${MKWIIMM_MSG_LANG}
    - CTRENAME = ${MKWIIMM_CTRENAME}
    - REORDER = ${MKWIIMM_CTREORDER}
    - see README.RC for more infos
- support for MKWiimm 2015-08 (ID 29)
- support for MKWiimm 2015-12 (ID 30)
- support for MKWiimm 2016-02 (ID 31)
- support for The Legend of Yoshi (SMN?66)
- support for Remixed Super Mario Bros. Wii (SMN?60)
- support for Ghostly Super Mario Boos. Wii (SMN?65)
- update wit/wszst override for MKWiimm
  - if you can't build MKWiimm, set MKWIIMM_OVERRIDE_SZS=TRUE
    in ~/.patchimage.rc to use supplied tools, that the case
    on Debian GNU/Linux Stretch or Sid
- update link to Wiimmfi-Patcher (Generic)
  - unused Patchimage uses "wit cp --wiimmfi" instead
- update link to Wiimmfi-Patcher (Mario Kart Wii)
- update for Wiimmfi-Patcher script changes
- fix error when creating MKWiimm and patchimage is
  installed system-wide

v6.0.0:
- update szs to version 1.40a
- add support for MKWiimm 2015-05
- support for replacing characters in NSMBW

v5.4.0:
- fixed major bug creating MKWiimm: image was not saved to proper
  destination directory (now everything's fine)
- update wit to version 2.31a
- update szs to version 1.39a
- add support for MKWiimm 2015-03
- add support for creating multiple MKWiimm at once
- add support for replacing karts in MKWiimm
  The madness begins, feel free to test this out. downloaded
  karts are prefixed mkwiimm_kart_ to avoid naming collision
  with fonts and items (3-chars.szs naming-scheme)
  .
  Original files are backed-up in ${PATCHIMAGE_RIIVOLUTION_DIR}/ \
  ${GAME}_SZS/ - for example /home/chris/Hacks/RMCP27_SZS/ and
  restored every time when you change your selection on the same
  game.
  .
  Your choices are saved into ${HOME}/.patchimage.choice, if
  you want to modify another MKWiimm with the same settings,
  simply enter y when the script asks you whether you want to
  apply your previous settings, else enter n for new choices.
  .
  No dummys were harmed during the making of this feature
- downloaded fonts for MKWiimm are now prefixed mkwiimm_font_
- downloaded items for MKWiimm are now prefixed mkwiimm_item_
- add support for SMN?41 (Devil Mario Winter Special)
- add support for SMN?31 (New Super Mario Bros. Wii - Other World)
- add MKWIIMM_OVERRIDE_SZS variable to patchimage.rc
  If set to TRUE patchimage will override the supplied SZS tools
  of the MKWiimm patcher with it's own version of the tools.
  .
  This is useful when the supplied ones don't work with your system's
  libpng (usually this happens on non-recent Debian GNU/Linux).
  .
  If creating anything newer than RMCP26 (2015 versions) the tools will
  be never overriden (for now, does not work yet).

v5.3.0:
- update wit to 2.30a
- update szs to 1.36b
- update link for MKWiimm 2014-01 to v2
- update link for MKWiimm 2014-02 to v3
- update link for MKWiimm 2014-04 to v4
- add support for MKWiimm 2014-11
- fixed bug that ${MKWIIMM_GAME_LANG} from ${HOME}/.patchimage.rc is not honoured
- only apply wiimmfi patcher for pre 2014 MKWiimm (starting with 2014 the supplied
  patcher supports wiimmfi out-of-the-box)
- add support for SMN?YL: Luigi's Super Yoshi Bros.
- add support for SMN?FL: Newer: Falling Leaf

v5.2.0:
- add support for SMN?MI (Midi's Super Mario Wii - Just A Little
  adventure)
- add support for SMN?DU DarkUmbra SMB Anniversary Edition
- add support for SMN?ZA Newer Apocalypse
- add exit code 81 (hack does not support supplied game version)

v5.1.0:
- remove MKWIIMM_GAME_LANG from patchimage.rc (sets the language
  for the patcher only, so not required at all) Thanks @Leseratte
  for the hint.
- fixup debian packaging scripts
- add exit code 69 (wiimmfi failed) and 75 (wrong user-input)
- proper error-code providing and exiting in mario kart wiimm,
  mario kart wiimm font, mario kart wiimm items, wiimmfi mario
  kart and wiimmfi generic modules

v5.0.1:
- fix bug in mario kart wiimm items (did not properly work)

v5.0:
- mario kart wiimm: when choosing all RMCP25 (Fun 2014-04) was
  not build (RMCP06 - RMCP24 were built "only")
- mario kart wiimm items: backup the original common.szs on first
  customization of a game
- mario kart wiimm fonts: support changing font in mario kart

v4.98:
- mario kart wiimm: when building mario kart wiimm from scratch
  use the wiimmfi mario kart patcher, not wiimmfi generic. Also
  some string changes and more detailed info on current step
- supply wit 2.29a and szs 1.35a
- always use supplied tools (don't fallback to system ones)

v4.97:
- changed IDs in the game selection menu (old A..Z for Wii, 1..9
  for ROMs / new <ID>1..<ID>..99 ; example: NSMB1, NSMB2, NSMB3)
- mkwiimm_items: support for exchanging items in Mario Kart Wii
  (your item choices are saved and can be re-used, so if you want
  to modifiy more than one Mario Kart you only have to choose the
  items once for all mods)

v4.96:
- wiimmfi/mkwiimm/kirbywii: minor improvements and fixups
- support RVLution Wii (a NewSMB Mod)
- update README.GAMEIDS
- update WinterMoon link to v1.2.3
- added gdown.pl (google-drive downloader) by circulosmeos

v4.95:
- fixed storing NewSMB mods into ${PATCHIMAGE_GAME_DIR}
- added support for exchanging first player's character
  in Kirby's Adventure Wii (using someone different than
  one of the different Kirbys may crash the game)

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
  if you set them they will be applied for all mkwiimm patchers and no
  further user interactions with the wiimm patcher is needed.
- NOTE: error-handling for mkwiimm, wiimmfi generic and wiimmfi mario
  kart is not yet complete

v4.93:
- various fixups
- wiimmfi generic: show game titles next to id when showing available images
- wiimmfi generic: only offer those games to be patched that are wfc-enabled
  (according to gametdb)
- add support for Super Mario Skyland (SMN?ZY)

v4.92:
- wiimmfi mario kart: check if user-provided input is correct
- wiimmfi generic: add generic wiimmfi patcher (only one game at a time)

v4.91:
- update my mail address
- fixed downloading soundtracks
- when using wiimmfi stuff, ask whether to patch all or a specific image
- previously --soundtrack would download the soundtrack and exit. Now
  it does no longer exit.
- added --only-soundtrack (download soundtrack for selected game and exit)
- added --covers (download covers for selected game)
- added --only-covers (download covers for selected game and exit)
- added mkwiimm.db ("database" containing all RMC??? IDs for MKWiimm)

v4.90:
- support wiimmfi patcher. All RMC??? images in the current directory or
  all RMC??? images in ${PATCHIMAGE_WBFS_DIR} will be patched to use the
  new server. patchimage will download and prepare the wiimmfi-patcher,
  check the directory for RMC??? images (.iso and .wbfs), create a copy
  of your image for the patcher, let Wiimm's patcher do it's work, move
  the new image to ${PATCHIMAGE_GAME_DIR}.
  .
  Ensure both variables are set in ${HOME}/.patchimage.rc

v4.0:
- bugfix: fix looking for already downloaded riivolution files in ${PATCHIMAGE_RIIVOLUTION_DIR}
- bugfix: fix looking for original game iso in ${PATCHIMAGE_WBFS_DIR}
- bugfix: if the directories set in ${HOME}/.patchimage.rc don't exist let the script create them
- bugfix: fix paths for NewerSMBW (seems they changed the way the latest release is packaged slightly)
- bugfix: download files with __tmp suffix, so that faulty downloads cause re-download the next time it is tried
- bugfix: make use of ${PATCHIMAGE_PATCH_DIR} when building Retro Remix, fixing the openingTitle for PAL and US
- bugfix: fix applying openingTitle for PAL and US in NSMBW4
- bugfix: updated download link for NSMBW3 (downloading works again)
- bugfix: don't apply wiiStrap from NSMBW3 on PAL (black screen on start)
- added meaningfull exit codes to the script (see: EXIT_CODES for more info)
- annoy the user with messages (eases finding bugs, as you now see when the script stopped working) and make wit quiet
- do all operation in ${PWD}/workdir (which removed on each start)
- support for Awesomer Super Luigi Mini (WIP)

v3.1:
- bugfix: for NSMBW3 on US games the language files weren't updated
- bugfix: for Super Mario: Mushroom Adventure PLUS - Winter Moon on US games the language files weren't updated
- bugfix: for Super Mario: Mushroom Adventure PLUS - Winter Moon on non-US games the supplied OpeningTitle does not work, so don' use it
- support for Super Mario Vacation

v3.0:
- Bugfix: keinen Fehler in check_input_image ausgeben, da noch check_input_image_special aufgerufen wird
- Bugfix: WIT konnte das Spiele-Abbild nicht finden, wenn es durch check_input_image_special gefunden wurde.
- Bugfix: PATCHIMAGE_RIIVOLUTION_DOWNLOAD aus $HOME/.patchimage.rc wurde ignoriert
- Bugfix: Wenn der riivolution-patch in PATCHIMAGE_RIIVOLUTION_DIR existierte, wurde dieser nicht korrekt verarbeitet
- Bugfix: PATCHIMAGE_WBFS_DIR aus $HOME/.patchimage.rc wird nun verwendet
- Funktion zum Erkennen des NSMB-Abbildes in eigene Funktion gepackt (keine Code-Duplizierung) und verbessert
- Es ist nun möglich patchimage zu installieren (Makefile + Debian Paketierungsskripte hinzugefügt)
- Es ist nun möglich systemweit installierte wit, uips, unp und applyppf3 zu benutzen, sofern installiert
- Unterstützung für Super Mario: Mushroom Adventure PLUS - Winter Moon
- Unterstützung für NSMBW3: The Final Levels

v2.5:
- openingTitle für NSMBW 4 und Retro Remix (PAL, US) von alejandroues hinzugefügt
- ucat und unp Werkzeuge hinzugefügt (Perl-Skript zum Entpacken von Archiven)
- Unterstützung für $HOME/.patchimage.rc (siehe README.RC) Konfigurationsdatei
- aktualisierte Patch-Datei für Epic Super Bowser World (dmm)

v2.4:
- NewerSMBW kann wieder heruntergeladen werden
- Unterstützung für New Super Mario Bros. Retro Remix
  (PAL/JAP-Versionen zeigen den normalen Startbildschirm)
- Savegamehacks für Epic Super Bowser World, Newer: Holiday Special und New Super Mario Bros. 4 hinzugefügt
- es wird eine Meldung mit dem Dateinamen angezeigt
- NewerSMBW 1.02 benötigt den 03-06 patch nicht mehr
- NSMBW Versionserkennung separariert (kein duplizierter Code mehr)
- Verbesserung bei der Überprüfung von Koopa Country
- Zip/Rar-Dateien mit Leerzeichen im Namen werden nun korrekt gehandhabt

v2.3:
- Unterstützung für New Super Mario Bros. 4
- Fehler bei Erstellung der japanischen Version von NewerHolidaySpecial behoben

v2.2:
- ID von Koopa Country to SMN?10 geändert
- Fehler bei der Handhabung von .rar Dateien behoben

v2.1:
- --clean löscht die Riivolution-Zip-Dateien nicht mehr
- vor dem Erstellen eines neuen Abbildes wird ein eventuell vorhandenes des selben Spiels entfernt, nicht mehr alle
- volle Unterstützung für Cannon SMBW
- Download-Link für Cannon SMBW hinzugefügt

v2.0:
- --download Parameter (lädt Riivolution-Daten mit wget herunter)
- --soundtrack Parameter (lädt Soundtrack mit wget herunter)
- --banner Parameter (benutzt einen custom Banner)
- --download-banner Parameter (lädt einen custom Banner mit wget herunter)

- wit auf Version 2.22c aktualisiert
- uips hinzugefügt

- Loader-Patches von DMM auf aktuellem Stand
- README hinzugefügt
- GAMEIDS hinzugefügt

Unterstützung für folgende neue Spiele:
* Another SMBW
* Newer Summer Sun
* Newer Holiday Special
* Epic Super Bowser World
* Cannon SMBW [ungetestet]
* Koopa Country
* The Legend of Zelda - Parallel Worlds

- diverse (Fehler)-Korrekturen, Verbesserungen und Umstrukturierungen

v1.2:
- Autoerkennung der Spielversion (EURv1,  EURv2, USAv1, USAv2, JPNv1)
- Fehlerbehebung bei Bearbeitung von USA/JPN-Versionen
- --sharesave Parameter
- --customid Parameter
- unzip-Ausgabe nach /dev/null

v1.1:
- neue patches für EURv2, USAv1, USAv2, JPNv1 hinzugefügt (DMM)
- Holländisch wird ebenfalls berücksichtigt
- kleinere Verbesserungen am Code
- --version= Parameter (zur Angabe der Spielversion)

v1.0:
- erste Version