CharPad 2.6 User Manual - Subchrist Software, 2020.
CTM File Format, Version 6.
Used by CharPad 2.6 ("Thalamus" Edition) to record project data.
First comes the header, 10 bytes... ID_STR [00-02] : 3 bytes : File format ID string "CTM", ASCII format. VERSION [03] : 1 byte : File format version number (6). COLOURS [04-07] : 4 bytes : Screen colour, Char multi-colour 1, Char multi-colour 2, Char colour. COLR_METH [08] : 1 byte : Colouring method (0 = Global, 1 = Per-tile, 2 = Per-char). FLAGS [09] : 1 byte : Project flags (byte)... Bit0 : MCMODE (Character multi-colour mode enable, 1 = yes). Bit1 : TILESYS (Tile system enable, 1 = yes). Character data block (always present)... BLKMARK : Block marker (0xDA, 0xB0). CHARCNT : Character image count minus one (16-bit, LSBF). CHARDAT : Character image data (eight bytes/rows per image for CHARCNT images, rows are in TB order). Character set attributes block (always present)... BLKMARK : Block marker (0xDA, 0xB1). CHARATTS : Char attribute data, one byte per char image for CHARCNT images, low nybble = colour, high nybble = material. nb. colours are only stored when the colouring mode is "per character". Tile data block (only present if TILESYS is true)... BLKMARK : Block marker (0xDA, 0xBn). TILECNT : Tile count minus one (16-bit, LSBF). TILEWID : Tile width (byte). TILEHEI : Tile height (byte). TILEDAT : Tile data, 16 bits per tile cell (LSBF) for TILEWID * TILEHEI cells * TILECNT items, cells are in LRTB order. Tile colours block (only exists if TILESYS is true and the colouring method is "Per tile")... BLKMARK : Block marker (0xDA, 0xBn). TILECOLRS : Tile colour data, one byte per tile for TILECNT tiles, low nybble = colour, high nybble is unused. Tile tags block (only exists if TILESYS is true)... BLKMARK : Block marker (0xDA, 0xBn). TILETAGS : Tile tag values, one byte per tile for TILECNT items. Tile names block (only exists if TILESYS is true)... BLKMARK : Block marker (0xDA, 0xBn). TILENAMES : Tile name strings (ASCII format, 0 to 32 chars max, zero terminated) for TILECNT items. Map data block (always present)... BLKMARK : Block marker (0xDA, 0xBn). MAPWID : Map Width (16-bit, LSBF). MAPHEI : Map height (16-bit, LSBF). MAPDAT : Map data, 16 bits per cell (LSBF) for MAPWID * MAPHEI cells, cells are in LRTB order. Notes... - LSBF = Least Significant Byte First, TB = Top-to-Bottom, LRTB = Left-to-Right/Top-to-Bottom. - The block markers always consist of two bytes, the first byte is always 0xDA, the second byte always has 0xB in it's upper nybble and the block number in the lower nybble, the block numbers begin at zero and increment by one for each block in the file. - The block markers do not indicate the type of data in a block but the written order of block types (and what type to expect next) will always be as described above. - The block markers really only exist as a development convenience, their values are not actually necessary for the successful reading of a CTM v6 file. File format limitations... Max character images : 65536 Max tiles : 65536 Max maps : 1 Max tile size : 255 x 255 (including non-square) Max map width : 65535 Max map height : 65535 CharPad 2.6 limitations... Max character images : 65536 Max tiles : 65536 Max maps : 1 Max tile size : 10 x 10 (including non-square) Max map width : 8192 Max map height : 8192
See also:-
CTM File Format, Version 1.