X-Hax / sadx-mod-loader

Sonic Adventure DX PC Mod Loader
59 stars 17 forks source link

Remove GBIX and weird memory limitation #131

Open Sora-yx opened 12 months ago

Sora-yx commented 12 months ago

I had in experimentation a code that prevent the game to fill the GBIX array so it always treat texture as new, while still being limited to a maximum of 2048 textures, this has the advantage of removing GBIX conflict for textures, making replacement easier.

However, after some tests, it has been discovered that the game crashes when using HD GUI and unlocking a new GameGear game, regardless of the level or how long the game has been running.

image

HD GUI for what I saw load the subtitles PVM ~5 times in the result screen before it actually crashes, I'm guessing GBIX prevent the crash since the game doesn't have to re load the textures.

Now, while this could be fixed on HD GUI side, that wouldn't really fix the original issue, any other mod could potentially do something similar, if not the game itself, so it would be nice to figure out why this error happens and how to fix it. This could even be a D3D8 limit thing, but I find this kind of odd. If the limit cannot be increased, it would be nice to at least prevent the game to crash.

pkr-sadx commented 12 months ago

The hook on the emblem count screen in HD GUI made it load textures infinitely, which is bad either way so I redid it to hook a different function. It may no longer crash, so here's the DLL from the old version just in case. HD_GUI_old.zip

PiKeyAr commented 3 months ago

Alternative implementation: Hack the game to always load the texture when its GBIX is 0 so the modders could just set the index to 0 while the rest of the GBIX system will remain functional. As far as I know, SA1 DC ignores GBIX 0 as well.