04-17-2006, 08:14 PM
I have dealt with this a long time now and want to clear it up for good.
In a post way back i read that fb emulates 16 bit mode so that the rgb value always i 8:8:8. Then i read that it's 5:6:5..
That's the first thing, then i wonder how rgb() works. RGB(255,255,255) will be white even in 16 bit mode were you don't have 255 colors to play with..
I can't get peek and rgb() to work together in 16 bit! I'm going crazy!!!
If i can get the code below to run as desired i will be so thankfull!
SCREEN 15,16,2
SCREENSET 1,1
S1 = SCREENPTR
LINE (0,0)-(400,300),RGB(244,180,55),BF
SLEEP
SCREENSET 0,0
S2 = SCREENPTR
FOR N=0 TO 400 * 300 - 1
C=PEEK(USHORT,S1 + N * 2)
B = C AND &HFF
G = (C AND &HFF00) SHR 8
R = (C AND &HFF0000) SHR 16
POKE USHORT, S2 + N * 2, RGB(R,G,B)
NEXT
PRINT R,G,B
SLEEP
In a post way back i read that fb emulates 16 bit mode so that the rgb value always i 8:8:8. Then i read that it's 5:6:5..
That's the first thing, then i wonder how rgb() works. RGB(255,255,255) will be white even in 16 bit mode were you don't have 255 colors to play with..
I can't get peek and rgb() to work together in 16 bit! I'm going crazy!!!
If i can get the code below to run as desired i will be so thankfull!
SCREEN 15,16,2
SCREENSET 1,1
S1 = SCREENPTR
LINE (0,0)-(400,300),RGB(244,180,55),BF
SLEEP
SCREENSET 0,0
S2 = SCREENPTR
FOR N=0 TO 400 * 300 - 1
C=PEEK(USHORT,S1 + N * 2)
B = C AND &HFF
G = (C AND &HFF00) SHR 8
R = (C AND &HFF0000) SHR 16
POKE USHORT, S2 + N * 2, RGB(R,G,B)
NEXT
PRINT R,G,B
SLEEP
ttp://hem.passagen.se/qb.basta