Shop OBEX P1 Docs P2 Docs Learn Events
Work or Fun with Graphics , TV AND VGA. (Is this "new"?) — Parallax Forums

Work or Fun with Graphics , TV AND VGA. (Is this "new"?)

VIRANDVIRAND Posts: 656
edited 2010-01-14 05:44 in Propeller 1
I added nothing to this. Its only Chip's old code. I bent his GRAPHICS DEMO by removing the mouse stuff,
pasting part of TV demo code to an old VGA version. I wouldn't be surprised if he did this before and is
embarrassed at what I did. I think all the drivers are included with Propeller Tool,
(note for BST and SPHINX). I picked colors that look similar on VGA and TV(*).
After commenting out the mouse stuff I changed a few minor details to make it still look interesting.
It took a very short time; a few hours (and I'm slow). I'm not even familiar with the VGA driver yet.

I commented the code and it maybe a good place to start to write code with dual display option.
As is, it will output simultaneously to TV and VGA on Demo Board if both screens are connected,
using the same format. My monitor would turn off if I changed VGA parameters, so I couldn't
fill the whole VGA screen, but it should only have to run slower to do that. If there is
another program that runs two different video outputs, say so.
I didn't waste much time.
It seems like people have been asking about this and not been answered. These days, people are
throwing away virus-infested computers with working screens AND analog TVs in my area almost every day
so it is possible to find a spare video screen of either type.

PAL Spinners should have no problem using their own GRAPHICS compatible TV drivers.
I am surprised that some people have said here in the past that it is not possible to have a
full color VGA GRAPHICS driver because VGA is too fast. I think the old VGA driver uses one cog,
maybe it uses two. Say something if Propeller Tool doesn't have all the drivers.

Two needed improvements may be separated Colors[noparse]/noparse LUTs, and making the VGA image fill the whole screen.

Is spin file really attached? I can't see it yet. Weird. If not I'll try again. (Still working on it, trying again...)OK, I think,

One of my next projects may be a demo of some or all of the Public Domain 3DTV systems from the
1900s that will soon be sold. So hop into the DeLorean and go Back to the Future with me to where Doc Brown
first installed his Flux Capacitor in it, and grab a pair of these Sega 3D Glasses, and play some Rescue on Fractalus,
featuring THX. (30,000 lines of C according to the USPTO, which somehow fits in 32K with the rest of the game).
www.old-computers.com/MUSEUM/hardware.asp?t=1&c=840&st=2

"VIeRidiAN Dynamics. LIFE. BETTER." lol.gif

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
VIRAND, If you spent as much time SPINNING as you do Trolling the Forums,
you'd have tons of awesome code to post!
(Note to self)

Post Edited (VIRAND) : 1/12/2010 2:39:31 AM GMT

Comments

  • mparkmpark Posts: 1,305
    edited 2010-01-12 10:54
    Doesn't the Demo Board come pre-loaded with a version of graphics_demo that outputs to both TV and VGA concurrently?
  • VIRANDVIRAND Posts: 656
    edited 2010-01-13 00:34
    mpark said...
    Doesn't the Demo Board come pre-loaded with a version of graphics_demo that outputs to both TV and VGA concurrently?
    I don't know. Does it? I have a Hydra and I usually use Protoboards wired in Demoboard configuration and also DIP40s.
    Please show me that version since it fits both drivers and the mouse and all of the graphics demo, which I couldn't do.
  • BradCBradC Posts: 2,601
    edited 2010-01-13 00:45
    No, the code on the Demo board does a TV graphics object and a VGA text object.
    Can't see why you could not have both VGA and TV drivers running from the same bitmap buffer though.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • VIRANDVIRAND Posts: 656
    edited 2010-01-13 01:34
    BradC said...
    No, the code on the Demo board does a TV graphics object and a VGA text object.
    Can't see why you could not have both VGA and TV drivers running from the same bitmap buffer though.
    That's what I did in the spin attached to OP. (use both drivers with same bitmap)
  • BradCBradC Posts: 2,601
    edited 2010-01-13 01:49
    VIRAND said...

    Please show me that version since it fits both drivers and the mouse and all of the graphics demo, which I couldn't do.

    I re-enabled the mouse driver and compiled it with bst using "unused spin method removal" in the compiler options. It compiled with 32 longs available (after taking into account the reserved space for the buffers and 100 longs of stack).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
  • VIRANDVIRAND Posts: 656
    edited 2010-01-13 05:26
    BradC said...
    VIRAND said...

    Please show me that version since it fits both drivers and the mouse and all of the graphics demo, which I couldn't do.

    I re-enabled the mouse driver and compiled it with bst using "unused spin method removal" in the compiler options. It compiled with 32 longs available (after taking into account the reserved space for the buffers and 100 longs of stack).

    But did you restore the mouse-driven parts of the graphics demo that I commented out?
    Not only did I run out of memory, I also got a corruption of the first tiles of the bitmap with part of the program.
    What part was unused and removable? I'll try the alternative compilers very soon.

    Assuming I will have the same problem with your fix, Can you post a fully functional binary at least?
    I guess so far it does look like the GRAPHICS demo can run on both types of screen at the same time,
    and nobody else showed it had been done before, although I thought for sure Chip must have done it like this.

    Post Edited (VIRAND) : 1/13/2010 5:43:42 AM GMT
  • BradCBradC Posts: 2,601
    edited 2010-01-13 08:14
    VIRAND said...

    But did you restore the mouse-driven parts of the graphics demo that I commented out?

    Yes.

    I could not find a VGA lead to test with (all my stuff is either DVI or a laptop), but I'd guess it works. I finally found a PS2 mouse in a box, so that works too.
    It looks like the top left hand tile is corrupt on startup, but I don't know if thats an artifact of stack smashing or something you've done when you've modified the code.
    The colours are different to the original demo also. Lots of reds where there used to be greens.

    brad@bklaptop2:/tmp$ bstc -b -p0 -Oa -L /media/raid3/Viridian-Work/Prop-Projects/Library/ AVA_TVxVGAxGraphics_Demo_2010v001.spin 
    Found a USB Serial Device
    Brads Spin Tool Compiler v0.15.4-pre2 - Copyright 2008,2009 All rights reserved
    Compiled for i386 Linux at 00:06:12 on 2010/01/04
    Loading Object AVA_TVxVGAxGraphics_Demo_2010v001
    Loading Object tv
    Loading Object vga
    Loading Object graphics
    Loading Object mouse
    Program size is 7044 longs
    6 Constants folded
    Compiled 2101 Lines of Code in 0.599 Seconds
    We found a Propeller Version 1
    Propeller Load took 1.683 Seconds
    
    



    <edit>

    To answer your other question, it looks like Quad() and Finish() in Graphics.spin are not referenced. Quad() references Tri() so by eliminating those three you gain 3 longs (headers) + 198 bytes (bytecode) or 52 longs.
    Given the error message says "Binary too large for RAM by 51 Longs" it looks like we win.

    The "fast constants" optimisation costs us 2 longs.
    "Fold constants" buys us 4 longs.

    Recompiling with "fast constants" disabled makes the corrupt bit of the top tile smaller, so the corruption is certainly a stack smash.
    Need to reduce the memory consumption by about another 5-10 longs by the looks of things.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.

    Post Edited (BradC) : 1/13/2010 8:47:02 AM GMT
  • VIRANDVIRAND Posts: 656
    edited 2010-01-14 05:09
    The corrupt tile and excess longs were the first things I noticed after including the VGA driver.
    The colors had to be different because the color codes for different screens don't ever match. I chose sort of close ones on the OP program.
    I didn't provide the drivers so I couldn't mod them to use separate palettes which would have needed more memory anyway.
    Thanks for the files and trying the code. I'm surprised the program still works with a corrupted stack.

    Also. VIRAND does not really exactly stand for Viridian Dynamics but the joke is the words and logos are close enough.
    Veridian Dynamics is a fictional conglomerate that does similar weird science, and has funny ads on ABC-TV.
    Similar enough to say we are them while the ads are good and funny, different enough to not be them if the ads become evil.
    They have their own website, and their ads are also on Youtube, and they don't sell anything, but they make me laugh.
    It was inevitable with billions of people and only a million words to say.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    VIRAND, If you spent as much time SPINNING as you do Trolling the Forums,
    you'd have tons of awesome code to post!
    (Note to self)
  • BradCBradC Posts: 2,601
    edited 2010-01-14 05:44
    VIRAND said...
    I'm surprised the program still works with a corrupted stack.

    It's not corrupting the stack. The stack is corrupting the graphics. It would appear the stack pokes out into the graphics bitmap and then retreats back again before anything in the graphoics code writes to those particular longs (otherwise things would get messy). I've not investigated it much further, although I've made some pretty horrific "optimisations" to the spin code to reduce the code size and stack usage on some calls. I've pared another 6 longs out of it (without altering the functionality) and the corruption is just a tiny spec in the top corner now. The problem is the "optimisations" make the code *much* harder to follow.
    VIRAND said...

    Also. VIRAND does not really exactly stand for Viridian Dynamics

    Interesting. My consulting company is Viridian. I've been using it in the Middle East since 2005 and Australia since early last year. Not to indicate we're green or anything.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Life may be "too short", but it's the longest thing we ever do.
Sign In or Register to comment.