-
Notifications
You must be signed in to change notification settings - Fork 73
Description
Follow-up to: #2614 (comment)
Currently, we use the sotn-assets tool to extract data from the binaries in disks/ into the assets/ folder, either as readable files or raw binary. We then run sotn-assets build to convert those assets into header files, which are included in the C source like this:
u8 text_item_up[] = {
#include "gen/text_item_up.h"
};This works well for portability. Since the data is part of the C source, it builds cleanly across compilers and platforms. However, it has a downside: longer build times. As the project grows, this is becoming more noticeable.
One potential improvement is using .incbin to include raw binary data directly via assembly. This was likely how the original code handled assets, and switching to it could reduce build times by ~20%.
The main challenge is making this approach portable. .incbin doesn’t always play nice with all compilers or targets, for example, it currently fails when I last tried building with GCC 15 targeting x86_64.
This issue is about exploring how we might modify the build system to support .incbin in a clean, portable way. If we can find a reliable method to integrate .incbin without breaking cross-compiler compatibility (Clang, MSVC, MWCC, etc.), it could be a solid upgrade.
We’re assuming a portable implementation is possible. We just need to figure out what changes are needed in the build chain to make it work smoothly, then port the current assets to be used as blob files.