Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Change palette
#1
How do i change the palette on screen 12, i want to choose my own colours, if that is possible
Reply
#2
i believe the OUT "hack" should be able to do it.

i'll see if i can remember it:
Code:
OUT &h3a9, col_id%
OUT &h3a8, r%
OUT &h3a8, b%
OUT &h3a8, g%

that code may be completely wrong, though

sorry - can't find a copy of the actual code

oz~
Reply
#3
The ports are a bit wrong...

Code:
Out &H3C8, col_id
Out &H3C9, red
Out &H3C9, green
Out &H3C9, blue
Port &H3C8 is auto-incrementing.
Reply
#4
Quote:The ports are a bit wrong...

Code:
Out &H3C8, col_id
Out &H3C9, red
Out &H3C9, green
Out &H3C9, blue
Port &H3C8 is auto-incrementing.

thanks for the correction

oz~
Reply
#5
If you were using fb could'nt you use the RGB(r,g,b) command
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Reply
#6
Hi,

There is a PALETTE statement in QBASIC (and Quick BASIC) .

c = blue * 65536 + green * 256 + red
PALETTE 15, c

blue, green and red are numbers in the range of 0 to 63 inclusive.

The 15 is just the color of the default printing etc. and is usually bright white. It can be any of the 16 (0 - 15) colors available in screen 12.
ou learn something new everyday.
Pappy
Reply
#7
Isn't the default printing color 7?
/post]
Reply
#8
Hi,

Try this.

SCREEN 12
PRINT "this is a test"
LINE (100, 100)-(300, 300), , BF
SLEEP
FOR x = 0 TO 63
c = x * 65536 + x * 256 + x
PALETTE 15, c
t = TIMER
WHILE TIMER - t < .1
WEND
NEXT
ou learn something new everyday.
Pappy
Reply
#9
I have tried the above examples but i cannot get them to work when i use &H3C9 i can only change the border.

I will try and give you an idea of what i want

in the program the user can pick a colour from the list, but i do not want to use the default colours, i want to make my own and show them on screen.
Reply
#10
You mean you don't want to use the colors 0 to 15?
That's impossible in screen 12 because of the size of the
screen memory or something like that.

If you "need" more than 16 colors I would suggest that you either
get some vesa routines (through a library like future library, or by
executing some asm code manually) or continue the developing in
freebasic, which supports hi-res graphics natively.
/post]
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)