don't click here

SA2/SADX Mod Loader

Discussion in 'Engineering & Reverse Engineering' started by MainMemory, Aug 4, 2013.

  1. Yeah, didn't give me any warning.
     
  2. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    So, you copied the files from 7z into your SADX folder, including the SADXModManager.exe file and the mods folder with SADXModLoader.dll, you ran the manager, clicked the "Install loader" button so that it now says "Uninstall loader", checked the "Disable CD Check" box, clicked the "Save and Play" button, and the game starts up without the mod loader showing an error message, and it then asks you to insert disc 2 as if nothing happened?
     
  3. Yep. Guess I'm going to have to track down an American copy. Oh well.
     
  4. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I swear I checked the European cracked version and it showed the error message for me. Well either way, you can get the US sonic.exe file from my website, and it should work as a drop-in replacement for whatever sonic.exe you have.
     
  5. That worked flawlessly, thank you. Is there any way to implement the 360 Controller fix as well? And I'm curious, how does the Mod Manager modify the draw distance / fog? Is it possible to maybe extend it even further and be able to see more of the level at once?
     
  6. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    You can use the patcher on my website to apply the X360 controller fix to the exe directly, it won't conflict with the mod loader. If by draw distance and fog you're referring to the items in the configuration editor, that is just providing an interface for editing the settings that autorun.exe already allowed you to change.

    The main problem with draw distance is that the current draw distance settings are relatively close to where the skybox is anyway, so even if you expand it, you'd have to edit the skyboxes for all the levels as well.
     
  7. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SADX Mod Manager update:
    [​IMG]

    Because of this, the configuration editor requires the DirectX runtime.

    Edit: SADX Mod Loader update, now the SADX window has a proper icon if you don't check "Don't fix window" in the manager.
     
  8. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SA2 Mod Loader update, now each CodeLine can contain a RepeatCount element, allowing the same operation to be performed on multiple items in a row, as in the size changing codes.
    There are also several new code types:
    • add - adds a value to the value at the address
    • sub - subtracts a value from the value at the address
    • mul (signed/unsigned) - multiplies the value at the address by a value
    • div (signed/unsigned) - divides the value at the address by a value
    • mod (signed/unsigned) - takes the remainder of dividing the value at the address by a value
    • shl - shifts the value at the address left a number of times
    • shr (signed/unsigned) - shifts the value at the address right a number of times
    • rol - rotates the value at the address left a number of times
    • ror - rotates the value at the address right a number of times

    The mul and div code types in particular have allowed for two new codes that increase and decrease your size as you hold directions on the D-Pad.
     
  9. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    SA2 Mod Manager update, now saving the code xml doesn't put enabled="false" on disabled codes or add <FalseLines /> on if* type codes, and I fixed a bug for pointer-type addresses without any offsets specified.

    The SADX Mod Manager and Loader have also been updated to add support for cheat codes. I may have to change where they execute from, because the place I picked doesn't seem to run until the intro video.
     
  10. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Since my most recent mod reminded me that it existed, I've updated the SADX Mod Loader to display debug messages onscreen if the console is disabled and debug messages are enabled.
    [​IMG]
     
  11. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I've now rearranged the "Show Console Window" and "Show SADX Debug Output" options so that no distinction is made between messages outputted by the loader and SADX, and I've made three output options, all of which can be toggled separately: Console displays a console window, Screen prints messages to the screen (as seen in the post above), and File writes messages to mods\SADXModLoader.log. You may need a text editor that supports Shift-JIS if you want to view the log file properly; unfortunately neither the console nor screen output support Shift-JIS. Now uses UTF-8, no special steps necessary.
     
  12. Pexs

    Pexs

    Otherwise known as Spex Member
    I know not many people post in here, but we're all watching. Keep up the good work!
     
  13. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    Since you've interjected, I'll take this opportunity to say that I've updated the file output to use UTF-8, so now it should Just Work™ with any text editor.
     
  14. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    The SA2 Mod Loader has now been updated to have console and file output options. Screen output is not available, as it appears that the screen printing function was completely removed from this build of SA2.
     
  15. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    There's a new version of the SADX mod loader that initializes mods after all of the DLLs are loaded, which means that mods can modify the data in the DLLs in their Init function.

    And related to that, SA Tools has been updated with two new tools just for DLL files.

    splitDLL is like the regular split tool, except instead of listing addresses in the INI file, it uses the names in the DLL's export table to find data. It's designed to export items from arrays using their index as filenames, and it detects when a model is part of another model that was previously exported, like splitMDL.

    DLLModGenerator is akin to the StructConverter tool, but instead of using the pointer list in the ModInfo struct, it generates an Init function. You will not be able to replace the data in SADXPC's Mystic Ruins Chao Garden with this tool, because the DLLs are loaded on-demand when you enter the garden.

    With this, it should now be possible to perform level edits to the adventure fields, although you will have to fix up the texture list pointers manually.
     
  16. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I have updated the cheat code system in the mod loaders to add something that I've wanted for a while: registers. Each code can now access a set of 16 unique registers by specifying a value of "r0" to "r15" for the Address field.
    Additionally, there are now a new set of code types which allow you to write data from a register to an address (even another register) by specifying the register's index (without 'r') in the Value field. These new code types all have "reg" before the data type indicator, ie writereg8, mulregu16, divregfloat. There are also "readreg" code types that perform the opposite function of the "writereg" types: they read data from an address and store it in a register.

    With this, several advanced codes are now possible, such as a size modifier for SA2 that remembers your size between levels and alters the character's collision sphere also (although it doesn't work quite as well as you might hope).
     
  17. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I have added an option for Windowed Fullscreen to the SADX Mod Loader. If you enable it, then when the game is set to run in fullscreen mode, then rather than enabling Direct3D's fullscreen mode, it creates a borderless window with the same dimensions as your primary monitor, and displays the game's screen in an appropriately sized area in the center, with black borders if the aspect ratios don't match.

    Essentially, it's exactly the same as regular fullscreen, except you can use Alt+Tab to switch windows.
     
  18. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I have upated the SADX Mod Loader to add support for ADX music playback via vgmstream. When the game requests a song be played, the mod loader first changes the file's extension to ADX and searches for matching files, and falls back to WMA if none are found. Other vgmstream formats are also supported.

    I recommend creating an adxmusic mod, copying the music files from your favorite version of Sonic Adventure (DX) to its system\sounddata\bgm\wma folder, and enabling it as the first mod loaded. Note that an ADX file will always take precedence over a custom WMA file, regardless of mod order.

    I will not be uploading a premade ADX music mod, because I would rather not have a 400MB file on my website.
     
  19. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    I am happy to report that thanks to angryzor, not only do songs that are supposed to stop actually stop and resume the normal stage music when applicable, the mod loader will now autodetect any of vgmstream's supported file formats, not just ADX.
     
  20. MainMemory

    MainMemory

    Kate the Wolf Tech Member
    4,735
    334
    63
    SonLVL
    In an effort to make all the model swapping that's been going on in SA2 easier, I have given the SA2 Mod Loader the ability to load split MDL files. For example, when the game loads the SONICMDL file, if it finds a file in the gd_PC folder (original or mods) named SONICMDL\SONICMDL.ini (like splitMDL produces), it will load all the sa2mdl files in that folder, and construct the MDL index based on the information in the INI file. buildMDL is no longer necessary.