Shop OBEX P1 Docs P2 Docs Learn Events
TV_TERMINAL - questions — Parallax Forums

TV_TERMINAL - questions

ALIBEALIBE Posts: 299
edited 2006-11-12 00:36 in Propeller 1
Hello all,
sorry if this has already been asked and covered in past threads. I could not find by searching.

I have a couple ?s below that I was hoping to find some answers to here.

1. How to position cursor at a certain row,col to output text
2. Where can I find the different "codes" for the TV_Terminal.Out.
····· 2.1 For example tv.out(3) '--- sets the forground color to White.·
···········Where can I find this documentation?
······2.2 tv.out(ClearScreen) ' Where is this out command documented?

thanks in advance

ALIBE

Comments

  • ALIBEALIBE Posts: 299
    edited 2006-09-09 15:37
    I must not be thinking clearly. I looked in the "TV.spin" object and found the answer to my Q2. So never mind that.

    I still need some help on #1 please

    thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-09 15:44
    At this point, the only documentation is in the source code of tv_terminal.spin and graphics.spin. To summarize from the out() routine:
    $00 = home
    $01..$03 = color
    $04..$07 = color schemes
    $09 = tab
    $0D = return
    $20..$7E = character
    color_schemes
     $BC_6C_05_02
     $0E_0D_0C_0A
     $6E_6D_6C_6A
     $BE_BD_BC_BA
    
    


    I assume ClearScreen is defined as zero (home) which moves the cursor to (0,0) and clears the screen. This driver (tv_terminal) doesn't have the ability as written to position the cursor. It looks like it could be easily added, but it's not there. The way the colors work in this driver is that the screen is made up of 16x16 pixel tiles. Each tile can have a set of 4 colors associated with it. The codes $01..$03 select which foreground color to use. The driver has 4 predefined color combinations that can be selected ($04..$07) as shown above and you can select which one you want to use. You'd have to change the color_schemes table to change the combinations available. There is a program called graphics_palette.spin in the Propeller Tool's library that will show you all the possible colors and, when you select a color with the mouse, will give you the 8 bit hexadecimal code for the color to go in the color_schemes table.
  • ALIBEALIBE Posts: 299
    edited 2006-09-09 15:49
    Mike, thanks for the notes above.

    ALIBE
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-11 17:17
    ALBIE, when I first started working with propeller I wrote an alternate TV_Terminal object with text positioning. I need to get it from my home computer, but I'll share it. Because of the nature of the TV.spin object, the text_xy routine simply overwrites the graphic location, so the results are best after a clear screen is performed. As an aside, I have since discontinued using the TV_Terminal object in favor of the TV_Text object. The TV_Text object uses less memory, uses the internal character display and has the goto function built into the out(c) routine, and is quite adequate for text only displays.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • ALIBEALIBE Posts: 299
    edited 2006-09-12 14:41
    Paul,
    I will give TV_Text a shot today and let you know. thanks for the pointer.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-12 15:32
    No problem, if you still want the function to insert in TV_Terminal let me know (unfortunately I forgot last night, I can't wait until my internet @ home is connected (1 week from today)).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • ALIBEALIBE Posts: 299
    edited 2006-09-12 16:42
    I saw the graphics That looks pretty cool - and also has ::Text method that takes the graphics coord x,y and the text. That gives me what I need.

    Are there any reasons why one would not or should not use this object for regular text displays?

    Perfrmance, etc?

    thanks
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-12 16:52
    The graphics display uses a lot more memory than the purely text display (for the bitmap buffer mostly). The graphics display is slower, but that really doesn't matter much. The biggest issue from a programming standpoint is that the graphics object "paints" the text on the background, just like it does with any other graphic. If you want to do conventional text processing like scrolling, backspacing and overwriting, you have to clear the space where the new character is to go. The text writing routines don't do that for you. It could be added easily enough, but it's not there now.
  • ALIBEALIBE Posts: 299
    edited 2006-09-12 17:45
    Mike, good points above.

    In the good 'ol DOS days, I used to write directly to the Video Memory for fast rendering. Is it possible to "poke" and "peek" into memory addresses via SPIN and what is the memory address space for video.

    thanks, Nagi
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-12 18:19
    Yes it is possible, however there is no dedicated location for video memory. "Peek"ing and "Poke"ing doesn't offer the speed benefit as it did in DOS, in fact when dealing with the video drivers the result will be slower than going through the driver because the drivers are written in assembly which is much faster than Spin.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-12 18:28
    Actually, you can "peek" and "poke" easily into the video memory. In the Propeller OS I'm working on, the video memory is in a globally accessible area with a pointer at a fixed location. When debugging drivers, I've used assembly debug display routines that write to fixed locations on the "screen" with either hex or decimal editing ... very useful. With the standard Propeller video drivers, the video buffers are not at fixed locations. They're part of the display driver objects and could be anywhere in memory. The graphics drivers are an exception, but that's not as easy to use as a text buffer.
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-12 18:32
    Oh, ok slight disconnect there, with the text drivers, peek and poke works well enough. When dealing with the graphics based drivers you will see little benefit unless you are only changing a pixel or so.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-09-12 22:10
    Paul,
    You might want to look at my posting on the Propeller OS - TV version. I've taken the VGA text control codes and slightly modified them (and the routines that process them) for tv text use. The changes mostly have to do with handling color and are intended to be compatible with tv_text. I'd appreciate any comments.
    Mike Green
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-09-12 22:29
    It may be a little while before I can get to them, but I would be happy to look at them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • HarleyHarley Posts: 997
    edited 2006-11-11 01:08
    Where can one find TV_Text.spin?___· Search didn't help me.

    After my ThinkPad got corrupted, I had to do a 'restore'.· Thought I'd backed up all the files I've been using, find it didn't get saved.· freaked.gif

    And, for some reason I cannot download the latest released PropTool without some file being missing.· Don't know what's really happening.· confused.gif

    Had to re-download the FTDI driver for PropPlug (because of the restore).· Wow, are those LEDs on it bright; thought I'd blown couple of fuses.· But still blastingly working.

    Is there a way to have both the serial i/f to my PropSTICK and USB for a second Prop usable at the same time?___· Seems one should.· (But maybe the PropTool wouldn't know which to work with.· If not, going to be a lot of plugging/unplugging of DB9 and USB connectors.)

    Once this is resolved, I can get back to programming.· Rather than hand-holding a PC.




    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • ALIBEALIBE Posts: 299
    edited 2006-11-11 01:13
    Harley,
    in the "Object Exchange" url?

    here it is:
    http://ww1.parallax.com/Default.aspx?tabid=65

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "any small object, accidentally dropped, goes and hides behind a larger object."


    ALIBE - Artificial LIfe BEing. In search of building autonoumous land robot
    http://ALIBE.crosscity.com/
    ·
  • HarleyHarley Posts: 997
    edited 2006-11-11 01:41
    Sorry, but I only find TV_terminal. No TV_text.spin object by that name appears.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-11-11 06:45
    http://forums.parallax.com/showthread.php?p=587524

    Harley, did you use http://search.parallax.com to do your searching? If not, you should.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • El PaisaEl Paisa Posts: 375
    edited 2006-11-11 09:25
    This is a copy
  • HarleyHarley Posts: 997
    edited 2006-11-11 15:47
    Thank you Paul and El Paisa,

    No wonder I couldn't find it by itself; was part of that demo. I didn't really recognize it, as my monitor is only b/w. smilewinkgrin.gif

    Now that the ThinkPad PC is back working (clobbered OS) I can continue making progress with the two Prop programming. Had to use the F11/HPA route (hidden protected area) so time to download a number of apps. A time waster.

    Paul, I was surprised when I tried 'http://search.parallax.com'; that took me to Google. Now why didn't I think of that; do use it a lot at times. yeah.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Harley Shanko
    h.a.s. designn
  • Paul BakerPaul Baker Posts: 6,351
    edited 2006-11-12 00:36
    The http://search.parallax.com is a dedicated server owned by Parallax which runs a miniature version of Google's search engine and directly searches Parallax's domain.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
Sign In or Register to comment.