Available on: c128 c64 vic20 c64reu plus4
See also: NEXT RASTER NEXT RASTER AT

RASTER AT

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.

SYNTAX

 RASTER AT line WITH label
 RASTER label AT line


Legend
  • id : identifier
  • type : datatype
  • v : value
  • "..." : string
  • [...] : optional

EXAMPLE

 RASTER AT #&H42 WITH rasterRoutine
 RASTER AT (rasterLine+1) WITH rasterRoutine


ABBREVIATION: RstAt

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:

  • PUR-120 - A game in 10 lines of max 120 characters (w/abbrev.)
  • EXTREME-256 - A game in 10 lines of max 256 characters (w/abbrev.)
  • SCHAU - Any program in 10 lines of max 256 characters (w/abbrev.)
In order to reduce space you can use this abbreviation for this instruction:

RASTER AT ↔ RstAt

Any problem?

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