1. Welcome to Wi-Fi! Please remember to read the rules and do NOT create a new thread for simple trades or Friend Safari codes.

Past Gen RNG Research

Discussion in 'Wi-Fi' started by mingot, Sep 12, 2009.

  1. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
    It looks like Cute Charm forces the PID to be a value between 0-255 (the gender value). That means 24 of of the PID's bits are going to be constant. Since three of the bits don't matter to shininess, that leaves only 5 bits to worry about.

    In other words, with the right ID\SID, Cute Charm could force shinies to appear with a 1\32 probability.

    EDIT: Seems to be for DPPtHGSS only. In 5th gen, PID generation works like Entralink generation, except the nature comes from a different frame.
  2. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    Cute Charm in Generation III (Emerald Only)

    Stage 0 - Unformatted Raw Data (open)
    Code:
    Frame	Time	PID		Nature	Ability	
    1452	0:24.20	1544DEF9	Modest	1	24/13/03/23/01/21	
    m pooch 5 (slot0), method 1
    no H
    
    Frame	Time	PID		Nature	Ability	
    1499	0:24.98	DDBFBDD3	Relaxed	1	05/24/09/06/19/00	
    m taillow 5 (slot8), method 1
    1437	1439	1441	1469	1475	1479
    1	0	6	6	5	1
    
    Frame	Time	PID		Nature	Ability	
    1518	0:25.30	A1387DCE	Careful	0	18/10/22/14/03/04	
    m wurmple 6 (slot6), method 2
    no H
    
    Frame	Time	PID		Nature	Ability	
    1445	0:24.08	96C615FA	Naughty	0	02/25/11/31/00/10
    m silcoon 5 (slot4), method 1
    1391	1443
    7	3
    
    Frame	Time	PID		Nature	Ability	
    1484	0:24.73	2FFD72CF	Lonely	1	19/10/20/02/25/23
    m poochyena 6 (slot3)
    1344	1382	1396	1444
    5	1	10	2
    
    Frame	Time	PID		Nature	Ability	
    1573	0:26.21	04608AC8	Careful	0	05/21/27/17/01/06
    m shroomish 5 (slot2) method 2
    no H
    
    Frame	Time	PID		Nature	Ability	
    1540	0:25.66	47A29F70	Lax	0	23/04/23/08/22/13
    F cascoon 5 (slot5) method 2
    1446	1466	1474	1504	1512	1522
    1	0	3	1	9	5	1
    
    Frame	Time	PID		Nature	Ability	
    1469	0:24.48	800EFF91	Brave	1	30/02/27/01/25/30
    m wurmple 5 (slot1) method 1
    1447
    10
    Just staring at it a bit you can see the format of the data.
    Stage 1 - Data Consolidation (open)
    Code:
    1544DEF9 M1	Modest	24/13/03/23/01/21	
    male slot 0
    no H2 (?? 8)
    
    DDBFBDD3 M1	Relaxed	05/24/09/06/19/00	
    male slot 8
    1441 H1 = 6
    
    A1387DCE M2	Careful	18/10/22/14/03/04	
    male slot 6
    no H2 (?? 4)
    
    96C615FA M1	Naughty	02/25/11/31/00/10
    male slot 4
    1443 H1 = 3
    
    2FFD72CF M1	Lonely	19/10/20/02/25/23
    male slot 3
    1444 H2 = 2
    		
    04608AC8 M2	Careful	05/21/27/17/01/06
    male slot 2
    no h2 (?? 5)
    
    47A29F70 M2	Lax	23/04/23/08/22/13
    FEMA slot 5
    1446 H2 = 1
    
    800EFF91 M1	Brave	30/02/27/01/25/30
    male slot 1
    1447 H1 = 10
    Code:
    Slot Frame Progression
    5 0 8 6 4 3 2 5 1 10 1
    Stage 2 - Pattern Recognition (open)
    Code:
    1440 ->	1444	Modest	Wrong Gender 	0x15FA751B	~~~
    	1452	Modest	Correct Gender 	0x1544DEF9
    
    1441 -> 1499	Relaxed Correct Gender	0xDDBFBDD3
    
    1442 -> 1460	Careful Wrong Gender	0x2A62CC18	~~~
    	1462	Careful Wrong Gender	0xE4318526		
    	1518	Careful	Correct Gender	0xA1387DCE
    
    1443 -> 1445	Naughty Correct Gender	0x96C615FA
    
    1444 ->	1484	Lonely	Correct Gender	0x2FFD72CF
    
    1445 -> 1521	Careful Wrong Gender	0x0DC4D952	~~~
    	1573	Careful Correct Gender	0x04608AC8	
    
    1446 -> 1540	Lax DEFIANT GENDER	0x47A29F70	!!!
    		This implies the calc DID NOT PASS
    
    1447 -> 1469	Brave Correct Gender	0x800EFF91
    
    Now on to Researcher for the calculation determination!
    Stage 3 - Final Analysis (open)
    Code:
    Frame	Nature	N#	Slot	ESV	CuteCharm
    1	Modest	15	Slot 0	00-19	Pass	92
    2	Relaxed	7	Slot 8	90-93	??	82
    3	Careful	23	Slot 6	80-84	Pass	65
    4	Naughty 4	Slot 4	60-69	??	57
    5	Lonely	1	Slot 3	50-59	??	48
    6	Careful	23	Slot 2	40-49	Pass	79
    7	Lax	9	Slot 5	70-79	FAIL	26
    8	Brave	2	Slot 1	20-39	??	98

    Altered Call Structure
    Code:
    n     - ?????
    n + 1 - Battle (?)
    n + 2 - ESV
    n + 3 - CuteCharm
    n + 4 - Level
    n + 5 - Nature
    CuteCharm Calc
    Code:
    after ESV, before level
    
    U16 % 3 , if [1 or 2] pass, else fail (0).
    
    If Passed, 
       PID finding loop satisfies gender and nature!
    If Failed, 
       PID finding loop satisfies nature only.
    
    IVs generated the same, but for the end user 
        PIDIV may be preferential to Method H1/H2.
  3. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    Cute Charm in HGSS

    Code:
    n     - Initial
    n + 1 - u16 % 0x64 = ESV
    n + 2 - u16 % 0x03 = CuteCharm
    n + 3 - u16 % 0x19 = Nature# 
      With Nature# -> Form PID
           Buffer [0x96 for 50/50] 
               (such that Buffer%0x19=0, still above GV) 
           + Nature#
    n + 4 - IV
    n + 5 - IV
    Debuggers are for the weak. (open)
    First off, assume that Dark Ray's computer did not have a wonky time. Dark Ray was going to bed shortly, implying the game time would have been night time.

    Zubat occurs on night time slots 4/5/8/10, which fits 2 consecutive ESV calc frames from method K. Oh look, the natures are there too! The IVs were from frame 4+5 and 5+6 for the two Zubat via method 1, which meant that all the calcs had to be done within 3 frames. ESV/CuteCharm/Level/Nature calc had to occupy 3 frames.

    [​IMG]

    I was able to get the PIDs with the Gender Buffer method. With the new data following this post, I figured out the image is correct, and the structure in this post is correct for HGSS.

    btw, Custom 6/7 don't access the right "Custom" or "Previous". Incorrect reference? Had to paste in the correct values to custom7.
  4. Dark Ray

    Dark Ray Here to bug you
    is a Pre-Contributor

    Joined:
    Sep 27, 2010
    Messages:
    672
    8 more PKM for you, Female CC Iggly used for all of them, same seed and stuff as before, these are all from sequential frames (last nights Zubats were from frames 2 and 3, these are 4-11) these were all caught during Daytime ingame.

    #1. 2 frames advanced by date rollover.
    #2. ^+1 frame advanced by Irwin call.
    #3. ^etc.
    #4.
    #5.
    #6.
    #7.
    #8.

    I can catch some more if you still need.
    EDIT: From what I can see CC advances the RNG by 1 (activation check?) as even when I got normal pokemon they were 1 frame off from what I should have gotten.
    It also looks like when CC activates it uses current method K frame for ES, current method 1 for IVs, next method K for nature and IDK what for PID.
    EDIT#2: Proof that cute charm is useful.
  5. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
    Cute Charm in DPPt

    Code:
    n     - Initial
    n + 1 - u16 / 0x290  = ESV
    n + 2 - u16 / 0x5556 = Cute Charm check
    n + 3 - u16 / 0xA3E  = Nature#
     this + buffer with a value such that %25 = 0 (if male) forms the PID
    n + 4 - IV
    n + 5 - IV
  6. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    So basically I forgot that Gen 4 games don't have the level calc for Land Pokemon (no level range in the slots).

    Reasoning behind the Buffering of CuteCharm PIDs

    Code:
    n     - Battle
    n + 1 - ESV
    n + 2 - CuteCharm (P/F)
    n + 3 - Nature 
            Pass -> Buffer Method for PID
            Fail -> Loop Method (J/K) as usual
    Code:
    Game	CuteCharm	Nature			
    DPPt	High16 / 0x5556	High16 / 0xA3E
    HGSS	High16 % 0x3	High16 % 0x19
    Basically it inserts a calc in between ESV/Nature
    (moving resulting nature up one frame, compared to current J/K)

    For HGSS (at least), the Buffer method adds a nonbiased buffer, whose %25 = 0.
    They can just add the nature value (0-24) to the buffer to get a valid PID within the Gender Range that has the intended Nature.

    Logic behind the calculation:
    Code:
    PID     = Buffer + Nature#
    PID%25  = Nature#
    PID%256 = Within Specified Gender Range
    Code:
    Buffer > Threshold
     AND Buffer%25=0
    
    Female Forced CuteCharm would be fine with a 0 buffer, 
      because no matter the ratio, 0-24 will always be below it. 
    
    0/[s]25[/s]/50/75/[s]100/125[/s]/150/[s]175[/s]/200/[s]225/250[/s]
          all %25 = 0, nonbiased buffer numbers
          But what about the Gender Threshold? Gotta be above it!
    
    Ratio Thresh   Implied Buffers
    1F|7M (32)  -> Female Forced = 0, Male Forced =  50 (0x32)
    3F|1M (192) -> Female Forced = 0, Male Forced = 200 (0xC8)
    1F|1M (128) -> Female Forced = 0, Male Forced = 150 (0x96)
    1F|3M (64)  -> Female Forced = 0, Male Forced =  75 (0x4B)
    One Gender Only -> 0, or CuteCharm doesn't go off at all (no calc, same J/K)
    The image posted in my previous post was correct after all.

    For the other encounter types in which level has to be determined (another call needed), the CuteCharm calc would occur before (just like in Emerald).
  7. Tux

    Tux

    Joined:
    Dec 1, 2011
    Messages:
    11
    @OmegaDonut : I have made the procedure which is needed to calculate initial seed, with my French DSi and French White.

    Here are the Pokémon.

    My DSi's MAC adress is EF-E7-51-E9-A3-4B.
    I launched my game at December 21st, 10:15:25.

    OD's Note to chiizu: C74B7FB378FBE9C9 is the initial seed he got

    I hope that will serve ^^ (even if I have neither a retail card of French Pokémon Black nor CycloDS iEvolution).

    Method H in the Safari Park in RSE

    In the Safari Park of RSE, if you have put a Pokéblock in the feeder where your player is, you'll get in 20 % of cases the Sync check (or directly a Pokémon with a random nature in RS); in the remaining 80 %, you'll get a Pokémon with a nature that likes the Pokéblock (if no nature likes the Pokéblock, goto Sync check).

    Here is the Pokéblock structure in RAM :

    Code:
    typedef struct Pokeblock{
    	// In the following order :
    	u8 typeID;
    	s8 spicyLevel, dryLevel, sweetLevel, bitterLevel, sourLevel; // If a taste != 0, it is present in the Pokéblock
    	u8 feel; // If feel > 99, then feel = 99
    	u8 unknown;
    	// The global level is determined by the unsigned value of the highest taste level
    }; Pokeblock
    And let the nature's tastes lookup structure (also in RAM) be :

    Code:
    typedef struct NatureTastes{
    	// In this order :
    	s8 spicy, dry, sweet, bitter, sour;
    	/* A nature's taste value is :
    		-1 if the nature dislikes the taste
    		 0 if the nature is indifferent to the taste
    		 1 if the nature likes the taste
    	*/
    }; NatureTastes
    Now, let the following formula :
    All negative Pokéblock tastes (if this would happen) are replaced by 0.
    Let :
    Code:
    const NatureTastes tastesOfNature[25] = // ... ... ... ;  
    s32 doesThePokemonLikesTaste(u8 nature, Pokeblock const& pokeblock){
    	return pokeblock.spicyLevel * tastesOfNature[nature].spicy + pokeblock.dryLevel * tastesOfNature[nature].dry + pokeblock.sweetLevel * tastesOfNature[nature].sweet + pokeblock.bitterLevel * tastesOfNature[nature].bitter + pokeblock.sourLevel * tastesOfNature[nature].sour;
    	/*
    	If the result is negative, the Pokémon doesn't like the Pokéblock
    	If the result is zero, the Pokémon is indifferent to the Pokéblock. This is always the case for neutral natures (#0, #6, #12, #18, #24)
    	If the result is positive, the Pokémon likes the Pokéblock
    	*/
    }
    Here is the relevant assembly code :

    Code:
    MethodH
    
    ROM:080B4F26
    ROM:080B4F26 arg_0           =  0
    ROM:080B4F26
    ROM:080B4F26                 LSLS    R2, R0, #8
    ROM:080B4F28
    ROM:080B4F28 loc_80B4F28                             ; CODE XREF: sub_80B4E68+32j
    ROM:080B4F28                                         ; sub_80B4E68+40j ...
    ROM:080B4F28                 BL      chooseNature
    ROM:080B4F2C                 LSLS    R0, R0, #0x18
    ROM:080B4F2E                 LSRS    R0, R0, #0x18
    ROM:080B4F30                 LDR     R1, =0x2024744
    ROM:080B4F32                 STR     R0, [SP,#arg_0]
    ROM:080B4F34                 MOVS    R0, R1
    ROM:080B4F36                 MOVS    R1, R6
    ROM:080B4F38                 MOVS    R2, R7
    ROM:080B4F3A                 MOVS    R3, #0x20
    ROM:080B4F3C                 BL      MethodH_BuildPkm ; 0x08067E96 not 0x08067E90
    ROM:080B4F40
    ROM:080B4F40 loc_80B4F40                             ; CODE XREF: sub_80B4E68+B8j
    ROM:080B4F40                 ADD     SP, SP, #0xC
    ROM:080B4F42                 POP     {R4-R7}
    ROM:080B4F44                 POP     {R0}
    ROM:080B4F46                 BX      R0
    ROM:080B4F46 ; End of function MethodH
    Code:
    ROM:080B4D78 ; =============== S U B R O U T I N E =======================================
    ROM:080B4D78
    ROM:080B4D78
    ROM:080B4D78 chooseNature                            ; CODE XREF: sub_80B4E68:loc_80B4F02p
    ROM:080B4D78                                         ; MethodH:loc_80B4F28p
    ROM:080B4D78                 PUSH    {R4-R7,LR}
    ROM:080B4D7A                 SUB     SP, SP, #0x1C
    ROM:080B4D7C                 BL      isSafari        ; Return 1 if player is in Safari Park, 0 otherwise
    ROM:080B4D80                 CMP     R0, #1
    ROM:080B4D82                 BNE     hasFirstPokemonSync ; If the player is not in the Safari Park, directly jump to the classic Method H's Sync check
    ROM:080B4D84                 BL      PRNG
    ROM:080B4D88                 LSLS    R0, R0, #0x10
    ROM:080B4D8A                 LSRS    R0, R0, #0x10
    ROM:080B4D8C                 MOVS    R1, #0x64
    ROM:080B4D8E                 BL      Mod
    ROM:080B4D92                 LSLS    R0, R0, #0x10
    ROM:080B4D94                 LSRS    R0, R0, #0x10
    ROM:080B4D96                 CMP     R0, #0x4F
    ROM:080B4D98                 BHI     hasFirstPokemonSync ; 80 % : do "Pokéblock to wild Pokémon nature"
    ROM:080B4D98                                         ; 20 % : directly jump to the classic Sync check
    ROM:080B4D9A                 BL      isPkblckSet     ; Return 0 if there isn't any Pokéblock put in the current zone's Pokéblock feeder.
    ROM:080B4D9A                                         ; Otherwise, return the the Pokéblock in the current zone's Pokéblock feeder structure's adress
    ROM:080B4D9E                 MOVS    R7, R0
    ROM:080B4DA0                 CMP     R7, #0
    ROM:080B4DA2                 BEQ     hasFirstPokemonSync
    ROM:080B4DA4                 MOVS    R5, #0
    ROM:080B4DA6
    ROM:080B4DA6 loc_80B4DA6                             ; CODE XREF: chooseNature+3Cj
    ROM:080B4DA6                 MOV     R1, SP
    ROM:080B4DA8                 ADDS    R0, R1, R5
    ROM:080B4DAA                 STRB    R5, [R0]
    ROM:080B4DAC                 ADDS    R0, R5, #1
    ROM:080B4DAE                 LSLS    R0, R0, #0x18
    ROM:080B4DB0                 LSRS    R5, R0, #0x18
    ROM:080B4DB2                 CMP     R5, #0x18
    ROM:080B4DB4                 BLS     loc_80B4DA6     ; Fill *(sp + n) by n from 0 to 24 (nature IDs)
    ROM:080B4DB6                 MOVS    R5, #0
    ROM:080B4DB8
    ROM:080B4DB8 shuffleNatures                          ; CODE XREF: chooseNature+76j
    ROM:080B4DB8                 ADDS    R1, R5, #1      ; 300 iterations
    ROM:080B4DBA                 LSLS    R0, R1, #0x18
    ROM:080B4DBC                 LSRS    R4, R0, #0x18
    ROM:080B4DBE                 MOVS    R6, R1
    ROM:080B4DC0                 CMP     R4, #0x18
    ROM:080B4DC2                 BHI     loc_80B4DE8
    ROM:080B4DC4                 ADD     R5, SP
    ROM:080B4DC6
    ROM:080B4DC6 shuffleDecision                         ; CODE XREF: chooseNature+6Ej
    ROM:080B4DC6                 BL      PRNG
    ROM:080B4DCA                 MOVS    R1, #1
    ROM:080B4DCC                 ANDS    R1, R0
    ROM:080B4DCE                 CMP     R1, #0
    ROM:080B4DD0                 BEQ     loc_80B4DDE     ; 1/2 chance (if PRNG result is odd)
    ROM:080B4DD2                 LDRB    R2, [R5]        ; Swap nature IDs at *sp and *(sp + r4)
    ROM:080B4DD4                 MOV     R0, SP
    ROM:080B4DD6                 ADDS    R1, R0, R4
    ROM:080B4DD8                 LDRB    R0, [R1]
    ROM:080B4DDA                 STRB    R0, [R5]
    ROM:080B4DDC                 STRB    R2, [R1]
    ROM:080B4DDE
    ROM:080B4DDE loc_80B4DDE                             ; CODE XREF: chooseNature+58j
    ROM:080B4DDE                 ADDS    R0, R4, #1
    ROM:080B4DE0                 LSLS    R0, R0, #0x18
    ROM:080B4DE2                 LSRS    R4, R0, #0x18
    ROM:080B4DE4                 CMP     R4, #0x18
    ROM:080B4DE6                 BLS     shuffleDecision
    ROM:080B4DE8
    ROM:080B4DE8 loc_80B4DE8                             ; CODE XREF: chooseNature+4Aj
    ROM:080B4DE8                 LSLS    R0, R6, #0x18
    ROM:080B4DEA                 LSRS    R5, R0, #0x18
    ROM:080B4DEC                 CMP     R5, #0x17
    ROM:080B4DEE                 BLS     shuffleNatures
    ROM:080B4DF0                 MOVS    R5, #0
    ROM:080B4DF2
    ROM:080B4DF2 loc_80B4DF2                             ; CODE XREF: chooseNature+94j
    ROM:080B4DF2                 MOV     R1, SP
    ROM:080B4DF4                 ADDS    R4, R1, R5
    ROM:080B4DF6                 LDRB    R0, [R4]        ; Load each nature to r0
    ROM:080B4DF6                                         ; Reminder : the nature IDs list has been shuffled
    ROM:080B4DF8                 MOVS    R1, R7
    ROM:080B4DFA                 BL      doesPkmLikesPblck
    ROM:080B4DFE                 LSLS    R0, R0, #0x10   ; Negative sign will be kept if r0 <= 32768
    ROM:080B4E00                 CMP     R0, #0
    ROM:080B4E02                 BGT     PokeblockSuccessful ; If the Pokémon's nature likes the Pokéblock, load this nature
    ROM:080B4E04                 ADDS    R0, R5, #1
    ROM:080B4E06                 LSLS    R0, R0, #0x18
    ROM:080B4E08                 LSRS    R5, R0, #0x18
    ROM:080B4E0A                 CMP     R5, #0x18
    ROM:080B4E0C                 BLS     loc_80B4DF2     ; If not any nature likes the Pokéblock, the determination is a failure.
    ROM:080B4E0C                                         ; The game will jump to the classic Sync determination.
    ROM:080B4E0E
    ROM:080B4E0E hasFirstPokemonSync                     ; CODE XREF: chooseNature+Aj
    ROM:080B4E0E                                         ; chooseNature+20j ...
    ROM:080B4E0E                 LDR     R4, =0x20244EC
    ROM:080B4E10                 MOVS    R0, R4
    ROM:080B4E12                 MOVS    R1, #6
    ROM:080B4E14                 BL      sub_806A518
    ROM:080B4E18                 CMP     R0, #0
    ROM:080B4E1A                 BNE     loc_80B4E4C
    ROM:080B4E1C                 MOVS    R0, R4
    ROM:080B4E1E                 BL      sub_806B6D8
    ROM:080B4E22                 LSLS    R0, R0, #0x18
    ROM:080B4E24                 LSRS    R0, R0, #0x18
    ROM:080B4E26                 CMP     R0, #0x1C
    ROM:080B4E28                 BNE     randomNature
    ROM:080B4E2A
    ROM:080B4E2A Sync
    ROM:080B4E2A                 BL      PRNG
    ROM:080B4E2E                 LSLS    R0, R0, #0x10
    ROM:080B4E30                 LSRS    R0, R0, #0x10
    ROM:080B4E32                 MOVS    R1, #1
    ROM:080B4E34                 ANDS    R0, R1
    ROM:080B4E36                 CMP     R0, #0
    ROM:080B4E38                 BNE     loc_80B4E4C
    ROM:080B4E3A                 MOVS    R0, R4
    ROM:080B4E3C                 MOVS    R1, #0
    ROM:080B4E3E                 BL      sub_806A518
    ROM:080B4E42                 B       randomNature
    ROM:080B4E2A Sync
    ROM:080B4E2A                 BL      PRNG
    ROM:080B4E2E                 LSLS    R0, R0, #0x10
    ROM:080B4E30                 LSRS    R0, R0, #0x10
    ROM:080B4E32                 MOVS    R1, #1
    ROM:080B4E34                 ANDS    R0, R1
    ROM:080B4E36                 CMP     R0, #0
    ROM:080B4E38                 BNE     randomNature
    ROM:080B4E3A                 MOVS    R0, R4
    ROM:080B4E3C                 MOVS    R1, #0
    ROM:080B4E3E                 BL      sub_806A518
    ROM:080B4E42                 B       Nature_setup
    ROM:080B4E42 ; ---------------------------------------------------------------------------
    ROM:080B4E44 dword_80B4E44   DCD 0x20244EC           ; DATA XREF: chooseNature:hasFirstPokemonSyncr
    ROM:080B4E48 ; ---------------------------------------------------------------------------
    ROM:080B4E48
    ROM:080B4E48 PokeblockSuccessful                     ; CODE XREF: chooseNature+8Aj
    ROM:080B4E48                 LDRB    R0, [R4]
    ROM:080B4E4A                 B       loc_80B4E5E
    ROM:080B4E4C ; ---------------------------------------------------------------------------
    ROM:080B4E4C
    ROM:080B4E4C randomNature                            ; CODE XREF: chooseNature+A2j
    ROM:080B4E4C                                         ; chooseNature+B0j ...
    ROM:080B4E4C                 BL      PRNG
    ROM:080B4E50                 LSLS    R0, R0, #0x10
    ROM:080B4E52                 LSRS    R0, R0, #0x10
    ROM:080B4E54
    ROM:080B4E54 Nature_setup                            ; CODE XREF: chooseNature+CAj
    ROM:080B4E54                 MOVS    R1, #0x19
    ROM:080B4E56                 BL      Mod
    ROM:080B4E5A                 LSLS    R0, R0, #0x18
    ROM:080B4E5C                 LSRS    R0, R0, #0x18
    ROM:080B4E5E
    ROM:080B4E5E loc_80B4E5E                             ; CODE XREF: chooseNature+D2j
    ROM:080B4E5E                 ADD     SP, SP, #0x1C
    ROM:080B4E60                 POP     {R4-R7}
    ROM:080B4E62                 POP     {R1}
    ROM:080B4E64                 BX      R1
    ROM:080B4E64 ; End of function chooseNature
    ROM:080B4E64
    ROM:080B4E64 ; ---------------------------------------------------------------------------
    Code:
    ROM:08136FE4 ; =============== S U B R O U T I N E =======================================
    ROM:08136FE4
    ROM:08136FE4
    ROM:08136FE4 doesPkmLikesPblck                       ; CODE XREF: chooseNature+82p
    ROM:08136FE4                 PUSH    {R4-R7,LR}
    ROM:08136FE6                 MOV     R7, R9
    ROM:08136FE8                 MOV     R6, R8
    ROM:08136FEA                 PUSH    {R6,R7}
    ROM:08136FEC                 MOV     R8, R1
    ROM:08136FEE                 LSLS    R0, R0, #0x18
    ROM:08136FF0                 LSRS    R0, R0, #0x18
    ROM:08136FF2                 MOVS    R6, #0
    ROM:08136FF4                 MOVS    R4, #0
    ROM:08136FF6                 LDR     R1, =tasteLookupStructList ; This list is stored at 0x085B25A0 (Emerald U).
    ROM:08136FF6                                         ; It contains the tastes of each of the 25 natures.
    ROM:08136FF8                 MOV     R9, R1
    ROM:08136FFA                 LSLS    R1, R0, #2
    ROM:08136FFC                 ADDS    R7, R1, R0      ; r7 = nature * 5
    ROM:08136FFE
    ROM:08136FFE loc_8136FFE                             ; CODE XREF: doesPkmLikesPblck+4Aj
    ROM:08136FFE                 ADDS    R0, R4, #1
    ROM:08137000                 LSLS    R0, R0, #0x18
    ROM:08137002                 LSRS    R5, R0, #0x18
    ROM:08137004                 MOV     R0, R8
    ROM:08137006                 MOVS    R1, R5
    ROM:08137008                 BL      sub_8136F9C     ; Load *(currentZone_Feeder_Pokeblock + counter) into r0.
    ROM:08137008                                         ; This corresponds to the taste[counter] level of the feeder's Pokéblock.
    ROM:0813700C                 LSLS    R0, R0, #0x10
    ROM:0813700E                 ASRS    R1, R0, #0x10
    ROM:08137010                 CMP     R1, #0
    ROM:08137012                 BLE     loc_813702A     ; If Pokéblock.taste[counter] = 0 (tast not present, e.g taste[0] means the PBlock is not spicy), or
    ROM:08137012                                         ; Pokéblock.taste[counter] < 0  <=> (u8) Pokéblock.taste[counter] > 128, continue loop.
    ROM:08137014                 ADDS    R0, R7, R4
    ROM:08137016                 ADD     R0, R9
    ROM:08137018                 LDRB    R0, [R0]        ; Load tasteLookupStructList[counter +  nature*5].
    ROM:08137018                                         ; This is :
    ROM:08137018                                         ; 0 if the nature makes the Pokémon indifferent to the taste
    ROM:08137018                                         ; 1 if the nature makes the Pokémon like the taste
    ROM:08137018                                         ; -1 if the nature makes the Pokémon dislike the taste
    ROM:0813701A                 LSLS    R0, R0, #0x18
    ROM:0813701C                 ASRS    R0, R0, #0x18
    ROM:0813701E                 MULS    R1, R0          ; Multiply Pokéblock.taste[counter] with tasteLookupStructList[nature * 5 + counter]
    ROM:08137020                 LSLS    R0, R6, #0x10
    ROM:08137022                 ASRS    R0, R0, #0x10
    ROM:08137024                 ADDS    R0, R0, R1      ; Perform currentResult += previousResult (0 if there isn't any)
    ROM:08137026                 LSLS    R0, R0, #0x10
    ROM:08137028                 LSRS    R6, R0, #0x10
    ROM:0813702A
    ROM:0813702A loc_813702A                             ; CODE XREF: doesPkmLikesPblck+2Ej
    ROM:0813702A                 MOVS    R4, R5
    ROM:0813702C                 CMP     R4, #4
    ROM:0813702E                 BLS     loc_8136FFE
    ROM:08137030                 LSLS    R0, R6, #0x10
    ROM:08137032                 ASRS    R0, R0, #0x10
    ROM:08137034                 POP     {R3,R4}
    ROM:08137036                 MOV     R8, R3
    ROM:08137038                 MOV     R9, R4
    ROM:0813703A                 POP     {R4-R7}
    ROM:0813703C                 POP     {R1}
    ROM:0813703E                 BX      R1
    ROM:0813703E ; End of function doesPkmLikesPblck
    ROM:0813703E ; ---------------------------------------------------------------------------
    This routine is described in this (simplified) diagram :
    Diagram (open)
    [​IMG]
  8. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    PokeBlock Success Calc

    Emerald Only...

    Since PokeBlock Calc happens before PokeBlock Check (which is before sync), we can assume it would be after ESV and Level (those 2 are essentially always one after another) but before Sync/Nature determination.

    General Logic (open)
    Code:
    0 - Initial
    1 - Battle
    2 - ESV
    3 - Level
    4 - PokeBlock
     Fail
      a - Sync/Nature (failed block calc)
        a* - Nature (failed sync)
     Pass
      b - Build / Decide
        c - Sync/Nature (failed table)
           c* - Nature (failed sync)


    Code:
    PokeBlock
    
    n     - Initial
    n + 1 - ESV
    n + 2 - Level
    n + 3 - PokeBlock
    n + 4 - Nature
    
    PokeBlock Success: High16 % 100, if (0-79) pass, 
                check to see if PokeBlock is present. 
                                   Else, do sync/nature.
    Fail Example (open)

    Code:
    Pre-Scent: 
    Pink PokeBlock (Cute)
    Timid/Hasty/Jolly/Naive
    
    Seed: B019BA60 on vblank patched version for sanity
    Quiet 3/16/15/7/16/12 -> not 
    male slot8 M1
    H1's frame 6 has this spread but slot is normally 1 (8 is previous frame slot)
  9. Tux

    Tux

    Joined:
    Dec 1, 2011
    Messages:
    11
    @Reject Monk Poop :
    The "80 % calc" is done before checking if a Pokéblock is present (sorry, I forgot to add pseudo-code)

    Code:
    Fill listNatures[n] with n, for n from 0 to 24 included (increment by 1 every iteration)
    
    Randomization (300 iterations) : 
    For i from 0 to 24 excluded (incremented by 1 every iteration)
    	For j from i+1 to 24 included (incremented by 1 every iteration)
    		If ((rand() AND 1) != 0) // 1/2 chance (if PRNG result is odd)
    			Swap listNatures[0] with listNatures[j]
    		EndIf 
    	EndFor
    EndFor
    
    Checking :
    For n from 0 to 24 included (increment by 1 every iteration)
    	Does nature listNatures[n] likes the Pokéblock in the feeder ? If so, select this nature
    EndFor  
    
    If not any nature like the Pokéblock : Sync ...
    
  10. Biosci

    Biosci !
    is a Community Contributor Alumnusis a Contributor Alumnusis a VGC3 Winner

    Joined:
    Apr 7, 2011
    Messages:
    1,469
    Okay, so last couple days MMX and I have been doing some testing on how much the rain and thunder Thundurus creates advances the PID. A few things we've been able to establish so far through our trial and error testing of a few different seeds:

    -The rain Thundurus creates remains at ~420 PID Advances.

    -Number of Lightning strikes may be associated with the number of advances or PID frame you would hit with only 1 strike of lightning.

    -Even with multiple numbers of advancements, you still might lead to one frame.

    Here is the link to all the data we've recorded for our tests and attempts to RNG Thundurus:
    https://docs.google.com/spreadsheet...GVKVWtKWnlFRGE5M1hhalBTbDZjUHc&hl=en_US#gid=0


    So pretty much, one thing that I've noticed about that Thundurus that makes it different from Tornadus is the way you can determine if the desired PID frame is reachable or not. For Tornadus, if you hit 1 under or over the frame, you can't hit it. If you hit 2 under or over, you could nearly always hit the frame. For Thundurus, there seems to be an entirely different process for this. As you can see in the notes we have, I hit every possible number of advancements, but due to the amount of lightning on some advancements I couldn't hit the frame.

    MMX and I will still be doing some more testing on different seeds to try and find more results. Any help is appreciated, so just feel free to pop in on IRC and help him and I with this. Thanks
  11. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    wrong lol (open)
    PokeBlock to psuedocode!

    Code:
    n     - Initial
    n + 1 - ESV
    n + 2 - Level
    n + 3 - PokeBlock       U16%100, if less than 80 (80%) pass.
       set b = 0
    n + 4 - ???? (something? not related to one taste blocks)
    
    --------------------------
    Start PokeBlock Loop
    
           n + 5 + 3b - Nature#
           n + 6 + 3b - PID1
           n + 7 + 3b - PID2
    Code:
    
    if (PID2_PID1)%25 = Nature#
       -Pass -> Check if nature like the block.
             Yes -> Keep PID, generate IVs, break
             No  -> Throw out Nature# and PID, start loop again.
                        b = b + 1
       -Fail
                   -> Throw out Nature# and PID, start loop again.
                        b = b + 1
    
    if b = 300
     break loop, do Sync/Nature calc.
    Basically the game does sets of 3 calcs (Nature, PID1 PID2), and does checks to see if it's a valid PID. Stops after 300 attempts.

    Code:
    Pre-Scent: 
    Pink PokeBlock (Cute)
    Timid/Hasty/Jolly/Naive
    
    
    B019BA60
    Naive 14/20/28/28/6/1
    F slot1 M1
    213	257	333	337
    2	0	2	0
    
    Nature #'s for Nature
    Naive	14
    Timid	10
    Hasty	11
    Jolly 	13
    
    Method 1 Spread Occurrences
    Naive: 14 23  65 122 164 191 315 336* (hit)
    Timid: 61 85 109 111 179 206 217 
    	     225 242 256 274 284
    	     310 317 331 354
    Jolly:  3 30  79 154 162 163 194 
    	     200 208 216 233 269 
    	     278 291 324 361
    Hasty	33 42 64  92 143 148 173
    	     180 199 204 273 288
    	     307 334 358
    Excel Sheet Formulas:

    Code:
    C3 - =IF(AND((F3 = H3),(OR(H3=11,H3=13,H3=14,H3=10))), "PASS","")
    D3 - =DEC2HEX(HEX2DEC(B3)/65536)
    E3 - =CONCATENATE(D5,D4)
    F3 - =MOD(MOD(HEX2DEC(E3),500),25)
    
    Row 3 then gets columns C-F pasted down the entire output.
    Code:
    seed     - nature frame matches subsequent PID2_PID1
    73C498CC - pass 323 - 106 iterations
    B019BA60 - pass 335 - 110 iterations
    112D68BB - pass 350 - 115 iterations
    
    frame = 5 + 3b, b must be integer.
    Code:
    Commentary on this Calculation and its effectiveness:
    
    The chance for a given iteration to work is 
       (4/25) for a proper nature PID, 
         * (1/25) for a PID to match the Nature# the frame before.
    
    25^2/4 = 157 iterations average for a success. 
    Given 300 iterations, the cumulative distribution function implies 
            it won't be uncommon to go beyond 300 iterations 
            (and thus fail when it should pass).
    
    Badly designed mechanic in my opinion :P
    It's best to use the pure one-flavor PokeBlock, the FlavorDecide calc is always there.

    Basically, 2 dummy calcs are added in to the mix for Emerald Safari if no PokeBlock is present. If there is one, it would go through this alternate PID finding method instead of the usual nature->PID loop.

    If one were to add a Vital Spirit lead, it would be a gap of 3 (same as a failed sync+2).

    I should just mention that Vital Spirit acts as a perma-fail sync.
  12. Tux

    Tux

    Joined:
    Dec 1, 2011
    Messages:
    11
    I don't agree with your understandings. In fact, the PID is generated AFTER the nature has been determined. Here is some C++ (pseudo-)code :
    Code:
    void methodH(){
    	buildPkm(chooseNature());
    }
    
    u8 chooseNature(){
    	if (isPlayerinSafari() && (rand() % 100 <= 79) && isPokeblockSet()){
    		//Safari Pokéblock routine
    		u8 listOfNatures[25];
    		for(u8 n = 0; n <= 24; n++) listOfNatures[n] = n; // Fill the list of natures
    
    		for(u8 i = 0; i < 24; i++) // 300 iteration. Randomize the list
    			for(u8 j = i+1; j <= 24; j++)
    				if((rand() & 1) == 0){
    					exchangeValues(listOfNatures[0], listOfNatures[j]);
    
    		for(u8 m = 0; m <= 24; m++)
    			if((doesThePokemonLikesPokeblock(listOfNatures[m]) << 16 /* Sign keeped if >= -32768 */ ) >= 0)
    				return listOfNatures[m];
    		goto SyncCheck; // If no nature likes the Pokéblock			 
    	}
    	else goto SyncCheck;
    
    SyncCheck : if(doesTheFistPartyPokemonHaveSync() && ((rand() & 1) == 0) ) return natureOfFirstPartyPokemon; // Not in R/S
    	else return (rand() % 25); 
    }
    
    void buildPokemon(u8 nature){
    	u16 uPID = 0, lPID = 0, tempPID = 0, finalPID = 0;
    	//BUILD PID
    	while((tempPID % 25) != nature){
    		lPID = rand();
    		uPID = rand() << 16;
    		tempPID = lPID | uPID;
    	}
    	finalPID = tempPID;
    	//BUILD IV
    	// ... ... ...
    }
    
  13. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    Ok that makes a little bit more sense. A few more tries I invalidated what I thought was true. But I do see it your way:

    Code:
    n     - Initial
    n + 1 - ESV
    n + 2 - Level
    n + 3 - PokeBlock
    ...?
    300x natures generated
    ...find first nature that likes block, set = nature#
    Generate PIDs until %25 = nature#
    I still don't understand the if "PRNG is odd, shuffle" part however :(

    Examples of the game passing the PokeBlock calc and building the table (open)


    Code:
    Seed	73C498CC
    Frame 	324	Naive	425B447C
    
    From the seed, first %25=naive occurs on frame
    10
    before the hit frame.
    
    This nature is the first nature that likes the block,
         no shuffle required.
    
    Code:
    Seed	A855A882
    Frame 	340	Hasty	EAA0C357
    
    From the seed, first %25=hasty occurs on frame
    6
    
    This nature is the first nature that likes the block,
         no shuffle required.
    
    Code:
    Seed	112D68BB
    Frame 	352	Jolly	AF3797E3
    
    From the seed, %25=jolly occurs on frames
    23
    
    THIS IS NOT THE FIRST LIKING NATURE WITHOUT SHUFFLING.
    
    Code:
    Seed	B019BA60
    Frame	336	Naive	425B447C
    
    From the seed, first %25=naive occurs on frame
    17
    
    THIS IS NOT THE FIRST LIKING NATURE WITHOUT SHUFFLING.
    
    I'm not a programmer, but I do get what's going on most of the time...
    Only programming experience is a semester of MATLAB :(
  14. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    Magnet Pull / Static in Emerald
    How Many Calls? (open)


    First, we have to find out how it alters Method H to get the ability to work. We start by just generating random tests with a vBlank free version of Emerald on VBA-RR.

    Code:
    Seed: 7BE78549
    Location: [URL="http://bulbapedia.bulbagarden.net/wiki/Victory_Road_(Hoenn)"]Victory Road 1F[/URL]
    
    Code:
    Advancements	Result		Pass(0)/Fail(1)
    N + 0 (Serious)	Frame 2 H1
    Slot 8 or 10	PASS		0
    
    N + 1 (Brave)	Frame 3 H1
    Slot 8 or 10	PASS		0
    
    N + 2 (Careful)	Frame 4 H1
    Slot 1		FAIL		1
    
    N + 3 (Lax)	Frame 5 H1
    Slot 0		FAIL		1
    
    N + 4 (Brave)	Frame 6 H1
    Slot 8 or 10	PASS		0
    
    N + 5 (Gentle)	Frame 7 H1
    Slot 1		FAIL		1
    
    N + 6 (Serious)	Frame 8 H1
    Slot 8 or 10	PASS		0
    Notice that there's a gap of one frame between the method H frame and what we should have hit. The ones that altered the slots had a different calc then the regular ESV determination. We see that all the fails follow method H, but all the passes have different encounter slots.

    By using logic of call placement... this means that there's a total of 1 extra call, with a replacement ESV calc if the first one passes.
    Call Determination (open)


    From the previous section, we've seen that there's one extra call that doesn't mess up failed attempts. So it has to go before ESV so that the example fails are predicted properly. If the ability passes, the game has to decide which slot to choose. So after this first decision it will branch to 2 different calcs, direction depending on the first result.

    Call Order
    Code:
    n + 0	Initial
    n + 1	Decision
             |->Pass => n + 2 v-Slot#
    	 \->Fail => n + 2 ESV
    n + 3	Level
    n + 4	Nature#
    
    But wait! We don't know how these 2 new calcs work! Time to go to Researcher.
    1. We mark the passes 0, and the fails 1. Look back up, I've already done this.
    2. In researcher, we see test various calcs to get a matching string of numbers.
      • The calc that works is "High16 % 2", which is identical to the sync calc!
      • For ease of calculating in game, we'll use High16 & 1, for the same results.
    3. Ok, so now we know how to predict if the ability will activate. But how does the second decide which slot to pick?

    Unfortunately Victory Road only has 2 steel slots (and they are identical level/pokemon). Time to choose a new place from the game's encounter slot table.

    Granite Cave B1F has a good set of slots, and it's where we head off to now. Lets use the same seed, but RAM Hack it back in to the seed location so that our results are consistent with the first set we already observed.

    Code:
    Seed: 7BE78549
    Location: [URL="http://bulbapedia.bulbagarden.net/wiki/Granite_Cave"]Granite Cave B1F[/URL]
    
    Code:
    Frame	Result
    1	Slot 4 (3rd Valid)	2
    2	Slot 3 (2nd Vaild)	1
    3	no pass			x
    4	no pass			x
    5	Slot 3 (2nd Vaild)	1
    6	no pass			x
    7	Slot 3 (2nd Vaild)	1
    8	no pass			x
    9	Slot 2 (1st Vaild)	0
    
    If we look left to right on the Encounter Table, we can see that there's 3 slots possible to be picked from.

    1. Let's call the leftmost steel-slot "1st Vaild", and going right we call 'em accordingly. The above list dictates this.
    2. For all the failed frames, let's put a x, because the game does %100 for the ESV (which we observed for a failed first calc in the first test). We can't know those values.
    3. Now we assign "1st Vaild" to "0", "2nd Vaild" to "1", etc.
    4. Now we have to find a calc such that we get the proper numbers.
      • High16 % 3 works!
      • If there's a different amount of valid slots (this example has 3), we'd just replace 3 with the # of Valid Slots for the location.
    5. We've got our 2nd and final calc. Now to post-up the final call structure the game uses!


    Call Order
    Code:
    n + 0	Initial
    n + 1	SlotForce
             |->Pass => n + 2 FVSlot
    	 \->Fail => n + 2 ESV
    n + 3	Level
    n + 4	Nature#
    
    Calculations
    Code:
    SlotForce	High16 & 1	If 0, Pass. Do FVSlot
    				If 1, Fail. Do ESV
    
    FVSlot		High16 % (#Valid Slots)
    		Left to Right selection, no slot preference!
    SlotForce - Force a certain slot with typing according to the ability.
    FVSlot - Find Valid Slot, in which left to right valid slot# is used.
  15. chiizu

    chiizu PPPPPPPPPPPPPPPPP RNG
    is a Programmeris a Pokemon Researcher

    Joined:
    Nov 12, 2010
    Messages:
    404
    Please verify the above seed details, including date (year of the date is 2011, correct?), start time, MAC address, that there were no button presses, and that the C-Gear was never turned on. I have searched Nazos in the range 0x0275F800 to 0x02761800 for seconds 25 to 33 with no matches. I will have limited time to work directly on this for the next few days so I will set up a larger search range that I can leave running, but if something is indeed not correct in the above information it would be good to know sooner rather than later.
  16. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
    I think we can be assured that the C-Gear was never turned on, because if that had happened, I would most likely not have found an initial seed that matches the IVs AND the starting frame that corresponds with the natures. Tux got Quirky and Naive, in that order, and at the starting frame for C74B7FB378FBE9C9 (49) the first two natures are Quirky and Naive.
  17. ΩDonut

    ΩDonut don't glaze me bro
    is a Programmeris a Forum Moderatoris a Community Contributoris a Pokemon Researcheris a Contributor to Smogon
    Moderator

    Joined:
    Aug 23, 2006
    Messages:
    3,727
  18. chiizu

    chiizu PPPPPPPPPPPPPPPPP RNG
    is a Programmeris a Pokemon Researcher

    Joined:
    Nov 12, 2010
    Messages:
    404
    Turns out the A-button was being held down (or most likely being tapped rapidly).
    French White DSi Parameters (open)

    Code:
    Nazo: 0x02760250
    Timer0: 117c
    VCount: 86
    VFrame: 7
    


    French Black DSi Parameters (open)

    Code:
    Nazo: 0x02760230
    Timer0: 115c
    VCount: 86
    VFrame: 8
    


    And as requested, here is a download link for my Nazo searcher.
    Some notes:
    Nazo Searcher Info (open)


    • This program requires OpenCL 1.0, which I believe is available from the major video card manufacturers. On Macs, it can be run on the CPU as well.
    • This program is not user friendly; it requires recompilation in order to search for a new seed, or to adjust the Nazo search range. The parameters are set as variables at the beginning of the DoFullSearch function. The program also expects the OpenCL code file to be located in a particular directory relative to the executable, so change that as appropriate.
    • I took a sample OpenCL program from Apple and adapted it for this, so the code is not particularly clean. Also, it probably won't compile on Windows without some modifications because it makes use of a some Mach functions available in Mac OS X for time measurements. Those are easily removed or replaced with appropriate equivalents.
    • The OpenCL code contains functions for different integer vector sizes because I was testing which size worked best. For running on my CPU (I have a lousy graphics card) it works fastest using uint8 vectors, so that is the version I ended up optimizing (by working in a 16-word buffer rather than an 80-word buffer and unrolling all of the loops in the SHA1 hash code). Switching to use a different vector size requires tweaks in the C++ code that calls the OpenCL code in order to set the work size correctly. Switching to using the GPU requires a change in the device type argument of the first OpenCL call in the main function.
    • Since we know the general range of Timer0 and VCount for DSi now, the search could be made a couple hundred times faster by limiting the Timer0 and VCount search ranges. I prefer the complete coverage (also I couldn't be bothered to do it), since it doesn't generally take all that long to find the result anyway.
    • It's probably safe at this point to start on an odd-numbered 16-byte aligned Nazo value and increment it by 0x20 each time to cut the search time in half.
    • Pretty much none of this code is in PPRNG, except for the optimized SHA1 hashing code. PPRNG uses a similar concept of building the message once and only modifying the bits that change between each seed in order to save on search time, however. (I really am planning to release the PPRNG code soon...)
    • Standard Disclaimer: I make no promises that this won't destroy your computer in some way.
  19. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    PokéRadar Abuse
    trying to be more transparent/verbose with the research process and conclusions so that other people can see how this works

    After chatting a bit about the lack of stuff to do, the topic of PokéRadar abuse popped up. We are all now very familiar with how each game likes to handle calcs. OmegaDonut said he had a seed which produced a shiny Radar patch with a count of 39. Seed - 1E3863CE.

    We know that DPPt almost exclusively uses the div operation ( / ), so let's take a look at the seed.

    In researcher, we see this:
    Code:
    0	1E3863CE
    ....
    6	0098BB4C	0098	BB4C
    I've only shown frame 6, as it is an "Extreme" seed (low/high). Take a look at that High16. It's really low, which would indicate that if this calc was the one that determined shininess; it would likely be 0 after the determination. For now we assume it is a div operation, but what is the calc?!

    • From the onsite article, the chance of a shiny patch at a chain of 39 is 1 in 400.
    • After the div operation, the High16 must be distributed between 1 and 400.
    • Adjust it to RNG numbers, you have (0,399).
    • The High16 ranges from 0 to 65535.
    • 65535 (max value) / div value (rounded down result < 400) ensures (0,399).
      • div value = ~163.838. That's not a round number.
      • To ensure that it is always within (0,399), the div is instead 164 (0xA4)

    Ok, so we then do High16 / 0xA4 [HEX], and lo and behold our ShinyPatch determination comes out to 0, being true! We then test similar low-value seeds and we see that this is a valid description of how PokéRadar determines whether a patch will be shiny (for a chain of 39).

    Hold on, we have to make sure the probabilities for all of the chain counts are correct. Turns out, they aren't!

    ====================

    Correcting the Onsite Article

    The game does operations in steps, flooring between each one. If we take the given probability calc:

    Code:
    Probability = floor((14747 – 40 × c) ÷ (1640 – 40 × c)) ÷ 65536
    Remove the "÷ 65536" and we actually end up with the div the game uses! So what's wrong with the article? The probabilities aren't right.

    • The High16 values the game uses range from 0 to 65535, it's just Hex. (0x0 - 0xFFFF).
    • If we divide the maximum value of the RNG by the div (65535/div) and floor it, we get the maximum value.
    • Do the same for the minimum value (0/div) and you get a max/min distribution of (0,Max).
    • How many numbers occupy this range? Max+1.
      • This is our probability of something being shiny. 1/(Max+1)

    Now we re-generate the list of probabilities, and you are left with this:
    Chain Count vs Probability (open)

    (Download Spreadsheet)

    Code:
    Chain	Probability
    0	1 in 8192
    1	1 in 7282
    2	1 in 7282
    3	1 in 7282
    4	1 in 7282
    5	1 in 6554
    6	1 in 6554
    7	1 in 6554
    8	1 in 6554
    9	1 in 5958
    10	1 in 5958
    11	1 in 5958
    12	1 in 5462
    13	1 in 5462
    14	1 in 5042
    15	1 in 5042
    16	1 in 4682
    17	1 in 4682
    18	1 in 4370
    19	1 in 4370
    20	1 in 4096
    21	1 in 3856
    22	1 in 3641
    23	1 in 3450
    24	1 in 3277
    25	1 in 3121
    26	1 in 2979
    27	1 in 2731
    28	1 in 2521
    29	1 in 2341
    30	1 in 2185
    31	1 in 1986
    32	1 in 1772
    33	1 in 1599
    34	1 in 1395
    35	1 in 1192
    36	1 in 993
    37	1 in 800
    38	1 in 596
    39	1 in 400
    40+	1 in 200


    Compare this to the Onsite Article (example: chain=37). The odds are worse by ~1 for a few of the chain values!

    By working it out with knowledge of how the game computes, we see that the onsite probabilities are wrong. The Onsite Article did not do the flooring when calculating the probability; it instead rounded so that the c=40 chain was 200 instead of 199 (to make it line up with actual data, wrong thing to do!).

    Improper Rounding was done like this: =ROUND((1/(FLOOR((14747-40*c)/(1640-40*c),1)/65536)),0). It should have been floored and +1. All the numbers that rounded down caused the discrepancy of 1.

    How would the game decide what is in a (would be) shiny patch if the chain was 0? Nothing is chained! We still have to make sure that this is actually how the game acts!


    ====================

    So now that that's cleared up, we are now left with the actual div values the game uses to determine if the shaking spot is shiny or not.

    Div Values in relation to Chain Count (open)
    Code:
    Chain	DivDec	DivHex
    0	8	8
    1	9	9
    2	9	9
    3	9	9
    4	9	9
    5	10	A
    6	10	A
    7	10	A
    8	10	A
    9	11	B
    10	11	B
    11	11	B
    12	12	C
    13	12	C
    14	13	D
    15	13	D
    16	14	E
    17	14	E
    18	15	F
    19	15	F
    20	16	10
    21	17	11
    22	18	12
    23	19	13
    24	20	14
    25	21	15
    26	22	16
    27	24	18
    28	26	1A
    29	28	1C
    30	30	1E
    31	33	21
    32	37	25
    33	41	29
    34	47	2F
    35	55	37
    36	66	42
    37	82	52
    38	110	6E
    39	164	A4
    40+	328	148


    But what's the overall call order that happens when the PokéRadar is activated?

    • There are confirmed cases of double shiny patches, thus it doesn't prevent multiple patches.
    • Shifting the example seed forward or backward 2 frames causes a different patch to appear shiny.
    • The game doesn't waste frames for no reason. All are used.
    • Certain low value seeds should create shiny patches, but don't.
      • The Pokemon of the patch doesn't match the chain.
      • The Pokemon of a patch is determined before the patch's shiny determination.
    So what we're dealing with is a set of 2 calc for each spot.
    Even frames determine Shiny. One would think that GrassType(Slot)->Shiny is the most logical answer. But how is the placement determined?

    We are now a little ahead of ourselves -- the overall structure of the PokéRadar calls has yet to be ironed out!

    ~soon™
  20. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    WORK IN PROGRESS

    just so we can see what happens and make sense of any debugging if needed

    Calls following an Activated PokéRadar

    First we must chain something. If we don't have a chain, we can't have any shiny patches.

    By noting the current seed BEFORE and AFTER activating the PokéRadar, we can find out how many calls happen if we activate it. If we try it a few times with different seed, we can see that the current seed after activating is 12 frames after the initial. So, 12 random numbers are used to calculate how the PokéRadar gives patches.

    We know that each patch requires 2 calls (for ESV and Shiny). That leaves us with 4 position calls, and 4x2 calls for ESV/Shiny. Perfect!

    Upon further observation (first 4 call debugging courtesy of Bond697), we see that the game calculates position with 4 different divisions - 0x20, x18, 0x10, 0x8. After the 4 positions, slot and shiny are determined. But how does the game position?

    Code:
    Div values the game uses to determine position: 
    High16/(position div)
    0x20, 0x18, 0x10, 0x8     -> 
    
    Possible Range: 
    0x20	0x0000-0x07FF
    0x18	0x0000-0x0AAB
    0x10	0x0000-0x0FFF
    0x8	0x0000-0x1FFF
    
    Bit ranges of the max result
    
    7FF	[s]000[/s]0011111111111
    AAA	[s]000[/s]0101010101010
    FFF	[s]000[/s]0111111111111
    1FFF	[s]000[/s]1111111111111
    	   12345xxxxyyyy --- ???
    
    
    Grid Position with Player at Origin
    
    444444444
    433333334
    432222234
    432111234
    432101234
    432111234
    432222234
    433333334
    444444444
    
    9x9, 7x7, 5x5, 3x3, [1x1 (center)]
    4    3    2    1    0	
    9x9 perimiter = 32 (5 bits)
    7x7 perimiter = 24 (5 bits)
    5x5 perimiter = 16 (4 bits)
    3x3 perimiter = 8 (3 bits)

    Code:
    0    - Initial
    1    - Position1
    2    - Position2
    3    - Position3
    4    - Position4
    
    56   - ESV1/Shiny1
    78   - ESV2/Shiny2
    910  - ESV3/Shiny3
    1112 - ESV4/Shiny4
    
    However, we can't assume that it will allow for shiny-notchain Pokemon.
    The game doesn't allow for shiny patches with a non-started chain (c=0)

    editing in, more of a scratchy post
  21. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    conversation arose in IRC about hitting funny keypresses. Since we didn't have a list of every single one (1506 different ones!) I decided to permute all possible theoretical keypress states the game can have (some may not register?)

    (13*9*13) - soft resetting combos = 1506

    Code:
    2FFF	None
    2FFE	A
    2FFD	B
    2FFC	A-B
    2FFB	Select
    2FFA	Select-A
    2FF9	Select-B
    2FF8	Select-A-B
    2FF7	Start
    2FF6	Start-A
    2FF5	Start-B
    2FF4	Start-A-B
    2FF3	Start-Select
    2FEF	Right
    2FEE	A-Right
    2FED	B-Right
    2FEC	A-B-Right
    2FEB	Select-Right
    2FEA	Select-A-Right
    2FE9	Select-B-Right
    2FE8	Select-A-B-Right
    2FE7	Start-Right
    2FE6	Start-A-Right
    2FE5	Start-B-Right
    2FE4	Start-A-B-Right
    2FE3	Start-Select-Right
    2FDF	Left
    2FDE	A-Left
    2FDD	B-Left
    2FDC	A-B-Left
    2FDB	Select-Left
    2FDA	Select-A-Left
    2FD9	Select-B-Left
    2FD8	Select-A-B-Left
    2FD7	Start-Left
    2FD6	Start-A-Left
    2FD5	Start-B-Left
    2FD4	Start-A-B-Left
    2FD3	Start-Select-Left
    2FBF	Up
    2FBE	A-Up
    2FBD	B-Up
    2FBC	A-B-Up
    2FBB	Select-Up
    2FBA	Select-A-Up
    2FB9	Select-B-Up
    2FB8	Select-A-B-Up
    2FB7	Start-Up
    2FB6	Start-A-Up
    2FB5	Start-B-Up
    2FB4	Start-A-B-Up
    2FB3	Start-Select-Up
    2FAF	Up-Right
    2FAE	A-Up-Right
    2FAD	B-Up-Right
    2FAC	A-B-Up-Right
    2FAB	Select-Up-Right
    2FAA	Select-A-Up-Right
    2FA9	Select-B-Up-Right
    2FA8	Select-A-B-Up-Right
    2FA7	Start-Up-Right
    2FA6	Start-A-Up-Right
    2FA5	Start-B-Up-Right
    2FA4	Start-A-B-Up-Right
    2FA3	Start-Select-Up-Right
    2F9F	Up-Left
    2F9E	A-Up-Left
    2F9D	B-Up-Left
    2F9C	A-B-Up-Left
    2F9B	Select-Up-Left
    2F9A	Select-A-Up-Left
    2F99	Select-B-Up-Left
    2F98	Select-A-B-Up-Left
    2F97	Start-Up-Left
    2F96	Start-A-Up-Left
    2F95	Start-B-Up-Left
    2F94	Start-A-B-Up-Left
    2F93	Start-Select-Up-Left
    2F7F	Down
    2F7E	A-Down
    2F7D	B-Down
    2F7C	A-B-Down
    2F7B	Select-Down
    2F7A	Select-A-Down
    2F79	Select-B-Down
    2F78	Select-A-B-Down
    2F77	Start-Down
    2F76	Start-A-Down
    2F75	Start-B-Down
    2F74	Start-A-B-Down
    2F73	Start-Select-Down
    2F6F	Down-Right
    2F6E	A-Down-Right
    2F6D	B-Down-Right
    2F6C	A-B-Down-Right
    2F6B	Select-Down-Right
    2F6A	Select-A-Down-Right
    2F69	Select-B-Down-Right
    2F68	Select-A-B-Down-Right
    2F67	Start-Down-Right
    2F66	Start-A-Down-Right
    2F65	Start-B-Down-Right
    2F64	Start-A-B-Down-Right
    2F63	Start-Select-Down-Right
    2F5F	Down-Left
    2F5E	A-Down-Left
    2F5D	B-Down-Left
    2F5C	A-B-Down-Left
    2F5B	Select-Down-Left
    2F5A	Select-A-Down-Left
    2F59	Select-B-Down-Left
    2F58	Select-A-B-Down-Left
    2F57	Start-Down-Left
    2F56	Start-A-Down-Left
    2F55	Start-B-Down-Left
    2F54	Start-A-B-Down-Left
    2F53	Start-Select-Down-Left
    2EFF	R
    2EFE	A-R
    2EFD	B-R
    2EFC	A-B-R
    2EFB	Select-R
    2EFA	Select-A-R
    2EF9	Select-B-R
    2EF8	Select-A-B-R
    2EF7	Start-R
    2EF6	Start-A-R
    2EF5	Start-B-R
    2EF4	Start-A-B-R
    2EF3	Start-Select-R
    2EEF	Right-R
    2EEE	A-Right-R
    2EED	B-Right-R
    2EEC	A-B-Right-R
    2EEB	Select-Right-R
    2EEA	Select-A-Right-R
    2EE9	Select-B-Right-R
    2EE8	Select-A-B-Right-R
    2EE7	Start-Right-R
    2EE6	Start-A-Right-R
    2EE5	Start-B-Right-R
    2EE4	Start-A-B-Right-R
    2EE3	Start-Select-Right-R
    2EDF	Left-R
    2EDE	A-Left-R
    2EDD	B-Left-R
    2EDC	A-B-Left-R
    2EDB	Select-Left-R
    2EDA	Select-A-Left-R
    2ED9	Select-B-Left-R
    2ED8	Select-A-B-Left-R
    2ED7	Start-Left-R
    2ED6	Start-A-Left-R
    2ED5	Start-B-Left-R
    2ED4	Start-A-B-Left-R
    2ED3	Start-Select-Left-R
    2EBF	Up-R
    2EBE	A-Up-R
    2EBD	B-Up-R
    2EBC	A-B-Up-R
    2EBB	Select-Up-R
    2EBA	Select-A-Up-R
    2EB9	Select-B-Up-R
    2EB8	Select-A-B-Up-R
    2EB7	Start-Up-R
    2EB6	Start-A-Up-R
    2EB5	Start-B-Up-R
    2EB4	Start-A-B-Up-R
    2EB3	Start-Select-Up-R
    2EAF	Up-Right-R
    2EAE	A-Up-Right-R
    2EAD	B-Up-Right-R
    2EAC	A-B-Up-Right-R
    2EAB	Select-Up-Right-R
    2EAA	Select-A-Up-Right-R
    2EA9	Select-B-Up-Right-R
    2EA8	Select-A-B-Up-Right-R
    2EA7	Start-Up-Right-R
    2EA6	Start-A-Up-Right-R
    2EA5	Start-B-Up-Right-R
    2EA4	Start-A-B-Up-Right-R
    2EA3	Start-Select-Up-Right-R
    2E9F	Up-Left-R
    2E9E	A-Up-Left-R
    2E9D	B-Up-Left-R
    2E9C	A-B-Up-Left-R
    2E9B	Select-Up-Left-R
    2E9A	Select-A-Up-Left-R
    2E99	Select-B-Up-Left-R
    2E98	Select-A-B-Up-Left-R
    2E97	Start-Up-Left-R
    2E96	Start-A-Up-Left-R
    2E95	Start-B-Up-Left-R
    2E94	Start-A-B-Up-Left-R
    2E93	Start-Select-Up-Left-R
    2E7F	Down-R
    2E7E	A-Down-R
    2E7D	B-Down-R
    2E7C	A-B-Down-R
    2E7B	Select-Down-R
    2E7A	Select-A-Down-R
    2E79	Select-B-Down-R
    2E78	Select-A-B-Down-R
    2E77	Start-Down-R
    2E76	Start-A-Down-R
    2E75	Start-B-Down-R
    2E74	Start-A-B-Down-R
    2E73	Start-Select-Down-R
    2E6F	Down-Right-R
    2E6E	A-Down-Right-R
    2E6D	B-Down-Right-R
    2E6C	A-B-Down-Right-R
    2E6B	Select-Down-Right-R
    2E6A	Select-A-Down-Right-R
    2E69	Select-B-Down-Right-R
    2E68	Select-A-B-Down-Right-R
    2E67	Start-Down-Right-R
    2E66	Start-A-Down-Right-R
    2E65	Start-B-Down-Right-R
    2E64	Start-A-B-Down-Right-R
    2E63	Start-Select-Down-Right-R
    2E5F	Down-Left-R
    2E5E	A-Down-Left-R
    2E5D	B-Down-Left-R
    2E5C	A-B-Down-Left-R
    2E5B	Select-Down-Left-R
    2E5A	Select-A-Down-Left-R
    2E59	Select-B-Down-Left-R
    2E58	Select-A-B-Down-Left-R
    2E57	Start-Down-Left-R
    2E56	Start-A-Down-Left-R
    2E55	Start-B-Down-Left-R
    2E54	Start-A-B-Down-Left-R
    2E53	Start-Select-Down-Left-R
    2DFF	L
    2DFE	A-L
    2DFD	B-L
    2DFC	A-B-L
    2DFB	Select-L
    2DFA	Select-A-L
    2DF9	Select-B-L
    2DF8	Select-A-B-L
    2DF7	Start-L
    2DF6	Start-A-L
    2DF5	Start-B-L
    2DF4	Start-A-B-L
    2DF3	Start-Select-L
    2DEF	Right-L
    2DEE	A-Right-L
    2DED	B-Right-L
    2DEC	A-B-Right-L
    2DEB	Select-Right-L
    2DEA	Select-A-Right-L
    2DE9	Select-B-Right-L
    2DE8	Select-A-B-Right-L
    2DE7	Start-Right-L
    2DE6	Start-A-Right-L
    2DE5	Start-B-Right-L
    2DE4	Start-A-B-Right-L
    2DE3	Start-Select-Right-L
    2DDF	Left-L
    2DDE	A-Left-L
    2DDD	B-Left-L
    2DDC	A-B-Left-L
    2DDB	Select-Left-L
    2DDA	Select-A-Left-L
    2DD9	Select-B-Left-L
    2DD8	Select-A-B-Left-L
    2DD7	Start-Left-L
    2DD6	Start-A-Left-L
    2DD5	Start-B-Left-L
    2DD4	Start-A-B-Left-L
    2DD3	Start-Select-Left-L
    2DBF	Up-L
    2DBE	A-Up-L
    2DBD	B-Up-L
    2DBC	A-B-Up-L
    2DBB	Select-Up-L
    2DBA	Select-A-Up-L
    2DB9	Select-B-Up-L
    2DB8	Select-A-B-Up-L
    2DB7	Start-Up-L
    2DB6	Start-A-Up-L
    2DB5	Start-B-Up-L
    2DB4	Start-A-B-Up-L
    2DB3	Start-Select-Up-L
    2DAF	Up-Right-L
    2DAE	A-Up-Right-L
    2DAD	B-Up-Right-L
    2DAC	A-B-Up-Right-L
    2DAB	Select-Up-Right-L
    2DAA	Select-A-Up-Right-L
    2DA9	Select-B-Up-Right-L
    2DA8	Select-A-B-Up-Right-L
    2DA7	Start-Up-Right-L
    2DA6	Start-A-Up-Right-L
    2DA5	Start-B-Up-Right-L
    2DA4	Start-A-B-Up-Right-L
    2DA3	Start-Select-Up-Right-L
    2D9F	Up-Left-L
    2D9E	A-Up-Left-L
    2D9D	B-Up-Left-L
    2D9C	A-B-Up-Left-L
    2D9B	Select-Up-Left-L
    2D9A	Select-A-Up-Left-L
    2D99	Select-B-Up-Left-L
    2D98	Select-A-B-Up-Left-L
    2D97	Start-Up-Left-L
    2D96	Start-A-Up-Left-L
    2D95	Start-B-Up-Left-L
    2D94	Start-A-B-Up-Left-L
    2D93	Start-Select-Up-Left-L
    2D7F	Down-L
    2D7E	A-Down-L
    2D7D	B-Down-L
    2D7C	A-B-Down-L
    2D7B	Select-Down-L
    2D7A	Select-A-Down-L
    2D79	Select-B-Down-L
    2D78	Select-A-B-Down-L
    2D77	Start-Down-L
    2D76	Start-A-Down-L
    2D75	Start-B-Down-L
    2D74	Start-A-B-Down-L
    2D73	Start-Select-Down-L
    2D6F	Down-Right-L
    2D6E	A-Down-Right-L
    2D6D	B-Down-Right-L
    2D6C	A-B-Down-Right-L
    2D6B	Select-Down-Right-L
    2D6A	Select-A-Down-Right-L
    2D69	Select-B-Down-Right-L
    2D68	Select-A-B-Down-Right-L
    2D67	Start-Down-Right-L
    2D66	Start-A-Down-Right-L
    2D65	Start-B-Down-Right-L
    2D64	Start-A-B-Down-Right-L
    2D63	Start-Select-Down-Right-L
    2D5F	Down-Left-L
    2D5E	A-Down-Left-L
    2D5D	B-Down-Left-L
    2D5C	A-B-Down-Left-L
    2D5B	Select-Down-Left-L
    2D5A	Select-A-Down-Left-L
    2D59	Select-B-Down-Left-L
    2D58	Select-A-B-Down-Left-L
    2D57	Start-Down-Left-L
    2D56	Start-A-Down-Left-L
    2D55	Start-B-Down-Left-L
    2D54	Start-A-B-Down-Left-L
    2D53	Start-Select-Down-Left-L
    2CFF	R-L
    2CFE	A-R-L
    2CFD	B-R-L
    2CFC	A-B-R-L
    2CFB	Select-R-L
    2CFA	Select-A-R-L
    2CF9	Select-B-R-L
    2CF8	Select-A-B-R-L
    2CF7	Start-R-L
    2CF6	Start-A-R-L
    2CF5	Start-B-R-L
    2CF4	Start-A-B-R-L
    2CEF	Right-R-L
    2CEE	A-Right-R-L
    2CED	B-Right-R-L
    2CEC	A-B-Right-R-L
    2CEB	Select-Right-R-L
    2CEA	Select-A-Right-R-L
    2CE9	Select-B-Right-R-L
    2CE8	Select-A-B-Right-R-L
    2CE7	Start-Right-R-L
    2CE6	Start-A-Right-R-L
    2CE5	Start-B-Right-R-L
    2CE4	Start-A-B-Right-R-L
    2CDF	Left-R-L
    2CDE	A-Left-R-L
    2CDD	B-Left-R-L
    2CDC	A-B-Left-R-L
    2CDB	Select-Left-R-L
    2CDA	Select-A-Left-R-L
    2CD9	Select-B-Left-R-L
    2CD8	Select-A-B-Left-R-L
    2CD7	Start-Left-R-L
    2CD6	Start-A-Left-R-L
    2CD5	Start-B-Left-R-L
    2CD4	Start-A-B-Left-R-L
    2CBF	Up-R-L
    2CBE	A-Up-R-L
    2CBD	B-Up-R-L
    2CBC	A-B-Up-R-L
    2CBB	Select-Up-R-L
    2CBA	Select-A-Up-R-L
    2CB9	Select-B-Up-R-L
    2CB8	Select-A-B-Up-R-L
    2CB7	Start-Up-R-L
    2CB6	Start-A-Up-R-L
    2CB5	Start-B-Up-R-L
    2CB4	Start-A-B-Up-R-L
    2CAF	Up-Right-R-L
    2CAE	A-Up-Right-R-L
    2CAD	B-Up-Right-R-L
    2CAC	A-B-Up-Right-R-L
    2CAB	Select-Up-Right-R-L
    2CAA	Select-A-Up-Right-R-L
    2CA9	Select-B-Up-Right-R-L
    2CA8	Select-A-B-Up-Right-R-L
    2CA7	Start-Up-Right-R-L
    2CA6	Start-A-Up-Right-R-L
    2CA5	Start-B-Up-Right-R-L
    2CA4	Start-A-B-Up-Right-R-L
    2C9F	Up-Left-R-L
    2C9E	A-Up-Left-R-L
    2C9D	B-Up-Left-R-L
    2C9C	A-B-Up-Left-R-L
    2C9B	Select-Up-Left-R-L
    2C9A	Select-A-Up-Left-R-L
    2C99	Select-B-Up-Left-R-L
    2C98	Select-A-B-Up-Left-R-L
    2C97	Start-Up-Left-R-L
    2C96	Start-A-Up-Left-R-L
    2C95	Start-B-Up-Left-R-L
    2C94	Start-A-B-Up-Left-R-L
    2C7F	Down-R-L
    2C7E	A-Down-R-L
    2C7D	B-Down-R-L
    2C7C	A-B-Down-R-L
    2C7B	Select-Down-R-L
    2C7A	Select-A-Down-R-L
    2C79	Select-B-Down-R-L
    2C78	Select-A-B-Down-R-L
    2C77	Start-Down-R-L
    2C76	Start-A-Down-R-L
    2C75	Start-B-Down-R-L
    2C74	Start-A-B-Down-R-L
    2C73	Start-Select-Down-R-L
    2C6F	Down-Right-R-L
    2C6E	A-Down-Right-R-L
    2C6D	B-Down-Right-R-L
    2C6C	A-B-Down-Right-R-L
    2C6B	Select-Down-Right-R-L
    2C6A	Select-A-Down-Right-R-L
    2C69	Select-B-Down-Right-R-L
    2C68	Select-A-B-Down-Right-R-L
    2C67	Start-Down-Right-R-L
    2C66	Start-A-Down-Right-R-L
    2C65	Start-B-Down-Right-R-L
    2C64	Start-A-B-Down-Right-R-L
    2C63	Start-Select-Down-Right-R-L
    2C5F	Down-Left-R-L
    2C5E	A-Down-Left-R-L
    2C5D	B-Down-Left-R-L
    2C5C	A-B-Down-Left-R-L
    2C5B	Select-Down-Left-R-L
    2C5A	Select-A-Down-Left-R-L
    2C59	Select-B-Down-Left-R-L
    2C58	Select-A-B-Down-Left-R-L
    2C57	Start-Down-Left-R-L
    2C56	Start-A-Down-Left-R-L
    2C55	Start-B-Down-Left-R-L
    2C54	Start-A-B-Down-Left-R-L
    2C53	Start-Select-Down-Left-R-L
    2BFF	X
    2BFE	A-X
    2BFD	B-X
    2BFC	A-B-X
    2BFB	Select-X
    2BFA	Select-A-X
    2BF9	Select-B-X
    2BF8	Select-A-B-X
    2BF7	Start-X
    2BF6	Start-A-X
    2BF5	Start-B-X
    2BF4	Start-A-B-X
    2BF3	Start-Select-X
    2BEF	Right-X
    2BEE	A-Right-X
    2BED	B-Right-X
    2BEC	A-B-Right-X
    2BEB	Select-Right-X
    2BEA	Select-A-Right-X
    2BE9	Select-B-Right-X
    2BE8	Select-A-B-Right-X
    2BE7	Start-Right-X
    2BE6	Start-A-Right-X
    2BE5	Start-B-Right-X
    2BE4	Start-A-B-Right-X
    2BE3	Start-Select-Right-X
    2BDF	Left-X
    2BDE	A-Left-X
    2BDD	B-Left-X
    2BDC	A-B-Left-X
    2BDB	Select-Left-X
    2BDA	Select-A-Left-X
    2BD9	Select-B-Left-X
    2BD8	Select-A-B-Left-X
    2BD7	Start-Left-X
    2BD6	Start-A-Left-X
    2BD5	Start-B-Left-X
    2BD4	Start-A-B-Left-X
    2BD3	Start-Select-Left-X
    2BBF	Up-X
    2BBE	A-Up-X
    2BBD	B-Up-X
    2BBC	A-B-Up-X
    2BBB	Select-Up-X
    2BBA	Select-A-Up-X
    2BB9	Select-B-Up-X
    2BB8	Select-A-B-Up-X
    2BB7	Start-Up-X
    2BB6	Start-A-Up-X
    2BB5	Start-B-Up-X
    2BB4	Start-A-B-Up-X
    2BB3	Start-Select-Up-X
    2BAF	Up-Right-X
    2BAE	A-Up-Right-X
    2BAD	B-Up-Right-X
    2BAC	A-B-Up-Right-X
    2BAB	Select-Up-Right-X
    2BAA	Select-A-Up-Right-X
    2BA9	Select-B-Up-Right-X
    2BA8	Select-A-B-Up-Right-X
    2BA7	Start-Up-Right-X
    2BA6	Start-A-Up-Right-X
    2BA5	Start-B-Up-Right-X
    2BA4	Start-A-B-Up-Right-X
    2BA3	Start-Select-Up-Right-X
    2B9F	Up-Left-X
    2B9E	A-Up-Left-X
    2B9D	B-Up-Left-X
    2B9C	A-B-Up-Left-X
    2B9B	Select-Up-Left-X
    2B9A	Select-A-Up-Left-X
    2B99	Select-B-Up-Left-X
    2B98	Select-A-B-Up-Left-X
    2B97	Start-Up-Left-X
    2B96	Start-A-Up-Left-X
    2B95	Start-B-Up-Left-X
    2B94	Start-A-B-Up-Left-X
    2B93	Start-Select-Up-Left-X
    2B7F	Down-X
    2B7E	A-Down-X
    2B7D	B-Down-X
    2B7C	A-B-Down-X
    2B7B	Select-Down-X
    2B7A	Select-A-Down-X
    2B79	Select-B-Down-X
    2B78	Select-A-B-Down-X
    2B77	Start-Down-X
    2B76	Start-A-Down-X
    2B75	Start-B-Down-X
    2B74	Start-A-B-Down-X
    2B73	Start-Select-Down-X
    2B6F	Down-Right-X
    2B6E	A-Down-Right-X
    2B6D	B-Down-Right-X
    2B6C	A-B-Down-Right-X
    2B6B	Select-Down-Right-X
    2B6A	Select-A-Down-Right-X
    2B69	Select-B-Down-Right-X
    2B68	Select-A-B-Down-Right-X
    2B67	Start-Down-Right-X
    2B66	Start-A-Down-Right-X
    2B65	Start-B-Down-Right-X
    2B64	Start-A-B-Down-Right-X
    2B63	Start-Select-Down-Right-X
    2B5F	Down-Left-X
    2B5E	A-Down-Left-X
    2B5D	B-Down-Left-X
    2B5C	A-B-Down-Left-X
    2B5B	Select-Down-Left-X
    2B5A	Select-A-Down-Left-X
    2B59	Select-B-Down-Left-X
    2B58	Select-A-B-Down-Left-X
    2B57	Start-Down-Left-X
    2B56	Start-A-Down-Left-X
    2B55	Start-B-Down-Left-X
    2B54	Start-A-B-Down-Left-X
    2B53	Start-Select-Down-Left-X
    2AFF	X-R
    2AFE	A-X-R
    2AFD	B-X-R
    2AFC	A-B-X-R
    2AFB	Select-X-R
    2AFA	Select-A-X-R
    2AF9	Select-B-X-R
    2AF8	Select-A-B-X-R
    2AF7	Start-X-R
    2AF6	Start-A-X-R
    2AF5	Start-B-X-R
    2AF4	Start-A-B-X-R
    2AF3	Start-Select-X-R
    2AEF	Right-X-R
    2AEE	A-Right-X-R
    2AED	B-Right-X-R
    2AEC	A-B-Right-X-R
    2AEB	Select-Right-X-R
    2AEA	Select-A-Right-X-R
    2AE9	Select-B-Right-X-R
    2AE8	Select-A-B-Right-X-R
    2AE7	Start-Right-X-R
    2AE6	Start-A-Right-X-R
    2AE5	Start-B-Right-X-R
    2AE4	Start-A-B-Right-X-R
    2AE3	Start-Select-Right-X-R
    2ADF	Left-X-R
    2ADE	A-Left-X-R
    2ADD	B-Left-X-R
    2ADC	A-B-Left-X-R
    2ADB	Select-Left-X-R
    2ADA	Select-A-Left-X-R
    2AD9	Select-B-Left-X-R
    2AD8	Select-A-B-Left-X-R
    2AD7	Start-Left-X-R
    2AD6	Start-A-Left-X-R
    2AD5	Start-B-Left-X-R
    2AD4	Start-A-B-Left-X-R
    2AD3	Start-Select-Left-X-R
    2ABF	Up-X-R
    2ABE	A-Up-X-R
    2ABD	B-Up-X-R
    2ABC	A-B-Up-X-R
    2ABB	Select-Up-X-R
    2ABA	Select-A-Up-X-R
    2AB9	Select-B-Up-X-R
    2AB8	Select-A-B-Up-X-R
    2AB7	Start-Up-X-R
    2AB6	Start-A-Up-X-R
    2AB5	Start-B-Up-X-R
    2AB4	Start-A-B-Up-X-R
    2AB3	Start-Select-Up-X-R
    2AAF	Up-Right-X-R
    2AAE	A-Up-Right-X-R
    2AAD	B-Up-Right-X-R
    2AAC	A-B-Up-Right-X-R
    2AAB	Select-Up-Right-X-R
    2AAA	Select-A-Up-Right-X-R
    2AA9	Select-B-Up-Right-X-R
    2AA8	Select-A-B-Up-Right-X-R
    2AA7	Start-Up-Right-X-R
    2AA6	Start-A-Up-Right-X-R
    2AA5	Start-B-Up-Right-X-R
    2AA4	Start-A-B-Up-Right-X-R
    2AA3	Start-Select-Up-Right-X-R
    2A9F	Up-Left-X-R
    2A9E	A-Up-Left-X-R
    2A9D	B-Up-Left-X-R
    2A9C	A-B-Up-Left-X-R
    2A9B	Select-Up-Left-X-R
    2A9A	Select-A-Up-Left-X-R
    2A99	Select-B-Up-Left-X-R
    2A98	Select-A-B-Up-Left-X-R
    2A97	Start-Up-Left-X-R
    2A96	Start-A-Up-Left-X-R
    2A95	Start-B-Up-Left-X-R
    2A94	Start-A-B-Up-Left-X-R
    2A93	Start-Select-Up-Left-X-R
    2A7F	Down-X-R
    2A7E	A-Down-X-R
    2A7D	B-Down-X-R
    2A7C	A-B-Down-X-R
    2A7B	Select-Down-X-R
    2A7A	Select-A-Down-X-R
    2A79	Select-B-Down-X-R
    2A78	Select-A-B-Down-X-R
    2A77	Start-Down-X-R
    2A76	Start-A-Down-X-R
    2A75	Start-B-Down-X-R
    2A74	Start-A-B-Down-X-R
    2A73	Start-Select-Down-X-R
    2A6F	Down-Right-X-R
    2A6E	A-Down-Right-X-R
    2A6D	B-Down-Right-X-R
    2A6C	A-B-Down-Right-X-R
    2A6B	Select-Down-Right-X-R
    2A6A	Select-A-Down-Right-X-R
    2A69	Select-B-Down-Right-X-R
    2A68	Select-A-B-Down-Right-X-R
    2A67	Start-Down-Right-X-R
    2A66	Start-A-Down-Right-X-R
    2A65	Start-B-Down-Right-X-R
    2A64	Start-A-B-Down-Right-X-R
    2A63	Start-Select-Down-Right-X-R
    2A5F	Down-Left-X-R
    2A5E	A-Down-Left-X-R
    2A5D	B-Down-Left-X-R
    2A5C	A-B-Down-Left-X-R
    2A5B	Select-Down-Left-X-R
    2A5A	Select-A-Down-Left-X-R
    2A59	Select-B-Down-Left-X-R
    2A58	Select-A-B-Down-Left-X-R
    2A57	Start-Down-Left-X-R
    2A56	Start-A-Down-Left-X-R
    2A55	Start-B-Down-Left-X-R
    2A54	Start-A-B-Down-Left-X-R
    2A53	Start-Select-Down-Left-X-R
    29FF	X-L
    29FE	A-X-L
    29FD	B-X-L
    29FC	A-B-X-L
    29FB	Select-X-L
    29FA	Select-A-X-L
    29F9	Select-B-X-L
    29F8	Select-A-B-X-L
    29F7	Start-X-L
    29F6	Start-A-X-L
    29F5	Start-B-X-L
    29F4	Start-A-B-X-L
    29F3	Start-Select-X-L
    29EF	Right-X-L
    29EE	A-Right-X-L
    29ED	B-Right-X-L
    29EC	A-B-Right-X-L
    29EB	Select-Right-X-L
    29EA	Select-A-Right-X-L
    29E9	Select-B-Right-X-L
    29E8	Select-A-B-Right-X-L
    29E7	Start-Right-X-L
    29E6	Start-A-Right-X-L
    29E5	Start-B-Right-X-L
    29E4	Start-A-B-Right-X-L
    29E3	Start-Select-Right-X-L
    29DF	Left-X-L
    29DE	A-Left-X-L
    29DD	B-Left-X-L
    29DC	A-B-Left-X-L
    29DB	Select-Left-X-L
    29DA	Select-A-Left-X-L
    29D9	Select-B-Left-X-L
    29D8	Select-A-B-Left-X-L
    29D7	Start-Left-X-L
    29D6	Start-A-Left-X-L
    29D5	Start-B-Left-X-L
    29D4	Start-A-B-Left-X-L
    29D3	Start-Select-Left-X-L
    29BF	Up-X-L
    29BE	A-Up-X-L
    29BD	B-Up-X-L
    29BC	A-B-Up-X-L
    29BB	Select-Up-X-L
    29BA	Select-A-Up-X-L
    29B9	Select-B-Up-X-L
    29B8	Select-A-B-Up-X-L
    29B7	Start-Up-X-L
    29B6	Start-A-Up-X-L
    29B5	Start-B-Up-X-L
    29B4	Start-A-B-Up-X-L
    29B3	Start-Select-Up-X-L
    29AF	Up-Right-X-L
    29AE	A-Up-Right-X-L
    29AD	B-Up-Right-X-L
    29AC	A-B-Up-Right-X-L
    29AB	Select-Up-Right-X-L
    29AA	Select-A-Up-Right-X-L
    29A9	Select-B-Up-Right-X-L
    29A8	Select-A-B-Up-Right-X-L
    29A7	Start-Up-Right-X-L
    29A6	Start-A-Up-Right-X-L
    29A5	Start-B-Up-Right-X-L
    29A4	Start-A-B-Up-Right-X-L
    29A3	Start-Select-Up-Right-X-L
    299F	Up-Left-X-L
    299E	A-Up-Left-X-L
    299D	B-Up-Left-X-L
    299C	A-B-Up-Left-X-L
    299B	Select-Up-Left-X-L
    299A	Select-A-Up-Left-X-L
    2999	Select-B-Up-Left-X-L
    2998	Select-A-B-Up-Left-X-L
    2997	Start-Up-Left-X-L
    2996	Start-A-Up-Left-X-L
    2995	Start-B-Up-Left-X-L
    2994	Start-A-B-Up-Left-X-L
    2993	Start-Select-Up-Left-X-L
    297F	Down-X-L
    297E	A-Down-X-L
    297D	B-Down-X-L
    297C	A-B-Down-X-L
    297B	Select-Down-X-L
    297A	Select-A-Down-X-L
    2979	Select-B-Down-X-L
    2978	Select-A-B-Down-X-L
    2977	Start-Down-X-L
    2976	Start-A-Down-X-L
    2975	Start-B-Down-X-L
    2974	Start-A-B-Down-X-L
    2973	Start-Select-Down-X-L
    296F	Down-Right-X-L
    296E	A-Down-Right-X-L
    296D	B-Down-Right-X-L
    296C	A-B-Down-Right-X-L
    296B	Select-Down-Right-X-L
    296A	Select-A-Down-Right-X-L
    2969	Select-B-Down-Right-X-L
    2968	Select-A-B-Down-Right-X-L
    2967	Start-Down-Right-X-L
    2966	Start-A-Down-Right-X-L
    2965	Start-B-Down-Right-X-L
    2964	Start-A-B-Down-Right-X-L
    2963	Start-Select-Down-Right-X-L
    295F	Down-Left-X-L
    295E	A-Down-Left-X-L
    295D	B-Down-Left-X-L
    295C	A-B-Down-Left-X-L
    295B	Select-Down-Left-X-L
    295A	Select-A-Down-Left-X-L
    2959	Select-B-Down-Left-X-L
    2958	Select-A-B-Down-Left-X-L
    2957	Start-Down-Left-X-L
    2956	Start-A-Down-Left-X-L
    2955	Start-B-Down-Left-X-L
    2954	Start-A-B-Down-Left-X-L
    2953	Start-Select-Down-Left-X-L
    28FF	X-R-L
    28FE	A-X-R-L
    28FD	B-X-R-L
    28FC	A-B-X-R-L
    28FB	Select-X-R-L
    28FA	Select-A-X-R-L
    28F9	Select-B-X-R-L
    28F8	Select-A-B-X-R-L
    28F7	Start-X-R-L
    28F6	Start-A-X-R-L
    28F5	Start-B-X-R-L
    28F4	Start-A-B-X-R-L
    28F3	Start-Select-X-R-L
    28EF	Right-X-R-L
    28EE	A-Right-X-R-L
    28ED	B-Right-X-R-L
    28EC	A-B-Right-X-R-L
    28EB	Select-Right-X-R-L
    28EA	Select-A-Right-X-R-L
    28E9	Select-B-Right-X-R-L
    28E8	Select-A-B-Right-X-R-L
    28E7	Start-Right-X-R-L
    28E6	Start-A-Right-X-R-L
    28E5	Start-B-Right-X-R-L
    28E4	Start-A-B-Right-X-R-L
    28E3	Start-Select-Right-X-R-L
    28DF	Left-X-R-L
    28DE	A-Left-X-R-L
    28DD	B-Left-X-R-L
    28DC	A-B-Left-X-R-L
    28DB	Select-Left-X-R-L
    28DA	Select-A-Left-X-R-L
    28D9	Select-B-Left-X-R-L
    28D8	Select-A-B-Left-X-R-L
    28D7	Start-Left-X-R-L
    28D6	Start-A-Left-X-R-L
    28D5	Start-B-Left-X-R-L
    28D4	Start-A-B-Left-X-R-L
    28D3	Start-Select-Left-X-R-L
    28BF	Up-X-R-L
    28BE	A-Up-X-R-L
    28BD	B-Up-X-R-L
    28BC	A-B-Up-X-R-L
    28BB	Select-Up-X-R-L
    28BA	Select-A-Up-X-R-L
    28B9	Select-B-Up-X-R-L
    28B8	Select-A-B-Up-X-R-L
    28B7	Start-Up-X-R-L
    28B6	Start-A-Up-X-R-L
    28B5	Start-B-Up-X-R-L
    28B4	Start-A-B-Up-X-R-L
    28B3	Start-Select-Up-X-R-L
    28AF	Up-Right-X-R-L
    28AE	A-Up-Right-X-R-L
    28AD	B-Up-Right-X-R-L
    28AC	A-B-Up-Right-X-R-L
    28AB	Select-Up-Right-X-R-L
    28AA	Select-A-Up-Right-X-R-L
    28A9	Select-B-Up-Right-X-R-L
    28A8	Select-A-B-Up-Right-X-R-L
    28A7	Start-Up-Right-X-R-L
    28A6	Start-A-Up-Right-X-R-L
    28A5	Start-B-Up-Right-X-R-L
    28A4	Start-A-B-Up-Right-X-R-L
    28A3	Start-Select-Up-Right-X-R-L
    289F	Up-Left-X-R-L
    289E	A-Up-Left-X-R-L
    289D	B-Up-Left-X-R-L
    289C	A-B-Up-Left-X-R-L
    289B	Select-Up-Left-X-R-L
    289A	Select-A-Up-Left-X-R-L
    2899	Select-B-Up-Left-X-R-L
    2898	Select-A-B-Up-Left-X-R-L
    2897	Start-Up-Left-X-R-L
    2896	Start-A-Up-Left-X-R-L
    2895	Start-B-Up-Left-X-R-L
    2894	Start-A-B-Up-Left-X-R-L
    2893	Start-Select-Up-Left-X-R-L
    287F	Down-X-R-L
    287E	A-Down-X-R-L
    287D	B-Down-X-R-L
    287C	A-B-Down-X-R-L
    287B	Select-Down-X-R-L
    287A	Select-A-Down-X-R-L
    2879	Select-B-Down-X-R-L
    2878	Select-A-B-Down-X-R-L
    2877	Start-Down-X-R-L
    2876	Start-A-Down-X-R-L
    2875	Start-B-Down-X-R-L
    2874	Start-A-B-Down-X-R-L
    2873	Start-Select-Down-X-R-L
    286F	Down-Right-X-R-L
    286E	A-Down-Right-X-R-L
    286D	B-Down-Right-X-R-L
    286C	A-B-Down-Right-X-R-L
    286B	Select-Down-Right-X-R-L
    286A	Select-A-Down-Right-X-R-L
    2869	Select-B-Down-Right-X-R-L
    2868	Select-A-B-Down-Right-X-R-L
    2867	Start-Down-Right-X-R-L
    2866	Start-A-Down-Right-X-R-L
    2865	Start-B-Down-Right-X-R-L
    2864	Start-A-B-Down-Right-X-R-L
    2863	Start-Select-Down-Right-X-R-L
    285F	Down-Left-X-R-L
    285E	A-Down-Left-X-R-L
    285D	B-Down-Left-X-R-L
    285C	A-B-Down-Left-X-R-L
    285B	Select-Down-Left-X-R-L
    285A	Select-A-Down-Left-X-R-L
    2859	Select-B-Down-Left-X-R-L
    2858	Select-A-B-Down-Left-X-R-L
    2857	Start-Down-Left-X-R-L
    2856	Start-A-Down-Left-X-R-L
    2855	Start-B-Down-Left-X-R-L
    2854	Start-A-B-Down-Left-X-R-L
    2853	Start-Select-Down-Left-X-R-L
    27FF	Y
    27FF	Y-R
    27FE	A-Y
    27FE	A-Y-R
    27FD	B-Y
    27FD	B-Y-R
    27FC	A-B-Y
    27FC	A-B-Y-R
    27FB	Select-Y
    27FB	Select-Y-R
    27FA	Select-A-Y
    27FA	Select-A-Y-R
    27F9	Select-B-Y
    27F9	Select-B-Y-R
    27F8	Select-A-B-Y
    27F8	Select-A-B-Y-R
    27F7	Start-Y
    27F7	Start-Y-R
    27F6	Start-A-Y
    27F6	Start-A-Y-R
    27F5	Start-B-Y
    27F5	Start-B-Y-R
    27F4	Start-A-B-Y
    27F4	Start-A-B-Y-R
    27F3	Start-Select-Y
    27F3	Start-Select-Y-R
    27EF	Right-Y
    27EF	Right-Y-R
    27EE	A-Right-Y
    27EE	A-Right-Y-R
    27ED	B-Right-Y
    27ED	B-Right-Y-R
    27EC	A-B-Right-Y
    27EC	A-B-Right-Y-R
    27EB	Select-Right-Y
    27EB	Select-Right-Y-R
    27EA	Select-A-Right-Y
    27EA	Select-A-Right-Y-R
    27E9	Select-B-Right-Y
    27E9	Select-B-Right-Y-R
    27E8	Select-A-B-Right-Y
    27E8	Select-A-B-Right-Y-R
    27E7	Start-Right-Y
    27E7	Start-Right-Y-R
    27E6	Start-A-Right-Y
    27E6	Start-A-Right-Y-R
    27E5	Start-B-Right-Y
    27E5	Start-B-Right-Y-R
    27E4	Start-A-B-Right-Y
    27E4	Start-A-B-Right-Y-R
    27E3	Start-Select-Right-Y
    27E3	Start-Select-Right-Y-R
    27DF	Left-Y
    27DF	Left-Y-R
    27DE	A-Left-Y
    27DE	A-Left-Y-R
    27DD	B-Left-Y
    27DD	B-Left-Y-R
    27DC	A-B-Left-Y
    27DC	A-B-Left-Y-R
    27DB	Select-Left-Y
    27DB	Select-Left-Y-R
    27DA	Select-A-Left-Y
    27DA	Select-A-Left-Y-R
    27D9	Select-B-Left-Y
    27D9	Select-B-Left-Y-R
    27D8	Select-A-B-Left-Y
    27D8	Select-A-B-Left-Y-R
    27D7	Start-Left-Y
    27D7	Start-Left-Y-R
    27D6	Start-A-Left-Y
    27D6	Start-A-Left-Y-R
    27D5	Start-B-Left-Y
    27D5	Start-B-Left-Y-R
    27D4	Start-A-B-Left-Y
    27D4	Start-A-B-Left-Y-R
    27D3	Start-Select-Left-Y
    27D3	Start-Select-Left-Y-R
    27BF	Up-Y
    27BF	Up-Y-R
    27BE	A-Up-Y
    27BE	A-Up-Y-R
    27BD	B-Up-Y
    27BD	B-Up-Y-R
    27BC	A-B-Up-Y
    27BC	A-B-Up-Y-R
    27BB	Select-Up-Y
    27BB	Select-Up-Y-R
    27BA	Select-A-Up-Y
    27BA	Select-A-Up-Y-R
    27B9	Select-B-Up-Y
    27B9	Select-B-Up-Y-R
    27B8	Select-A-B-Up-Y
    27B8	Select-A-B-Up-Y-R
    27B7	Start-Up-Y
    27B7	Start-Up-Y-R
    27B6	Start-A-Up-Y
    27B6	Start-A-Up-Y-R
    27B5	Start-B-Up-Y
    27B5	Start-B-Up-Y-R
    27B4	Start-A-B-Up-Y
    27B4	Start-A-B-Up-Y-R
    27B3	Start-Select-Up-Y
    27B3	Start-Select-Up-Y-R
    27AF	Up-Right-Y
    27AF	Up-Right-Y-R
    27AE	A-Up-Right-Y
    27AE	A-Up-Right-Y-R
    27AD	B-Up-Right-Y
    27AD	B-Up-Right-Y-R
    27AC	A-B-Up-Right-Y
    27AC	A-B-Up-Right-Y-R
    27AB	Select-Up-Right-Y
    27AB	Select-Up-Right-Y-R
    27AA	Select-A-Up-Right-Y
    27AA	Select-A-Up-Right-Y-R
    27A9	Select-B-Up-Right-Y
    27A9	Select-B-Up-Right-Y-R
    27A8	Select-A-B-Up-Right-Y
    27A8	Select-A-B-Up-Right-Y-R
    27A7	Start-Up-Right-Y
    27A7	Start-Up-Right-Y-R
    27A6	Start-A-Up-Right-Y
    27A6	Start-A-Up-Right-Y-R
    27A5	Start-B-Up-Right-Y
    27A5	Start-B-Up-Right-Y-R
    27A4	Start-A-B-Up-Right-Y
    27A4	Start-A-B-Up-Right-Y-R
    27A3	Start-Select-Up-Right-Y
    27A3	Start-Select-Up-Right-Y-R
    279F	Up-Left-Y
    279F	Up-Left-Y-R
    279E	A-Up-Left-Y
    279E	A-Up-Left-Y-R
    279D	B-Up-Left-Y
    279D	B-Up-Left-Y-R
    279C	A-B-Up-Left-Y
    279C	A-B-Up-Left-Y-R
    279B	Select-Up-Left-Y
    279B	Select-Up-Left-Y-R
    279A	Select-A-Up-Left-Y
    279A	Select-A-Up-Left-Y-R
    2799	Select-B-Up-Left-Y
    2799	Select-B-Up-Left-Y-R
    2798	Select-A-B-Up-Left-Y
    2798	Select-A-B-Up-Left-Y-R
    2797	Start-Up-Left-Y
    2797	Start-Up-Left-Y-R
    2796	Start-A-Up-Left-Y
    2796	Start-A-Up-Left-Y-R
    2795	Start-B-Up-Left-Y
    2795	Start-B-Up-Left-Y-R
    2794	Start-A-B-Up-Left-Y
    2794	Start-A-B-Up-Left-Y-R
    2793	Start-Select-Up-Left-Y
    2793	Start-Select-Up-Left-Y-R
    277F	Down-Y
    277F	Down-Y-R
    277E	A-Down-Y
    277E	A-Down-Y-R
    277D	B-Down-Y
    277D	B-Down-Y-R
    277C	A-B-Down-Y
    277C	A-B-Down-Y-R
    277B	Select-Down-Y
    277B	Select-Down-Y-R
    277A	Select-A-Down-Y
    277A	Select-A-Down-Y-R
    2779	Select-B-Down-Y
    2779	Select-B-Down-Y-R
    2778	Select-A-B-Down-Y
    2778	Select-A-B-Down-Y-R
    2777	Start-Down-Y
    2777	Start-Down-Y-R
    2776	Start-A-Down-Y
    2776	Start-A-Down-Y-R
    2775	Start-B-Down-Y
    2775	Start-B-Down-Y-R
    2774	Start-A-B-Down-Y
    2774	Start-A-B-Down-Y-R
    2773	Start-Select-Down-Y
    2773	Start-Select-Down-Y-R
    276F	Down-Right-Y
    276F	Down-Right-Y-R
    276E	A-Down-Right-Y
    276E	A-Down-Right-Y-R
    276D	B-Down-Right-Y
    276D	B-Down-Right-Y-R
    276C	A-B-Down-Right-Y
    276C	A-B-Down-Right-Y-R
    276B	Select-Down-Right-Y
    276B	Select-Down-Right-Y-R
    276A	Select-A-Down-Right-Y
    276A	Select-A-Down-Right-Y-R
    2769	Select-B-Down-Right-Y
    2769	Select-B-Down-Right-Y-R
    2768	Select-A-B-Down-Right-Y
    2768	Select-A-B-Down-Right-Y-R
    2767	Start-Down-Right-Y
    2767	Start-Down-Right-Y-R
    2766	Start-A-Down-Right-Y
    2766	Start-A-Down-Right-Y-R
    2765	Start-B-Down-Right-Y
    2765	Start-B-Down-Right-Y-R
    2764	Start-A-B-Down-Right-Y
    2764	Start-A-B-Down-Right-Y-R
    2763	Start-Select-Down-Right-Y
    2763	Start-Select-Down-Right-Y-R
    275F	Down-Left-Y
    275F	Down-Left-Y-R
    275E	A-Down-Left-Y
    275E	A-Down-Left-Y-R
    275D	B-Down-Left-Y
    275D	B-Down-Left-Y-R
    275C	A-B-Down-Left-Y
    275C	A-B-Down-Left-Y-R
    275B	Select-Down-Left-Y
    275B	Select-Down-Left-Y-R
    275A	Select-A-Down-Left-Y
    275A	Select-A-Down-Left-Y-R
    2759	Select-B-Down-Left-Y
    2759	Select-B-Down-Left-Y-R
    2758	Select-A-B-Down-Left-Y
    2758	Select-A-B-Down-Left-Y-R
    2757	Start-Down-Left-Y
    2757	Start-Down-Left-Y-R
    2756	Start-A-Down-Left-Y
    2756	Start-A-Down-Left-Y-R
    2755	Start-B-Down-Left-Y
    2755	Start-B-Down-Left-Y-R
    2754	Start-A-B-Down-Left-Y
    2754	Start-A-B-Down-Left-Y-R
    2753	Start-Select-Down-Left-Y
    2753	Start-Select-Down-Left-Y-R
    25FF	Y-L
    25FE	A-Y-L
    25FD	B-Y-L
    25FC	A-B-Y-L
    25FB	Select-Y-L
    25FA	Select-A-Y-L
    25F9	Select-B-Y-L
    25F8	Select-A-B-Y-L
    25F7	Start-Y-L
    25F6	Start-A-Y-L
    25F5	Start-B-Y-L
    25F4	Start-A-B-Y-L
    25F3	Start-Select-Y-L
    25EF	Right-Y-L
    25EE	A-Right-Y-L
    25ED	B-Right-Y-L
    25EC	A-B-Right-Y-L
    25EB	Select-Right-Y-L
    25EA	Select-A-Right-Y-L
    25E9	Select-B-Right-Y-L
    25E8	Select-A-B-Right-Y-L
    25E7	Start-Right-Y-L
    25E6	Start-A-Right-Y-L
    25E5	Start-B-Right-Y-L
    25E4	Start-A-B-Right-Y-L
    25E3	Start-Select-Right-Y-L
    25DF	Left-Y-L
    25DE	A-Left-Y-L
    25DD	B-Left-Y-L
    25DC	A-B-Left-Y-L
    25DB	Select-Left-Y-L
    25DA	Select-A-Left-Y-L
    25D9	Select-B-Left-Y-L
    25D8	Select-A-B-Left-Y-L
    25D7	Start-Left-Y-L
    25D6	Start-A-Left-Y-L
    25D5	Start-B-Left-Y-L
    25D4	Start-A-B-Left-Y-L
    25D3	Start-Select-Left-Y-L
    25BF	Up-Y-L
    25BE	A-Up-Y-L
    25BD	B-Up-Y-L
    25BC	A-B-Up-Y-L
    25BB	Select-Up-Y-L
    25BA	Select-A-Up-Y-L
    25B9	Select-B-Up-Y-L
    25B8	Select-A-B-Up-Y-L
    25B7	Start-Up-Y-L
    25B6	Start-A-Up-Y-L
    25B5	Start-B-Up-Y-L
    25B4	Start-A-B-Up-Y-L
    25B3	Start-Select-Up-Y-L
    25AF	Up-Right-Y-L
    25AE	A-Up-Right-Y-L
    25AD	B-Up-Right-Y-L
    25AC	A-B-Up-Right-Y-L
    25AB	Select-Up-Right-Y-L
    25AA	Select-A-Up-Right-Y-L
    25A9	Select-B-Up-Right-Y-L
    25A8	Select-A-B-Up-Right-Y-L
    25A7	Start-Up-Right-Y-L
    25A6	Start-A-Up-Right-Y-L
    25A5	Start-B-Up-Right-Y-L
    25A4	Start-A-B-Up-Right-Y-L
    25A3	Start-Select-Up-Right-Y-L
    259F	Up-Left-Y-L
    259E	A-Up-Left-Y-L
    259D	B-Up-Left-Y-L
    259C	A-B-Up-Left-Y-L
    259B	Select-Up-Left-Y-L
    259A	Select-A-Up-Left-Y-L
    2599	Select-B-Up-Left-Y-L
    2598	Select-A-B-Up-Left-Y-L
    2597	Start-Up-Left-Y-L
    2596	Start-A-Up-Left-Y-L
    2595	Start-B-Up-Left-Y-L
    2594	Start-A-B-Up-Left-Y-L
    2593	Start-Select-Up-Left-Y-L
    257F	Down-Y-L
    257E	A-Down-Y-L
    257D	B-Down-Y-L
    257C	A-B-Down-Y-L
    257B	Select-Down-Y-L
    257A	Select-A-Down-Y-L
    2579	Select-B-Down-Y-L
    2578	Select-A-B-Down-Y-L
    2577	Start-Down-Y-L
    2576	Start-A-Down-Y-L
    2575	Start-B-Down-Y-L
    2574	Start-A-B-Down-Y-L
    2573	Start-Select-Down-Y-L
    256F	Down-Right-Y-L
    256E	A-Down-Right-Y-L
    256D	B-Down-Right-Y-L
    256C	A-B-Down-Right-Y-L
    256B	Select-Down-Right-Y-L
    256A	Select-A-Down-Right-Y-L
    2569	Select-B-Down-Right-Y-L
    2568	Select-A-B-Down-Right-Y-L
    2567	Start-Down-Right-Y-L
    2566	Start-A-Down-Right-Y-L
    2565	Start-B-Down-Right-Y-L
    2564	Start-A-B-Down-Right-Y-L
    2563	Start-Select-Down-Right-Y-L
    255F	Down-Left-Y-L
    255E	A-Down-Left-Y-L
    255D	B-Down-Left-Y-L
    255C	A-B-Down-Left-Y-L
    255B	Select-Down-Left-Y-L
    255A	Select-A-Down-Left-Y-L
    2559	Select-B-Down-Left-Y-L
    2558	Select-A-B-Down-Left-Y-L
    2557	Start-Down-Left-Y-L
    2556	Start-A-Down-Left-Y-L
    2555	Start-B-Down-Left-Y-L
    2554	Start-A-B-Down-Left-Y-L
    2553	Start-Select-Down-Left-Y-L
    24FF	Y-R-L
    24FE	A-Y-R-L
    24FD	B-Y-R-L
    24FC	A-B-Y-R-L
    24FB	Select-Y-R-L
    24FA	Select-A-Y-R-L
    24F9	Select-B-Y-R-L
    24F8	Select-A-B-Y-R-L
    24F7	Start-Y-R-L
    24F6	Start-A-Y-R-L
    24F5	Start-B-Y-R-L
    24F4	Start-A-B-Y-R-L
    24EF	Right-Y-R-L
    24EE	A-Right-Y-R-L
    24ED	B-Right-Y-R-L
    24EC	A-B-Right-Y-R-L
    24EB	Select-Right-Y-R-L
    24EA	Select-A-Right-Y-R-L
    24E9	Select-B-Right-Y-R-L
    24E8	Select-A-B-Right-Y-R-L
    24E7	Start-Right-Y-R-L
    24E6	Start-A-Right-Y-R-L
    24E5	Start-B-Right-Y-R-L
    24E4	Start-A-B-Right-Y-R-L
    24DF	Left-Y-R-L
    24DE	A-Left-Y-R-L
    24DD	B-Left-Y-R-L
    24DC	A-B-Left-Y-R-L
    24DB	Select-Left-Y-R-L
    24DA	Select-A-Left-Y-R-L
    24D9	Select-B-Left-Y-R-L
    24D8	Select-A-B-Left-Y-R-L
    24D7	Start-Left-Y-R-L
    24D6	Start-A-Left-Y-R-L
    24D5	Start-B-Left-Y-R-L
    24D4	Start-A-B-Left-Y-R-L
    24BF	Up-Y-R-L
    24BE	A-Up-Y-R-L
    24BD	B-Up-Y-R-L
    24BC	A-B-Up-Y-R-L
    24BB	Select-Up-Y-R-L
    24BA	Select-A-Up-Y-R-L
    24B9	Select-B-Up-Y-R-L
    24B8	Select-A-B-Up-Y-R-L
    24B7	Start-Up-Y-R-L
    24B6	Start-A-Up-Y-R-L
    24B5	Start-B-Up-Y-R-L
    24B4	Start-A-B-Up-Y-R-L
    24AF	Up-Right-Y-R-L
    24AE	A-Up-Right-Y-R-L
    24AD	B-Up-Right-Y-R-L
    24AC	A-B-Up-Right-Y-R-L
    24AB	Select-Up-Right-Y-R-L
    24AA	Select-A-Up-Right-Y-R-L
    24A9	Select-B-Up-Right-Y-R-L
    24A8	Select-A-B-Up-Right-Y-R-L
    24A7	Start-Up-Right-Y-R-L
    24A6	Start-A-Up-Right-Y-R-L
    24A5	Start-B-Up-Right-Y-R-L
    24A4	Start-A-B-Up-Right-Y-R-L
    249F	Up-Left-Y-R-L
    249E	A-Up-Left-Y-R-L
    249D	B-Up-Left-Y-R-L
    249C	A-B-Up-Left-Y-R-L
    249B	Select-Up-Left-Y-R-L
    249A	Select-A-Up-Left-Y-R-L
    2499	Select-B-Up-Left-Y-R-L
    2498	Select-A-B-Up-Left-Y-R-L
    2497	Start-Up-Left-Y-R-L
    2496	Start-A-Up-Left-Y-R-L
    2495	Start-B-Up-Left-Y-R-L
    2494	Start-A-B-Up-Left-Y-R-L
    247F	Down-Y-R-L
    247E	A-Down-Y-R-L
    247D	B-Down-Y-R-L
    247C	A-B-Down-Y-R-L
    247B	Select-Down-Y-R-L
    247A	Select-A-Down-Y-R-L
    2479	Select-B-Down-Y-R-L
    2478	Select-A-B-Down-Y-R-L
    2477	Start-Down-Y-R-L
    2476	Start-A-Down-Y-R-L
    2475	Start-B-Down-Y-R-L
    2474	Start-A-B-Down-Y-R-L
    246F	Down-Right-Y-R-L
    246E	A-Down-Right-Y-R-L
    246D	B-Down-Right-Y-R-L
    246C	A-B-Down-Right-Y-R-L
    246B	Select-Down-Right-Y-R-L
    246A	Select-A-Down-Right-Y-R-L
    2469	Select-B-Down-Right-Y-R-L
    2468	Select-A-B-Down-Right-Y-R-L
    2467	Start-Down-Right-Y-R-L
    2466	Start-A-Down-Right-Y-R-L
    2465	Start-B-Down-Right-Y-R-L
    2464	Start-A-B-Down-Right-Y-R-L
    245F	Down-Left-Y-R-L
    245E	A-Down-Left-Y-R-L
    245D	B-Down-Left-Y-R-L
    245C	A-B-Down-Left-Y-R-L
    245B	Select-Down-Left-Y-R-L
    245A	Select-A-Down-Left-Y-R-L
    2459	Select-B-Down-Left-Y-R-L
    2458	Select-A-B-Down-Left-Y-R-L
    2457	Start-Down-Left-Y-R-L
    2456	Start-A-Down-Left-Y-R-L
    2455	Start-B-Down-Left-Y-R-L
    2454	Start-A-B-Down-Left-Y-R-L
    23FF	X-Y
    23FE	A-X-Y
    23FD	B-X-Y
    23FC	A-B-X-Y
    23FB	Select-X-Y
    23FA	Select-A-X-Y
    23F9	Select-B-X-Y
    23F8	Select-A-B-X-Y
    23F7	Start-X-Y
    23F6	Start-A-X-Y
    23F5	Start-B-X-Y
    23F4	Start-A-B-X-Y
    23F3	Start-Select-X-Y
    23EF	Right-X-Y
    23EE	A-Right-X-Y
    23ED	B-Right-X-Y
    23EC	A-B-Right-X-Y
    23EB	Select-Right-X-Y
    23EA	Select-A-Right-X-Y
    23E9	Select-B-Right-X-Y
    23E8	Select-A-B-Right-X-Y
    23E7	Start-Right-X-Y
    23E6	Start-A-Right-X-Y
    23E5	Start-B-Right-X-Y
    23E4	Start-A-B-Right-X-Y
    23E3	Start-Select-Right-X-Y
    23DF	Left-X-Y
    23DE	A-Left-X-Y
    23DD	B-Left-X-Y
    23DC	A-B-Left-X-Y
    23DB	Select-Left-X-Y
    23DA	Select-A-Left-X-Y
    23D9	Select-B-Left-X-Y
    23D8	Select-A-B-Left-X-Y
    23D7	Start-Left-X-Y
    23D6	Start-A-Left-X-Y
    23D5	Start-B-Left-X-Y
    23D4	Start-A-B-Left-X-Y
    23D3	Start-Select-Left-X-Y
    23BF	Up-X-Y
    23BE	A-Up-X-Y
    23BD	B-Up-X-Y
    23BC	A-B-Up-X-Y
    23BB	Select-Up-X-Y
    23BA	Select-A-Up-X-Y
    23B9	Select-B-Up-X-Y
    23B8	Select-A-B-Up-X-Y
    23B7	Start-Up-X-Y
    23B6	Start-A-Up-X-Y
    23B5	Start-B-Up-X-Y
    23B4	Start-A-B-Up-X-Y
    23B3	Start-Select-Up-X-Y
    23AF	Up-Right-X-Y
    23AE	A-Up-Right-X-Y
    23AD	B-Up-Right-X-Y
    23AC	A-B-Up-Right-X-Y
    23AB	Select-Up-Right-X-Y
    23AA	Select-A-Up-Right-X-Y
    23A9	Select-B-Up-Right-X-Y
    23A8	Select-A-B-Up-Right-X-Y
    23A7	Start-Up-Right-X-Y
    23A6	Start-A-Up-Right-X-Y
    23A5	Start-B-Up-Right-X-Y
    23A4	Start-A-B-Up-Right-X-Y
    23A3	Start-Select-Up-Right-X-Y
    239F	Up-Left-X-Y
    239E	A-Up-Left-X-Y
    239D	B-Up-Left-X-Y
    239C	A-B-Up-Left-X-Y
    239B	Select-Up-Left-X-Y
    239A	Select-A-Up-Left-X-Y
    2399	Select-B-Up-Left-X-Y
    2398	Select-A-B-Up-Left-X-Y
    2397	Start-Up-Left-X-Y
    2396	Start-A-Up-Left-X-Y
    2395	Start-B-Up-Left-X-Y
    2394	Start-A-B-Up-Left-X-Y
    2393	Start-Select-Up-Left-X-Y
    237F	Down-X-Y
    237E	A-Down-X-Y
    237D	B-Down-X-Y
    237C	A-B-Down-X-Y
    237B	Select-Down-X-Y
    237A	Select-A-Down-X-Y
    2379	Select-B-Down-X-Y
    2378	Select-A-B-Down-X-Y
    2377	Start-Down-X-Y
    2376	Start-A-Down-X-Y
    2375	Start-B-Down-X-Y
    2374	Start-A-B-Down-X-Y
    2373	Start-Select-Down-X-Y
    236F	Down-Right-X-Y
    236E	A-Down-Right-X-Y
    236D	B-Down-Right-X-Y
    236C	A-B-Down-Right-X-Y
    236B	Select-Down-Right-X-Y
    236A	Select-A-Down-Right-X-Y
    2369	Select-B-Down-Right-X-Y
    2368	Select-A-B-Down-Right-X-Y
    2367	Start-Down-Right-X-Y
    2366	Start-A-Down-Right-X-Y
    2365	Start-B-Down-Right-X-Y
    2364	Start-A-B-Down-Right-X-Y
    2363	Start-Select-Down-Right-X-Y
    235F	Down-Left-X-Y
    235E	A-Down-Left-X-Y
    235D	B-Down-Left-X-Y
    235C	A-B-Down-Left-X-Y
    235B	Select-Down-Left-X-Y
    235A	Select-A-Down-Left-X-Y
    2359	Select-B-Down-Left-X-Y
    2358	Select-A-B-Down-Left-X-Y
    2357	Start-Down-Left-X-Y
    2356	Start-A-Down-Left-X-Y
    2355	Start-B-Down-Left-X-Y
    2354	Start-A-B-Down-Left-X-Y
    2353	Start-Select-Down-Left-X-Y
    
  22. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    PokéRadar Abuse: 15 Test Cases

    In these examples, I used seeds in which 2 Shiny Patches should spawn if I had a chain of 40+. 6/15 times only 1 would spawn.

    Code:
    Seed		Shiny	Rare	Common
    9E4C2C26	2	2	0
    03533C8B	2	2	0
    6776E496	2	2	0
    493847BB	2	2	0
    20851176	2	2	0
    B3F5A0F3	2	2	0
    1AF5F499	2	1	1
    6AE5AA00	2	1	1
    A0BD8446	2	1	1
    4B5E1680	1	2	1
    E8F1238E	1	2	1
    B51852BE	1	1	2
    07A888C8	1	1	2
    6FBB02E7	1	0	3
    D20B5EAD	1	0	3
    
    Both Shiny Patches Spawned (open)



    [​IMG] [​IMG]
    [​IMG] [​IMG]
    [​IMG] [​IMG]
    [​IMG] [​IMG]
    [​IMG]


    Seed || First Call // Second Call
    Code:
    9E4C2C26	34	62	82	55
    		0	0	184	171
    
    03533C8B	43	43	29	66
    		0	0	133	137
    
    6776E496	10	39	22	1
    		0	186	0	122
    
    493847BB	60	43	0	12
    		0	0	42	148
    
    20851176	3	52	39	95
    		0	0	54	126
    
    B3F5A0F3	80	28	93	4
    		0	0	179	40
    
    1AF5F499	43	23	59	26
    		0	0	53	65
    
    6AE5AA00	53	43	88	12
    		0	0	12	36
    
    A0BD8446	60	3	52	36
    		0	0	72	26


    Only One Shiny Patch Spawns (open)


    [​IMG] [​IMG]
    [​IMG] [​IMG]
    [​IMG] [​IMG]


    Seed || First Call // Second Call
    Code:
    D20B5EAD	15	82	91	34
    		0	0	76	29
    
    6FBB02E7	65	96	98	28
    		0	0	74	57
    
    07A888C8	39	88	54	93
    		0	0	118	71
    
    B51852BE	99	27	54	53
    		0	0	42	187
    
    E8F1238E	59	75	98	36
    		0	0	119	122
    
    4B5E1680	62	82	79	25
    		0	0	115	68


    Stepping into ANY patch at ANY chain length:

    Code:
    n     initial
    n + 1 ??
    n + 2 ??
    n + 3 nature
          pid
          iv
    m + 1 ??
    m + 2 ??
    m + 3 ??
    m + 4 ??
    m + 5 ??
    *m + 6 ?
    *m + 7 ?
    
    five calls after PIDIV generated, 2 calls before nature.
    unrelated calls below?
    then there's another single one when the battle shifts start.
    and another when you start throwing your pokemon out
    --------------

    If I move to make certain shaking patches outside of the area, they simply won't spawn. The game only does 4 position calcs, and based on the valid positions it does 2*valid calls. It compares between the two sets of calls (position and ESV/Shiny) to determine type somehow. Instead of finishing this it was decided to finish up Chatot confirmation for gen 4 (High16 & 0x1FF * pitch >> 13, essentially %8192/AAB) and for gen 5 too. It's gonna be displayed in a 0-99 pitch scale because it's not 3 distinct levels.
  23. venkii

    venkii

    Joined:
    Jan 1, 2012
    Messages:
    1
    Hi, I'm new to smogon; is there any chance I could jump on board with this research? I've studied and done research in cryptography/PRNGs/Hashing algos at multiple Ivy leagues and I think I could help...
  24. Kaphotics

    Kaphotics Remodeling Kitchens
    is a Pokemon Researcheris a Contributor to Smogon

    Joined:
    Apr 25, 2009
    Messages:
    772
    Toyed with the RAM and was able to find the locations where the patches are set.

    Each patch is separated by 0x28 (40d)

    Made a Lua script to display the positions relative to the trainer, including patchtype and shiny. aka "Radar HUD"

    [​IMG]

    Lua script (.lua) (open)


    Code:
    -- Radar HUD (By Kaphotics)
    
    -- Enter the address of the Start of Slot Table
    	local start=0x022A15A0
    
    -- Enter the address of the X Position
    	local pos=0x0227F458
    
    -- Local Variables
    
    local seed
    local pkm
    local lvl
    local xp1
    local xp2
    local xp3
    local xp4
    local yp1
    local yp2
    local yp3
    local yp4
    local tp1
    local tp2
    local tp3
    local tp4
    local dp1
    local dp2
    local dp3
    local dp4
    local sp1
    local sp2
    local sp3
    local sp4
    
    -- Start Radar HUD
    
    while true do
    
    	-- Display the Seed ingame and in the Lua window
    
        		gui.text(0,16,"Seed: "..string.format("%8X", memory.readdwordunsigned(0x021BFB14)))
        		print(""..string.format("%8X", memory.readdwordunsigned(0x021BFB14)))
    
    	-- Is the game currently chaining a Pokemon? If nothing is being chained, we don't display anything.
    
        if (memory.readdwordunsigned(start+540,2) == 0)
    		then gui.text(1,64, string.format("Chain: Broken"))
    		emu.frameadvance()
    
        else
    	-- We're chaining something. Time to display what we're chaining.
    
    		posx=memory.readwordunsigned(pos,4)
     		posy=memory.readwordunsigned(pos+4,4)
    
    		
    		chaincount=memory.readwordunsigned(start+528,2)
    		gui.text(1,64, string.format("Chain: %d", chaincount))
    		pkm=memory.readwordunsigned(start+532,2)
    		gui.text(1,74, string.format("Dex: %d", pkm))
    		lvl=memory.readwordunsigned(start+536,2)
    		gui.text(1,84, string.format("Lvl: %d", lvl))
    
    		gui.text(0,104,"Player:")
    			gui.text(1,114,"X: "..string.format(posx))
    			gui.text(1,124,"Y: "..string.format(posy))
    
    		gui.text(0,144,"Patches:")
    
    	-- Patch 1 Display -- 
    
    		xp1=memory.readdwordunsigned(start+552,2)-posx
    		yp1=memory.readdwordunsigned(start+556,2)-posy
    		tp1=memory.readwordunsigned(start+560,2)
    		dp1=memory.readdwordunsigned(start+564,2)
    		sp1=memory.readwordunsigned(start+572,2)
    
    			if xp1<0 then	gui.text(1,154,   string.format("X: %d", xp1))	else 	gui.text(1,154,   string.format("X:  %d", xp1))	end
    			if yp1<0 then 	gui.text(51,154,  string.format("Y: %d", yp1))	else	gui.text(51,154,  string.format("Y:  %d", yp1))	end
    			gui.text(101,154, string.format("Type: %d", tp1))
    			if dp1==0 then	gui.text(171,154, string.format("Disabled"))	end
    			if sp1==1 then	gui.text(171,154, string.format("Shiny!"))	end
    
    	-- Patch 2 Display -- 
    
    		xp2=memory.readdwordunsigned(start+592,2)-posx
    		yp2=memory.readdwordunsigned(start+596,2)-posy
    		tp2=memory.readwordunsigned(start+600,2)
    		dp2=memory.readwordunsigned(start+604,2)
    		sp2=memory.readwordunsigned(start+612,2)
    
    			if xp2<0 then	gui.text(1,164,   string.format("X: %d", xp2))	else	gui.text(1,164,   string.format("X:  %d", xp2))	end
    			if yp2<0 then	gui.text(51,164,  string.format("Y: %d", yp2))	else	gui.text(51,164,  string.format("Y:  %d", yp2))	end
    			gui.text(101,164, string.format("Type: %d", tp2))
    			if dp2==0 then	gui.text(171,164, string.format("Disabled"))	end
    			if sp2==1 then	gui.text(171,164, string.format("Shiny!"))	end
    
    	-- Patch 3 Display --	
    
    		xp3=memory.readdwordunsigned(start+632,2)-posx
    		yp3=memory.readdwordunsigned(start+636,2)-posy
    		tp3=memory.readwordunsigned(start+640,2)
    		dp3=memory.readwordunsigned(start+644,2)
    		sp3=memory.readwordunsigned(start+652,2)
    
    			if xp3<0 then	gui.text(1,174,   string.format("X: %d", xp3))	else 	gui.text(1,174,   string.format("X:  %d", xp3))	end
    			if yp3<0 then 	gui.text(51,174,  string.format("Y: %d", yp3))	else	gui.text(51,174,  string.format("Y:  %d", yp3))	end
    			gui.text(101,174, string.format("Type: %d", tp3))
    			if dp3==0 then	gui.text(171,174, string.format("Disabled")) 	end
    			if sp3==1 then	gui.text(171,174, string.format("Shiny!")) 	end
    
    	-- Patch 4 Display --
    
    		xp4=memory.readdwordunsigned(start+672,2)-posx
    		yp4=memory.readdwordunsigned(start+676,2)-posy
    		tp4=memory.readwordunsigned(start+680,2)
    		dp4=memory.readwordunsigned(start+684,2)
    		sp4=memory.readwordunsigned(start+692,2)
    
    			if xp4<0 then	gui.text(1,184,   string.format("X: %d", xp4))	else	gui.text(1,184,   string.format("X:  %d", xp4))	end
    			if yp4<0 then	gui.text(51,184,  string.format("Y: %d", yp4))	else	gui.text(51,184,  string.format("Y:  %d", yp4))	end
    			gui.text(101,184, string.format("Type: %d", tp4))
    			if dp4==0 then	gui.text(171,184, string.format("Disabled")) end
    			if sp4==1 then	gui.text(171,184, string.format("Shiny!")) end
    		
    		
    	-- End Dynamic Display
    
    	emu.frameadvance()
    
        end
    end


    I tried to make the Lua easily readable, and made the onscreen HUD a little prettier by making +/- numbers spaced proper.

    edit: pretty sure everything is tidied up

    There's another flag that determines if the chain is continued (at least I think that's what it does). It's between the Enabler and Shiny Flags. Too lazy to get pointers for the table and player position, so that's gotta be manually edited as a setup stage.

    --

    self note: seed C9C4FC3E creates 4 patches in a line to the left. ez
  25. Ryziken

    Ryziken

    Joined:
    Apr 9, 2011
    Messages:
    25
    RNG Abusing the Pickup ability

    This seems to be the best place to mention this. It occurred to me just yesterday that a very useful application of RNG abuse (one which non-hacking players like myself would find highly appealing) would be to abuse the Pickup ability, specifically the non-battle effect of the Pickup ability.

    What drove me to look into this was the simple yet stupid way that Game Freak made the wifi room battle rules this gen. Forcing us to train every Pokemon to level 100 for 6v6 singles was a huge slap in the face of every non-hacking competitive battler out there.

    So as nice as it is to have good old RNG reporter level the playing field in terms of IV's and Hidden Powers, there is still no way to quickly level up those perfect Pokemon, and so many will turn to AR or some other hacking device, just for the sake of hacking those hard-to-get Rare Candies.

    But for us bold few who want to resist that temptation, there is still another way to save up those Rare Candies, and all it involves is beginner-level RNG abuse.

    From some simple experiments that anyone could do, I have discovered that you CAN abuse the Pickup ability, and it is very easy.

    What I know so far can be summed up as follows:

    Let's say your team of six (Pickup ability) Pokemon consists of Pokemon A thru F, with A being the lead and F being the sixth member. You hit some random seed, immeadiately (Frame 1) encounter and defeat a wild Pokemon, and by happy coincidence, you discover after the battle:
    1. Pokemon A is holding a Rare Candy <<<< Just an example
    2. Pokemon F is holding a Max Revive

    If you hit this same seed again (you can remove the items and save first), and have a well-behaved Timer0, the SAME POSITIONS in your team (the 1st and 6th members in my example) will be holding items again, as long as they have Pickup of course, and are not already holding something.

    But that's not all!

    The items being held can be changed by thinking of them as being analogous to Encounter slots. In this case, we have "Item slots." The SEED is what determines the item SLOT for a particular team position (and whether there will be one at all; remember, Pickup only grants an item 10% of the time). What determines the specific item is the Pokemon's LEVEL. So by replacing the 6th member of my example team with a much lower or higher-level Pickup user, we can change that Max Revive into almost a dozen different items if we so desire.

    So let's say that positions A and F on my example team each have a Lv92 Aipom. In another position, say, position E, I have a Lv42 Lillipup. By looking up the item slot tables via Wikipedia, Serebii, etc we see that Aipom F picked up the item in the last column of the "Uncommon" Pickup items. That column represents the ITEM SLOT for that team position. We also see that, in this same column, there is a Rare Candy in the Lv41-50 range. By switching my Lv42 Lillipup with Aipom F, saving, and hitting the seed again, I check my result....
    ....and find positions A and F now BOTH have Rare Candies!

    I hope the above paragraphs are clear. Let me know if there are issues. Ideally, the best thing to find would be a seed that yields 3 or 4 items after the first battle. The logic is all there, all that's missing is the computer program ("P-UpRNG Reporter" ??) to allow users to find ultra-rare 5 or 6 item seeds with the Item Slots they want. Rare Candies, PP Ups, Nuggets, and more. As many as 6 every two minutes.

    It's almost as fast as hacking. And the best part.... it's not hacking.

Users Viewing Thread (Users: 0, Guests: 0)