Jump to content

Bond697

Former Staff
  • Posts

    1358
  • Joined

  • Last visited

Posts posted by Bond697

  1. you would need to resize the options on the subscreen, re-align everything on the screen, adjust everything in sub-OAM(shift the top 6 things up 1 at a time, leave the bottommost one alone), hook the code that builds the menu again to add another option to the OAM, add linking code to make the new option open a new menu or whatever, based on like a winAPI RECT(top, bottom, left, right, and subtract) sorta thing with a touchpad read. and that's just what i can think of off the top of my head.

    this would be an unbelieveable pain to do.

    note the sub-OAM:

    evckPHo.png

    the icons are in OAM, so they need to be shifted upward. you can do that in code by changing the calls that add them to OAM.

    e: doing it with a PC at a pokemon center would be a lot easier. still hard.

  2. by the way, what's the goal of the library? accuracy in reading/creating pokemon? i'm just wondering because, for example, you have code to change genders:

    void setpkmgender(pokemon_obj *pkm, int gender)
    {
    switch (gender)
    {
    case Genders::male:
    	pkm->forms.female = false;
    	pkm->forms.genderless = false;
    	break;
    case Genders::female:
    	pkm->forms.female = true;
    	pkm->forms.genderless = false;
    	break;
    case Genders::genderless:
    	pkm->forms.female = false;
    	pkm->forms.genderless = true;
    	break;
    }
    }
    

    which is fine, but gender is determined by the pid. so if you change the gender, you need to adjust the pid across the gender value boundary or (i'm pretty sure) it's illegal. are you leaving that up to the person who uses the library, or..?

  3. figuring out which script file a callstd call will use:

    -take the argument supplied with the callstd and look here: http://pastebin.com/q98R6YfN.

    -this is a 60 element array of 5 member 16-bit structs.

    -go down the array of structs looking at the first member of each struct until you find the one where the callstd argument is finally bigger than the first member of the struct.

    -take the third member of that struct and turn it to decimal. there's your script file number.

  4. it turns out that the 3 unknowns in my script environment:

    struct ScriptEnvironment
    {
     u16 maxStackDepth;
     u16 maxVars;
     ScriptCall *cmdArray;
     u32 cmdMax;
     [b]u32 unk3;
     u32 unk4;
     u32 unk5;[/b]
     u8 stackPointer;
     u8 executionState;
     u8 scriptCmpResult;
     u8 padding;
     AsmCall funcptr;
     u8 *script_pos_ptr;
     u8 *script_stack_ptr;
     u32 *vars;
     ScrcmdEnvironment *scrcmd_ptr;
     ScriptCall script_callback_verifier;
     void *sys_info;
     Arc_Tool *script_arc_file_ptr;
    };

    are actually the components of a scripting plugin system that gamefreak uses for commands that are very specific to certain contexts in the game. they're plugins that can be switched in when new sub-script environments are started and are "unloaded" when the environment memory is freed. the environment actually looks like this:

    struct ScriptEnvironment
    {
     u16 maxStackDepth;
     u16 maxVars;
     ScriptCall *cmdArray;
     u32 cmdMax;
     ScriptPlugin plugin;
     u8 stackPointer;
     u8 executionState;
     u8 scriptCmpResult;
     u8 padding;
     AsmCall funcptr;
     u8 *script_pos_ptr;
     u8 *script_stack_ptr;
     u32 *vars;
     ScrcmdEnvironment *scrcmd_ptr;
     ScriptCall script_callback_verifier;
     void *sys_info;
     Arc_Tool *script_arc_file_ptr;
    };

    ScriptPlugin being this:

    struct ScriptPlugin
    {
     ScriptCall *plugin_lut;
     int plugin_cmd_count;
     int plugin_min_cmd;    // seems to always be 0x3E8(1000d)
    };
    

    at 0x216C1EC there's a set of 17 registered script plugins. each info set is 0x14 bytes. basically, there's a word in the player data(0x223B370 + 0x2F8) that gets updated when a plugin is needed. that byte is read while the script environment is being built and the right plugin pointer is loaded from the array. that plugin ptr is written to the script virtual machine. then the plugin ptr is run through a verifier function that verifies the plugin and counts the number of commands in it. that number of commands is written to the virtual machine and so is 0x3E8, which is always the minimum script command value. after it's loaded, the script handler and virtual machine run as usual. when they hit a special command from a plugin, it activates an exception handler kind of thing that handles the very high script number and points the handler to the plugin to pull data from. after that command runs, it returns to the main script handler and continues execution commands back and forth between the main script command set and the plugin.

  5. Old post, but I came up with this for Emerald (see this post for FireRed/LeafGreen):

    Walk in Menu/Conversation (Hold R)

    99CF8FED 916474F5
    AC9EE500 A6C63E09
    

    Seems to work fine on VBA-H and VBA 1.7.2. Here's an image:

    walk_in_menu.png

    Here's two more codes for Emerald:

    Items Cost $1

    FF363D32 86978AE6
    9E9098F2 D85C96B3
    3769FF8D 71474369
    

    Infinite Money

    97563A1B E119B7B7
    20D4ACD4 DD1F5161
    634287F7 54873DB0
    5FD329F8 BB39EA3B
    73393D39 B10006BF
    222C5768 3B0D60E6
    402938A0 FC19BD6D
    A05A144C 078B0074
    

    It seems like no one made a working Infinite Money code for this game.

    Note 1: This is an ASM hack and it went over the 3 ROM code limit so it will most likely only work on an emulator.

    Note 2: You have to buy an item before it becomes max.

    money.png

    can you post the unencrypted codes? just curious.

    e: also, how do you enrypt/decrypt gba ar codes again? i've done it before for codes i've made for this thread, but i can't find the document i read on the subject.

    e2: i don't mean encrypt/decrypt. i mean like... how do you take instruction hex, i.e. 08000300 00001234 and convert it to be encrypted?

  6. i honestly don't know. it could be that the firmware/software on your flash card has an issue with patching dp to work. try this:

    start a new game in desmume. play up to the point the game would crash. save your game in desmume. export the save as a .sav file from desmume and run it on your r4. play for a minute or whatever and then save again. see if pokegen works at that point.

  7. To just make sure, I changed my Save-Game Manager and I updated my R4 with the latest Wood R4 download. I then quickly made a new save and then tried to simply changed my starter's level to 1 right after getting it. Pokegen still crashed. I don't know what to do anymore.

    post the new save. i'll guarantee you it's broken like the last one.

  8. But why is it only doing it on every Pokemon Pearl and Diamond save I make and not on Platinum, Gold, Silver, Black, White, Black 2, or White 2? Both English and Japanese versions I might add.

    it doesn't matter. that save you gave me is broken. the footer on the "big block" in the save is empty, among other issues. try making a new one or something. the save is 100% definitely broken. maybe find a new rom, a later dump. i don't know.

    e: pokegen is properly editing the save. it gets stuck when it tries to.. repair the save after making changes.

  9. yeah, i was right the first time. there are errors with the save that the r4 wrote. either change software on the card to something better, dump and write a real pearl card with the r4, or use desmume to make the saves. crashing isn;t the best thing pokegen could do given a broken save, but this isn't a pokegen bug.

×
×
  • Create New...