View Single Post
Old January 5th, 2015 (9:26 AM).
redriders180's Avatar
redriders180 redriders180 is offline
Mastermind of Pokemon Glazed
    Join Date: Jun 2010
    Location: Path of Victory, Tunod
    Gender: Male
    Nature: Quirky
    Posts: 540
    I'm not sure if anybody's done any research on this in the past, but in BPRE, the branch for incenses in breeding starts at 0x08045FD2. At that point, R4 appears to contain an address to the Pokemon's species, and R6 and R2 contain the held items of the two Pokemon. More info in the spoiler.

    ROM:08045FD2                 LDRH    R0, [R4]
    ROM:08045FD4                 CMP     R0, R7
    ROM:08045FD6                 BNE     loc_8045FE4
    ROM:08045FD8                 CMP     R6, #0xDD
    ROM:08045FDA                 BEQ     loc_8045FE4
    ROM:08045FDC                 CMP     R2, #0xDD
    ROM:08045FDE                 BEQ     loc_8045FE4
    ROM:08045FE0                 MOVS    R0, #0xCA
    ROM:08045FE2                 STRH    R0, [R4]
    ROM:08045FE4 loc_8045FE4                             ; CODE XREF: sub_8045FA0+36j
    ROM:08045FE4                                         ; sub_8045FA0+3Aj ...
    ROM:08045FE4                 LDRH    R1, [R4]
    ROM:08045FE6                 MOVS    R0, 0x15E
    ROM:08045FEA                 CMP     R1, R0
    ROM:08045FEC                 BNE     loc_8045FFA
    ROM:08045FEE                 CMP     R6, #0xDC
    ROM:08045FF0                 BEQ     loc_8045FFA
    ROM:08045FF2                 CMP     R2, #0xDC
    ROM:08045FF4                 BEQ     loc_8045FFA
    ROM:08045FF6                 MOVS    R0, #0xB7
    ROM:08045FF8                 STRH    R0, [R4]
    The checks themselves are extremely simple. R4 is loaded, and compared with Wynaut's index number (0x168) If it's not equal, move on to the next check (Azurill). It then compares both items with the index number of Lax Incense (0xDD). If either are equal, move on to the next check. If neither are equal, write the index number of Wobbuffet to R4. The check is nearly identical for Azurill, except for different indices of course.

    It would be fairly simple to put a hook in the table and point to more checks.

    I think I'm done with ROM hacking. I'll still pop in and visit, though.

    Reply With Quote