ethteck / splat

A binary splitting tool to assist with decompilation and modding projects
MIT License
149 stars 41 forks source link

Make linker entries less janky for .data (e.g. images) #348

Open mkst opened 4 months ago

mkst commented 4 months ago

(copy/pasta from Discord):

The linker names are a little crazy because we are taking the file suffixes and dropping the last one (the aim being to drop the .o)

this leads to the following yaml entry:

    - [0x117200, rgba16, img/intro/spaceship_interior.D_04000630_117200, 32, 32]

generating these lines in the .ld script:

        img_intro_spaceship_interior_D_04000630_117200_rgba16_D_04000630_117200__rgba16__png = .;
        build/assets/img/intro/spaceship_interior.D_04000630_117200.rgba16.png.o(.data);

I think the entry in the linker file should be:

        img_intro_spaceship_interior_D_04000630_117200_rgba16_png = .;
        build/assets/img/intro/spaceship_interior.D_04000630_117200.rgba16.png.o(.data);

This could be done by taking the build_path and removing the prefix (i.e. build/assets) and removing the final suffix (i.e. .o).

This would probably be a breaking change for people though (even if the only change was the double underscores becoming single underscores.

AngheloAlf commented 4 months ago

Currently who is using this feature? I thought papermario was the only one using it and as far as I know they migrated to C files instead

mkst commented 4 months ago

I'm using it a bit in SSSV, I would use it more if it was less janky 🙂