Shop OBEX P1 Docs P2 Docs Learn Events
Color chart ? — Parallax Forums

Color chart ?

Maxwell EdisonMaxwell Edison Posts: 8
edited 2008-06-20 09:27 in Propeller 1
Hello everyone-
I'm really enjoying the Prop, I started with BS1's in the mid to late 90s, and the prop is a nice new challenge.

I want to do some basic stuff with the vga and vga hi res tile drivers, but I'm a little confused on how to set the colors, especially clearing the blue screen background that comes with the code demos. I would like a nice clean black background.

Can someone point me to a thread, or documentation on this? I couldn't find anything in the prop wiki, prop manual, hydra sample chapters, etc.

Thanks in advance, and thanks for all of the things I've learned simply by lurking in this forum!

Comments

  • RaymanRayman Posts: 14,233
    edited 2007-12-01 17:36
    Look here:
    http://www.rayslogic.com/propeller/Programming/Colors.htm

    But, setting the background color is easy...· Just set the color like this:
    color:=2
    And the clear the screen:
    print($100)

    However, I think there's a bug in Parallax's VGA demo regarding clearing the screen...· I think you need to replace this:

    ···· $100:·············· 'clear screen?
    ····· wordfill(@screen, $200, screensize)
    ····· col := row := 0

    with this:

    ··· $100:·············· 'clear screen?
    ····· wordfill(@screen, $220, screensize)
    ····· col := row := 0
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2007-12-01 18:04
    @Ray

    Wouldn't have been $20 ? (space)

    Or does the wordfill in the VGA driver work different than the TV drivers?

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Just getting started with Propeller?

    Propeller Cookbook

    PropDOS
  • Maxwell EdisonMaxwell Edison Posts: 8
    edited 2007-12-01 18:17
    thanks for the help rayman...

    but that didn't work for me. No matter what I tried (working with VGA Tile Driver Demo) I would get the proper foreground and background colors where I had text, but where ever I had not printed text would be blue. The lincoln.txt demo is a perfect example.

    No matter how I set color :=2 or 0 or whatever I got the same results

    So looking at the vgacolors long at the bottom of the code, I figured out that printing $114 would give white characters on a black background. So I did this :

    print($114) 'set color to white
    print($100) 'clear screen

    which gave me a complete blue screen because I did not print any characters.

    so then I added:
    Repeat tiles 'tiles was set earlier in this demo as col * Rows
    print_string(string(" "))

    Which gives me all but the last line as a nice black background, the last line is solid blue line, but now when I try to put text after clearing it with the repeat, it doesn't show up, even if I use a print($101) to go home first.

    The mouse cursor overlays nicely on the black screen though.

    any more hints, where am I going wrong? thanks again.

    BTW oldbitcollector - I thought it might be $20 also for space, but when put that in the spacetile constant, it makes a funky char I can't describe.
  • Maxwell EdisonMaxwell Edison Posts: 8
    edited 2007-12-01 19:52
    After a lot of experimentation, I now have a black background.

    With the VGA Tile Driver Demo
    In the constants section I set

    spacetile=$0A20

    Then later in the code I can specify what ever color with the Print($114) settings ($114 gives me white on black, so I now have white text on a black screen)

    Thanks for your help, and I have your website bookmarked rayman!
  • johnfl68johnfl68 Posts: 72
    edited 2008-06-20 02:50
    Has anyone figured out the method to the madness for "spacetile"??


    As Maxwell has said - there seems to be no logic to how you set the background color - I have found that it seems to be the first color you have declared in the color table. Is it hard coded to the first color?

    Also in the 1024x768 tile example they have spacetile as this:

    spacetile = $8000 + $20 << 6

    But in the 1280x1024 example spacetile is this:

    spacetile = $220

    I am trying to do the same things in both resolutions, and you would think that the same text and same color tables would work for both tile drivers, but it doesn't , you get strange characters - and I am now trying to go over both demos line by line to attempt to figure out why.

    John
  • RaymanRayman Posts: 14,233
    edited 2008-06-20 09:27
    That madness extends to all characters!

    The various resolution VGA drivers all store screen info in a word array.· Each word specifies both a character address and a color.

    But, sometimes the address part is in upper bits and sometimes in the lower bits depending on the particular driver.

    The 640x480 and 1280x1024 drivers do it the same way, but the 1024x768 does it the opposite way...
Sign In or Register to comment.