======================================
Jett Rocket Classic Controller Patcher
======================================
                            Vague Rant

This script will optionally apply one of two Classic Controller IPS patches to
any valid WAD for Jett Rocket which you provide. The options are:

- default, inverted camera
    hold left to look right, hold right to look left

- custom, un-inverted camera
    hold left to look left, hold right to look right

-----
Usage
-----
You must place common-key.bin into the same directory where you unpack this
script. This key is a cryptographic secret, protected in some jurisdictions due
to its potential use in circumvention of DRM. I cannot help you find this file.

To begin patching, you can pass an argument to the script in one of two ways:
dragging and dropping the source WAD onto the apply-patch.bat file or directly
from the command prompt, e.g.

    apply-batch.bat "Jett Rocket (USA) (v512) (WiiWare).wad"

If you don't provide a source WAD via argument, you will be prompted to provide
one upon launching the script. This should be either an absolute or relative
path to your source WAD, surrounded in quotation marks (").

Once the script has started, you will answer y/N prompts for which of the two
patches you wish to use. These prompts are not case-sensitive.

If you provide an incorrect WAD, the patching process will fail and exit
without patching. If you don't select any patches, the script will again
exit without patching.

The original WAD will not be modified. A new WAD will be packed with the
filename "JRo_[region]_[revision]_patched.wad" and placed into the script
directory.

-----------------------
Patching without Script
-----------------------
If you cannot run the included script and tools due to being on a different
operating system or architecture, the process to apply these patches manually
using appropriate tools for your system is:

    1. Unpack your WAD
    2. Decompress the 00000001.app file
    3. Apply the IPS patches you want to use
           If you're not sure which patch version to use:
               v1: EUR v3 WAD
               v2: USA v3 WAD / EUR v256 WAD
               v3: USA v256 WAD / EUR v512 WAD
               v4: USA v512 WAD
    4. Compress the 00000001.app file
    5. Pack a new WAD

-------------------------
Classic Controller Layout
-------------------------
The patch adds the following control scheme to the game. Note that D-Pad and
Right Stick Left/Right are swapped in the custom, un-inverted camera variant.

    +------------------------------------------------------------+
    |  Wiimote/Nunchuk |      Classic     |       Function       |
    |------------------+------------------+----------------------|
    |   Analog Stick   |    Left Stick    | Movement             |
    |------------------+------------------+----------------------|
    | D-Pad Left/Right | D-Pad Left/Right | Camera Rotation      |
    |                  |    Right Stick   |                      |
    |------------------+------------------+----------------------|
    |     D-Pad Up     |     D-Pad Up     | Re-Center Camera     |
    |                  |         Y        |                      |
    |                  |         L        |                      |
    |                  |        ZL        |                      |
    |------------------+------------------+----------------------|
    |         A        |         A        | Confirm              |
    |                  |                  | Jump                 |
    |------------------+------------------+----------------------|
    |         B        |         B        | Cancel               |
    |                  |                  | Interact             |
    |------------------+------------------+----------------------|
    |       Minus      |       Minus      | Delete Save (menu)   |
    |------------------+------------------+----------------------|
    |       Plus       |       Plus       | Pause                |
    |------------------+------------------+----------------------|
    |       Home       |       Home       | Open/Close Home Menu |
    |------------------+------------------+----------------------|
    |       Shake      |         X        | Dash/Air Dash        |
    |                  |         R        | Charge Rocket        |
    |                  |        ZR        |                      |
    |------------------+------------------+----------------------|
    |       Point      |    Left Stick    | Navigate Menus       |
    |                  |    Right Stick   |                      |
    +------------------------------------------------------------+

--------------
Included Tools
--------------
- flips by Alcaro
    licensed under GPLv3
    https://github.com/Alcaro/Flips

- lzx by CUE
    licensed under GPLv3
    https://github.com/PeterLemon/Nintendo_DS_Compressors

- wadpacker and wadunpacker by BFGR
    licensed under GPLv2
    https://github.com/AuroraWright/FunKii/tree/master/wadtools

- xxd by Juergen Weigert, Vadim Vygonets et al
    licensed under the following terms:
        Distribute freely and credit me,
        make money and share with me,
        lose money and don't ask me.
    https://github.com/bigbio2002/xxd