Last Modified: 9/3/2021

Decompresses a file encoded with the RLE Compression tool and stores it in memory.


FileStartAddress Long Integer Yes The starting memory address of the compressed file.
FileEndAddress Long Integer Yes The ending memory address of the compressed file.


Syntax: SbsRleDecomp <FileStartAddress>, <FileEndAddress>
    Option UseRLE
    Global DecompBytes(8191) As Byte
    MyTiles& = VarPtr&(DecompBytes)
    SbsRleDecomp LblPtr&(MyGfxStart), LblPtr&(MyGfxEnd)
    LoadTiles MyTiles&, 128, 256
    DataFile "c:\SecondBASIC\MyGfx.rle", Bin


In order to use the RLE Decompression module, you'll need to set the Option UseRLE setting, and then you'll need to set a Global variable called DecompBytes() as a Byte array for the decompression routine.

You can retrieve the decompressed data by treating DecompBytes() as a regular array, or use a variable to act as a pointer to this array, as seen in the example above.

The array size must end in an odd number. You can have a maximum value of 65,535, however, that would utilize all available memory.