ROM type signature

From MSX Game Library

Revision as of 01:55, 16 February 2024 by Aoineko (talk | contribs)

This documentation is a proposal for ROM type signature to help Flash tools and emulators correctly detect ROM formats and, in particular, the type of mapper used.

Note: All the strings of this page are defined without zero-terminator.

ROM type signature

The ROM type signature is 8 bytes long and placed just after the ROM header starting with "AB".

Mapper Signature
Plan 16 KB "ROM_PL16"
Plan 32 KB "ROM_PL32"
Plan 48 KB "ROM_PL48"
Plan 64 KB "ROM_PL64"
ASCII 8 KB "ROM_ASC8"
ASCII 16 KB "ROM_AS16"
Konami 8 KB (K4) "ROM_KON4"
Konami 8 KB with SCC (K5) "ROM_KON5"
NEO 8 KB "ROM_NEO8"
NEO 16 KB "ROM_NE16"

Detection

Most of the time, the ROM header is at the beginning of the .ROM file, so the signature is at offset 16 of this file. However, there are formats where this is not the case, such as a 32 KB ROM with its header visible at address 0x8000 of the memory space and therefore placed in the .ROM file at offset 0x4000.

Appendix

Header as code

The 4 first bytes of the ROM type signature "ROM_", have been choose because the code it generates is so incoherent that it's extremely unlikely that a program would start with these instructions and therefore unintentionally contain a valid signature.

Code generated by the first 4 bytes of the signature:

ld    d, d
ld    c, a
ld    c, l
ld    e, a

Known ROM signature

Device Signature Size
MSX-Audio "AUDIO" 5 bytes
Internal MSX-Music (and FM-PAC clone) "APRLOPLL" 8 bytes
FM-PAC "OPLL" 4 bytes