LBM8 r2
Local Bitmap Mode 8 (release 2)
LBM8 is a Turbo Rascal library and an abbreviation of Local Bitmap Mode 8. It is used to simulate small 8x8 sprites that can be rendered over the regular Vic 20 character display, positioned at any pixel position rather than aligned at character positions.
As a library, the source code is written in Turbo Rascal with some 6502 assembler blocks for speed. This means you can improve upon the code and add more features if you wish. You could even port it to another Commodore computer such as the C64, C16 etc.
Release 2 allows character sprites to go off the screen boundaries.
Getting started
To get started with LBM8r2, I have created a three part tutorial with a PDF explaining the important parts of each command or section.
The first tutorial file covers everything to get an LBM8 sprite moving on the screen.
The second tutorial moves to using fixed-point positioning for the sprite.
The final tutorial gives the player control through the joystick and it is here where the value of the fixed-point positioning comes into its own.
About the tutorial code
The tutorials are for the unexpanded Vic 20, but it will work equally well on a Vic 20 with any memory expansion.
To build the tutorials, you will need Turbo Rascal for Windows, Linux or MacOS. Start Turbo Rascal and load in the project. There are three tutorial files to examine, a folder called chr containing graphics, and a docs folder with a detailed PDF to walk you through interesting and relevant parts of the code.
There are three commands:
Reset - call this if you redraw the screen, it clears the buffers.
RestoreBG - call this each game loop to remove any drawn character sprites.
DrawAt - call each game loop for each sprite character you wish to draw.