don't click here

SADX/SA1 Hacking/Modding

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 15, 2009.

  1. Someone did something similar with the trial, 3:45 in the video:



    For a second there I thought you had ported that boss battle to SADX...
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I've known that SA2's SET files are the same as SA1's (I don't know that everybody knew), Morph has had a list of object IDs for City Escape but has been too lazy to put them on the wiki, and you should be able to use SETswitch to convert between Dreamcast and GameCube. Perhaps the object list is in the same format as SA1?

    Also this is technically not a thread for SA2 hacking.
     
  3. SF94

    SF94

    Tech Member
    The one who compiled that list is actually "Psyhcojason", who is also the owner of the video ultima espio posted earlier. The only reason I got it was because I was going to "help" him even though I really couldn't do much except for screw around with the set files. But meh, might as well. Items are probably not totally accurately labeled or anything, but that can be dealt with... at some point.
     
  4. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    [​IMG]
    As you probably guessed, this is a cheap clone of calc.exe I made specifically for hex editing sonic adventure files. Operations such as converting rotations and adding/subtracting pointer keys are now one-click operations instead of several. Being lazy never felt so good.

    Downloads:
    http://x-hax.cultnet.net/SADXCalculator.rar
    http://www.megaupload.com/?d=Q5EA9WD0
     
  5. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Meanwhile, I've made some progress on "my "build" tool, and now it can insert ASM code. Just have an INI file with the name of your EXE, plus "_code"; for example, "sonic.exe" would have "sonic_code.ini". The INI will have something like this:
    Code (Text):
    1. [Describe Code Here]
    2. filename=asm/myfile.asm
    3. nop=100A-100F ;comma-separated list of locations to replace with NOPs, if you have to insert a CALL opcode (5 bytes) in the middle of other code and it overwrites half of an instruction.
    4. call=100A ;addresses to insert a CALL to your code. If you do overwrite other code with a CALL to your code, you probably want to include the codes you wrote over in your asm file.
    5. pointer=2000 ;addresses to put a pointer to your code, for example, to load a custom object instead of a default one.
    If you use CALL or JMP in your asm, you have to refer to the file address of the code, not the RAM address. When using data, such as writing to a RAM variable, use the RAM address. build uses The Netwide Assembler (NASM) to assemble the files, so it may help to be familiar with it.
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I have added support for LandTable (level geometry) to split and build. Additionally, I'm releasing a very early build of the new SADXLVL. It can only view levels so far. To use these programs, you'll need to put these files in a folder with a clean SADX EXE.

    I have tested, and splitting and building Emerald Coast 1's geometry works perfectly fine, although the texture animations don't work anymore.
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Rather than fill the SVN with a bunch of EXE, DLL and PDB files, I'm going to make the latest build of the SADXPCTools available here. This includes split and build, the INI files and readme, and SADXLVL2 in its own folder.

    As of right now, SADXLVL2 can:
    • Load levels
    • Select level parts with the left mouse button, and select multiple parts with Ctrl
    • Move level parts by holding the left mouse button
    • Rotate the camera by holding the middle button
    • View and edit some properties of selected items (position, rotation, surface flags)
    • Save levels
    Eventually, SADXLVL2 will have all the features of the original, plus the ability to add and remove level parts, death areas, and starting positions. If there's something you'd like that the original didn't have, tell me and I'll try to make it work.
     
  8. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Can you make the pth import not zero out the rotation values? That's the only thing keeping me from editing loops.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I'll probably update SADXPath to include all three rotation values at each point in addition to the position.
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I probably won't bump the topic for every update, but I made it so you can actually change the position and rotation properties, and added OBJ import.
     
  11. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    It might take awhile for that link to work, for some reason the x-hax server has been squirrely lately.
     
  12. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SADXLVL2 update: It can edit start positions and SET files now; only Rings are defined, everything else is "Unknown".
    You'll have to run split.exe again to split the ring model and character texture lists.

    Download
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I have figured out some things about the E101R_GC.NB file...
    It starts with a 10-byte header of some sort, starting with "NJ".
    After that, it has a bunch of "chunks", with a header with a 2 byte type, 2 byte unknown, and 4 byte size, followed by that many bytes of data.
    The data types are normal Sonic Adventure model data, Dreamcast version.
    At 0x85F0 is the root OBJECT, which uses a key of -0x10, so to view it you have to remove the header. Opening it in SADXMDL with the settings "Model File", 85D0, Dreamcast shows this:
    [​IMG]

    After the model data, there appear to be animations, but they seem to start with the AnimHead2 struct, and I haven't figured out the "key" they use yet.
     
  16. Dude

    Dude

    Tech Member
    3,138
    0
    16
    Southbridge, MA
    Random VR/AR trash
    Whoa. I wonder if there's a way to get the game to load those instead of the embedded models. That would make things alot easier.
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Not any easier than splitting model data from the EXE and compiling it back in, which is what my split and build programs do. I think you'd have to write a whole new routine to load these files, this one seems to have stuff for setting up AnimHead structs at specific addresses.

    Speaking of split/build... I'm thinking of changing the model files from INI to raw binary with a small header pointing to the root OBJECT. Because honestly, the INI files are kind of huge.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I hate to double-post within two hours, but I just discovered that what I assume is a Chao model (it's used in the Chao's Display routine) is using the SA2 model format.

    Not terribly surprising, but I guess it's a reason I might want to make an SA2 model viewer.

    Edit: Yeah I can't understand the formats from SANiK's notes...
     
  19. darkspines35

    darkspines35

    It's Easy Actually. No, seriously. Tech Member
    248
    0
    16
    .V.
    Sanik Adevnt Casters
    I can help you figure it out. I already worked a crap load on trying to do my own MaxScript importer which went nowhere other than importing verts. So yeah, let me know what you need help with and I'll help.
     
  20. It's actually a good idea. If you did levels too, we'd finally be able to view the Chao Library as it's supposed to be. The picture I made years ago is full of other objects, and the uvs are broken on most.

    Speaking of which, do you think it would be possible to use Cheat engine on the DC version to get it to load the Library instead of the Classroom or something?