Remix.run Logo
weinzierl 2 hours 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 33 minutes ago | parent [-]

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.