ColourTrans_SetGCOL on Pi

Discuss all aspects of programming here. From 8-bit through to modern architectures.
Post Reply
ksattic
Posts: 4
Joined: Sun Jul 01, 2018 8:31 pm
Contact:

ColourTrans_SetGCOL on Pi

Post by ksattic » Wed May 15, 2019 9:41 pm

ColourTrans_SetGCOL works as expected on my A5000. On the Pi in a 32 bpp mode it appears to always select black. I'm assuming that's because GCOL/colour numbers are not meaningful in 32 bpp modes.

So, what's the alternative? :?:

I'm trying to draw directly to a window in the desktop using BASIC and plot commands. Nothing fancy, nothing fast. I'm hoping to not have to figure out my mode pixel format and write directly to the screen.

User avatar
flaxcottage
Posts: 3568
Joined: Thu Dec 13, 2012 8:46 pm
Location: Derbyshire
Contact:

Re: ColourTrans_SetGCOL on Pi

Post by flaxcottage » Thu May 16, 2019 8:15 am

The latest version of RISCOS on the Pi handles colour and screen modes very differently from the A5000.

I tend to use the Pi to try to run retro educational software using MODE1, say. The Pi uses 64 colours in MODE1, whereas the A5000 uses just the 4. I set the colours in constants, Red%=3, for example, and in all GCOL or COLOUR statements use the constant to set the colour. That works a treat and the colours display properly. Change the constants and the code works on my A5000 too.

With 64 colours, using GCOL3,x is fun! :lol:
- John

Image

ksattic
Posts: 4
Joined: Sun Jul 01, 2018 8:31 pm
Contact:

Re: ColourTrans_SetGCOL on Pi

Post by ksattic » Thu May 16, 2019 2:21 pm

Understood, but ColourTrans is supposed to abstract that away, no?

I managed to get it working - for some reason I thought that running a BASIC file from the Wimp and executing commands after F12 (note: not from a task window) were fundamentally the same. ColourTrans_SetGCOL works as expected on the Pi after pressing F12 but not when running a BASIC file from the Wimp.

Interesting that the Pi allows the use of more colours in MODE 1! I'll give that a try...

Post Reply