Shop OBEX P1 Docs P2 Docs Learn Events
VGA colour and VT100 objects — Parallax Forums

VGA colour and VT100 objects

pullmollpullmoll Posts: 817
edited 2012-09-02 09:39 in Propeller 1
Attached is a VGA object that can do 80x30 characters with separate foreground and background colour per character. The VT100 emulation can be used to write to the screen using the well known escape sequences. The vgademo code contains only a small excerpt of the supported escape sequences.
The frame buffer requires 80 x 30 words or 1200 longs.
The timing is set for a 80MHz Propeller and video outputs are on pins 16..23.
Oops: v0.0.2 fixes a bug with the underline cursor, which was never displayed.
v0.0.3: Still playing around. This adds underlined characters to the font and uses them with the corresponding VT100 attribute.
v0.0.4: This one uses an 8x8 font with 128 characters only, so it saves a lot of hub RAM. The character scanlines are doubled to make the font 8x16. Underline is generated for the 2nd half of the character set, i.e. char + $80.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Pullmoll's Propeller Projects

Post Edited (pullmoll) : 5/14/2010 8:13:55 PM GMT

Comments

  • BaggersBaggers Posts: 3,019
    edited 2010-05-09 09:06
    Nice one pullmoll, I was trying to do that, but made the mistake of not changing the driver res from 1024x768 to 640x480, which obviously meant the prop wasn't fast enough for one attribute per character [noparse]:D[/noparse]

    As I was also wanting 1024 to divide down to 256x192 [noparse]:D[/noparse] but I'll just have to have borders, I can live with that [noparse]:D[/noparse]

    Thanks, will have a play with this, and the Z80 emu [noparse]:D[/noparse] any guesses what I'm making? lol [noparse]:D[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2010-05-09 09:27
    Do we have to speculate?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Style and grace : Nil point
  • pullmollpullmoll Posts: 817
    edited 2010-05-09 09:30
    Baggers said...
    Nice one pullmoll, I was trying to do that, but made the mistake of not changing the driver res from 1024x768 to 640x480, which obviously meant the prop wasn't fast enough for one attribute per character [noparse]:D[/noparse]

    As I was also wanting 1024 to divide down to 256x192 [noparse]:D[/noparse] but I'll just have to have borders, I can live with that [noparse]:D[/noparse]

    Thanks, will have a play with this, and the Z80 emu [noparse]:D[/noparse] any guesses what I'm making? lol [noparse]:D[/noparse]

    Higher resolutions won't work, that's true. They may be possible without a CLUT and just the foreground colour in the attribute byte, but that wasn't what I wanted. With the two lookups per character there is no time left for any extra instruction (or perhaps for one, but not for two). It was very, very tight wink.gif

    I guess you're going to emulate some colour computer? I don't know the Spectrum specs, but the resolution is certainly lower than 80x30 characters.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-05-09 10:23
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-09 11:09
    Very impressive. Working great here. How much memory does it use (and can it fit into the qZ80 emulation?)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller
  • BaggersBaggers Posts: 3,019
    edited 2010-05-09 11:17
    lol Toby [noparse]:)[/noparse] yes, I think you do have to SPECulate what it might be! [noparse]:D[/noparse]

    yes, Pullmoll, the res is 256x192 pixels, thankfully bitmapped, so should save some cycles not having to get char from font, which will allow it to get the palette.
    Do you know the Timex 1000? was that what they called it in the states?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • pullmollpullmoll Posts: 817
    edited 2010-05-09 13:02
    Dr_Acula said...
    Very impressive. Working great here. How much memory does it use (and can it fit into the qZ80 emulation?)

    Nope, it won't fit. The 1400 longs is too much with all the other code in place. There is some space to gain from cog initialization code, but it is scattered throughout the memory space: the qz80 cog, the serial i/o cog, the SPI SD + XMM cog, the VT100 cog. Right now the CP/M+MP/M screen buffer reuses the I/O cog's init space ($200 longs) plus what it needs for 80x40 characters = $320 longs, so it preserves $120 longs after the I/O cog's initial code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects

    Post Edited (pullmoll) : 5/9/2010 1:07:24 PM GMT
  • KPRKPR Posts: 189
    edited 2010-05-09 13:03
    Do you know the Timex 1000? was that what they called it in the states?

    zx-81?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I always have someone watching my back.
  • BaggersBaggers Posts: 3,019
    edited 2010-05-09 13:52
    Ah, you're right KPR, the Timex 1000 was the ZX81, was the Spectrum called something else in the states? was it a ZX Spectrum? or something else?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • potatoheadpotatohead Posts: 10,261
    edited 2010-05-09 16:17
    I think it was the ZX Spectrum here. Saw one once in the departments stores in the 80's.

    http://en.wikipedia.org/wiki/ZX_Spectrum

    That one? Hmmm.... lots of 16K games on cassette available!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!

    Post Edited (potatohead) : 5/9/2010 4:38:02 PM GMT
  • BaggersBaggers Posts: 3,019
    edited 2010-05-09 17:44
    Ah, so it was just the ZX81 that was renamed [noparse]:D[/noparse]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    http://www.propgfx.co.uk/forum/·home of the PropGFX Lite

    ·
  • ColeyColey Posts: 1,110
    edited 2010-05-09 17:52
    Hmmm I thought the US version of the Speccy was the TS2068
    en.wikipedia.org/wiki/Timex_Sinclair_2068
    Sorry for being off topic Pullmoll....

    Baggers you should really start a new thread if you are doing a Speccy emulator, that is if you haven't already finished it while I am typing this post lol.gif

    Regards,

    Coley

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PropGFX - The home of the Hybrid Development System and PropGFX Lite
  • potatoheadpotatohead Posts: 10,261
    edited 2010-05-09 19:14
    I think you are right Coley. I might have confused the other one. I deffo remember that machine here. The single line color cells were kind of a big deal back then, as a lot of color could be drawn to the screen. That's one attribute I latched onto back then. The other one was the 512x192 mode.

    Depending on how they chose to do the video, that computer would do 256 colors on NTSC TV's just like the CoCo 3 can, and I never got to try it... (would have too) [noparse]:)[/noparse]

    The end product would have been 128x192x256! Never exploited over here, just as the CoCo 3 160x200x256 wasn't. I believe that's because few people really knew about it being possible, and the conflict with PAL displays where it was not possible to do in the same way.

    Somebody somewhere needs to toss up a NTSC speccy demo for the next Breakpoint. [noparse]:)[/noparse] [noparse][[/noparse]goes off in search of screenies to see what the video signal was like]

    No chance at that. Can't find anything on the NTSC beasties... Oh well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!

    Post Edited (potatohead) : 5/9/2010 7:32:54 PM GMT
  • KPRKPR Posts: 189
    edited 2010-05-10 00:02
    I remember you could also get a kit and build it yourself... I went the apple II way myself.. but a buddy in school had one.. got it from the back of popular science mag.. and kit built it..,.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I always have someone watching my back.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-05-10 00:36
    Nope, it won't fit. The 1400 longs is too much with all the other code in place.

    Oh bother! That demo just looks so cool in colour.

    Which part doesn't fit - the driver code, or the buffer needed for the screen? If the latter, would it be possible to split up the display into parts and fit those into the reused hub space?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    www.smarthome.viviti.com/propeller

    Post Edited (Dr_Acula) : 5/10/2010 6:40:05 AM GMT
  • pullmollpullmoll Posts: 817
    edited 2010-05-10 06:18
    Dr_Acula said...
    Which part doesn't fit - the driver code, or the buffer needed for the screen? If the latter, would it be possible to split up the display into parts and fit those into the reused hub space?

    The buffer doesn't fit. It would allocate 688 longs in addition to the 512 it reuses from the I/O cog initialization space. It may be possible to scatter the video RAM around, but the VT100 code would become a mess: think of scrolling through several memory ranges. I'd rather not try it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • pullmollpullmoll Posts: 817
    edited 2010-05-11 02:33
    I tried ways to reduce the hub RAM footprint of the object and so here is a variation that uses an 8x8 font with 128 characters (256 longs) as opposed to the 256 8x16 characters (1024 longs) of the previous versions. The code repeats each character scanline once, using a little trick to not rotate the data on the first sweep, so the displayed height is still 8x16. Of course this 8x8d font looks a little chunkier than the real 8x16 font. You can't have both: high resolution and low memory footprint.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2010-05-27 16:48
    @Pullmoll

    Trying to compile this using the lastest BST and lastest Propeller Tool I'm getting some compile errors.

    The first stop is the "#define DracBladeProp"

    Can this be compiled using Propeller Tool on the demoboard?

    Thanks!
    OBC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Are you Propeller Powered?
    Propeller Feature Projects: PropellerPowered.com
    Visit the: PROPELLERPOWERED SIG forum kindly hosted by Savage Circuits.
  • pullmollpullmoll Posts: 817
    edited 2010-05-27 17:17
    Oldbitcollector said...
    @Pullmoll

    Trying to compile this using the lastest BST and lastest Propeller Tool I'm getting some compile errors.

    The first stop is the "#define DracBladeProp"

    Can this be compiled using Propeller Tool on the demoboard?

    Thanks!
    OBC

    With BST you have to enable the extended syntax in the compiler options to allow #defines.
    You can also just remove the #define DracBladeProp. It isn't currently used - it was intended to try to have a frame buffer in XMM.
    The one thing you may have to change is the first pin of the VGA output group. It's 16 for the DracBlade and the first parameter to vga.start()

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Pullmoll's Propeller Projects
  • bogdanmbogdanm Posts: 4
    edited 2010-10-28 04:37
    Hi,

    First of all, thanks for this object, it's exactly what I was looking for. I need a little help though: what would be needed to modify it to output 640x400 (80x25) instead of 640x480 (80x30)? I tried to change the settings as shown here:

    http://tinyvga.com/vga-timing/640x400@70Hz

    but for some reason my monitor detects this as 640x350 (and obviously doesn't display the whole 25 lines). I have to mention that I couldn't change the polarity of the vertical sync to positive (as specified in the forementioned page), because when I try to change 'vn' to 0 in vgacolour.spin I get a very strange output (completely desynchronized). I'm quite new to this, and I'm not sure what to do anymore. Searching the forums for "640x400 vga" didn't help much.
  • jimigoujimigou Posts: 8
    edited 2012-09-02 06:44
    bogdanm wrote: »
    Hi,

    First of all, thanks for this object, it's exactly what I was looking for. I need a little help though: what would be needed to modify it to output 640x400 (80x25) instead of 640x480 (80x30)? I tried to change the settings as shown here:

    http://tinyvga.com/vga-timing/640x400@70Hz

    but for some reason my monitor detects this as 640x350 (and obviously doesn't display the whole 25 lines). I have to mention that I couldn't change the polarity of the vertical sync to positive (as specified in the forementioned page), because when I try to change 'vn' to 0 in vgacolour.spin I get a very strange output (completely desynchronized). I'm quite new to this, and I'm not sure what to do anymore. Searching the forums for "640x400 vga" didn't help much.

    I too need 80x25 to better emulate a real terminal.
    But I also need 100 MHz operation to work on a PropCade board.
  • Heater.Heater. Posts: 21,230
    edited 2012-09-02 08:41
    No idea how PullMoll has done this but many graphics and other objects will not be so fussy about clocks speed as they compensate for it.
    Have you actually tried it on a 100MHz Prop?
  • Oldbitcollector (Jeff)Oldbitcollector (Jeff) Posts: 8,091
    edited 2012-09-02 09:39
    jimigou wrote: »
    I too need 80x25 to better emulate a real terminal.
    But I also need 100 MHz operation to work on a PropCade board.

    Would this ANSI term help?
    https://www.dropbox.com/sh/qwhixzvtlrvp1u1/zupPP-EA4Q/PropellerBASIC/Useful%20Binaries/sources/ansiterm.zip

    Jeff
Sign In or Register to comment.