Skip to content

TONERR is a dynamic memory buffer for Sonic Heroes which allows you to bypass default file size limits for your ONE archive files.

Notifications You must be signed in to change notification settings

Sewer56/TONERR.ReloadedII

Repository files navigation

Heroes Essentials: TONERR



The One Expandonger Reloaded Reloaded

What else did you think TONERR stood for?

Id: sonicheroes.utils.toner

About This Project

The following project is a Reloaded II Mod Loader mod that allows you to load arbitrarily large files from inside ONE archives. (up to ~2GB)

How to Use

A. Install Reloaded mods as usual. (Extract to mod directory)
B. Enable mod and run the game.

If your mod needs TONERR, consider setting it as a dependency.

The Problem Under the Hood

When Sonic Heroes extracts files from ONE Archives, it allocates a fixed amount of memory to which the individual files are to be decompressed to.

Normally this is a non-issue, however once mods and custom files are involved, larger than the originals, the preallocated buffers may become too small for the custom files causing reads in unallocated memory.

TONERR solves by hooking every single function used to read a file from a ONE archive used by the game. Using my own fast PRS Compression/Decompression library, it calculates the size of the file without decompressing it and provides a new buffer of sufficient size to decompress the file to.

To avoid unnecessary heap allocations, one buffer is reused for all files. This buffer is resized every time a file larger than it shows up.

Original TONER

The original TONER used a slightly different approach, you can read a more in-depth explanation about the problem and how the original TONER tackled it here: https://github.com/Sewer56/TONER

In comparison to the original, this is a more "dumb TONER", it sacrifices RAM Usage for CPU, with less heap allocations in particular.

Acknowledgements

big by JunGSa from Noun Project

About

TONERR is a dynamic memory buffer for Sonic Heroes which allows you to bypass default file size limits for your ONE archive files.

Resources

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published