Filetrip Logo

Pokepatch 4.2

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

** 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 ~
use single ROM mode and load the saver from the client. Disable as many patches as it allows.

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.)
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 -

Change log (4.2):
~ changelog ~
** working on eLink support, still need to work out ROM bankswitching **

- moved memory relocation address up for compatibility with platinum versions released after USA version
- fixed a bug that occurs with some trimmed ROMs, end of file was not copying because it is no longer aligned to 512 bytes once trimmed
V4 (no joke, I completed this work and it's testing on April 1st 2009 and modifying this readme @ 10:57AM)
- no longer does in place patching, creates a new copy of the file with _pkpt tacked on as the patched output
- reworked entire patching method to support per-cart stubs
- added compatibility for EZ I/EZ II(and possibly older XG), EZ III/IV and most Flash Advance variants
V3 alpha2
- added platinum jpn to the new detection routine (again, not tested but doesn't seem much has changed since the kor D/P versions.)
V3 alpha
- added tentative pokemon platinum USA support (no one has tested it at time of writing)
the US version has the same code internally as the korean ones, hopefully this method still works
do not repatch the file multiple times as it will overwrite important data after the first time on platinum US version.
- added arm9 footer awareness, wifi modes depend on certain data to be present at the tail of the arm9 binary
now pokepatch attempts to retain this data
V2 alpha
- attempt to add the korean versions to the patcher
comments powered by Disqus