Functions | |
| void | MaybeStripSmcHeader (std::vector< uint8_t > &rom_data, unsigned long &size) |
Variables | |
| constexpr size_t | kBaseRomSize = 1048576 |
| Standard SNES ROM size for The Legend of Zelda: A Link to the Past (1MB) | |
| constexpr size_t | kHeaderSize = 0x200 |
| void yaze::anonymous_namespace{rom_old.cc}::MaybeStripSmcHeader | ( | std::vector< uint8_t > & | rom_data, |
| unsigned long & | size ) |
Detects and removes the 512-byte SMC copier header if present.
SMC headers were added by SNES game copier devices (Super Magicom, Pro Fighter, etc.) to store metadata about the ROM. Modern emulators and tools expect headerless ROM images, so this header must be stripped for correct operation.
Detection Logic:
This modulo-based approach correctly identifies:
| rom_data | The ROM data buffer (modified in-place if header found) |
| size | The file size (updated if header stripped) |
Definition at line 95 of file rom_old.cc.
References LOG_INFO.
|
constexpr |
Standard SNES ROM size for The Legend of Zelda: A Link to the Past (1MB)
Definition at line 60 of file rom_old.cc.
|
constexpr |
Size of the optional SMC/SFC copier header that some ROM dumps include. This 512-byte header was added by SNES copier devices (Super Magicom, etc.) and contains metadata about the ROM. It must be stripped for correct address calculations since all ROM offsets assume a headerless image.
Definition at line 66 of file rom_old.cc.