Qbasicnews.com
September 22, 2020, 07:42:48 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Back to Qbasicnews.com | QB Online Help | FAQ | Chat | All Basic Code | QB Knowledge Base
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: I think this should be added to the faq  (Read 3385 times)
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« on: April 10, 2003, 03:43:54 AM »

There's some nice pallette routine for screen 13 like

POKE <number>,red
POKE <number>,green
POKE <number>,blue

I don't know the adresses but PALETTE is slow for me
and this is easier (instead of PALETTE c, r + 256 * g + 65536 * b)
Logged

/post]
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #1 on: April 10, 2003, 04:04:54 AM »

It's

OUT &H3C8, attribute
OUT &H3C9, red
OUT &H3C9, green
OUT &H3C9, blue

If you're going to set RGB values for sequential attributes, you don't need the

OUT &H3C8, attribute

line each time.  You only need to write the first attribute to register 3C8h.  Once you write three values to register 3C9h, the value at register 3C8h is automatically incremented by one.

If you want to read RGB data, it's

OUT &H3C7, attribute
red = INP(&H3C9)
green = INP(&H3C9)
blue = INP(&H3C9)

Again, if you're going to read RGB values for successive attributes, you only need to use the

OUT &H3C7, attribute

statement for the first attribute.
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #2 on: April 10, 2003, 11:59:58 AM »

thanks!
Logged

/post]
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #3 on: April 10, 2003, 02:25:37 PM »

.
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #4 on: April 10, 2003, 04:18:24 PM »

also: do this piece o' code apply to screen 12?
Logged

/post]
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #5 on: April 10, 2003, 05:05:41 PM »

the same way that mode 13 does.  The attribute just can't be larger than 15 for mode 12.  (It will also work for 8-bit SVGA modes.  4-bit SVGA modes, however (not that anybody but I have ever used those), work like QB's mode 9, not 12.)
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #6 on: April 10, 2003, 05:35:10 PM »

And to know how does SCREEN 9 work, just take a glance here http://faq.qbasicnews.com/?blast=DacRegistersInScreenNine Wink
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
red_Marvin
Na_th_an
*****
Posts: 1509



WWW
« Reply #7 on: April 11, 2003, 06:33:35 AM »

Thanks!

[spam] but what will happen if you run your computer in
256 colour mode, qbasic screen 13 in a dos box and use palette?[/spam] :lol:
Logged

/post]
toonski84
__/--\__
*****
Posts: 2567



« Reply #8 on: April 11, 2003, 07:37:10 AM »

in that case its:
palette attribute, red + green * 256 + blue * 65536

or at least i think
Logged

i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
na_th_an
*/-\*
*****
Posts: 8244



WWW
« Reply #9 on: April 11, 2003, 08:17:46 AM »

Quote from: "red_Marvin"
Thanks!

[spam] but what will happen if you run your computer in
256 colour mode, qbasic screen 13 in a dos box and use palette?[/spam] :lol:


Never run QB windowed. Specially running a graphics mode.
Logged

SCUMM (the band) on Myspace!
ComputerEmuzone Games Studio
underBASIC, homegrown musicians
[img]http://www.ojodepez-fanzine.net/almacen/yoghourtslover.png[/i
Glenn
I hold this place together
*****
Posts: 786



WWW
« Reply #10 on: April 11, 2003, 01:42:49 PM »

if red, green, and blue are INTEGERs.  PALETTE expects a LONG value for the color specifier.


Quote from: "toonski84"
in that case its:
palette attribute, red + green * 256 + blue * 65536

or at least i think
Logged

ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!