Shop OBEX P1 Docs P2 Docs Learn Events
Has anyone already implemented - or thought about - display lists? — Parallax Forums

Has anyone already implemented - or thought about - display lists?

pullmollpullmoll Posts: 817
edited 2010-03-14 04:22 in Propeller 1
I guess most of you have heard the term. Display lists were used already on the famous Xerox Alto computer to counter the tight memory. Yes, it was 197something and RAM was very expensive. Displaying a full 606x808 screen of black and white bits took 30704 of the 32768 (- I/O range) words available. Sounds familiar, huh? They implemented a rather simple to understand scheme, where the display would be described by a linked list of words and description of what the current block should look like. Perhaps it's not even a bad idea to think about using an approach like this today, because the developers of the Alto certainly spent a lot of time on the design.

Here's an overview of how DCBs (display control blocks) looked like on the Alto:
DCB:    word  DCB1      ' link to the next display control block
            word  control    ' control for this DCB, bits explained below
            word  bitmap    ' pointer to the actual bitmap memory to display
            word  SLC        ' scan line count




The control word consisted of a number of fields for various purposes:
bit #     purpose
-----------------------------------
0          LOW: use low resolution if set (double wide pixels / half pixel clock)
1          INV: inverse bitmap if set
2-7       HTAB: indentation by a number of 16*HTAB bits (16 because that was word size of the Alto)
8-15     NWRDS: number of words in the bitmap (had to be even)




The Alto used an interlaced display, but there's no reason why the principles of the DCB layout should not work non-interlaced.
By defining DCBs with NWRDS = 0 and SLC > 0 you could simply insert some empty scanlines in a layout. You could just as well insert 'horizontal rulers' (black) and even indented ones by setting the INV and/or HTAB fields of a DCB. Doubling, tripling etc. a vertical regions height, like for double or triple height text, could be done by just repeating the same bitmap addresses in several DCBs. By defining NWRDS smaller than the number of words for a full scanline you could save (white) space on the right edge. A DCB with a link field of value 0 would end the display, i.e. the video would continue with blank lines until the vertical blanking + sync.

The size of the bit fields could be different today, depending on what ranges are required for the values. There could perhaps be more fields, like for dealing with colors (background?). The Alto was B&W...

There wasn't much more to it but this, except perhaps for the compact way the Alto stored fonts (that's another story) and the microcoded opcode to expand such a glyph into some bitmap memory. If something similar to the Alto DCBs could be implemented on the Propeller, then certainly also the font rendering could be done as they did it back then.

I doubt I would yet be able to tackle any of this, since I did not even look too close in the 'simple' tile buffer video drivers. Perhaps this is an idea for those of you who are more acquainted with WAITVID than I am.

Juergen

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
He died at the console of hunger and thirst.
Next day he was buried. Face down, nine edge first.

Post Edited (pullmoll) : 3/10/2010 11:16:25 AM GMT

