Shop OBEX P1 Docs P2 Docs Learn Events
TV font size problems — Parallax Forums

TV font size problems

computer guycomputer guy Posts: 1,113
edited 2008-03-17 05:25 in Propeller 1
I changed the font size to 16x16 using the tv mode setting.
long    %00010          'mode


This made the line height 16 high however the font size remains 32 high, therefore the text gets truncated.

Is there something else I have to do to get the font smaller?

I am using tv_wtext.spin, which uses TV.spin.

Both files are attached.

Thank you smile.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out my robot using the propeller RECONAUTOR
If you like my avatar then check this out Propeller Domed Stickers for sale

Post Edited (computer guy) : 3/14/2008 6:19:21 AM GMT

Comments

  • VIRANDVIRAND Posts: 656
    edited 2008-03-12 06:57
    Although I haven't tried it yet,
    I imagine you just have to change the assembly code in the driver to skip every odd line of pixels in the font table.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-12 06:59
    Your best bet would be to try one of the other drivers. Have a look at the AI_Generic drivers that come with PropDOS. I *think* that they fit more on the screen. Of course you could always make your own 16x16 font smile.gif
  • VIRANDVIRAND Posts: 656
    edited 2008-03-12 07:15
    What is the exact URL to get PropDOS? Not the website, because my browser doesn't see any working link there.
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-12 07:22
    Try here http://forums.parallax.com/showthread.php?p=683157 which is the forum page or here http://forums.parallax.com/attachment.php?attachmentid=52607 which is the actual file. You will need to add a .zip to it.
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-12 11:34
    Steven,

    What changes do I need to make in order to get tv_wtext.spin to work with AI_Generic_TV.spin?

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-12 11:45
    Not sure. I haven't looked at it enough to know. I think that you can just replace tv_wtext with AI_Generic_TV in the obj section though.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2008-03-12 11:52
    Virand said...
    What is the exact URL to get PropDOS? Not the website, because my browser doesn't see any working link there.

    try this:

    http://forums.parallax.com/attachment.php?attachmentid=52607

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Aka: CosmicBob
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-12 12:45
    steven,

    I tried replacing TV.spin with AiGeneric_Driver.spin
    I also changed stop to close
    However this did not work.

    If anyone knows could they please post.

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Post Edited (computer guy) : 3/12/2008 12:54:49 PM GMT
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2008-03-12 14:34
    Here's the link to the Propeller Wiki page, (which includes link to the current version of AiGeneric)
    propeller.wikispaces.com/AiGeneric

    I'd recommend using the standard version over the "cf" version for now, as I'm working out
    some minor issues with Baggers in regard to Commodore font use. It should do the job
    nicely.

    BTW: It requires more than one spin file to operate.

    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    New to the Propeller?

    Getting started with the Protoboard? - Propeller Cookbook 1.4
    Updates to the Cookbook are now posted to: Propeller.warrantyvoid.us
    Got an SD card? - PropDOS
    A Living Propeller FAQ - The Propeller Wiki
    (Got the Knowledge? Got a Moment? Add something today!)

  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-12 22:41
    computer guy, have a look at the demo in the link Oldbitcollector gave. If I remember correctly I think that your tv only does PAL so you will have to change the driver to use that. It looks like it should be easy.
  • RinksCustomsRinksCustoms Posts: 531
    edited 2008-03-13 02:30
    @computer guy·- you only set the interlace mode to interlaced with the·tv_mode·= %0010 -·note the code below - taking from the code below, the MAX res·you'll get out of this driver is if you set tv_mode to %10010 (NTSC), or %10011 (PAL). For a sharper image, the best a TV can do (USA) is to use S-Video by defining the pin group, and then the pin group mode(MSB/LSB of tv_pins) Also, if you wish to use S-Video function, you'll need to set bit 3 of tv_mode - %10110(NTSC), %10111(PAL). Each pin group is 8 pins so set your pin group mode according to which nibble or (group of 4 pins - lower/higher)·your DAC is connected & use the %xxx partial-nibble to the left of the pin group mode table to select your DAC.

    Say your DAC starts on pin 8 and you want to enable S-Video ( that 4th resistor isn't just used for audio ). so you look up the pin group, the document says that pin8 is part of the second group, so bits 6,5, & 4 of the tv_pins var would read %001_0000 (the lower 4 are for the mode). Next you'll need to determine the group mode (LSB nibble), looking at the table for group mode you see that since the DAC is on the lower nibble of the pin group 8..15 & you want s-video, you want to select baseband + chroma which coresponds to %0010 to the left of the table for baseband + chroma. put the two together (not add) and you get tv_pins = %001_0010. Don't ask me why there are only 7 bits for this variable, there just are. And the "_" character is just there so we can read it better, the compiler ignores it. Hope this sheds some light. To my understanding, this is as far as you can go with this driver unless you write your own, the hydra book has·ALOT of info on the prop, video hardware, memory organization, and ALOT more.
    ''VAR                   'TV parameters - 14 contiguous longs
    ''
    ''  long  tv_status     '0/1/2 = off/invisible/visible              read-only
    ''  long  tv_enable     '0/non-0 = off/on                           write-only
    ''  long  tv_pins       '%pppmmmm = pin group, pin group mode       write-only
    ''  long  tv_mode       '%tccip = tile,chroma,interlace,ntsc/pal    write-only
    ''  long  tv_screen     'pointer to screen (words)                  write-only      
    ''  long  tv_colors     'pointer to colors (longs)                  write-only                            
    ''  long  tv_ht         'horizontal tiles                           write-only                            
    ''  long  tv_vt         'vertical tiles                             write-only                            
    ''  long  tv_hx         'horizontal tile expansion                  write-only                            
    ''  long  tv_vx         'vertical tile expansion                    write-only                            
    ''  long  tv_ho         'horizontal offset                          write-only                            
    ''  long  tv_vo         'vertical offset                            write-only                            
    ''  long  tv_broadcast  'broadcast frequency (Hz)                   write-only                            
    ''  long  tv_auralcog   'aural fm cog                               write-only                            
    ''                                                                                              
    ''The preceding VAR section may be copied into your code.        
    ''After setting variables, do start(@tv_status) to start driver. 
    ''                                                               
    ''All parameters are reloaded each superframe, allowing you to make live
    ''changes. To minimize flicker, correlate changes with tv_status.
    ''
    ''Experimentation may be required to optimize some parameters.
    ''
    ''Parameter descriptions:
    ''  _________
    ''  tv_status
    ''
    ''    driver sets this to indicate status:
    ''      0: driver disabled (tv_enable = 0 or CLKFREQ < requirement)
    ''      1: currently outputting invisible sync data
    ''      2: currently outputting visible screen data
    ''  _________
    ''  tv_enable
    ''
    ''        0: disable (pins will be driven low, reduces power)
    ''    non-0: enable
    ''  _______
    ''  tv_pins
    ''
    ''    bits 6..4 select pin group:
    ''      %000: pins 7..0
    ''      %001: pins 15..8
    ''      %010: pins 23..16
    ''      %011: pins 31..24
    ''      %100: pins 39..32
    ''      %101: pins 47..40
    ''      %110: pins 55..48
    ''      %111: pins 63..56
    ''
    ''    bits 3..0 select pin group mode:
    ''      %0000: %0000_0111    -                    baseband
    ''      %0001: %0000_0111    -                    broadcast
    ''      %0010: %0000_1111    -                    baseband + chroma
    ''      %0011: %0000_1111    -                    broadcast + aural
    ''      %0100: %0111_0000    broadcast            -
    ''      %0101: %0111_0000    baseband             -
    ''      %0110: %1111_0000    broadcast + aural    -
    ''      %0111: %1111_0000    baseband + chroma    -
    ''      %1000: %0111_0111    broadcast            baseband
    ''      %1001: %0111_0111    baseband             broadcast
    ''      %1010: %0111_1111    broadcast            baseband + chroma
    ''      %1011: %0111_1111    baseband             broadcast + aural
    ''      %1100: %1111_0111    broadcast + aural    baseband
    ''      %1101: %1111_0111    baseband + chroma    broadcast
    ''      %1110: %1111_1111    broadcast + aural    baseband + chroma
    ''      %1111: %1111_1111    baseband + chroma    broadcast + aural
    ''      -----------------------------------------------------------
    ''            active pins    top nibble           bottom nibble
    ''
    ''      the baseband signal nibble is arranged as:
    ''        bit 3: chroma signal for s-video (attach via 560-ohm resistor)
    ''        bits 2..0: baseband video (sum 270/560/1100-ohm resistors to form 75-ohm 1V signal)
    ''
    ''      the broadcast signal nibble is arranged as:
    ''        bit 3: aural subcarrier (sum 560-ohm resistor into network below)
    ''        bits 2..0: visual carrier (sum 270/560/1100-ohm resistors to form 75-ohm 1V signal)
    ''  _______
    ''  tv_mode
    ''
    ''    bit 4 selects between 16x16 and 16x32 pixel tiles:
    ''      0: 16x16 pixel tiles (tileheight = 16)
    ''      1: 16x32 pixel tiles (tileheight = 32)
    ''
    ''    bit 3 controls chroma mixing into broadcast:
    ''      0: mix chroma into broadcast (color)
    ''      1: strip chroma from broadcast (black/white)
    ''
    ''    bit 2 controls chroma mixing into baseband:
    ''      0: mix chroma into baseband (composite color)
    ''      1: strip chroma from baseband (black/white or s-video)
    ''
    ''    bit 1 controls interlace:
    ''      0: progressive scan (243 display lines for NTSC, 286 for PAL)
    ''           less flicker, good for motion
    ''      1: interlaced scan (486 display lines for NTSC, 572 for PAL)
    ''           doubles the vertical display lines, good for text
    ''
    ''    bit 0 selects NTSC or PAL format
    ''      0: NTSC
    ''           3016 horizontal display ticks
    ''           243 or 486 (interlaced) vertical display lines
    ''           CLKFREQ must be at least 14_318_180 (4 * 3_579_545 Hz)*
    ''      1: PAL
    ''           3692 horizontal display ticks
    ''           286 or 572 (interlaced) vertical display lines
    ''           CLKFREQ must be at least 17_734_472 (4 * 4_433_618 Hz)*
    ''
    ''      * driver will disable itself while CLKFREQ is below requirement
    ''  _________
    ''  tv_screen
    ''
    ''    pointer to words which define screen contents (left-to-right, top-to-bottom)
    ''      number of words must be tv_ht * tv_vt
    ''      each word has two bitfields: a 6-bit colorset ptr and a 10-bit pixelgroup ptr
    ''        bits 15..10: select the colorset* for the associated pixel tile
    ''        bits 9..0: select the pixelgroup** address %ppppppppppcccc00 (p=address, c=0..15)
    ''
    ''       * colorsets are longs which each define four 8-bit colors
    ''
    ''      ** pixelgroups are <tileheight> longs which define (left-to-right, top-to-bottom) the 2-bit
    ''         (four color) pixels that make up a 16x16 or a 32x32 pixel tile
    ''  _________
    ''  tv_colors
    ''
    ''    pointer to longs which define colorsets
    ''      number of longs must be 1..64
    ''      each long has four 8-bit fields which define colors for 2-bit (four color) pixels
    ''      first long's bottom color is also used as the screen background color
    ''      8-bit color fields are as follows:
    ''        bits 7..4: chroma data (0..15 = blue..green..red..)*
    ''        bit 3: controls chroma modulation (0=off, 1=on)
    ''        bits 2..0: 3-bit luminance level:
    ''          values 0..1: reserved for sync - don't use
    ''          values 2..7: valid luminance range, modulation adds/subtracts 1 (beware of 7)
    ''          value 0 may be modulated to produce a saturated color toggling between levels 1 and 7
    ''
    ''      * because of TV's limitations, it doesn't look good when chroma changes abruptly -
    ''        rather, use luminance - change chroma only against a black or white background for
    ''        best appearance
    ''  _____
    ''  tv_ht
    ''
    ''    horizontal number pixel tiles - must be at least 1
    ''    practical limit is 40 for NTSC, 50 for PAL
    ''  _____
    ''  tv_vt
    ''
    ''    vertical number of pixel tiles - must be at least 1
    ''    practical limit is 13 for NTSC, 15 for PAL (26/30 max for interlaced NTSC/PAL)
    ''  _____
    ''  tv_hx
    ''
    ''    horizontal tile expansion factor - must be at least 3 for NTSC, 4 for PAL
    ''
    ''    make sure 16 * tv_ht * tv_hx + ||tv_ho + 32 is less than the horizontal display ticks
    ''  _____
    ''  tv_vx
    ''
    ''    vertical tile expansion factor - must be at least 1
    ''
    ''    make sure <tileheight> * tv_vt * tv_vx + ||tv_vo + 1 is less than the display lines
    ''  _____
    ''  tv_ho
    ''
    ''    horizontal offset in ticks - pos/neg value (0 for centered image)
    ''    shifts the display right/left
    ''  _____
    ''  tv_vo
    ''
    ''    vertical offset in lines - pos/neg value (0 for centered image)
    ''    shifts the display up/down
    ''  ____________
    ''  tv_broadcast
    ''
    ''    broadcast frequency expressed in Hz (ie channel 2 is 55_250_000)
    ''    if 0, modulator is turned off - saves power
    ''
    ''    broadcasting requires CLKFREQ to be at least 16_000_000
    ''    while CLKFREQ is below 16_000_000, modulator will be turned off
    ''  ___________
    ''  tv_auralcog
    ''
    ''    selects cog to supply aural fm signal - 0..7
    ''    uses ctra pll output from selected cog
    ''
    ''    in NTSC, the offset frequency must be 4.5MHz and the max bandwidth +-25KHz
    ''    in PAL, the offset frequency and max bandwidth vary by PAL type
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.

    Post Edited (RinksCustoms) : 3/13/2008 4:39:07 AM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-13 05:08
    RinksCustoms,

    Thank you for the information. smile.gif

    I already had it set for interlaced.
    Is there a way to tell the tv driver to use a different font from a file. Like Font_ATARI.spin (attached)

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale

    Post Edited (computer guy) : 3/13/2008 7:03:14 AM GMT
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-14 06:02
    Ok, How hard would it be to make an object that could be interchangeable with TV.spin that would let you choose a font? ie. Font_ATARI.spin

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale
  • RinksCustomsRinksCustoms Posts: 531
    edited 2008-03-14 16:46
    @computer guy - I am aware that you alredy had the interlaced mode set to interlace, but you also have to set tile height (tv_mode = %1xxxx), the bit for interlace mode (tv_mode = %xxx1x), also must be turned on for max resolution (tv_mode = %1xx1x), notice it's a 5 bit variable. I think you have a misconception about the tv.spin object. Tv.spin's sole purpose is to generate a video signal compatable with a TV set, baseband (composite - most common RCA jack), broadcast (ie 55_250_000 = ch2 & each ch is 6MHz higher than the last), or baseband + chroma (S-video). Along with broadcast & baseband, you have the option for the aural cog (produces audio signal).

    The TV.spin file does no kind of "graphics engine" work per say, it just reads from a tile mapped buffer (screen, or onscreen_buffer) and generates scanlines of pixels to the tv, colored or not. It has no concept of fonts, graphical boxes, triangles, circles, or any other kind of rendering that a separate "graphics engine" running on another cog does to the pixels in an offscreen buffer. I suggest procurring a copy of the Game Programming for the prop powered HYDRA, it's ~$40 + s&h. I had many misconceptions about the video/graphics/color side of how a graphic or text goes from your prog to the screen.

    To answer your question on changing the font, yes it's possible to use your own font, but the internal ROM font is still in the chip and your font will consume a certain amount of memory depending on color depth (1,2bit), and how many characters you have, generally 1 tile = 16 LONGs in memory. I really don't want to give specifics for the reason of plagerism, so procuring a copy of the Hydra book will proove to be an invaluable resource. The HYDRA book has many details and very good explanations on how the prop works, handles screen data & colors, and how memory is laid out & dealt with. The prop manual does go into explaining some of these features, but the way it's explained is a bit cryptic and not really intened for the avg amateur.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    E3 = Thought

    http://folding.stanford.edu/·- Donating some CPU/GPU downtime just might lead to a cure for cancer! My team stats.
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-14 21:28
    I have wanted the Hydra book for a while now.
    I just don't have the money for it. cry.gif

    I will explain my problem in more detail so that hopefully someone will be able to help.

    I need to fit more characters on the screen.
    So I change the TV mode to %10010 this makes no difference.
    If I change TV mode to %00010 I get smaller tiles however the font gets truncated. So that I only see the top 16 pixels of the text.

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale
  • stevenmess2004stevenmess2004 Posts: 1,102
    edited 2008-03-14 21:40
    Your options are to
    1. Use another driver like AI_Generic. (Does propDOS work with your TV)
    2. Make a new 16x16 character set for the TV driver. You will fit twice as many rows but they will be a bit wide.
    3. Use TV_Terminal. This uses graphics.spin so needs a lot of memory but I think that it has smaller text.
    4. Write a new TV driver. Not recommended without the Hydra book.

    If you want to go option 2 have a look at this site www.rayslogic.com/propeller/Programming/GraphicsDemo.htm. Its mainly about the graphics demo but the stuff about the pointers to tiles will be useful.
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-14 21:43
    Thanks Steven.

    The only reason I have stayed away from using another driver is I need the "windowed text driver".
    I will probably go with option two.

    Thank you smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale
  • computer guycomputer guy Posts: 1,113
    edited 2008-03-17 05:25
    This TV stuff is to complex for me.

    I can't believe that pointing to a 16x32 font is this hard.
    If I knew how it all worked I am sure it would be easier but nothing makes sense to me.

    Thank you all for your help. smile.gif
    Maybe in a few years I will finally make sense of it all. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Check out my robot using the propeller RECONAUTOR
    If you like my avatar then check this out Propeller Domed Stickers for sale
Sign In or Register to comment.