BASIC Bloxel and Pixel Functions - fvdhoef/aquarius-plus GitHub Wiki

PSET

TYPE: plusBASIC graphics statement

FORMAT: PSET ( x-coordinate , y-coordinate )

Action: Draws a bloxel or pixel at the specified position on the screen.

  • x-coordinate is the horizontal position of the bloxel or pixel.
  • y-coordinate is the vertical position of the bloxel or pixel.
  • Position '(0,0)' is at the top-left of the screen.
  • In 40 and 80 text mode, the bloxel is drawn in the foreground color of the 2x3 character cell it occupies.
  • In 1bpp bitmap mode, the pixel is drawn in the foreground color of the 8x8 color cell it occupies.
  • In 4bpp bitmap mode, the pixel is drawn in the default color set with the COLOR statement.
  • Error 5, Illegal quantity results` if x-coordinate is not in the range:
    • 0 through 79 in 40 column text mode
    • 0 through 159 in 80 column text mode or 4bpp bitmap mode
    • 0 through 319 in 1bpp bitmap mode
  • Error 5, Illegal quantity results` if y-coordinate is not in the range:
    • 0 through 71 in 40 or 80 column text mode
    • 0 through 199 in 1bpp or 4bpp bitmap mode

FORMAT: PSET ( x-coordinate , y-coordinate ) , color

Action: As above, but draws the pixel in the specified color.

  • color is the color index to use.
  • Error 5, Illegal quantity resultsif _color_ is not in the range0through15`.
  • In 4bpp bitmap mode, the pixel is drawn in the specified color.
  • In 40 or 80 column text mode all pixels in the 2x3 character block are set to the specified color.
  • In 1bpp bitmap text mode all pixels in the 8x8 colormap block are set to the specified color.

FORMAT: PSET ( x-coordinate , y-coordinate ) , XOR

Action: As above, but toggles the pixel.

  • If the specified pixel is blank, it will be drawn.
  • If the pixel is currently drawn it will be erased.
  • Error 5, Illegal quantity results` in 4bpp bitmap mode.

PRESET

TYPE: plusBASIC graphics statement

FORMAT: PRESET ( x-coordinate , y-coordinate )

Action: As PSET, but erases a bloxel or pixel at the specified position on the screen.


POINT

TYPE: plusBASIC graphics function

FORMAT: POINT ( x-coordinate , y-coordinate )

Action: Returns the status of the bloxel or pixel at the specified position on the screen.

  • In 40 and 80 text mode, returns 1 if the bloxel is set, or 0 if it is reset.
  • In 1bpp bitmap mode, returns 1 if the pixel is set, or 0 if it is reset.
  • In 4bpp bitmap mode, returns the color of the pixel (0 if it is reset).
  • x-coordinate and y-coordinate have the same range restrictions as PSET

POSX

TYPE: plusBASIC graphics function

FORMAT: POSX

Action: Returns the current bloxel or pixel X-position.

  • This the x-coordinate of the last PSET or PRESET command.
  • Set to 0 by CLEAR BITMAP and cold start.

POSY

TYPE: plusBASIC graphics function

FORMAT: POSY

Action: Returns the current bloxel or pixel Y-position.

  • This the y-coordinate of the last PSET or PRESET command.
  • Set to 0 by CLEAR BITMAP and cold start.

LINE

TYPE: plusBASIC v0.70d graphics statement

FORMAT: LINE ( start-x , start-y ) - ( end-x , end-y )

Action: Draws a line of bloxels or pixels on the screen.

  • start-x, start-y, end-x, and end-y specify the start and end positions of the line.
    • These parameters are subject to the same restrictions as the PSET command.
  • The color of the line is determined in the same manner as the PSET command.

FORMAT: LINE ( start-x , start-y ) - ( end-x , end-y ) , line_option

Action: As above, but draws the line in the specified color.

  • line_option can be any of the following:
    • A color as used with the PSET statement
    • PRESET, which erases the line
    • XOR, which toggles each pixel in the line
  • Each pixel is drawn as if with the corresponding PSET or PRESET statement.

FORMAT: LINE ( start-x , start-y ) - ( end-x , end-y ) , line_option, RECT

Action: As above, but draws an unfilled rectangle.

  • line_option can be blank, in which case the default mode is used.

FORMAT: LINE ( start-x , start-y ) - ( end-x , end-y ) , line_option, FILL

Action: As above, but draws an unfilled rectangle.

  • line_option can be blank, in which case the default mode is used.