jgharston wrote: ↑
Thu Aug 09, 2018 2:54 pm
COLOUR l,r,g,b issues VDU 19,l,16,r,g,b to set logical colour L to physical colour R/G/B, but COLOUR r,g,b ? Set what?
Sounds to me as though it's somehow bypassing the palette and setting an RGB colour without also setting one of the palette entries. That's 'impossible' in all my versions of BBC BASIC because there's always a palette: if it's a paletted display (which is unlikely these days) then it sets the hardware palette entry; if (as is usual) it's a 'full colour' display it sets a software colour look-up table. This all happens for free in Windows GUI, which has the same concept of hardware/software palette (it makes it easier to code in a display-independent way).
I wonder if Acorn went down the different road of using a palette only when the display is itself paletted, and using RGB values if not. If so it was a poor decision in my opinion, making it more difficult to write a program that will run on both kinds of display. I'm pleased that I was 'out of the loop' for so many years after the BBC and Acorn parted company, and all my BBC BASICs stick very much to the spirit of the original. Where I've added back features from ARM BASIC, I've done so in a way that is in keeping with the philosophy of the original Beeb, and not slavishly followed what Acorn did.
I commonly store VDU sequences in string variables, and use them as a kind of graphics metafile. For example in my SDLIDE program the icons for a program file and a folder, which are displayed in the file selector window, are handled that way:
Code: Select all
OSCLI "spool """ + @tmp$ + "bbfile.vdu"""
PLOT 0,C%,0 : PLOT 99,C%*0.75,-C%*0.75 : PLOT 0,C%/4,C%/4 : PLOT 0,-C%*0.75,0
PLOT 115,-C%/2,-C%/2 : PLOT 0,C%/4,C%/4 : PLOT 98,C%*0.75,C%*0.75 : PLOT 0,0,-C%/2
PLOT 1,C%/4,0 : PLOT 1,-C%/2,-C%/2 : PLOT 1,-C%*0.75,0 : PLOT 1,C%/4,C%/4
PLOT 0,C%*1.25,C%*0.75 : PLOT 0,0,0
OSCLI "spool """ + @tmp$ + "folder.vdu"""
PLOT 0,C%,0 : PLOT 0,C%*0.75,0 : PLOT 99,-C%*0.75,-C%
PLOT 0,C%/2,-C%/4 : PLOT 0,0,C% : PLOT 115,-C%/2,C%/4
PLOT 1,0,-C% : PLOT 1,C%/2,-C%/4 : PLOT 1,0,C% : PLOT 1,-C%/2,C%/4
PLOT 1,C%*0.75,0 : PLOT 1,0,-C% : PLOT 1,-C%*0.25,0 : PLOT 0,C%*0.75,C%
F% = OPENIN(@tmp$ + "bbfile.vdu")
BBfile$ = GET$#F% BY EXT#F%
F% = OPENIN(@tmp$ + "folder.vdu")
Folder$ = GET$#F% BY EXT#F%
The whole idea of a graphics operation which has no VDU-stream equivalent is simply wrong!