After reading through the forum archive, I had reason to re-evaluate several assumptions. This has led to a synthesis of ideas which are new to me but might be well known or infeasible. One of these concerns video display on vintage computer systems.
A quick analysis of vintage home computers from 1979-1982 finds that the most popular systems used 6502 or Z80. While other micro-processors, such as RCA1802, TMS9900 and MC6809 were arguably more pleasant to program, such systems were a rounding error. Even among 6502 systems, many were a rounding error compared to Commodore's vertical integration.
It is also apparent that there were two popular configurations. Specifically, 6502 with 6845 derivative or Commodore custom chip working on alternate bus phases. The other configuration was Z80 with software interrupt to populate a shift register. This was a common feature of early Sinclair designs (ZX80, ZX81, ZX Spectrum) and Galaksija.
I previously assumed that Z80 was significantly more powerful ansd that it was possible to blow 80% of this power on software refresh and thereby achieve the cheaper configuration. However, it is easy to dispute this assumption. Although 6502 and Z80 are not directly comparable, 2MHz 6502 preferable as a bytecode interpreter and 4MHz Z80 preferable to perform single precision floating point. However, this does not explain the cheapest video configuration.
Perhaps Z80 is preferable for 15.6kHz interrupt due to the steady timing of the four phase clock? Well, that is complete bunkum.
Perhaps Z80 has an advantage with 16 bit index registers? I presume yes. This is demonstrated clearly with reference to
mvk's Gigatron (which I note uses a suspiciously Sinclair style logo while being loosely based upon 6502 and this may be pertinent to my consideration). A Gigatron approximates 640*480 pixel VGA with 160*120 bytes of memory. This is arranged in 32KB RAM such that the bottom 2KB is contiguous and the remaining 120 pages have a 160:96 byte split for display and variables. Historically, this would have been a more forgiving 40 bytes or 80 bytes per line of screen. However, this would lead to an arrangement of 3 or 6 lines of screen per page and a mere sliver of 16 bytes unused. It would also be possible to overscan with up to 51 bytes per line. However, this creates problems elsewhere. For example, line or character drawing must handle 3, 5 or 6 lines per page.
The worst problem is that software screen refresh with 8 bit counters is economically uncompetitive. A hypothetical 6502 with 320*240 monochrome bitmap display is unfavorable against ZX Spectrum with 320*256 block color bitmap display using the same contiguous amount RAM for bitmap and only requiring additional RAM for color. That is a problem. If we are unable to cross page boundary in a fixed unit of time, we get 6 lines of 320 pixels followed by 16 bytes doing nothing. Repeat this down the full display and the shortfall is 16 lines. Ignoring the smaller display and the additional difficulty of drawing on it, there is the difficulty of using 40 fragments of 16 bytes. This would be trivial with contemporary knowledge of memory allocation. However, this may not have been known (or implemented) in this era. As noted by GARTHWILSON, legacy equipment can be utilized more effectively with contemporary techniques. The fraught problem of
memory allocation is one such technique.
I don't like this state of affairs. It is possible to coax a 6845 into rastering a bitmap of 20KB or more with the advantage of hardware scrolling. However, it is apparent that the big draw in this arrangement is a hardware counter exceeding 8 bits. This analysis may open unexplored opportunities. For example, 65816, with 16 bit index registers and block copy instructions may be ideal for software refresh. It can easily shift more than 50 million bits per second. Monochrome 1024*768 may be desirable. However, we are skipping ahead to 1983 and, even here, the first use of 65816 was in Apple IIgs, which was already supplied with dedicated video hardware. But what about 1982? A year so fine that some people are still living in it.
I don't like to say this, boys, girls, and other assortments, but our mortal sworn enemies, Federico Faggin's Fanboys, the Glitchy Zilches of Zilog, [mild insults with dubious rhyme and meter continue unabated for several pages] with three 16 bit registers might beat 6502. If we count
abuse of 16 bit stack pointer, as was typical on 6800 and 6809, that's another - Hey! Stop waving those ridiculous EXX and EX DE,HL opcodes around like cheap, two barrel revolvers! Someone might get shot in the little-endian!
Thankfully, we have a secret weapon. A denizen so devious, you could put a doctorate on him and call him Dr Jefyll and who is - perhaps - the incumbent Chair of Cunning at Cunningham College. When
Dr Jefyll suggested rastering and blitting by using three latches in a ring and finding a timeslice for 6502, the suggestion passed with little more than a murmur, for this is a mere routine suggestion and one of many. Irrespectively, even if you invoke Dr Jefyll in
the mythical, the hypothetical or the chimerical, I implore you to consider a mantra, an abbreviation and a way of life:
WWDJD? - What Would Dr Jefyll Do?I have considered the problem in detail despite not having the expertise to implement it. However, there is one thing which is very obvious to me. We only require an incrementing counter which increments as fast as possible. Well, 6502 ships with a perfectly good one. We merely have to apply it in a suitable manner. So, WWDJD with a mere
program counter and a
lazy afternoon? I am not entirely sure what would emerge from Loughton Laboratories but it wouldn't be the craziest thing soldered together by members of this forum. Actually, it probably wouldn't be the third craziest video circuit.
Anyhow, some tidbits and morsels for your consideration:
- A latch of arbitrary size may be used to set the upper bits of raster display. This can be used to implement double buffering, triple buffering and - for fans of Commodore's Amiga - vertical split screen.
- A region of memory returns dummy opcodes while the lower address lines simultaneously select data for a latch or shift register. Access to the dummy opcode region may automatically set porch or a horizontal sychronization signal.
- The dummy opcode region precedes ROM or RAM, where a processor slides into the end of a loop. With this arrangement, it is also possible vary display width. However, rastered data will occur at the end of a page.
- Shift register dot clock may exceed 150MHz. However, this may require overclocking a micro-processor to 20MHz.
- RRGGBBII or similar at 640*256p can be achieved with 65816 at 14MHz or thereabouts. In this configuration, display is 160KB.
- There is no need for dual port RAM or lock out circuitry because a processor is always busy during rastering.
- This arrangement only uses one bus phase. It is possible to implement a dual display, although this arrangement may only be useful if displays run at different resolutions and frequencies. Alternatively, DMA on unused phase may exceed display rate.
- The selective dead cycle elimination of 65816 emulation/native mode might be useful for LORES/HIRES function. This requires suitable choice of dummy opcode.
It is possible to apply similar techniques to Z80 to obtain increased resolution. However, as is typical, 6502 matches or exceeds the performance of Z80 at half the clock speed. My work is done and order is restored to the universe.
Edit 1: Typographic errors.