1. FAST6191
    This is a patch to allow DS slot flash carts to link up with various GBA slot hardware to use the GBA cart linkup functions (see pal park) that do not otherwise work (various reasons but mainly that GBA carts use SRAM saves where the original game uses flash and as such has different read commands).
    ~ pokepatch V4 ~
    replicates EZ5's patch to allow pokemon migration using various GBA flashcarts and other slot1 cards

    Drag and drop Pokemon NDS ROM onto the EXE to apply the patch. This exe will create an output file
    in the directory of the file dropped onto the exe with "_pkpt.nds" at the end, this is the patched
    output.

    ** no warranties expressed or implied **
    There is a (now good) chance it will work, and a chance it won't. Give it a go. The biggest problems that
    have been encoutered are GBA headers that were patched or corrupt save data (sometimes due to bad sram patching.)
    If you have a corrupt save error, try playing from an emulator like no$ or vba - the gba game itself is capable
    of correcting some errors.

    I've tested it thoroughly on the hardware listed using Pokemon Diamond USA on a real R4 (thanks to vvedge) and
    found it working well; my initial testing on Pokemon Platinum (with "different DS/Time" errors) required
    a couple tries before I got past the initial migration screen but seems OK, it's my understanding Platinum
    isn't all that stable on many flashcarts to begin with.

    If you run across one that I haven't tested (aka: not diamond/platinum USA) that isn't working, black screen on migration
    or white sceen on startup, let me know and I'll re-verify if I can.
    ---------------------------------------------------------------------------------------------------------------------------
    ~ Per Card notes ~
    EZ I/II:
    use single ROM mode and load the saver from the client. Disable as many patches as it allows.

    EZ III/IV:
    the GBA game has to be on NOR in the first space avaiable, make sure to load your save file from
    EZ disk before trying to migrate, it may help. Disable as many patches as you can (ie: don't use EZ4 client)
    to try and avoid header issues. This patch is NOT meant to make migration work with ONLY a EZ III/IV, you
    will still need a DS slot card to play the NDS game from.

    EZ 3in1 :
    This will NOT work with Rudolph's tool unless you have the GBA ROM on NOR and not PSRAM.

    Flash Advance :
    I'm including a couple tools for SRAM management in a zip, as far as I am aware there is nothing eles out there
    that allows direct SRAM manipulation. See the FASsram_tool readme for more info. Use FAS1 or AKAIO to write the
    GBA ROM to FA works great, then using the sram tool I included to get your save into SRAM
    ---------------------------------------------------------------------------------------------------------------------------
    ~ Technical note ~
    Copy code and a 'stub' are inserted at the tail end of arm9, which takes the embedded bankswitching code 'stub' and copies it
    to 0x23B0F00, arm9 entry is patched to jump to the copy code (so the secure CRC will be buggered in the patched header), FLASH
    ident responses are patched in 2 locations, and FLASH bankswitching is patched to jump to the copied 'stub'. arm9 region is
    padded to (arm9 size+copy patch size+arm9 footer size) + pad to align to 512 bytes, all other offsets in the header are shifted
    to match the new offsets and the FAT table is iterated through to change it's offsets and verify the data at those offsets.

    CRC code was used verbatim from the CRC code found in ndstool (see crc.h and crc_tab.h and little.h for source.)
    http://devkitpro.svn.sourceforge.net/viewvc/devkitpro/trunk/tools/nds/ndstool/
    I'm providing the GPL'd source in this archive to reflect the changes I made to it as the rest of this project does not share
    the same license.
    ---------------------------------------------------------------------------------------------------------------------------
    ~ some thanks ~
    MANY MANY THANKS to vvedge for supplying a diamond save which allows me to migrate on my own DS
    Thanks for your help getting the initial version tested kettek, I'm sure there are plenty of pokefans (har har)
    that can make use of it.
    Thanks to everyone who helped test the kor patch
    Thanks to DKPro maintainers and it's contributors
    Thanks to Sasq for the great pogoshell, where I shamelessly stole the injected FA bankswitching code from
    Thanks to smiths for FAS1 and AKAIO FAS functions
    Thanks again to EZ team for the original version of the patches adapted here, and the great hardware along the way
    Thanks to theotherfreakyguy for helping verify Platinum migration is working
    Thanks to cracker for DSATM, without it's deadbeef padding I'd have had more hours of tedium

    Cory1492 - nds.cmamod.com
    ---------------------------------------------------------------------------------------------------------------------------