Home

Awesome

RCS (Reverse Computer Screen)

RCS is an utility to reorder bytes from ZX Spectrum screens before compression.

Technically, the ZX Spectrum screen can be divided in 4 parts:

RCS reorders bytes within each bitmap sector, without affecting attributes. If you apply RCS encoding before compression, the obtained compression ratio should be at least 10% better than usual.

Usage

To apply RCS encoding to a file, use the command-line utility as follows:

rcs Cobra.scr

This will generate a RCS encoded file called "Cobra.scr.rcs", that you must now compress using your favorite compressor (such as ZX0, ZX1, or ZX7).

Afterwards, you have the following choices to restore the original screen from the compressed data:

Partial Screens

Since RCS format reorders bitmap sectors separately, it can also be used before compressing only 1/3 or 2/3 of a ZX Spectrum screen.

Notice however that bitmaps and attributes are stored in separate memory areas for each part of the screen:

Because of this, storing a partial screen requires either compressing bitmaps and attributes as two distinct blocks, or using a contiguous temporary area to copy both.

RCS provides exactly the same choices:

Tech Stuff

The following program helps visualize the regular ZX Spectrum screen ordering:

    10 CLS
    20 FOR F=0 TO 6143
    30 POKE 16384+F,255
    40 NEXT F

The RCS format reorganizes this data as follows:

    10 CLS
    20 FOR S=0 TO 2
    30 FOR C=0 TO 31
    40 FOR R=0 TO 7
    50 FOR L=0 TO 7
    60 POKE 16384+S*2048+L*256+R*32+C,255
    70 NEXT L
    80 NEXT R
    90 NEXT C
   100 NEXT S

License

This utility can be used freely within your own ZX Spectrum programs, even for commercial releases. The only condition is that you indicate somehow in your documentation that you have used RCS.

Credits

RCS was created by Einar Saukas.

Many thanks to joefish for suggesting to implement the "on screen" decoder, Antonio Villena for additional suggestions to improve it, and James 'Arkannoyed' Slasor for providing the compact version of the "buffered" RCS decoder.