Skip to content

justforthefunofit/create-sprite-print-basic-program

Repository files navigation

PRINT vs POKE – Sprite Builder in BASIC

This repository is a follow-up to my earlier project where I explained how to use the PRINT command instead of the usual POKE to manipulate memory on the Commodore 64.
That trick made it possible to define sprites faster by printing specially formed strings directly into screen memory.

See my earlier created video on this here:
https://youtu.be/7vJO_p5X_ak?si=R3KAE_U25Xbnh31i


What’s new here?

This time, no Excel macro needed!
Instead, the conversion is done fully in Commodore BASIC.

  • The program takes a normal sprite definition written with DATA statements.
  • It automatically generates a set of BASIC lines.
  • These lines can be saved to disk as their own program.

Load that generated program back, run it, and voilà — your sprite is instantly created.

Examples:

  • Program showing how to create the string from normal sprite definition readme Code
  • Proof of concept to demonstrate creating of a basic program line readme Code
  • Program showin how to create a basic program with the appropriate basic code lines readme Code
  • Example program generating actual basic lines to be used in your program readme Code
  • Example on hoe to concatenate two basic programs so the sprite definition can be used (readme)

Defining the example sprite (used in the example code)

I used the online sprite creator at https://petscii.krissz.hu/ to create a simple sprite as an example in the code.

image

Use the sprite data

From this online sprite creator I exported the definition in raw byte format and then converted it to basic lines. Replaced, by search and replace, 'BYTE' to 'data' en then copied it to CBM prg studio to add linenumers to it.

like this:

image image

About

Follow-up to my PRINT vs POKE repo. This time no Excel macro, but pure Commodore BASIC: the program converts sprite DATA into BASIC code lines and saves them as a program on disk. Load it back, run it, and your sprite is ready to go!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages