Extending VDU 19 to set the alpha channel

Discussions related to graphics (2D and 3D), animation and games programming
Hated Moron

Extending VDU 19 to set the alpha channel

Post by Hated Moron »

A notable omission from the capabilities of VDU 19 is the option of setting the alpha (opacity) channel as well as RGB; at present it's only possible to set fully-opaque colours.

Because the command must always be the same length (6 bytes) there's no possibility of adding an extra parameter. However the high-bit of the logical colour is currently unused (this is used to flag the background colour in VDU 17 and VDU 18, which implies a logical colour range of no more than 0-127).

So I'm wondering about this as a possibility:

Code: Select all

VDU 19, logical+128, alpha, red, green, blue
Would this introduce any compatibility issues?
Ric
Posts: 200
Joined: Tue 17 Apr 2018, 21:03

Re: Extending VDU 19 to set the alpha channel

Post by Ric »

Not for me
Kind Regards Ric.

6502 back in the day, BB4W 2017 onwards, BBCSDL from 2023
Hated Moron

Re: Extending VDU 19 to set the alpha channel

Post by Hated Moron »

On 11/02/2024 10:27, J.G.Harston wrote (cross-posted from the Discussion Group):
I've spent a hour or so with a cup of tea checking documentation and
existing VDU driver code, and it looks like it will be fine. All
pre-existing correctly written code will be sending l<64 to VDU 19(*),
and using bit 7 safely segregates the additional function from
existing ranges.

Also, &80+n has a neat similarity to the use of &80+n in other functions.
Thank you, that's very helpful (I was hoping you would chime in).
(*)Other than an implementation I have that uses VDU 19,255 to set the
border colour, but I think that will also be fine as you would not be
using VDU 19 in a display with more than 64 colours
It's not impossible (BBCSDL can have 128 logical colours, so &80+127 is 'in range') but unlikely, and it's probably the case that platforms on which you can set the border colour don't overlap with platforms on which you can have >64 logical colours and set the alpha/opacity.