Comment by weinzierl

Comment by weinzierl 4 days ago

16 replies

At the end of the day it's always pixels - alway has been [1] - and the efficiency of storing and blitting a small number of fixed size rectangles is hard to beat if you can get away with it.

[1] Except for the early oscilloscope style vector displays maybe.

gmueckl 4 days ago

No, this is technically not fully correct. Early text based display output systems were relying on special character generator hardware to generate the display signals producing the text on screen. Those systems did not have any means of generating arbitrary pixel patterns.

  • weinzierl 4 days ago

    Do you have an example? All the 8-bitters I know drew the characters from memory, which was a character ROM per default but could be changed either with a screw driver or by bank switching some RAM in-place.

    EDIT: If you mean they were not copied in a frame buffer first, you are right. I should not have written 'blitting'.

    • LoganDark 4 days ago

      The character ROM was not read and processed by the CPU. The CPU set some bytes in video RAM, which served as indexes into the character ROM by the video output hardware.

      I believe on some systems there were some tricks that allowed some bitmap display by redefining glyphs. One example off the top of my head is The 8-Bit Guy's Planet X2, which can use text mode but with glyphs redefined to use for icons, units, terrain, UI, etc.

      • worthless-trash 4 days ago

        I believe you are correct, VGA even had character rom, where 'individual pixels' were not drawn by the CPU itself, the software presented an array of indexes into the rom and the vga hardware itself blitted the characters onto the screen.

    • nine_k 4 days ago

      IBM PC / AT / PS/2 all had a separate text mode, with glyphs defined in character ROM or RAM. Read about CGA, EGA, VGA. So TUIs basically owned the place since mid-1980s when PCs became ubiquitous, until mid-1990s when Windows started to dominate.

    • direwolf20 4 days ago

      With character RAM you can still only have up to 256 unique 8x8 blocks on screen.

    • numpad0 3 days ago

      > which was a character ROM per default but could be changed either with a screw driver or by

      No. Stop believing everything ChatGPT told you on this topic and DYOR. That's some bad hallucinations.

      • RetroTechie 3 days ago

        Actually a small flathead screw driver is a useful tool to pull an (EP)ROM from its socket. Been there, done that (80s/early 90s).

        Might be fun though to check with ChatGPT on how to use a screw driver in this context. :-)

    • Brian_K_White 4 days ago

      kaypro & trs-80, just a couple I happen to know myself. There is no way I just happen to know about the only 2.

orbital-decay 4 days ago

Character-based hardware only stores the characters and the grid instead of the full bitmap for the frame, which is very efficient memory-wise. Tile-based hardware (e.g. most console graphics chips in the 8/16 bit era) also had scrolling and layers, and was extremely memory-efficient as well. With bitmap displays you already store full frames.

  • weinzierl 4 days ago

    Sure. Maybe I should not have written 'blitting' when the rectangles are not copied from one memory location to another but end up directly on the screen.

    My original point that putting a fixed number of small and fixed rectangles on a screen is more efficient than line drawing still stands though.

    • codebje 4 days ago

      It's still wrong, though.

      Without dedicated sprite hardware it's not more efficient to read a byte from one place and write a byte to another than to write background bytes and write line colour bytes. DMA controllers on µCs won't save you: a character is usually something like 8x8 or 8x16 and displays are rarely more than 8 bit, so we're talking about DMA transfers of just 8 bytes each, and the overhead of setting them up more than offsets any efficiencies gained.

      An 8x12 cell, for example, is 96 pixels to be transferred in 12 rows of 8 pixels. That's 96 reads, 96 writes, and (assuming an unrolled inner loop) 12 branches, to copy as a sprite. Or, it's 96 writes and 12 branches to clear, and (horizontal line) another 8 writes to draw, no branches.

      When your graphics become too complex for simple drawing routines to handle them, they're probably also too complex for simple character ROMs, too.

      • Johanx64 4 days ago

        Depending on MCU, you can chain DMA transfers together, so you can have many small writes without extra CPU involvement per DMA transfer. DMA channels are a limited resource however.

        There's quite a few ways to do this, you can do a DMA transfer per horizontal/vertical screen line (not enough memory for a fullscreen buffer, but usually enough memory for 2 fullscreen lines), with an interrupt which fills in the next line to be transfered, etc.

        > displays are rarely more than 8 bit

        Backing memory in these color TFT SPI displays is often 18bits per pixel, often transfered as RGB565 (2bytes) per pixel.

        For SSD1306 its 1bit per pixel, and even the weakest MCUs usually have enough memory for a second buffer.

        All this is completely ass-backwards thinking though. The crucial question is - does the end-user/customer want to see smooth lines or prefers "hacker-man" TUI aesthetics.

        I'd say you generally speaking users want normal smooth lines graph instead of hackerman aesthetics.

        So preferring implementation simplicity (TUI) might be another case where substandard programmers prioritize their convenience over the end-user needs/preferences.

      • lizzylot 3 days ago

        Without DMA you need to insert a lot of wasted cycles to wait between each SPI transfer, so it doesn't take that many bytes to make it worth it. I use variable width fonts on 16bit rgb565 displays and DMA doubles the speed of drawing text with ~20 bytes/characters.