Jump to content

Bond697

Former Staff
  • Posts

    1358
  • Joined

  • Last visited

Posts posted by Bond697

  1. it's hypocritical of me to be posting in here, but someone asked me to add a minor feature to my nature adjustor, and i figured out something minorly useful. to change the max EV total, go to 0x201E980 and have a look. you'll see 0x000001FE in ram. that's 510. change it to whatever you want in the arm9.bin @ #(201E980 - 2004000) or use an AR code to change it in ram.

  2. scrcmd.txt from my info dump in the r&d forum:

    http://pastebin.com/yhVVej8A

    the script commands are at the end, starting with cmd 0, s0000. the array at the top is super-important if you're adding commands. it's a 0x2f3 u8 array(matching the number of script commands) of bitflags for each script command that each one is verified against before executing. the verifier works because it changes for every type of script command- moves, AI, effects, and events. it's part of the virtual machine built before execution starts. see here: http://img.thundaga.com/verify.png green is the verifier that runs first then hands off to the command execution in red.

    7 is for a normal script command

    1 is an assembly command

    0 is for non-existant script commands- there are about 90 or 95 non-existent script command numbers, more than enough to add your own.

    the other flags are for fine-grained stuff and aren't relevant for basically anyone besides me.

    ex. s0002 ends a script without jumping to the asm handler, so it's a normal script command and is a 7. s0003 pauses the entire script system for a given amount of time- a spinwait kinda thing in C#. it does it via the asm handler in the script virtual machine, so it's a 1 in the verifier array.

    the main script environment struct virtual machine is @ 224A140 and looks like this:

    struct ScriptEnvironment
    {
     u16 maxStackDepth;
     u16 maxVars;
     ScriptCall *cmdArray;
     u32 cmdMax;
     u32 unk3;
     u32 unk4;
     u32 unk5;
     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;
    };
    

    or this if you like it in excel: (see info dump download here for the spreadsheet)

    Offset	Member	Size	Use	224A140	2257248	224738C	224A004
    0x0	Stack size	2	Max size of the script stack- 4 bytes each				
    0x2	Global/Environment var size	2	Max number of global/script environment vars- 4 bytes each				
    0x4	Command ptr array	4	Ptr to command array to fetch script functions from				
    0x8	Command max 	4	Total number of commands				
    0xC							
    0x10							
    0x14							
    0x18	Stack position	1	sp++ every time a value is added to the stack, sp-- when removed				
    0x19	Environment state	1	Script environment current running state- 0/1/2 end/script/asm				
    0x1A	Compare result	1	Used for loading from compare mode array for conditionals				
    0x1B	Padding	1	Empty, 00				
    0x1C	Asm ptr	4	Ptr to asm routine for script state asm				
    0x20	Script pos	4	Ptr to current script position to read from				
    0x24	Stack	4	ptr to stack				
    0x28	Global/Environment var	4	Global/Environment var ptr				
    0x2C	Scrcmd environment	4	Ptr to info container				
    0x30	Script callback	4	Ptr to script callback verifier function				
    0x34	Gamesys	4	Ptr to main gamesystem				
    0x38	Script file	4	Ptr to beginning of loaded script file via Arc_Tool*				
    

    the entire core of the script system: (see scriptHandler_main for the actual script handler with notes)

    http://pastebin.com/zk31sJYg

    and last, there are up to 4 virtual machines running at once in a struct that looks like this:

    struct ScriptSystem
    {
     u16 vmMax;
     u16 vmCount;
     ScriptEnvironment *vmachines[4];
    };
    

    vmMax is always 4 and the first element of vmachine struct ptrs will always be 224A140. there's a script command that adds to this and creates submachines off the main one: s001B.

    (for anyone who hasn't realized it by now, the entire(literally entire) game hinges on a series of structs within structs within structs with structs that are nothing but pointers to other structs. gamefreak is obsessive about it. it also happens to be good practice for an embedded ARM system- reducing literal pools via relative offsetting, etc.)

  3. thanks.

    this was originally closed because i didn't want any commentary. a couple people suggested i open it because there's SO much in the archive that wasn't meant for anyone else to see and is.. not easy to understand. the main IDA database is the big one(viewable as plain text via the .s file), as it has 3500 of gamefreak's functions hand-labelled with explicit, functional names- most with arguments and return types included. it was.. a lot of work for 1 person. now i just want people to use it and make cool shit. that and the spreadsheet are what people will get the most use out of.

  4. This was going to be a longer thing about what's wrong with "hacking" here and with the Pokemon community in general. I'm not going to bother since it would all fall on deaf ears. I'll just copy and paste parts of the end bit from what I wrote:

    So.. I'm done. The link at the bottom is to all of my stuff- databases, notes, the spreadsheet, programs, etc. The IDBs are also in text format(.s is plain text; don't use notepad though- they're too big). I'm sure more than a few people will want some of the lists and .bss sections from the different binaries in them- especially the script commands and such ... That said, I'm not exactly leaving completely. I will still be working on PokeGen occasionally and the development "library" for W2. A few of those headers are done. Expect something like the main boost lib where almost the entire thing is headers and it will come with instructions for building code and a list of what to install(DevkitARM and such).

    (You're going to want IDA 6.1.110315 to view the IDB files. That's where the most useful stuff is. arm9-white2_decompressed_U.idb is the main one.)

    http://hack.thundaga.com/hacking_stuff.7z

  5. We'll figure out something you being an expert, but I do not mean that I do not understand

    anything.You are always prevented in saying that you do not share your thing, but I did not ask you to share.

    Anyhow thanks

    Edit:With what program I have to open?I do always make a thousand questions, but it is normal that I do a thousand questions, do not a guide and do not know what to do, then do not complain if we do a thousand questions.

    try doing something for yourself and figuring it out for yourself and not asking for tons of help at every step. nobody owes you any answers, tutorials, or programs.

  6. yeah, you only have access to the pokemon available in the area you get at the dream point level you're at. so you have to earn enough points to make the others available.

    since this makes so many pokemon available to you every time, it's easy to think you're just getting the same stuff and something might be wrong each time since it's giving you 8 pages which obviously covers everything available multiple times.

×
×
  • Create New...