Shop OBEX P1 Docs P2 Docs Learn Events
TV Text object confusion - How to make a TV do what it must — Parallax Forums

TV Text object confusion - How to make a TV do what it must

ElectricAyeElectricAye Posts: 4,561
edited 2008-10-02 04:35 in Propeller 1
Hey all,

I want to spruce up my TV output·and I've been·trying to decipher how to actually make the TV_Text object do what I want.· I'm not out to do anything fancy, just change colors of text and background, maybe scroll the screen, etc.··Methods like out() confuse me because I don't know how to set them up.· While .out($00)·clears the screen, I'm baffled at how .out($0C) is supposed to set a color.· Where·do the color·code instructions go when you call the .out()· method?· And what are the color codes???· Equally baffling is the .setcolors() method.· How is that used in a line of spin code?

And·there are no comments to even tell me what .newline·does.· Does it scroll the screen?· Draw a line?

Also freaking me out, I see the following in the TV_Text_Demo:

· text.str(string(13,"·· TV Text Demo...",13,13,$C,5," OBJ and VAR require only 2.8KB ",$C,1))
I understand what 13 gives me, but what's $C,5 do?

Is there a downloadable somewhere that describes all of this stuff?

confused.gif
thanks,
Mark

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-09-26 19:11
    The only description is the comments in the source file.

    Several of the display "commands" require two bytes. The first is the command code (like $0C) and the second is the parameter. For setting the color, you'd do .out($0C), then .out(color) where color is a value from 0 to 7.

    The color number is actually the index into a table of longs containing the color information in the 4 bytes of each long. During its initialization, the TV_Text object sets up this color table with default values. There's a palette display demo program that shows the actual displayed color for each of the 256 byte values. Each displayed character can have a foreground color and a background color. Look at the setcolors method in TV_Text.
  • BaggersBaggers Posts: 3,019
    edited 2008-09-26 19:14
    ElectricAye

    tvtext.out($0c) if followed by tvtext.out(5) ( which is the same as the $c,5 that you wish to know what it does )
    will set the palette to the 6th ( since 0 is also a number ) palette which is green text on a grey green background, if you have the palette set as below.

                            '       fore   back
                            '       color  color
    palette                 byte    $07,   $0A    '0    white / dark blue
                            byte    $07,   $BB    '1    white / red
                            byte    $9E,   $9B    '2   yellow / brown
                            byte    $04,   $07    '3     grey / white
                            byte    $3D,   $3B    '4     cyan / dark cyan
                            byte    $6B,   $6E    '5    green / gray-green
                            byte    $BB,   $CE    '6      red / pink
                            byte    $3C,   $0A    '7     cyan / blue
    
    



    To set these colours up, you use the tvtext.setcolors(@palette) function.

    And tvtext.out($0d), is the same as tvtext.newline which sends the printing coordinates ( an invisible cursor if you wish ) to the left and down 1 line, unless it's at the bottom line, in which case it will then scroll the whole screen text up leaving a new blank line, for any following text to appear on.

    I hope this clears it up a bit for you [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-26 19:21
    Mike Green said...

    Several of the display "commands" require two bytes. The first is the command code (like $0C) and the second is the parameter. For setting the color, you'd do .out($0C), then .out(color) where color is a value from 0 to 7.

    Ahhhh, that's the kind of sneaky stuff I was looking for!

    Thanks, Mike!

    And Baggers, thanks to you for explaining that string of code. Now the clouds are beginning to clear.

    WOW, you guys are really fast, too!

    cheers,
    Mark

    smile.gif
  • BaggersBaggers Posts: 3,019
    edited 2008-09-27 08:00
    Thanks Mark, and no probs [noparse]:)[/noparse] glad to help, when I can. not that I have any spare time lately [noparse]:([/noparse] that should change soon though [noparse]:)[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • JoJo Posts: 55
    edited 2008-09-27 14:19
    If you want to explore colors on the TV, don't forget about the graphics_palette demo. It is
    in the demo area of the Propeller tool and I believe it is also available in OBEX.

    This displays all the colors that the prop can manage and gives you a mouse driven interface
    giving you the code for each color. I find it very handy as each TV displays colors slightly
    differently.

    Rayman has put a web page with a screen capture for it at
    http://www.rayslogic.com/propeller/Programming/TV_Colors.htm
    and he also explains a bit how the color scheme works.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ---
    Jo
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-09-28 01:33
    Thanks, Joao, that looks interesting. I have yet to hook up a mouse, etc. to my Propeller, but all this color TV stuff looks like so much fun, I might just have to.

    cheers,
    Mark
  • AribaAriba Posts: 2,687
    edited 2008-09-28 02:15
    If you just want try out the palette demo, and have no mouse, you can use PropTerminal as a Mouse emulator.
    http://forums.parallax.com/showthread.php?p=649540

    Change the "mouse" object to "pc_mouse" and start PropTerminal, then the mouse of the PC can be used like a PS2 mouse.
    (Copy the "pc_mouse.spin", "pc_text.spin", "pc_interface.spin" and "pc_keyboard.spin" to the library folder first).

    Andy
  • ElectricAyeElectricAye Posts: 4,561
    edited 2008-10-02 04:35
    Thanks, Ariba. Being a mouseless being, your suggestion will surely come in handy.

    BTW, I love your sombrero!

    Mark


    smilewinkgrin.gif
Sign In or Register to comment.