The RASTER AT
instruction will set the next execution raster line for a
raster routine. A raster routine is a small program or sequence of instructions
that uses a particular moment in the screen display to be activated. This is
when the electron beam (the raster beam) scans the screen, line by line, to
draw the image.
The mechanism is simple. The computer generated an interrupt (a signal that
stopped the main program being executed) every time the raster beam reached
the given line on this instruction. When the interrupt occurred, the
processor passed execution to the raster routine. The routine directly does
something, like modify the video memory o registers. Once the change was
complete (by using the instruction NEXT RASTER
), the processor would
resume execution of the main program from where it had stopped.
Using this mechanism, programmers could create very simple, but often
surprisingly engaging, graphics, animations, and games, considering the
hardware limitations of the time. They were essential
for creating effects such as scrolling, moving sprites around the screen,
creating explosion or deformation effects.
Raster routines offers very precise control over image generation,
allowing for customized and optimized effects, and stimulated
the creativity of programmers, who could invent new ways to exploit
the mechanism to create innovative visual effects.
RASTER AT line WITH label RASTER label AT line
RASTER AT #&H42 WITH rasterRoutine RASTER AT (rasterLine+1) WITH rasterRoutine
Join BASIC 10Liner Contest with ugBASIC!
An interesting competition is held at the beginning of each year: the
BASIC 10Liner Contest.
It is possible to use ugBASIC to participate in the next
"BASIC10Liner" competition, in the following categories:
RASTER AT ↔ RstAt
If you have found a problem with this keyword, if you think there is a bug or, more
simply, you would like it to be improved, open an issue for this example on GitHub.
Thank you!
open an issue
BACK TO KEYWORDS