*ScrSave, *ScrLoad compressed screen saving and loading ======================================================= J.G.Harston - v1.08 - 15-Dec-1992 *ScrLoad and *ScrSave are commands to load and save compressed screen images, including the palette information. They work on BBC and Master and with shadow screens on the Master, Aries-B32 and Watford shadow screen systems. *ScrLoad --------------- Loads in a compressed screen picture saved with *ScrSave with its palette information. If a shadow screen mode is selected, then any mode change will also be a shadow mode. On a B+ non-shadow modes are forced. Shadow screen cannot be supported on the B+ as the hardware only allows the VDU driver code between &C000 and &DFFF to access the shadow screen memory. *ScrSave -------------- Saves a screen picture, and attempts to compress it. If compressing it would make a longer file (as a very detailed picture would), then the picture is saved without compressing it. Technical details ----------------- The palette information, screen mode and compression information is saved in the load and execution addresses of the file. Load address: &FFFFabbbb a: currently unused and ignored bbb: colours 4 to 7 held as %777666555444 in sixteen colour mode Execution address: &iiipmcccc iii: 000 for compressed, FFF for uncompressed p: if compressed: number of passes 0=1, 1=2, 2=8, otherwise F m: screen mode ccc: colours 0 to 3 held as %333222111000 For example, the file: JARRE FFFF3000 FFFF10CC 5000 is uncompressed, screen mode 1, palette entries 4, 1, 3, 0. The file: PYRAMID FFFF0FAC 00002248 0A94 is compressed, one pass, screen mode 2, palette entries 0, 1, 1, 1, 4, 5, 6, 7. With a sixteen-colour screen mode, the first four bytes of the file are replaced with palette colours 8 to 15. On loading with *ScrLoad, these four bytes are set to the same as the following four bytes. Compressed file contents are run-length encoded. The file is a series of pairs of bytes, each pair being {run},{value}. A run of &00 means a run of 256 bytes.