Necro-bump. I read this post while looking for a way to create VisualBoyAdvance
.clt files and wanted to share what I've learned from manipulating
.clt files created by two emulators; Android GBA.emu and VisualBoyAdvance-m.
There are 2 primary sections of a VBA
.clt file, one 12 byte global heading and 84 bytes for each individual code. The codes are broken down into four sections; a code heading, little endian code, ascii code
as a name, and the code title name.
Global heading, 12 bytes:
- 01 00 00 00 represents the cheat list version
- 01 00 00 00 represents the cheat list type
- XX XX 00 00 where "XX XX" is the little endian hex number for the total number of codes
Code, 84 bytes:
- heading = 16 bytes, Gameshark is:
- 4 byte code descriptor 00 02 00 00
- 4 byte code type based on 1st number of code
- 00 00 00 00
- 1 byte code enable status; "00" is off, "01" is on
- 00 00 00
- little endian code = 16 bytes, Gameshark (8 4) format is:
- 4 byte little endian code
- 4 byte little endian code with 1st digit set to "0"
- remaining 2 byte little endian code
- 00 00 00 00 00 00
- ascii code as a name = 20 bytes, Gameshark (8 4) format is:
- 8 characters space 4 characters = 13 bytes
- 00 00 00 00 00 00 00
- ascii code title name = 31 characters max, padded with byte "00" to 32 bytes
Gameshark codes have a translation table of sorts where the first hex digit of the code correlates to an 8 byte code type in the code heading. I input bogus codes to get this table.
0xxxxxxx FF FF FF FF
1xxxxxxx 70 00 00 00
2xxxxxxx 21 00 00 00
3xxxxxxx 00 00 00 00
4xxxxxxx 09 00 00 00
5xxxxxxx 24 00 00 00
6xxxxxxx 0B 00 00 00
7xxxxxxx 08 00 00 00
8xxxxxxx 01 00 00 00
9xxxxxxx FF FF FF FF
Axxxxxxx 0A 00 00 00
Bxxxxxxx 23 00 00 00
Cxxxxxxx 22 00 00 00
Exxxxxxx 20 00 00 00
Fxxxxxxx 32 00 00 00
I wrote a text reformatter, for Bash in Linux, to convert RetroArch style
.cht file to VBAM
.clt hex format and vice versa. It currently handles Gameshark style codes only. You can find it on my
Github.