SbsRleDecomp

Last Modified: 9/3/2021

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

Arguments

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

Example

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

Remarks

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.