metroid-maniac / SCFW

SCFW Supercard Custom Firmware & Kernel
GNU General Public License v3.0
105 stars 4 forks source link

Minor enhancement - PCEAdvance implementation #15

Closed OmDRetro closed 3 months ago

OmDRetro commented 3 months ago

For tracking purposes

Hints obtained from Patter's emu builders

//ROM header

//from gba.h in the PCEAdvance source code, flags deduced by testing with the Win32 builder

typedef struct {
    char name[32] null terminated;
    u32 filesize;
    u32 flags;
        Bit 0: 0=Full CPU, 1=50% CPU throttle (1 in decimal)
        Bit 1: 0=CPU Speedhacks enabled, 1=Disable CPU Speedhacks (2 in decimal)
        Bit 2: 0=JP rom, 1=USA rom (4 in decimal)
        Bit 5: 0=spritefollow, 1=addressfollow (32 in decimal)
    u32 address/sprite to follow;
    u32 identifier;
    char unknown[12];
} romheader;

Seems pretty straightforward until the part where there's CD-ROM support.

OmDRetro commented 3 months ago

The author made a mistake here(an oversight?). Based on the output of the "PCEAdvance_ROM_BUILDER.exe" file.

The header is actually 64 bytes

After the spritefollow attribute, padded data of 4 bytes is added right after which I assume doesn't have any use yet.

OmDRetro commented 3 months ago

Done! Pushed changes via commit ebf5cd1