RSDKv5-Decompilation
RSDKv5-Decompilation copied to clipboard
Use setvbuf and allocate a heap buffer on file access
This works around the default 1KB buffer that 3DS newlib has, which makes I/O slow. With this "hack" I mean, workaround, load times are reduced to 25% (around 3-4x faster), making the experience enjoyable. Level loading times around around 4-6 seconds (vs ~25s).
This is a hack, ideally some intermediate loading method should be added for consoles that do not have enough ram to load the entire datapack but have enough memory to load a significant amount of it (i.e. an LRU buffer cache or something).
Please push this fix! 🙏
Interesting workaround! Though I'm not quite sure if the o3DS has enough RAM left to fit some of the bigger files entirely in memory? Also do you mind if I steal this idea for my Wii port?
After playing a bit more, maybe I should cap the buffer at 512KB or so, or exclude ogg/ogv files. Theres a small 400ms freeze when the audio track changes.
After playing a bit more, maybe I should cap the buffer at 512KB or so, or exclude ogg/ogv files. Theres a small 400ms freeze when the audio track changes.
The audio freeze is mostly due to the asynchronous load not being implemented yet.