This is starting to drive me crazy. I know it is not possible to change the text colour directly by assigning r,g,b values. But memory tells me that in the distant past I used to assign an r,g,b colour to the graphics colour and then used a VDU call to swap this colour into text mode.
For the life of me I can't remember the number of this call. Can anybody remember?
Jochen
Re: Swapping graphics and text colour in BBC BASIC
Code: Select all
DEF PROCTxtRGB(rc%,gc%,bc%)
COLOUR 7,rc%,gc%,bc%
COLOUR 7
ENDPROC
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
Re: Swapping graphics and text colour in BBC BASIC
The problem is that this won't work with me, only when I use GCOL. Hence the swap.DavidS wrote:Code: Select all
DEF PROCTxtRGB(rc%,gc%,bc%) COLOUR 7,rc%,gc%,bc% COLOUR 7 ENDPROC
Jochen
Re: Swapping graphics and text colour in BBC BASIC
Are you running in a task window? Of cource if so I would like to know how you are using GCOL.
I will look up how to do it by either a SWI call or an OSByte/OSWord Call.
I will look up how to do it by either a SWI call or an OSByte/OSWord Call.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
Re: Swapping graphics and text colour in BBC BASIC
This will only work in an indexed palette mode. Though I did wonder if it was the solution OP was misremembering.DavidS wrote:COLOUR 7,rc%,gc%,bc%
COLOUR 7
Another possible hack is GCOL r,g,b:VDU 5. But that prints text at the graphics cursor, with a transparent background, and generally very slowly. And is the r,g,b form of GCOL really older than the r,g,b form of COLOUR?
I can find no evidence of a VDU to swap text and graphics colors. Indeed the modern practice seems to be to set colors with SWI not VDU.
For anyone unable to check HELP: the problem no longer exists. COLOUR r,g,b is fine.
Re: Swapping graphics and text colour in BBC BASIC
I am not inding anything after ust a quick look. I know that there is a way using a SWI call, though it may take a while looking through the RISC OS PRMs
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
Re: Swapping graphics and text colour in BBC BASIC
You are quite right, COLOUR r,g,b seems to work for the current colour. The VDU code I talked about was published in the Acorn User some 20 or so years ago. Possibly the problem was worse under RiscOs 3.5. As I always wrote for the WIMP, text colours were generally not important. It's the Raspberry Pi and writing non wimp programs that gave me the problem. I was trying to store two colours and call them on alternate cycles of a program I'm writing that decodes the Frankfurt DCF atomic clock. With a small work-around it works fine now.jojopi wrote:This will only work in an indexed palette mode. Though I did wonder if it was the solution OP was misremembering.DavidS wrote:COLOUR 7,rc%,gc%,bc%
COLOUR 7
Another possible hack is GCOL r,g,b:VDU 5. But that prints text at the graphics cursor, with a transparent background, and generally very slowly. And is the r,g,b form of GCOL really older than the r,g,b form of COLOUR?
I can find no evidence of a VDU to swap text and graphics colors. Indeed the modern practice seems to be to set colors with SWI not VDU.
For anyone unable to check HELP: the problem no longer exists. COLOUR r,g,b is fine.
Thanks everyone who answered.
Jochen
Re: Swapping graphics and text colour in BBC BASIC
Ok, sorry about that. I mostely run at X1280 Y720 C256 F60, so palettized tricks work. I will have to rember to switch to X1920 Y1080 C16M F30 when testing my responce for graphics related questions.
RPi = The best ARM based RISC OS computer around
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.
More than 95% of posts made from RISC OS on RPi 1B/1B+ computers.