Jump to content

Bond697

Former Staff
  • Posts

    1358
  • Joined

  • Last visited

Everything posted by Bond697

  1. someone asked me a bunch of questions that i couldn't answer, so i started reading through code. anyway, one of the things i picked up is that a/1/7/2 is for route connectors. each of those 124-byte files defines all the relevant data for the connectors. the other thing i did was take apart save block 37: Member Offset Size Use RTC Offset 0x0 8 "RTC offset" is the change in seconds (positive or negative) of the time since the last boot- for tracking player clock changes Birthday Month 0xE 1 Save owner's birthday month Birthday Day 0xF 1 Save owner's birthday day Adv Time Blk Init 0x10 4 Indicates that the adventure time block is ready/initialized Year 0x14 4 Current year Month 0x18 4 Current month Day 0x1C 4 Current day Weekday 0x20 4 Current weekday Hour 0x24 4 Current hour Minute 0x28 4 Current minute Second 0x2C 4 Current second Datetime Days 0x30 4 Current datetime days(days since 1/1/2000) Newgame Datetime Seconds 0x34 8 Datetime seconds on new game boot(seconds since 1/1/2000 up to new game boot) Datetime Seconds 0x3C 8 Current datetime seconds (seconds since 1/1/2000) Minutes in Day 0x44 4 The total number of minutes that have passed in the given day: counts down from 1440 to 0 - this only works if you reset and load a save. savestates break this for obvious reasons. block 37(0x25) also fyi: don't use script flags 0-99 or const vars 4000-4031. they are reinitialized on each boot.
  2. just another update on this: i'm still going. i just finished the main file manipulation functions. here's a preview: it's going pretty well.
  3. i want to delete this, but it's too funny not to leave.
  4. yes, but it would take a lot of hacking. you would need to change the box limit, add heaps for each box that would eventually end up in the save, etc.
  5. we have saves. this is useless unless he's actually going to do something useful with them and not just go dick around with them, repeating work yet again.
  6. aaany time you want to actually start contributing something useful, you have a list of what to do.
  7. awesome, thank you
  8. this could not have less to do with pokegen.
  9. https://dl.dropboxusercontent.com/u/13004170/hacking_stuff.7z
  10. if you really want to help: a. take this, it's loaded with info: http://hack.thundaga.com/hacking_stuff.7z b. map save blocks 27, 28, and 55 fully - we figured them out, but i don't have time to map them and am not really hacking anymore that would be an excellent start.
  11. post a save with (ideally) an active fes mission and a completed fes mission.
  12. i just went back and checked and i think the rom i used might've been patched for antipiracy. so get a clean rom, patch it with the antipriacy thing, and then apply the patch.
  13. that's very easy.
  14. technically, yes.
  15. 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: 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.
  16. 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..?
  17. do you take contributions? i figure it's easier to just add to this instead of making my own.
  18. if you have an acekard, you can just use wood dumper to dump ds games. works great. http://gamebrew.org/wiki/Wood_Dumper
  19. 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.
  20. 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.
  21. oh, so you don't have to do that stupid shit where you right-shift the address by 1 or 2 and whatever else to convert it before encryption?
  22. 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?
  23. why not? you have an r4. dump the saves.
  24. 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.
×
×
  • Create New...