Quantcast
Channel: stardot.org.uk
Viewing all articles
Browse latest Browse all 3098

programming • A3020 8-bit RGB332 Colour

$
0
0
I've been having a bit of fun generating a non-tint based 8-bit palette for my A3020. I found that in mode 13 or mode 28 I could create this palette:

Code:

20 DATA 0,0,0,0,0,2,0,0,4,0,0,630 DATA 0,2,0,0,2,2,0,2,4,0,2,640 DATA 4,0,0,4,0,2,4,0,4,4,0,650 DATA 4,2,0,4,2,2,4,2,4,4,2,660 FOR entry%=0 TO 15:READ b%,g%,r%:VDU 19,entry%,16,r%*16,g%*16,b%*16:NEXT
Then generate an RGB332 (really BGR233) colour range which I tried on Archimedes Live! https://archi.medes.live/#preset=a3020&ff=14000 before running on my real A3020 (in mode 28):
A3020Rgb332.jpg
With this little BASIC V program:

Code:

10 MODE 13:OFF15 DIM iBlock% 817 DIM oBlock% 420 DATA 0,0,0,0,0,2,0,0,4,0,0,630 DATA 0,2,0,0,2,2,0,2,4,0,2,640 DATA 4,0,0,4,0,2,4,0,4,4,0,650 DATA 4,2,0,4,2,2,4,2,4,4,2,660 FOR entry%=0 TO 15:READ b%,g%,r%:VDU 19,entry%,16,r%*16,g%*16,b%*16:NEXT65 !iBlock%=148:!(iBlock%+4)=-1:REM ScreenStart70 SYS &31,iBlock%,oBlock%80 PRINT iBlock%, oBlock%, !iBlock%, !(iBlock%+4), !oBlock%90 screen%=!oBlock%100 FOR y%=0 TO 15110 FOR x%=0 TO 15120 c%=(y%<<4)+x%: REM RrrG:GgBb => BGGR:bgrr, BGGgbRrr => BGGR:bgrr130 rgb%=((c% AND 1)<<3)+((c% AND 2)<<6)+(c% AND 4)+((c% AND 24)<<2)+((c% AND 96)>>5)+((c% AND 128)>>3)132 c%=(c% AND &eb)+((c% AND 16)>>2)+((c% AND 4)<<2)140 FOR h%=0 TO 7150 FOR w%=0 TO 7165 ?(screen%+(y%*8+h%)*320+x%*8+w%)=c%170 NEXT:NEXT:NEXT:NEXT
I wrote a blog post: https://oneweekwonder.blogspot.com/2024 ... 8-bit.html to go along with it, but I was just wondering: in my code I simply wrote directly to screen memory, because I understood that GCOL expected a 64-colour Palette + Tint. I'll experiment to see if I can use it, but maybe someone knows if it simply generates pixels of the form (PaletteColour<<2)+Tint, in which case I'd be able to translate RGB332 properly into that format.

Statistics: Posted by Snial — Sun Mar 24, 2024 4:00 pm



Viewing all articles
Browse latest Browse all 3098

Trending Articles