Is there a newer version of TV Typewriter?
Chuck McManis
Posts: 65
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
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
Steven
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
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
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