Research & Development Got a well-founded knack with ROM hacking? Love reverse-engineering the Pokémon games? Or perhaps you love your assembly language. This is the spot for polling and gathering your ideas, and then implementing them! Share your hypothesis, get ideas from others, and collaborate to create!

TrollandToad.com
Reply
 
Thread Tools
  #1    
Old August 19th, 2017 (9:15 PM). Edited August 22nd, 2017 by shanem7.
shanem7 shanem7 is offline
     
    Join Date: Mar 2013
    Gender: Male
    Posts: 41
    At the request of the user tkim, I'm posting this here. Altering Cave was supposed to be a cave with alternating wild Pokemon data based on a random value (1-9) being loaded into an address in RAM.

    Since the e-Reader event never came out to the public, I've decided to share my findings with the community. But not just any community... the Pokemon community!

    How to get Altering cave functional again:

    Code:
    '-----------------
    #org @Start    //put your starting address offset here or use a dynamic address
    random 0x9
    copyvar 0x4024 LASTRESULT
    setworldmapflag 0x8BE
    end
    Put this code in A-Map's map header for Altering Cave. What this does is alter the Pokemon of Altering Cave every time it is entered to emulate the original design of the cave as if Mystery Gift were used.

    Next, if we want to edit the Pokemon, its data starts at 0x3C9AF8.

    The data is in this order:

    The Pokemon Data (by level, then Pokemon), the termination byte ($05), 3 bytes of $00 and a 4 byte pointer (the first Pokemon is Mareep, pointing to 0x83C9AF8, the start of the Monster's data). The Pokemon data are 56 bytes long, each.

    For example, the first Pokemon is Mareep, it is loaded as follows when the right value gets written to 0x4024:

    Mareep lv7 - lv7
    Mareep lv9 - lv9
    Mareep lv5 - lv5
    Mareep lv12 - lv12
    Mareep lv7 - lv7
    Mareep lv9 - lv9
    Mareep lv13 - lv13
    Mareep lv3 - lv3
    Mareep lv5 - lv5
    Mareep lv12 - lv12
    Mareep lv5 - lv5
    Mareep lv12 - lv12

    Then it terminates with a $05.

    The Pokemon go in this order, starting at 0x3C9AF8, 56 bytes each:

    Mareep
    Pineco
    Houndour
    Teddiursa
    Aipom
    Shuckle
    Stantler
    Smeargle

    Zubat's data (the one used by A-Map for Altering Cave) is actually before Mareep's (the first "altering" Pokemon) within hex = 0x3C9AC0. Really, I'm not surprised, since the routine draws the data set by pulling a random value (1-9) so having them all together like that makes sense. You could, in theory, change the data offset for the pointer used for A-Map for each one to make it easier to edit then revert it.

    There is a bunch of free space tacked on at the end of this data. It seems that you could freely add more Pokemon and then change the "Random 9" to your new number of Pokemon to adjust it. The way the free space is set up, it seems that more Pokemon were originally intended to be used within Map 8BE (Altering Cave).

    I hope this basic explanation on the logic for Altering Cave is helpful.
    Reply With Quote

    Relevant Advertising!

    Reply

    Quick Reply

    Join the conversation!

    Create an account to post a reply in this thread, participate in other discussions, and more!

    Create a PokéCommunity Account

    Sponsored Links
    Thread Tools

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -8. The time now is 12:05 PM.