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

๐Ÿ–ฅ Oriental Paintbrush Sim

This is a port and mod of a QBJS program ("Calligraphy Pro 128 Studio:  Oriental paintbrush mode") by Vince. Click/touch the canva...