Shop OBEX P1 Docs P2 Docs Learn Events
Is there a newer version of TV Typewriter? — Parallax Forums

Is there a newer version of TV Typewriter?

Chuck McManisChuck McManis Posts: 65
edited 2008-02-09 08:45 in Propeller 1
Greetings fellow propeller heads,

So I thought I would start up a COG with the TV_Typewriter library object to display some of the parameters for my program in preparation for adding a modest user interface to it. I came across a weird behavior with updates.

So in my code I want to do this:

Parameter Value of Foo : xxxx

where xxxx is the current real-time value of parameter "Foo" and as it changes I want to re-write it on the screen. I modified my copy of TV_Typewriter so that ^L (ASCII code for new page) did the clear & home which was using $00 for, and changed the behavior of $00 to just home the "cursor" to 0,0. The thought was I could go back to "home" and print the same message with a new value and it would replace the old message with the old value. It does except it doesn't erase the previous character, instead it 'or's in the new data, so if you have a number that goes from 0 thru 9 you end up with a grey box where the number would be.

So now I'm digging around in the guts of TV Typewriter looking to see how to call the graphics _fill to fill the background color before I put the character there. And I'm wondering if anyone else figured this out first. In particular if there is a new version of TV Typewriter that acts more like the old TV typewriters where writing characters results in that, and only that, glyph being displayed?

--Chuck

Comments

  • Chuck McManisChuck McManis Posts: 65
    edited 2008-02-09 05:24
    Hmmm, I noticed that the VGA_text driver doesn't have this problem but it can't display as many characters either. Curious
  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-09 05:25
    If you need graphics, then you have to deal with the process of drawing text and clearing the area under the text. The advantage of a text-only system (like tv_text) is that it draws the whole character cell replacing one with another. It would be possible to combine the two by using something like the tiled graphics/text VGA driver which can combine areas of bitmapped graphics with tile-based text. It hasn't been done yet for a tv display though.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-02-09 05:27
    I haven't got a copy of TV_Typewriter so this is only a guess. By the sounds of what you are saying it uses a bitmap display and a vector font like the Graphics object. You could just write over the text with the same color as the background which will make the text disappear. Something like
    repeat
      'write display
      tv.color(foregroundColor)
      tv.displayNum(someNumber)
      'store the number so that we can wipe it out
      oldNumber:=someNumber
      '
      'Your code where someNumber gets changed
      '
      'change the color so that the number will disappear
      tv.color(backgroundColor)
      tv.displayNum(oldNumber)
    
    



    Steven
  • Chuck McManisChuck McManis Posts: 65
    edited 2008-02-09 06:07
    Actually I am (was) using TV_terminal which is in the Propeller library directory, not TV_Typewriter. Sorry about the confusion. And I didn't realize tv_text did the same thing. I'll try that one here ...

    Ok so tv_text does what I expect and replaces each charcacter when you print over it, TV_Terminal does not. Presumably tv_text is newer than Tv_terminal. I find it interesting that there is a sort of an emergent standard on what characters do what so you can almost (but not quite) have the statement
    OBJ
        console : "display_device"
    
    PUB
      ...
      console.start(<varies by type>)
      ...
      console.string( ... )
      console.out( ... )
      etc.
    
    



    Its been another interesting learning here...
    --Chuck


    P.S. And in a weird turn of events that number of characters / row you get with tv_text is greater than with vga_text, go figure.
    P.P.S. The reason I like tv_text is that my monitor lets me take an NTSC signal and put it on the screen via its Picture in a Picture (PIP) capability. That way I can run my propeller code and poof its talking to me on the same screen.

    Post Edited (Chuck McManis) : 2/9/2008 6:17:42 AM GMT
  • deSilvadeSilva Posts: 2,967
    edited 2008-02-09 08:45
    There is some confusion here:

    Neither TV_TEXT nor TV_TERMINAL do any rendering themselves. They use the tiled TV, and TV_TERMINAL additionally GRAPHICS.

    TV_TEXT just sets pointers to the ROM so TV displays those glyphs according to its tile mechanism. THs is most ingenious however - as all ingenius things - has seriuos drawbacks in some cases.

    TV_TERMINAL addresses those cases by using the brute force of GRAPHICS, needing a full 4-colour bitmap.
    This is extremely more versatile, at the cost of memory and speed.

    Two absolutely different approaches, nearly incomparable...

    BTW: Clearing the "underground" of displayed text by default is contrary to the basic function of GRAPHICS. As GRAPHICS uses the COG upto the last byte there is no room to add more features... So you have to clear the background by yourself in advance. It might be a good idea to do this on character by character basis - not on string basis - to avoid flickering...

    Post Edited (deSilva) : 2/9/2008 12:47:58 PM GMT
Sign In or Register to comment.