HES
From ArchaicPixels: HuC and PCEAS Documentation
The HES file format is used for storing the PC Engine program data responsible for playing music and sound effects, similar in concept to SID and NSF. The format does not allow for meta-data such as song lengths, titles, or even the number of valid songs contained in an HES. Presumably, the HES format was designed with the use of an external pregenerated playlist in mind.
To begin playing a song after the file is loaded, load the song number into the 'A' register of the HuC6280, load the 8 MPRs, and call the initialization address.
A HES file consists of one 16-byte header, followed by one or more data header and chunk combinations.
The 16-bit "words" and the 32-bit "dwords" are stored in little-endian format.
| Offset: | Type: | Description: |
| $0000 | 4 bytes | Magic string 'HESM' |
| $0004 | byte | Version |
| $0005 | byte | Starting song number |
| $0006 | word | Initialization Address |
| $0008 | byte | Initial MPR0 |
| $0009 | byte | Initial MPR1 |
| $000A | byte | Initial MPR2 |
| $000B | byte | Initial MPR3 |
| $000C | byte | Initial MPR4 |
| $000D | byte | Initial MPR5 |
| $000E | byte | Initial MPR6 |
| $000F | byte | Initial MPR7 |
| Offset: | Type: | Description: |
| $0000 | 4 bytes | ID string 'DATA' |
| $0004 | dword | Data chunk size(not including this 16-byte sub-header) |
| $0008 | dword | Load address for this data chunk |
| $000C | (Reserved for future use, should be 0) | |
| $0010 | 'Data chunk size' bytes | Data to load into the emulated PCE's memory map. |
