Now given that the TMS9900 has a 16 bit databus, it seems to me that they could have put all memory and all periphery on that bus. It would have saved the cost of the multiplexor, and made the computer a good deal faster too. Presumably it would have simplified the routing of the circuit board also.
Yes it would - if the computer had been intended to be built with a 9900 in the first place.
So my question is why the TI-99/4 had these two databuses. Why not put everything on a single databus.
TL;DR: The CPU operates a 16 bit bus, and the core components are on this bus. The 8 Bit bus is an extension or I/O bus - essentially what's accessible on the right side connector and the cartridge port. Think of this like 32 Bit Local Bus vs. 16 Bit ISA on a 486 PC.
For a thorough explanation this calls for a differentiated answer about a design and what happened.
The 99/4 was meant to be a low cost home computer design. The 9900 was, at that time, a top end 16 bit processor (*1) with great performance, but also a rather high price tag. 990 family CPU boards using a 9900 were priced close to and above 1000 USD. Building a home computer with a 9900 would have made a quite powerful, but also rather expensive machine - not least the fact that it would need 16 bit memory, making humongous (in 1977/78 (*2)) 32 KiB the basic RAM (*3). Similarly, ROMs must also offer 16 bit data, and so on. A machine like that would have been extremely expensive, and definitely not able to compete against other home computers - and consoles - at the same time.
But there was also an 8 bit version, the TMS9980. It's basically to the 9900 what the 8088 is to the 8086. The same CPU, just with an external 8 bit bus and a memory interface splitting each word access into two byte wide accesses. On the downside, it would (almost) halve the CPU speed. Not really what engineers like to design.
Without a closer look, this only leaves the choice between a great but expensive machine and a cheap(er) but quite slow one. Now, looking at the most common job for a home computer, running BASIC programs, reveals that most of the memory, where the BASIC code resides, is only accessed in 8 bit portions anyway. It also doesn't really matter if that access is slower than usual, as there will be many native instructions executed between each fetch of BASIC code. Furthermore, there are not many other RAM locations a BASIC interpreter (and an underlying BIOS) needs at all.
So the idea was born to use a version of the 9980 with a 16 bit wide on-board ROM for some BIOS and BASIC, some 16 bit wide RAM (256 Bytes (*4)) and an external 8 bit bus to access user RAM and other I/O components. The core system could run at full speed, while slower and less frequently used components were accessed using the 8 bit I/O bus (*5), thus enabling the use of less expensive standard 8 bit components.
The story could end here, but the TI engineers even went a step further and designed the whole machine around a streaming based access concept. External units that offered more than just a few port registers were supposed to offer a streaming access to their content. This means that after a start address (within the device) was set, each consecutive access should deliver the next byte - or take one when writing. Each of these streams were to be accessed by some (hard or dynamic) designated port, mapped into CPU address space, effectively enabling an almost unlimited amount of RAM or ROM. The latter being most important for game cartridges, as it was already obvious that limitation to 4 KiB as on the 2600 is a serious issue.
The streaming concept was also used for video and BASIC RAM. Instead of just mapping 16KiB plain into the main address space and having that shared with some CRT controller, the 9918 was designed to manage all RAM and offer streaming access to the host system. This not only saved the design of a separate DRAM controller, but also let BASIC store the program within video memory, separating it from any limitations of the CPU address space. In theory the VDP RAM could be extended way beyond 16 KiB (*6) without ever colliding with any other component. A 1 MiB 99/4 would just have required an additional address register ... and there was plenty of unused address space in which to put it.
A similar concept for streaming ROMs was devised, so called GROM. Without modification, a standard 99/4 could hold up to 16 external GROM with 40 KiB each (in default configuration). 640 KiB ROM for a 1977 machine does sound nice, doesn't it? (*7)
They even pushed it a level ahead and didn't put BASIC into the 16 bit ROM, but a simple basic OS plus a collection of routines, from memory and screen management to floating point ... and an interpreter for a general purpose virtual machine. Today we would call such a bytecode interpreter like the one used by Java - just here the 'language' was called Graphic Programming Language or GPL. Beside the usual computing stuff it consists of a mechanism called XML (*8) to include complex operations like floating point or graphics as basic 'machine' operations. Using such GPL programs in cartridge GROMs resulted in rather high execution due to its interpreted and optimized nature. In fact, even the BASIC interpreter itself was a GPL application.
Bottom line, this was a great design choice to create an extremely versatile system at low cost with incredible options to expand. It could have been great ... except for what happened.
When the basic design was done, three (somewhat) custom chips where needed.
- 9985 - CPU with ROM and 256 Bytes of RAM (and 8 bit I/O bus)
- 9918 - Capable of acting as VDP, RAM controller and CPU accessible RAM
- 9919 - A sound chip
During development VDP and Sound where prioritized due to their special features, while the 9985 could be substituted by a replacement circuit consisting of a board with a 9900, 16 bit ROM/RAM and multiplex logic to emulate the 8 bit Bus.
The multiplex logic was straightforward, turning each 9900 access into two 8 bit ones. This was different from the planned 9985 which would have made only a single 8 bit access if it was for a byte instead of a word. This wasn't a big deal except for the VDP. A useless full memory cycle for each and every byte accessed on screen was a real stopper for program development, in particular games. So the VDP got moved to the 16 bit side of the development setup, despite being an 8 bit device. (*9)
VDP and sound chips where delivered mostly on time, but even in early 1979, no 9985 was ready, while the machine was designated to premiere for Christmas 1979. So a decision was made to integrate the replacement circuit into the mainboard, use the full 9900 CPU plus the additional circuitry for a first batch, hoping that a few months later the 9985 would be ready.
Well, it wasn't. To make it worse, management canceled the 9985, as it didn't make much sense from the chip divisions point - and after all, the 99/4 did work 'fine' without, didn't it? So the 99/4 continued to be sold with a 9900. (*10) Instead, the 9940 and 9990 were produced.
When the 99/4A redesign came along, only minor changes (beside the 9918A) where made. They skipped the chance to increase the 256 Bytes RAM to at least 1 KiB, or improve the 8 bit bus connection. :(
- 9900 a full figured 16 bit CPU with plain 16 bit wide data bus.
- 9940 an 8 bit version of the 9900 with 128 Bytes RAM/4KiB ROM, 16 bit wide
- 9980 an 8 bit version of the 9900
- 9985 Like the 9980 but with internal 256 Bytes RAM and 8KiB ROM,16 bit wide
- 9990 an 8 bit Version, like 9980, but with 256 bytes 16 bit RAM (*11)
*1 - this may seam strange to us, as we always associate the 9900 with the somewhat strange 99/4. But it was considered a serious competition for 68k and 8086. Not just because of similar performance (and being available very early - 1976), but more importantly due to the huge software library available, including mature operating systems. Not to mention the fully symmetric and straightforward instruction set.
After all, the 9900 was the single chip implementation of the successful 990 series minis. Much like the LSI-11 implemented the PDP-11 - except the 9900 was a single chip implementation. It was used in several workstations and low end 990 minis.
*2 - This is about design decisions, not when it got first sold
*3 - At the same time, a PET was delivered with 4/8 KiB, a TRS-80 with 4 KiB and even the Apple II was able to run with just 4 KiB. 32 KiB as minimum memory would have been out of proportion for a home computer. That was a lot, even for professional machines/workstations.
*4 - This isn't just coincidentally similar to the 6500's Zero Page. It's the very same idea to make certain common instructions faster. In case of the 6502 by shortening address encoding for ZP (and enabling additional complex addressing modes), and with full wide access in case of the 99/4.
*5 - Quite similar to 32 bit PC CPUs (386ff) using 16 (or even 8) bit ISA bus for I/O.
*6 - Later 9918 follow up chips (9938/58) used in MSX2/3 did extended the VRAM up to 192 KiB.
*7 - As usual, reality is cruel to us. While GROM can have any size between 1 Byte and 64 KiB (with two byte addresses - longer addresses could provide more), TI manufactured them only with 6 KiB. But at least, GROMs could be combined if not occupying the same base address. So the maximum external GROM data was limited to 6x5x16=480 KiB ... well, still not bad, but way down from the original possible 1 MiB.
*8 - :)) No, not eXtensible Markup Language, but eXtensible Machine Language. Effectively a way to turn certain library functions like floating point or such into single virtual machine operations.
*9 - The memory behaviour also became eventually the first speed-up mod for the 99/4 - but that's a different story.
*10 - This was also the reason for the quite unusual move to raise the price tag for the 99/4 by almost 20% - they had to make good for more than calculated cost of components - mainly the CPU.
*11 - The 9990 was available much later, and used in compatible machines. Not to be confused with Yamaha's projected enhanced, MSX3 compatible VDP.