Shop OBEX P1 Docs P2 Docs Learn Events
Propeller Backpack with more graphical OSD — Parallax Forums

Propeller Backpack with more graphical OSD

FranciscoFrancisco Posts: 26
edited 2010-08-02 20:58 in Propeller 1
Hello, Im using the Backpack to show direction of gravitational pull on my live video feed using the standard character set--up,down,left,right arrows.

However, this limits my resolution to only 90 degree increments. Does anyone have a bright idea to display arrows with the on screen display at more than 4 different directions. If i could use the standard graphical object to be overlaid that would be ideal but i'm not sure if thats even possible.

Thanks tinkerers.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-07-16 03:05
    The overlay video driver uses the ROM font which only has the forward slash and backslash characters (/ \). It's also a text-only driver. The only way you could change this would be to modify the driver to use a font table in hub RAM and to copy the ROM font table to RAM, then modify a few characters to suit your needs. You could also write a completely new driver with a different character set or one that allows graphics to be used (by copying the TV.spin driver to do overlaying, then adding the graphics driver. Only the first is simple and straightforward.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-16 03:48
    Francisco,

    Yours is a reasonable requirement. As a consequence, I've modified the overlay object to accommodate a user-defined font, which is substituted for the characters $80 to $8f. These characters default -- and revert to -- the ROM glyphs when start is called. You can substitute your own glyphs for these characters via a call to setuserfont, which requires the address of a 256-long array formatted in the same way the ROM font table is organized (i.e. even and odd characters interleaved).

    Attached is the modified object. I have not tested this object yet. I know only that it compiles, so you are the offical test guinea pig. Try it first without calling setuserfont, and display characters from $80 to $8f to make sure the original glyphs have been correctly transferred to RAM. If that works, you should be able to call setfont with your own glyphs.

    If you have any trouble, leave a post here, and I will try to fix it as time allows.

    -Phil
  • FranciscoFrancisco Posts: 26
    edited 2010-07-16 06:09
    Thanks guys!

    Phil, I will test your code this weekend.
  • FranciscoFrancisco Posts: 26
    edited 2010-07-21 05:57
    Phil,

    I ran the original PropBP_overlay_demo.spin and displayed characters "pr.out($80)" to $8F successfully on the overlay.

    However, when i substituted prop_backpack_tv_overlay.spin object with yours, nothing comes up on the screen.

    Thanks.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-21 16:07
    Okay, Francisco, thanks for trying it. I guess I've got some debugging to do.

    -Phil
  • Duane DegnDuane Degn Posts: 10,588
    edited 2010-07-21 16:52
    Phil,
    I also have a Propeller Backpack and look forward to being able to use custom characters.· Thanks for working on this.

    Francisco,
    Thanks for bring this up.· I hope you share any custom charaters you make.· (I'll do the same.)

    Duane
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-07-23 20:42
    Well, okay, good news and bad news here.

    Good news: Attached is a working demo of an overlay object that lets you define (and animate!) your own character glyphs. It's also possible to overlay characters that are accessbile with those that are not (i.e. the command characters $00 to $0f).

    Bad news: The entire ROM font has to be copied into RAM to make this work. That's 16K bytes, or half of the entire RAM space. The reason for this is that the waitvid loop is too tight to determine, on a character-by-character basis, whether to read pixels from RAM or from ROM. Therefore, they all have to reside in one place or the other.

    I have an idea for a workaround to this, though, so don't give up on a reasonable RAM footprint just yet. Hint: the fact that the ROM font is located at the very beginning of ROM (i.e. right after the end of RAM) could be very helpful.

    -Phil
  • FranciscoFrancisco Posts: 26
    edited 2010-08-02 19:34
    Phil, thanks for the code. Its looking good. I tested it successfully on my side. I haven't had the time to integrate it into the rest of my project so the footprint is not a problem at the moment but hopefully its doesn't become one. thanks again.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-08-02 20:22
    Francisco,

    Here's a better version with a smaller footprint: http://forums.parallax.com/showthread.php?p=925961.

    -Phil
  • FranciscoFrancisco Posts: 26
    edited 2010-08-02 20:58
    Nice!
Sign In or Register to comment.