sbTransform

Last Modified: 11/15/2026

Transforms the graphic data loaded into the graphic buffer from the sbLoadGfxBuffer command using a trasnformation map generated by SecondBASIC Studio.

Arguments

NameTypeRequiredDescription
TxfmTableAddress Long Integer Yes The address of the transformation tables to apply to the graphics.
Frame Integer Yes The frame of the transformation you want to tranform to.
Size Integer Yes The size of the sprite. Valid values are 1, 2, 3, and 4.
Type Integer Yes Tells the routine if it's a background or sprite source. 0 is for background, 1 is for sprites.
UserBufferAddress Long Integer Yes The address of the variable you want to store the transformation data into. This is any long variable you want to use.

Example

Syntax: sbTransformation <TxfmTableAddress>, <Frame>, <Size>, <Type>, <UserBufferAddress>
    Option UseSBGfxLib
 
    Global sbGfxBuffer&(511) As Long, sbVRAMBuffer&(511) As Long, sbBuffer&(511) As Long
 
    TxfmTbl& = LblPtr&(MyTxfm)
 
    sbLoadGfxBuffer LblPtr&(MyGfx), 4, 1
    sbTransform TxfmTbl&, Frame, 4, 0, VarPtr&(myBuffer&)
    LoadTiles myBuffer&, 16, 256
 
MyGfx:
    DataFile "c:\SecondBASIC\MyGfx.bny", Bin
MyTxfm:
    DataFile "c:\SecondBASIC\MyTransformation.txm", Bin

Remarks

In order to use the sbLoadGfxBuffer and sbTransform, you'll need to set the Option UseSBGfxLib setting, and then you'll need to set a Global variable called sbGfxBuffer&() as a Long, sbVRAMBuffer&() as a Long, and sbBuffer&() as a Long arrays for the graphic routines.

The size of the graphics must be square (i.e., 1x1, 2x2, 3x3, or 4x4 tiles). This will be expanded upon in the future.

Currently only 4x4 sprites can be loaded into the graphic buffer. This will be expanded upon in the next update.