Sunday, August 27, 2023

๐Ÿ†• RGBAPSET and ๐Ÿงผ Consecutive Commas

 Latest version of BASIC Anywhere Machine.


๐Ÿ†• RGBAPSET

The RGBAPSET graphics statement sets a pixel at a specified coordinate to a specified alpha-blending of the already colour at the coordinate with a specified colour. The alpha value (0-255) determines the transparency of the specified colour (0 is completely transparent, as in no change to the already existing colour, and 255 is completely opaque, as in the already existing colour is entirely replaced.


  • x%
  • y%
  • rgbColour&
    • A long integer
    • A value representing an rgb colour
  • alpha%b
    • A "byte" integer (i.e. value between 0 and 255)
    • 0 indicates 100% transparent, meaning the new colour will be 100% the already existing colour
    • 255 indicates 100% opaque, meaning the new colour will be 100% rgbColour&
    • any in-between value will indicate the weight of rgbColour& (the weight of the already existing colour will be 255 - alpha%b)


๐Ÿงผ Consecutive Commas

Previously, BAM programs would fail when a program had any consecutive commas, requiring the programmer to make sure to separate commas by one or more spaces.

Now, the pre-processor handles consecutive commas by automatically inserting a space between consecutive commas.

For example, the following statement would get mangled by the pre-processor (causing a program to fail):

CIRCLE (100,100), 25, 14,,,,F

The pre-processor would convert that statement to:

CIRCLE (100,100), 25, 14F

Bad BAM. Bad.

Today's version of BAM, during pre-processing, takes a statement like:

CIRCLE (100,100), 25, 14,,,,F

And convert it to:

CIRCLE (100,100), 25, 14, , , ,F


⚗ Testing: POLYGON macro and support library

This version of BASIC Anywhere Machine inclues the POLYGON macro (see related blog entry.) 

Please note that this is just for prototyping, and will eventually be removed from BAM once the equivalent statement is developed in an include library.



No comments:

Post a Comment

๐Ÿ–ฅ Flower Tesselation: Testing DRAW and recursive SUB's

This BAM program inspired by Richard Russell's "Flower-like tesselation" BBC BASIC program posted on Facebook . Created in ord...