Comments

  • kwinnkwinn Posts: 8,697
    edited 2010-03-11 02:19
    I have been thinking of something along those lines for instrument panel displays. I want to be able to display buttons, icons, text boxes and numeric boxes of fairly large size at high resolution (1024x768 screen res and 256 color min). I pictured something along the lines of the sprites of older video games which were similar to the display lists.
  • BeanBean Posts: 8,129
    edited 2010-03-11 02:42
    Unless you use tiles, the problem with these methods is that they actually require MORE memory for the worst case.
    And you usually can't determine beforehand if the worst case could happen.

    I think back to the ZX81 display memory. It only had 1K of RAM. The display was 24 lines of 32 characters. But each line of text was ended with the special character. If a line had no characters the line consisted of only the special character. So the idea was to keep text to the left and/or only use a limited number of lines. But even this method uses 1 extra character per line worst case, but this could be eliminated if you just keep track of how many characters are on the line. If you reach 32 OR the special character then the rest of the line is blank.

    And these methods make drawing on the screen much harder and slower.

    Bean

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    Use BASIC on the Propeller with the speed of assembly language.

    PropBASIC thread http://forums.parallax.com/showthread.php?p=867134

    March 2010 Nuts and Volts article·http://www.parallax.com/Portals/0/Downloads/docs/cols/nv/prop/col/nvp5.pdf
    ·
  • VIRANDVIRAND Posts: 656
    edited 2010-03-12 11:15
    I recall the way the Atari 800 ANTIC chip did it.
    Each text or graphics color/resolution mode had a bytecode, 4 bytes for mode,
    one bit caused an interrupt, perhaps for changing sprite positions after drawing them ,allowing more,
    and also for changing pallettes to get more colors on the screen, etc.
    I think there was also a bit to enable horizontal and vertical scrolling...
    I know there is detailed info on ANTIC on the web.
    Oh, also... There were bytecodes for vertical retrace blanking, which at least made black lines above and below
    the visible part of the screen, because if you cound type under the bottom of the screen you wouldn't be able to read it.
    The most common use of the display list was to mix various sized pixels and characters, but
    each code represented usually one line of text or graphics, so the list was only a little bit longer
    than the vertical resolution.

    I was thinking about a mixed text and graphics driver recently for the propeller and figured that a display list
    Atari800 style or simpler could define what was text and what was bitmap, because text takes up a lot less
    screen buffer. It could be hard to automatically figure out where to display characters and where to
    display text, and also manually if you had several different zones on the screen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I should be typing in Spin now.
    Coming soon. My open Propeller Project Pages and favorite links index.
  • heaterheater Posts: 3,370
    edited 2010-03-12 11:54
    I was programming Marconi Radar PPI displays in 1984. Those huge round tubes with the rotating azimuth line, a map, a bunch of aircraft and text labels. Those things would have required a resolution of 2000 by 2000 as raster displays to get the same quality image and legible text. That was so far away in those days. They were vector graphic such that the electron beam drew the lines as the hardware cranked the X-Y deflection voltages up and down. The hardware executed a list of commands placed into memory by the CPU.

    Somewhere I have a big old scope tube that could do with driving in a similar way. I've often wondered if the Prop was up to it.

    How you use display lists with raster I'm not sure.

    Bean, yes in the worst case they require more memory, but at least there are a lot of cases where a few objects at high resolution would be great. For example the old Asteroids game. Lots of empty space with a few objects flying around in it. Or just drawing, for example, waveforms for a scope application. All you need is the X-Y axis, some tick marks and the waveform line or two. Most of the screen area is empty. Lot's of uses.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    For me, the past is not over yet.
  • pullmollpullmoll Posts: 817
    edited 2010-03-12 14:17
    I know the ANTIC and GTIA fairly well. I've written an Atari800 emulator for the MESS project a couple of years ago. The ANTIC display list would be overkill IMO, because it has far more modes that you can achieve with 2 or 4 color modes on the prop. Still, a mixed mode display with lines of tiles and other lines of bitmap data could be useful for many projects. Think of a display with text and some smaller graphics area to show some curve.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    He died at the console of hunger and thirst.
    Next day he was buried. Face down, nine edge first.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-12 14:27
    Chip wrote a tile-based display driver for VGA that I've used a couple of times where the tile pointers either point into the ROM font table or to bitmap tiles in RAM. The demo that came with it is nice in that it shows small areas of bitmapped graphics with most of the screen containing text and thus conserving RAM.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-03-12 14:30
    Here's the 1024 x 768 pixel version. There was also a 1280 x 1024 pixel version that used most of the cogs and pretty much all of the RAM.
  • kwinnkwinn Posts: 8,697
    edited 2010-03-12 14:48
    @heater, those were the 'good old days'. I played my first game of space war on a similar terminal connected to a CDC6600 courtesy of a friend I went to university with.

    With raster scan you would need either dedicated hardware to produce video pixels in a manner similar to the way text terminals generated a full screen of 80x24 characters from 1920 bytes of ram, or a very fast cpu to go through the display list and generate the image in a display buffer.

    I was thinking of a system with a full screen memory (possibly double buffered), additional ram to hold the "sprites" and a dedicated cpu to accept graphics commands and place "sprites" on the screen. For a 640x480 display 512Kx8 ram, 307,200 for the display buffer and the rest to store the sprites.
  • potatoheadpotatohead Posts: 10,261
    edited 2010-03-12 14:52
    The other problem with GTIA + ANTIC is color indirection. This is expensive on the propeller, generally limiting resolution to ~256 pixels (maybe), unless you want to consume a cog or two for color lookups.

    IMHO, another great alternative for higher detail/color/resolution displays would be serial memories. For an instrument panel, an awful lot of the display could come from the serial device. Static, or nearly static display elements could be combined with dynamic ones, on a scan line by scan line basis, preserving the HUB memory for those areas of detail that are dynamic.

    The SRAM could up updated during blanking periods, if needed.

    pullmoll, the propeller actually has several color "modes". If one sticks to the reference video circuit, it's possible to get ~100 colors, and do so at 1 bit per pixel, 2 bits, or 8 bits, some of which are wasted. Eric Ball wrote a higher color resolution display using all of the pins in VGA mode, to drive the reference circuit to better color, achieving 130 colors, but with much better characteristics. That is a 224 pixel display, timing coded specifically for a NTSC display.

    Additionally, the waitvid frame size can be changed. For "full color" where each pixel color is independent, that frame size is 4 pixels, using one long per 4 pixel group to get color on the screen. The trick there is to use the waitvid backwards, essentially changing the colors long into a pixels long, and the pixels become an immediate value. eg: waitvid colors, #%3210 For the 2 and 4 color modes, frames can be up to 32 pixels, but don't have to be. I use a frame size of 8 pixels when doing text drivers, to emulate the one byte per character 8x8 text modes common on older computers, for example.

    On a NTSC display, a resolution of 160 pixels exactly delivers ~400 in spec colors, and close to 1K colors, if one bends the standard a bit. This is done through artifacting, and will only work on a composite signal, NTSC display, and only work at 160 pixels.

    If one does not stick to the reference display, the number of colors could be significantly improved, by adding more grey scales, and to drive the circuit with VGA model. That would consume one cog for just scan lines, requiring another COG, or multiple COGs to feed that display cog each scan lines worth of data.

    Current display methods include tiles, where the "screen memory" is a combination of references to HUB memory color palettes, giving color indirection at a fairly low cost BTW, and HUB memory addresses. That's how the Parallax reference driver works, and it's very clever, and very flexible, but it is 4 colors per tile in the end.

    "Character mode", where a table of characters exists in HUB memory, or on the COG, if a limited display is all that is needed, an optional table of colors, and a screen memory consisting of bytes, that reference the characters. That's how my 8x8 text drivers work, and others have built nice variations of that. Think 8 bit computer, "text mode", without a dedicated character ROM, like the Apple and CoCo used.

    Bitmaps. These are really easy, but consume more HUB memory and that sharply limits their use on Propeller. The bitmap would be a great candidate for the sram + hub memory display scheme, IMHO.

    Those can all be done with a single COG, and depending on the driver attributes, can go to 640 pixels of resolution on a TV display. S-video makes that useful for color, otherwise, it's probably best to do a full interlace (like potatotext) for the best quality with the least artifacts, or stick to a monochrome display.

    Multi-cog displays almost all use a scan line buffer method. The primary video cog outputs sync signals for other display cogs, and draws each scan line as "full color" pixels, with the display cogs filling a scan line buffer while the display cog is drawing it. Either a single buffer or double buffer method can be used here, depending on the peak fill rate needed. I don't think I've seen a double scan line buffer driver, unless baggers higher end WOLF3D does that. It might, due to the very high fill rate required for that one.

    Multi-cog displays are most often used for sprites, though I did end up doing one for text, because of the cost of color lookups and their impact on resolution. It took two cogs to get 80 column "character mode" text on the screen, with color attribute capability. Sprite drivers sort the table of objects during the blanking period, then render them to a scan line buffer as the screen is being drawn. Sprites per line depends on number of render COG's, and a few cogs will get you 16 sprites per line, with each sprite being 16 colors, from a palette of the full color set.

    An alternative to the ANTIC way of doing things would be to use a simple display list, where the display reads from a string of bytes. Color palette info, character map offset, and or bitmap mode + start of display memory could be read, allowing people to use the screen in vertical strips. This method would not be too expensive, maybe even rendering with a single video cog. Characters could be "stacked" together to render graphics areas, and even duplicate those, if needed.

    Full on bitmaps could plot curves and such too.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!
  • mparkmpark Posts: 1,305
    edited 2010-03-12 18:32
    Off-topic, but since the first post mentioned the Alto:

    www.acm.org/press-room/news-releases/2010/turing-award-09
    ACM said...
    ACM, the Association for Computing Machinery today named Charles P. Thacker the winner of the 2009 ACM A.M. Turing Award for his pioneering design and realization of the Alto, the first modern personal computer, and the prototype for networked personal computers.
  • pullmollpullmoll Posts: 817
    edited 2010-03-12 18:57
    mpark said...
    Off-topic, but since the first post mentioned the Alto:

    www.acm.org/press-room/news-releases/2010/turing-award-09
    ACM said...
    ACM, the Association for Computing Machinery today named Charles P. Thacker the winner of the 2009 ACM A.M. Turing Award for his pioneering design and realization of the Alto, the first modern personal computer, and the prototype for networked personal computers.

    Mister Thacker certainly deserves the price. I have emulated the Alto and know the design to the chip. It's fascinating what you could do with a bucket full of TTL chips.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    He died at the console of hunger and thirst.
    Next day he was buried. Face down, nine edge first.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-03-12 20:05
    My Propeller Backpack video overlay driver (www.parallax.com/Portals/0/Downloads/docs/prod/prop/prop_backpack_tv_overlay.zip) uses a display list of sorts for character data. The master display list is an array of "displays", each pointing to one or more vertically-stacked "windows". Each display list window pointer includes visibility and X/Y position data for the window. That way the same window can be displayed in more than one location in different displays. Each window header contains its type (normal, auto date-time), size (rows, cols, font size), features (word-wrap, scroll position, blink enable, etc.), and "color" (gray level FG & BG, plus transparency). Following the header is the window's character data. A window's visibility and position in a given display (constrained by the list's top-to-bottom order), along with its features and color can be changed dynamically at any time.

    My main reason for organizing thigs this way was for flexibility, though, rather than space savings.

    -Phil
  • VIRANDVIRAND Posts: 656
    edited 2010-03-13 02:23
    Display List apparently describes more than one thing.

    The VECTREX video game system consisted of an ordinary yoked small TV tube
    and a 6809 and a couple of 8 bit DACs, which means you could make Asteroids
    or Tempest with a Prop and a small analog TV, methinks. Cheaper than o-scope tubes.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I should be typing in Spin now.
    Coming soon. My open Propeller Project Pages and favorite links index.
  • potatoheadpotatohead Posts: 10,261
    edited 2010-03-13 02:34
    Yes, it is more than one thing.

    A similar structure is found in modern 3D graphics displays, where triangles are linked into lists for texture mapping, and overall display culling of back faces, different Z depths, etc... A solid object is tessellated, then those triangles are sent to the graphics device, along with a whole bunch of other stuff, to be processed in specific order by the graphics system. Done right, the moving of things only requires a few transforms be written to be applied to the list on the next frame.

    I am wanting to make a vector display for the Prop for viewing on my O-scope sometime. If a 6809 can do it, and it can --the VECTREX is excellent, a Propeller should have no trouble with doing vectors at all. And, having one or maybe two COGs blasting out vectors would make for a great setup. No interrupts and such to contend with...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!
  • RossHRossH Posts: 5,519
    edited 2010-03-13 03:46
    @potatohead, VIRAND

    I wrote a vector graphics driver for the Prop as part of the VGA version of Space Wars and BattleZone (800x600 4 color image attached - it also does resolutions up to 1152x864, but only with 2 colors).

    See here: http://forums.parallax.com/forums/default.aspx?f=33&m=284807

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina

    Post Edited (RossH) : 3/13/2010 4:31:37 AM GMT
    1536 x 1152 - 276K
  • potatoheadpotatohead Posts: 10,261
    edited 2010-03-13 18:24
    I knew about the Space Wars driver, but I had missed the BattleZone one! Cool!!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!
  • VIRANDVIRAND Posts: 656
    edited 2010-03-13 19:41
    I think I was misunderstood about VECTREX and vector graphics.
    An oscilloscope suitable for vector graphics can be made out of a small TV,
    and I have tried this and noticed also that the VECTREX system works that way also.

    EDIT: Although people commonly repaired their own TVs in the 1970s, it was and is
    a dangerous exposure to skull.gifKILOVOLTS skull.gif . And in the 2010s, people
    are extremely careless, OR extremely terrified, and litigious about hazards.

    In any case, the memory requirements of a true vector graphic list of X,Y endpoints
    is very low, and the driver for the amplified DACs controlling a small TV yoke is so
    simple that it can probably be written in SPIN following the code that generates
    the list of endpoints for the image, such as a game, within the game loop.
    Lines are made simply by changing the endpoints through the DACs that power the
    tube yokes. Like an analog oscilloscope, these lines are not made of pixels, and
    thus each line may only need two bytes (X,Y) in the display list or buffer.

    I might as well ask, do those "vectorgraphic drivers" somehow convert vector graphic
    Cathode Ray coordinate data DIRECTLY into NTSC without a display buffer,
    or merely simulate vector graphics using a bitmapped display buffer?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I should be typing in Spin now.
    Coming soon. My open Propeller Project Pages and favorite links index.

    Post Edited (VIRAND) : 3/13/2010 11:47:31 PM GMT
  • potatoheadpotatohead Posts: 10,261
    edited 2010-03-14 04:22
    BTW: The Vectrex had 1Kb of RAM. That's such a cool old toy. Wish I had one!

    I got your intent perfectly, but have no intention of modding an old TV. At some point, I'm going to do a custom display on the scope though!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Propeller Wiki: Share the coolness!
    8x8 color 80 Column NTSC Text Object
    Safety Tip: Life is as good as YOU think it is!
Sign In or Register to comment.