--------------------
About the savestates
--------------------
- They are for Japanese Emerald (untouched rom).
- This file contains several "Emejap_XXm" files, where XX stands for "million frames", that is, the number of frames the savestate is into.
- For a flawless timid spread, you want to hit frame 176562489.
- For Mew, the cry produces a delay of 202 frames, so you want to press A on frame 176562287.
- I've included "Emejap176m562195.sgm", which is just about to hit the frame, and "Emejap176m562287_flawlessMEW.sgm", which is on the exact frame, if you load it while holding "A" button you'll jump right into the shiny flawless mew encounter.

- The other static encounters have already been done, but you may enable some AR cheat codes to rebattle/capture with the flawless spread, those codes should not really affect the pokmon's generation or its legality (besides you knowing what you did, but emulating the game for 5 weeks to hit the flawless timid spread is already kind of in the edge...).

------------------
Editing OT/TID/SID
------------------

Savegame uses the following:
	OT ("SUROKU" in romaji): 5D 7B 58 FF FF FF 00
	TID/SID (60510/31337):   5E EC / 69 7A
	 (this is a shiny TID/SID combination for flawless timid spread)

To change TID/SID with VBA :
1.- Pause emulation (control+P) and load savestate (this will keep emulation paused).
2.- Tools->Debug->Memory Viewer
3.- Go to offset 0x020246F8
4.- The first 6 bytes you see at the top left are the trainer name, but they are "scrambled" in the following way:

OT name hex view you'll see in a pk3 file: 	5D 7B 58 FF FF FF 00 00
OT name hex view you'll see in memory viewer:	7B 5D FF 58 FF FF FF 00

(Remember japanese OT names have 5 characters maximum!)

5.- If you'd like to chante TID/SID you'll find it at offset 0x02024702, also "scrambled":


TID-SID hex view you'll see in a pk3 file: 	5E EC 69 7A
TID-SID hex view you'll see in memory viewer:	EC 5E 7A 69

(First two bytes are TID, the following two SID)

6.- Close the memory viewer, you are done. Now you shall advance to any frame you'd want or do any encounter, the generated pokmon will be 

NOTE:  The listed addresses correspond to the working memory, so this is the only one we need to change as the OT/TID/SID in the actual savefile will be overwritten with the new value once you save in-game. Save two times in a row to update both blocks (savegame has a main block and a backup block).

NOTE 2: Alternatively, you may uncompress the savestates with 7zip (they are just gzip files), open on hex editor and search+replace OT/TID/SID (here you'll find them in the same byte order as pk3 files). After editing, recompress as a gzip file and rename to sgm. Compression settings don't matter, VBA will load them fine with any settings.

------------------------
About the savegame used:
------------------------
- It is a savegame of my playtrough trough Emerald in the Spanish rom.
- It has been done in emulator.
- All pokmon in the save are 100% legal
- No cheats or save editing have ever been applied to the save (except the ones I'll explain below)
- The save has the japanese Old Sea Map wondercard injected.
- The OT name and TID have been altered using pkhex, OT to match one a japanese game would generate (non-jap allow 1 extra character), TID/SID to match a shiny combination for flawless timid IV spread PID.

- I did not think about having one of each kind of pokball at least before doing the savestates, but there's still some variety to choose. Use a savestate before throwing the balls that only have 1 unit and keep reloading and doing savestates until the RNG allows you to catch the desired pokmon (or load a previous savestate that's near the flawless frame and just buy some balls).