Shop OBEX P1 Docs P2 Docs Learn Events
I REALLY like the "VGA_HiRes_Text" object; here's a simple demo with it — Parallax Forums

I REALLY like the "VGA_HiRes_Text" object; here's a simple demo with it

Bill HenningBill Henning Posts: 6,445
edited 2006-10-15 02:09 in Propeller 1
Hi,

I REALLY like the VGA HiRes Text object; I think that will be a mainstay in my projects - it lets me output very large ammounts of information using relatively little in the way of hub memory. Thank you Parallax!

Here's a simple demo for the mode; it shows all 64 possible background colors, with the opposite color for foreground; one combination per line. The first sixty four characters are 'normal', the second sixty four have the 'inverse' bit set.

--- cut here ---

'
' simple hires_text_demo - WH
'
obj
· vga : "VGA_HiRes_Text"

CON
· _clkmode = xtal1 + pll16x
· _xinfreq = 5_000_000

VAR
· byte scrn[noparse][[/noparse]8192]
· word pal[noparse][[/noparse]64]
· byte cursors[noparse][[/noparse]6]
· long vsync
· long i

pub main
· vga.stop

· ' set up frame buffer
· repeat i from 0 to 8191
··· scrn[noparse][[/noparse]i] := (i & 127) | (i & 64) << 1

· ' set up palette
· repeat i from 0 to 63
··· pal[noparse][[/noparse]i] := (i << 10) | (255 - (i << 2))
·
· vga.start(16,@scrn,@pal,@cursors,@vsync)


I have finally absorbed enough information to see how the video registers and hub instructions work, very cool; I think I'll try generating some other useful modes soon.

Best,

Bill

Comments

  • cgraceycgracey Posts: 14,206
    edited 2006-10-14 06:49
    Bill,

    Good job! The best way to get a handle on an object is to exercise it completely in some short demo program just like this. This builds your confidence in·the object and makes it easy for you·to apply·it in a real application. The best way to learn is by actually trying things out.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    Chip Gracey
    Parallax, Inc.

    Post Edited (Chip Gracey (Parallax)) : 10/14/2006 9:05:04 AM GMT
  • El PaisaEl Paisa Posts: 375
    edited 2006-10-14 11:50
    Once again,

    This program·does not·work with the basic VGA (640x480).

    There is a way to make this things running in all VGA resolutions.

    Or at least specify which resolution the program is designed for?

    It is too much to ask?

    BTW VGA_Hires_Text_demo does.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-14 14:03
    El Paisa,
    How about taking what Bill has done and modifying it to adjust to the different resolutions? If you look at VGA_hires_Text, it does make the resolution information available as constants which can be referenced in your program as vga#cols for example which is 40 for 640 x 480, 50 for 800 x 600, and 64 for 1024 x 768.
  • NewzedNewzed Posts: 2,503
    edited 2006-10-14 14:11
    Mike, I take it that this does not apply to OS_vga_hires_text.

    Sid

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Don't have VGA?

    Newzed@aol.com
    ·
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-14 16:17
    Sid,
    The OS_vgaHiresText object is essentially the same as the one El Paisa is talking about. The OS routine has some additional features (like windowing support) as well as the methods (functions/procedures) furnished with the other display drivers. It's also been split into a program interface part and an initialization part (with the assembly language driver). The screen buffer and color palette are allocated in a different part of memory, but Bill's program could be modified to work with it.
    Mike
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-14 16:43
    El Paisa said...
    Once again,

    This program does not work with the basic VGA (640x480).

    There is a way to make this things running in all VGA resolutions.

    Or at least specify which resolution the program is designed for?

    It is too much to ask?

    BTW VGA_Hires_Text_demo does.

    Yes I think it is too much to ask from a persons first demo with an object.

    Graham
  • El PaisaEl Paisa Posts: 375
    edited 2006-10-14 16:50
    It is too much to ask when somebody writes an VGA object to specify the resolution of the machine is using?
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2006-10-14 18:11
    What I mean is, he might not have realized that some people (like you and me) have screens that don't support higher resolutions.

    You sounded almost offended by the ommision of this information.

    Graham
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-14 18:29
    People (myself included sometimes) tend to underestimate the amount of work needed to document a program for others to use or adapt a program originally written just for yourself for wider use. Often what we are willing to put up with is far far short of what others can reasonably be expected to accept. That's a lesson for all of us and we also need to be tolerant of people who, in the excitement of the moment, want to share their new creation with others without the sometimes agonizing delay of sprucing it up for others.
  • James LongJames Long Posts: 1,181
    edited 2006-10-15 00:27
    Mike,

    I tend to agree......but I hope people who are submitting objects to the exchange go back and do a detailed documentation of their objects.....it will really cut down on the problems associated with them. There will always be confusion....like I had....but good documentation is really a necessity.

    But....I also have to remember the objects here are shared through the forum...not the exchange.....so we have to figure them out for our own use.....which is a good learning tool.

    Guys please remember.....we do appreciate all that you share.



    James L
  • Bill HenningBill Henning Posts: 6,445
    edited 2006-10-15 02:09
    Hi,

    I never expected such a debate over a simple off-the-cuff quick hack!

    In order of replies:

    Chip - Thanks!

    Especially for making the Propeller! I'm having a blast with it, I think I'm going to become a long term resident of this forum and propeller hardware... I'd better, given how much I've blown in the past month on components, lcd's etc to play with.

    El Paisa,

    This was a short hack for testing the default high-rez text mode, which is 128x64. See attached resolution independent one, with bonus animation at the end. Only took a few minutes.

    Mike Green,

    Thanks, I did it for him - see new source at the end of the message. It is still not commented, I do not consider this a "tutorial" or a released piece of code, just a quick hack to share on the forum. As a matter of fact, I deliberately left the "animation" code undocumented. After I play with the raw hardware some more, I am going to check out your Spin OS...

    Newzed,

    See the new constants on top. As long as you can pass the code the base address of the frame buffer, the color palette, and the sizes of both, it should work with any byte oriented text mode, including TV object (which I may play with tomorrow). I've been working 6.5 long days a week and have not had as much time to play with my propeller as I'd like... but tomorrow I am FREE!!!

    Graham,

    If he had simply asked, I'd have obliged him - even though the changes were trivial. As is, given the interest, I obliged him anyway, and added some pseudo-animation code too... (which is too slow in spin, but its still a neat effect)

    James,

    If I had intended this as an object for the exchange, I would have documented it. I have 24 years experience in IT, including being a project manager so I know how valuable documentation is; however I was just posting a neat, short hack that I whipped up for fun after a long day.

    Everyone:

    I have to use an attachment :-(

    I could not find an 'formatted' mcode and it kept messing with my spacing.

    Post Edited (Bill Henning) : 10/15/2006 2:26:57 AM GMT
Sign In or Register to comment.