THE .POK FILES -------------- The .POK file format is a proprietary format designed for use with SGD (version 1.20, 22-09-1996) and was originally used to POKE snapshots prior to launching an emulator to play the specific game. This mechanism works on snapshots only. The POKEs in the file are the famous multiface POKEs as published in several magazines and are used for things such as infinite lives. Since the files are easily readable, emulator authors start to add direct support for these files are well, thus allowing users to interactively apply or remove trainers. THE .POK FILE FORMAT -------------------- Each trainer contains one or more POKEs (sometimes more than one check needs to be removed from the game to acquire the result). All trainers for a game are written after eachother. The first character in a line of the file determines the content of the line. 'N' means: this is the Next trainer, 'Y' means: this is the last line of the file (the rest of the file is ignored). After the 'N' follows the name/description of this specific trainer. This string may be up to 30 characters. There is no space between the 'N' and the string. Emulator authors can use these strings to set up the selection entries. The following lines, up to the next 'N' or 'Z' hold the POKEs to be applied for this specific trainer. Again, the first character determines the content. 'M' means: this is not the last POKE (More) 'Z' means: this is the last POKE The rest of a POKE line is built from bbb aaaaa vvv ooo All values are decimal, separation is done by one or more spaces. The field 'bbb' (128K memory bank) is built from bit 0-2 : bank value 3 : ignore bank (1=yes, always set for 48K games) There theoretically is no space between the line tag and the field. However, since the value is never larger than 8, you will always see 2 spaces in front of the . The 'aaaaa' (address) is in range [16384, 65535]. If the field 'vvv' (value) is in range 0-255, this is the value to be POKEd. If it is 256, a requester should pop up where the user can enter a value. The field 'ooo' (original) holds the original value at the address. It is used to remove a POKE. Normally, when applying a POKE, the original value can be read from the address. Sometimes however, games as found on the internet are already POKEd, so the original value can not be read. If this field is filled in (non-0) you still have the possibility to remove the trainer. The format cannot handle the case where the original value was 0, but I haven't so far seen a single case where this was true. HISTORICAL NOTES ---------------- The selection of the first character of each line was made as a joke, when somebody specifically asked for 'a PC binary format', whatever that may be. PC programmers will know that the string 'MZ' marks a PC .EXE file. Using the 'M' and 'Z' tags, I did what was asked. The 'N' (='M'+1) and 'Y' (='Z'-1) tags were derived from it.