|
|||||||
![]() |
|
|
Thread Tools |
|
|
#776 |
|
Dies, died, will die.
Join Date: Jun 2010
Posts: 302
|
there is 1 main breeding routine in b/w and(in white), it's at 21C390C:
...
anything anyone could ever want to know is in there. it includes international breeding (a for-loop that runs 6 times with 6 rng advancements and 6 shiny pid checks, etc) and all quirks of the system. |
|
|
|
|
|
#777 |
|
Dies, died, will die.
Join Date: Jun 2010
Posts: 302
|
something i've been thinking about for awhile: i'm pretty sure that keypresses don't affect timer0 at all in gen 5, and i just wanted to demonstrate why i think so.
first, let's start with the code:
parameter fetch
ok, now have a look up at the top. timer0 is grabbed at 2088194. keypress data isn't retrieved until 2088220 and 2088224. when it is retrieved, there is no reading of hardware involved. it simply grabs the values at 4000130 and 2FFFFA8, ORs them, and continues. i could see making an argument for it being affected if the arm9 processor(that is running this routine) was the same one reading the scankeys() data in and setting those registers. maybe having keys pressed would slow it down then. however, the data retrieved from scankeys() is read/interpreted by the arm7 processor and then set up in the i/o registers for the arm9 cpu to read. it's just grabbing the value and running with it, not doing any interpretation of the data from the hardware. i know people have said that they seem to be affected by certain keypresses or whatever, but it just doesn't seem like it's possible. |
|
|
|
|
|
#778 |
|
Dies, died, will die.
Join Date: Jun 2010
Posts: 302
|
the chance of a random battle with no modifier in play is 8%. it becomes a 16% chance with illuminate. now, if you get into a battle on one square and step into an adjacent square where you can also get into a battle,(i.e. get into a fight on grass, take a step into a patch of grass) you will have a 1% chance of a fight, regardless of the modifiers involved. they are all ignored. apparently they were trying to be nice and keep step-battle, step-battle, step-battle rpg annoyance out of it.
might as well show what i was seeing: Code:
021AA438 2401 mov r4,#0x1 ;1S // compare value for battle test(1 here because i just got out of another battle)
021AA43A F000F961 bl #0x21AA700 ;1N+3S
(not gonna bother pasting the rng advancement or divmod in here again)
021AA700 B508 push {r3,r14} ;1N+1ND+1SD
021AA702 4804 ldr r0,=#0xFFFF ;1S+1ND+1I // this event value gives you (u32 >> 16) -1
021AA704 F65AFFF2 bl #0x20056EC ;1N+3S // u32_t rng.event(u32_t event)
021AA708 2129 mov r1,#0x29 ;1S // set up the divmod
021AA70A 0109 lsl r1,r1,#0x4 ;1S // here too, same calc as ESV
021AA70C F6F1EDDC blx #0x209C2C8 ;1N+3S // unsigned divmod
021AA710 BD08 pop {r3,r15} ;1N+2S+1ND+1SD+1I // done and heading back
021AA43E 42A0 cmp r0,r4 ;1S result of ((u32 * FFFF) >> 32) / 0x290 compared against the percent chance of an encounter. 8 normally, 0x10 for iluminate, 1 for a post-battle step
021AA440 D801 bhi #0x21AA446 ;1N+2S
021AA442 2001 mov r0,#0x1 ;1S // return 1 if a battle is set
021AA444 BD10 pop {r4,r15} ;1N+2S+1ND+1SD+1I
021AA446 2000 mov r0,#0x0 ;1S
021AA448 BD10 pop {r4,r15} ;1N+2S+1ND+1SD+1I
Last edited by Bond697; Sep 10th, 2011 at 3:40:59 AM. |
|
|
|
|
|
#779 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Emerald Eggs
I used a vblank removed version, so there may be a blank in between the Initial and Decision as I had one in my R/S Egg PID post. For this post, UpperLower is the format of the egg PID. No Everstone Used Eggs generated with Everstones
Code:
Test Case (Example)
Everstone Nature: Impish
PRNG[0] = 0xCFB8227E
PRNG[1] Pass Decision -- set up timer
tRNG[0] = 0x0001 +1
PRNG[2] Pass Everstone -- enable loop until true.
TempPID#1 : tRNG[1] and PRNG[2+1] -- fail
................... more fails
TempPID#39: tRNG[39] and PRNG[2+39]
tRNG[39] = 0x362CC473
PRNG[41] = 0xDFC556E1
TempPID#39 = 0x362CDFC5, % 0x19 = 8 (Impish), pass
set TempPID as the FinalPID
If the calc fails, I assume it just generates the first TempPID and sets it as the final as there is no loop enabled.
Nature Table
Last edited by Kaphotics; May 20th, 2012 at 10:33:01 AM. |
|
|
|
|
|
#780 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Somewhat separate thought, but the Emerald PID creation was the cause of the Spinda PID craze. Japanese RNGers would have a Spinda breed (70% chance) to find the offset of PRNG frames relative to the Timer, so that they could estimate and predict frames to aim for for shiny egg PIDs. According to a few posts, the difference between the frame and timer value was ~28 (29 and 30 sparsely, caused by vblanks).
Breed Spindas, find two halves of PID, find the seeds you hit and the difference between them! So with that it shouldn't be hard to predict egg PIDs once you calibrate for it. == Emerald Egg Calibration
Test Results (English Emerald): Code:
Zari: 0xBF1ED064 (497/521) = 24 (English & Red GBA) Zari: 0x3CA4525B (503/527) = 24 (English & Onyx GBA) Zari: 0x01F71C18 (506/530) = 24 (English & Onyx GBA) Supe: 0x0014BA75 (541/561) = 20 (Emulator) Supe: 0x88D62D18 (582/602) = 20 (Emulator) Supe: 0xBA878D50 (610/630) = 20 (Emulator) Supe: 0x3E133CBD (612/632) = 20 (Emulator) Nexus: 0xE4AAA5DF (778/797) = 19 (NDS) Kaphotics: 0x962101D5 (878/897) = 19 (Emulator) Supe: 0x8ACD923E (1088/1108) = 20 (Emulator) Nexus: 0xD3ADCEAE (1093/1112) = 19 (NDS) Last edited by Kaphotics; Sep 11th, 2011 at 4:50:52 AM. |
|
|
|
|
|
#781 |
|
Dies, died, will die.
Join Date: Jun 2010
Posts: 302
|
redownload eepid, fixed it up some more.
|
|
|
|
|
|
#782 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Emerald Egg PID Prediction
Use EmeraldEggPID.xlsm (spreadsheet) eepid.exe Calibrate and put in your Calibration. The spreadsheet is tuned to use the Calibration so that you can actually see your calibrations on the frame you were told! (use the lower "Test" result). ID/SID optional, only if you want to see where you have shinies. Bam, spits out the Frame, PID, Nature, Ability, GV, PID%6, Hittability, and Shiny depending on the Decision. You can filter everything you'd want in an egg. The spreadsheet is for the first ~2.7 minutes. ![]()
Example with old version & Zari's Calibrations
Everstone prediction is essentially impossible in Excel due to large number rounding, however using an Everstone would be the best way for someone to use existing IDs for a shiny PID. If you want more than 2.7 minutes of prediction, output more PRNG from researcher and extend the hidden columns to your desired frame count. Last edited by Kaphotics; Dec 26th, 2011 at 5:38:27 PM. |
|
|
|
|
|
#783 |
|
Dies, died, will die.
Join Date: Jun 2010
Posts: 302
|
so i spent awhile poring through code, observing, and reading programming manuals and other assorted gba documentation(basically any that i could find) and i think that i've pretty much nailed what causes methods 2/3/4 in gen 3.
http://www.smogon.com/forums/showpos...&postcount=391 http://www.smogon.com/forums/showpos...&postcount=392 if something is wrong or hard to understand, let me know. also if there's something that needs to be added/taken out. Last edited by Bond697; Sep 14th, 2011 at 8:32:27 AM. |
|
|
|
|
|
#784 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
XD PKM Structure
So I was digging through Dolphin's RAM to try to find my Pokemon, and managed to find this structure. I had Cheat Engine attach to Dolphin's process, and just copypasted with the XX byte view. This might be problematic because of endianness. This may not look like typical Research, but the structure is how the game uses the data. It will help us understand how the game gets the data to begin with.
...
Basing off of these 5 Pokemon in my party, here's the HEX structure of XDPKM. There are missing things like obedience flag etc, which I obviously can't check. Code:
0x00 - 0x01: Species 0x02 - 0x03: Unused 0x04 - 0x05: Current HP 0x06 - 0x07: Happiness (2 bytes) 0x08 - 0x09: ??? (00 or 0B) 0x0A - 0x0B: Unused 0x0C - 0x0D: Unused 0x0E - 0x0F: Level Obtained & Pokeball Type(?) 0x10 - 0x11: Current Level 0x12 - 0x13: Unused 0x14 - 0x15: Intro Data Closer (00 and FF) 0x16 - 0x17: Unused 0x18 - 0x19: Unused 0x1A - 0x1B: ??? (00 and X8) [gender?] 0x1C - 0x1D: ??? 0x1E - 0x1F: ??? 0x20 - 0x21: Unused 0x22 - 0x23: ??? 0x24 - 0x25: Secret ID 0x26 - 0x27: Trainer ID 0x28 - 0x2B: PID.... Vaporeon is Jolly! (0D) 0x2C - 0x2F: Unused 0x30 - 0x38: ???????????? 0x39 - 0x4D: OT Namefield 0x4E - 0x79: 2x Name Field (22 bytes *2) 0x7A - 0x7B: ??? 0x7C - 0x7D: Ribbons (Bitflags) 0x7E - 0x7F: ??? 0x80 - 0x81: Move 1 0x82 - 0x83: Move 1 PP 0x84 - 0x85: Move 2 0x86 - 0x87: Move 2 PP 0x88 - 0x89: Move 3 0x8A - 0x8B: Move 3 PP 0x8C - 0x8D: Move 4 0x8E - 0x8F: Move 4 PP 0x90 - 0x91: HP Stat 0x92 - 0x93: Atk Stat 0x94 - 0x95: Def Stat 0x96 - 0x97: SpA Stat 0x98 - 0x99: SpD Stat 0x9A - 0x9B: SpE Stat 0x9C - 0x9D: HP EV 0x9E - 0x9F: Atk EV 0xA0 - 0xA1: Def EV 0xA2 - 0xA3: SpA EV <--not sure on the ordering 0xA4 - 0xA5: SpD EV of these, didnt keep track 0xA6 - 0xA7: SpE EV 0xA8 HP IV 0xA9 Atk IV 0xAA Def IV 0xAB SpA IV <--not sure on the ordering 0xAC SpD IV of these, didnt keep track 0xAD SpE IV 0xAE - 0xAF: Unused 0xB0 - 0xB9: Unused 0xBA - 0xBB: ??? 0xBC - 0xBD: ??? 0xBE - 0xBF: ??? 0xC0 - 0xC1: Unused 0xC2 - 0xC3: Party Identify (2 leads 00, Backup 01) Implications: IVs may be generated as single numbers one at a time, not using a chunk of hex like in Gens 3/4.
Hex Table of Move / PKM / Item
Gotta love knowing the PIDs and memory locations
Last edited by Kaphotics; Sep 13th, 2011 at 11:19:11 PM. Reason: cleared up confusion |
|
|
|
|
|
#785 | |
|
Dies, died, will die.
Join Date: Jun 2010
Posts: 302
|
Quote:
|
|
|
|
|
|
|
#786 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Pokemon XD (GoD) Memory Locations
They may be different depending on pointers of your current setup. Code:
0x004E8610 PRNG State 0x00478EB8 Party PID#1 0x00478F7C Party PID#2 0x00479040 Party PID#3 0x00479104 Party PID#4 0x004791C8 Party PID#5 0x0047928C Party PID#6 0x004A86F4 OppPID#1 (Battle) 0x004A8774 OppIVs#1 (Battle) Others are nearby.
Frame chart of the first battle with a Shadow Pokemon (Teddiursa)
Last edited by Kaphotics; Sep 19th, 2011 at 8:36:45 PM. |
|
|
|
|
|
#787 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Pokemon XD: GoD - Call Structure for PID/IV Generation
Code:
1 Opponent TID 2 Opponent SID 3 1st ??? 4 2nd ??? 5 IV Block 1 (Def/Atk/HP) 6 IV Block 2 (SpD/SpA/SpE) 7 3rd ??? 8 Upper Half of PID 9 Lower Half of PID Last edited by Kaphotics; Sep 19th, 2011 at 8:39:49 PM. |
|
|
|
|
|
#788 |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
This just in: Pokémon caught in XD are never shiny. The game will continue to reroll for a new PID until it is not shiny.
Code:
Test results: Frame RNG Value 1 BFB03DDD <- frames 1 and 2 form a PID that should be shiny (BFB04B1B) 2 4B1B992C <- but we know it rerolls to frames 3 and 4 3 3F07833F <- frames 3 and 4 also form a PID that should also be shiny with our ID\SID (3F07CBA9). 4 CBA9D106 <- we want to know if it only rerolls once, or if it keeps rerolling until not shiny 5 2BC0C3B1 <- the PID was 2BC0FBF2, so it rerolled until a non-shiny PID occurred on frame 5 and 6. 6 FBF257B0 EDIT: We also tried manipulating the opposing trainers' ID\SID to make their Pokemon shiny. This also failed; it rerolled for their ID\SID when the PID\TID combination was found to make the Pokemon shiny. Last edited by ΩDonut; Sep 19th, 2011 at 8:09:14 PM. |
|
|
|
|
|
#789 | |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
IV\PID generation in XD is basically like Method 2 (described here), in reverse. Five RNG calls are made. The first two are used for IVs, the third is unused, and the last two form the PID.
A quick recap of IV generation in Method 2, from X-Act's article: Quote:
Code:
Frame RNG Value 1 171EA3F5 171E in binary: 0|00101|11000|11110 (Defense 5, Attack 24, HP 30) 2 CA36C6E4 CA36 in binary: 1|10010|10001|10110 (SpDef 18, SpAtk 17, Speed 22) 3 8302DA17 ignored 4 C7512C7E C751 forms the upper half of the PID 5 BF7E9149 BF7E forms the lower half of the PID |
|
|
|
|
|
|
#790 | |
|
Now with incrementally more toast!
![]() ![]()
|
I did some research a while ago and just realized that I never made it available here. This is all PIDRNG and NPC related. If I get the time, I'll translate it into an actual post. For now, here is a link to the document I used to record my findings.
Edit: Any notes about leading 0's has since been proven to be only mostly true. It is rarely possible for other low values to have the same effect.
__________________
RNG Timers!
EonTimer v1.5.1(all versions)|ZomgTimer v2.21(x86)] v1.6 - oh so much. | v2.21 - efficiency update Quote:
|
|
|
|
|
|
|
#791 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Abilities in XD (and Colo?)
Since the game generates the IVs before the PID (compared to the regular NDS/GBA method which does PID first), ability is determined differently. Code:
PID IV Low Bit (IV) 19B6E8AF 140109DE 0 (Natural Cure) Roselia D69C5CFF 1C4571D4 0 (Immunity) Snorlax A752AF5C 14959F84 0 (Natural Cure) Chansey CE78165A 94E2F24D 1 (Illuminate) Starmie 6AAD7B68 29D51C14 0 (Synchronize) Ralts 6DAE2D91 09798D98 0 (Lightningrod) Rhydon 8D73B8EA 85625197 1 (Lightningrod) Manectric Last edited by Kaphotics; Sep 26th, 2011 at 3:30:46 PM. |
|
|
|
|
|
#792 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Colosseum PKM Structure and offsets
Code:
004088FC Trainer SID_TID 00408900 Species (half word) 00408904 PID#1 00408914 PKM TID/SID 004089A4 IVs (half word each) 00408A3C PID#2 408A3C-408904 = 312 bytes of data XD had 194. There is some shifting based on how you start up, but it would be nearby if not there.
PID changing for shininess
Last edited by Kaphotics; Sep 20th, 2011 at 8:20:30 PM. |
|
|
|
|
|
#793 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Colosseum PID/IV Relationship
Code:
Pre-Generation Seed: A6A0DF7D 277 81559C60 8155 IV Block 1 1 00000 01010 10101 278 0ECF49A3 0ECF IV Block 2 0 00011 10110 01111 279 C0310DDA C031 ???? 280 F0CF5D35 F0CF UpperPID 281 5A199B24 5A19 LowerPID PID: F0CF5A19 IVs: 0015 000A 0000 0016 0003 000F Binary 10101 01010 00000 10110 00011 01111 It probably has the same Trainer TID/SID Generation. |
|
|
|
|
|
#794 | |
|
Join Date: May 2006
Posts: 659
???????
|
Quote:
__________________
Disclaimer: The above post may or may not have been made by a sane person. |
|
|
|
|
|
|
#795 |
|
sometimes experimentation begins with "let's multi battle strip pokémon"
![]() ![]() ![]()
Moderator
Join Date: Aug 2006
Posts: 3,691
|
We haven't tested Pokéspots, but frankly, they are not a high priority at all since there is nothing special about them. We'd only research them if we get really, really bored.
|
|
|
|
|
|
#796 | |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Paralleling XD's antishiny to Colosseum's blunder:
I've taken the time to figure out why Colosseum has shiny shadow Pokemon that lose shininess upon capture, and why it's possible to actually become shiny after capturing. The answer is simple: Opponent TID/SID. As we've seen in XD, if the PID is shiny with your TID/SID or the (randomly generated) Opponent's TID/SID, it is re-rolled. In Colosseum, the game only uses the Opponent TID/SID with the PID when determining shininess. Consider it like an egg. It may be shiny with Trainer A, but with Trainer B, it may not! Conversely, if it's nonshiny with A, it might be shiny with B. This is why the glitch occurs, and I've updated Bulbapedia's entries according to this. Quote:
|
|
|
|
|
|
|
#797 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
XD Togepi:
Code:
0 AC3F2930 ... 19 43908A15 4390 0 10000 11100 10000 (0x10 0x1C 0x10) 20 38619484 3861 0 01110 00011 00001 (0x0E 0x03 0x01) 21 0000F137 0 22 13DB671E 13DB UpperPID 23 41526169 4152 LowerPID 13DB4152 10 1C 10 03 0E 01 |
|
|
|
|
|
#798 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
yeah, ageto celebi to the GC sav file conforms to the XD/Colosseum method
Same struct. That Shiny Lax Ageto Celebi that's been trading for a long time? Hacked. Last edited by Kaphotics; Jan 4th, 2012 at 1:40:21 AM. Reason: tidied up 3 months later |
|
|
|
|
|
#799 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Uploaded a YouTube Video recording me RNGing the Shadow Togepi from HORDEL in Outskirt Stand in XD.
With audio narration! Here's the video!
Video Detail / Commentary
Last edited by Kaphotics; Jan 13th, 2012 at 10:28:13 PM. |
|
|
|
|
|
#800 |
|
Remodeling Kitchens
![]()
Join Date: Apr 2009
Posts: 758
Berkeley, CA
|
Japanese Bonus Disc PRNG
80477098 You have to select the Colosseum portion of the bonus disc (first one), then the seed is set. Then another menu pops up. Passing this menu screen advances it ~1018 times. It's for sure the PRNG state ;) finished editing the disc so it will give to english saves.... but I can't get the link going. == Abilities in XD/C (99% sure) Come from the top bit of the second set of IVs. Code:
iv1 xHHHHHAAAAADDDDD (binary) iv2 a Last edited by Kaphotics; Sep 25th, 2011 at 7:26:45 PM. |
|
|
|
![]() |
| Tags |
| NULL |
| Thread Tools | |
|
|