== Thomson MO/TO files formats GrafX2 is able to load/save pictures for the Thomson MO/TO ranges of computer in several formats : * RAW binary files. Two files of 8000 (8008 or 8032 with color palette) per picture : One 'P' file for the "FORME" VRAM, one 'C' file for the color VRAM (READ ONLY) * Autoloading DECB binary files. * MAP files (with optional TO-SNAP extension) As the TO7, TO7/70 and MO5 machines only have a fixed palette, palette data (or TO-SNAP) extension is not saved when targetting theses machines. == MAP files documentation for the MAP files : http://collection.thomson.free.fr/code/articles/prehisto_bulletin/page.php?XI=0&XJ=13 MAP files are saved on a Thomson machine using GET/SAVEP and loaded using LOADP/PUT. See link below for loading the palette from the TO-SNAP extension. GrafX2 use an optimized packing algorithm. == GrafX2 autoloading DECB binary files (BIN) GrafX2 use a format that can be natively be loaded on the Thomson machine using the LOADM instruction. The FORME VRAM is selected and loaded, then the COULEUR VRAM is selected and filled. {{{ offset| data | comment 0000 | 00 00 01 e7 c3 65 | write 0x65 to 0xe7c3 to select FORME 0006 | 00 1f 80 40 00 xx xx xx | write 8064 bytes to 0x4000 (VRAM) 1f8c | 00 00 01 e7 c3 64 | write 0x64 to 0xe7c3 to select COULEUR 1f91 | 00 1f 80 40 00 xx xx xx | write 8064 bytes to 0x4000 (VRAM) 3f16 | ff 00 00 00 00 | end marker }}} Here is a BASIC 128/512 program to load such a file : {{{ 10 REM CHARGEMENT D'UNE IMAGE GrafX2 20 REM (C) THOMAS BERNARD 30 LOCATE,,0 'DESACTIVE CURSEUR 40 LOADM"POISCTO8" 50 REM PALETTE EN VRAM APRES L'IMAGE 60 FOR I=0 TO 15 70 BGR=PEEK(&H4000+8000+I*2)*256+PEEK(&H4000+8000+I*2+1) 80 PALETTE I,BGR 90 NEXT I 100 IF INKEY$="" GOTO 100 110 LOCATE,,1 'ACTIVE CURSEUR 120 REM AFFICHAGE DU COMMENTAIRE 130 FOR I=0 TO 31 140 C=PEEK(&H4000+8032+I) 150 IF C>=32 AND C<127 THEN PRINT CHR$(C); 160 NEXT I 170 PRINT }}}