Saturday, February 1, 2020

A 1987 Themed Homebrew Computer

I've long had dreams of designing 70s/80s style game consoles/computers "from scratch" (where "from scratch" is vaguely defined). One of my students has started down a 70s path with the COSMAC VIP with the 1802 processor.

I was thinking of starting another development effort focusing on the year 1987. Besides me starting my junior year of high school, that year saw the appearance of VGA, so we could justify using a 15-pin VGA cable and not something weird, along with the appearance of PS/2 ports (not to be confused with Playstation 2) for keyboards and mice, which are plentiful. We could use 9-pin Sega Master System style controller ports, which are like the Atari 2600 port with an extra button. (Lots of manufacturers used DB-9 jacks for their controllers; there's a guide on wikipedia).

A general principle (on any project like this) would be to use chips and technologies available in that time period. For instance, we could use GAL22V10 PLDs, but not modern FPGAs. (One exception would be to use bigger RAM chips that are available now just to lower the chip count; one could imagine just using more chips in an earlier era). Another general guiding principle would be to avoid surface mount parts, especially anything with a tiny pitch. 

Parts 

I got some chips from eBay along such lines. They would be also interesting to experiment with on their own:

I bought 4 each of the following (they're interesting 64-pin chips; like a 40-pin package but smaller spacing between pins):
  • V9958 display chip used in MSX2+ computers. It's the last in the line of chips that started with the TMS9918 used in the TI 99/4A and the Colecovision (Z80 CPU) and the Vtech Creativision (6502 CPU), and it's backward compatible with an earlier chip, the V9938, and even the TMS9918. These chips use external video RAM (up to 192 KB) that's separate from the main CPU RAM; this contrasts with most other video chips of the era. 
  • YM2610 sound chip -- FM synthesis and ADPCM sample playback. Used in some Taito arcade boards and the SNK NeoGeo, and quite similar to the YM2608 used in NEC PC computers. You can hear lots of examples of YM2610 music on youtube. I picked the YM2610 since its sample playback is flexible; the YM2608 has built-in drum sounds, which are nice but you can't change them.
As far as CPU, well, lots of folks have used the Z80; that's well travelled territory. I was thinking of the 65C816, which is an extension of the 65C02 with 16-bit registers but an 8-bit external data bus. It has a 6502 compatibility mode. It's most famously used in the Apple IIGS (providing backward compatibility with the original Apple II line) and the SNES. I conjure it was originally chosen so the SNES could play NES games -- of course, the SNES can't play NES games, but I bet is was a design goal that got dropped somewhere along the line. (Notice I'm not going with a 68000 since I want to stick with an 8-bit bus; the V9958 and YM2610 use an 8-bit bus). This machine could be in honor of Chuck Peddle, the designer of the 6502, who sadly died last year.

Instead of using an actual 65C816, I've been looking at the 65C265, which is a 65C816 with a truckload of peripherals and expanded I/O that that makes it more like a microcontroller. It has the additional advantage of addressing the full 24-bit address space without the weird multiplexing that the 65C816 uses to keep the pin count low. It comes in both surface mount and PLCC packages; the later lets it be used as a through-hole part in an appropriate carrier. It came out a bit after 1987, but I feel it would be worth taking a bit of artistic license here.

Western Design Center makes two "single board computers" for the 65C265: the W65C265SXB (around $48), which has 32K SRAM and 128K Flash ROM in a PLCC, and the W65C265QBX, which is isn't much more than a breakout board. I just bought a couple the fancier boards, the W65C265SXB, from Amazon. WDC also a reference design called The Mench Computer (not to be confused with the W65C265QBX, which is also called "The Mench"), although that webpage looks like it is out of date. (I just noticed that it implements the full 6-button Sega Genesis controller standard, which is pretty cool).

As a "stretch goal," we could add a co-processor in the form of a NEC UPD77C25 DSP (in our case, we'd use the UPD77P25 which is one-time programmable instead of masked ROM); it has an 8-bit external data bus, a 8.3 MhZ clock, and comes in a 28-pin DIP or a 44-pin PLCC. I will attach the datasheet. The reason this caught my attention is that it's the "real" chip appearing in some SNES carts labeled "DSP-1," where it is used to do 3D calculations, among other things.  Someone even managed to dump the masked ROM code in the various DSP1 versions.

Other Design Efforts 

There's two main projects ongoing to create a 6502-inspired machine:
  • The Commander x16 by the 8-Bit Guy, aka David Murray, uses the 65C02. His team even has an emulator for it. One of his design goals is to avoid using FPGAs unless he absolutely has to, under the constraint that he wants to only use parts that are currently being manufactured; the latter constraint means they had to resort to using an FPGA for graphics. For my project, I value avoiding FPGAs and modern parts over avoiding parts that are no longer in production, and hence am happy to use the V9958 and YM2610. Although they are no longer manufactured, they are plentiful on ebay for reasonable prices (although one must watch out for counterfeits). Everyone should watch his videos (Part 1 and Part 2) describing his philosophy and design process. Many folks are helping David with it; just typing Commander x16 into the youtube search field will yield lots of interesting work.
  • The C256 Foenix headed by Stefany Allaire, uses the 65C816. Stefany is building the machine she imagines Commodore would have build if their 8-bit line kept going, including imagining the custom chips they might have designed. Hence, she makes extensive use of powerful FPGAs. This is awesome, but it differs from both the 8-Bit Guy's vision and mine.
  • Dan Grise is building a homebrew computer with a 65C816 and a V9958; I'm very interested in following his progress. I'm hoping by using the 65C265 we could avoid needing so many support chips.

Naming the Thing 

There are lot of computers with numbers in the name: Commodore VIC-20s and 64s, Dragon Commander x16s, Dragon 32s and 64s, Radio Shack TRS-80s, Sharp x6800s, NEC PC-9801s and PC-9821s, Atari 400s and 800s, Atari 2600s, 5200s, and 7800s, Amstrad CPC 464s, etc.
Since we're imaging that this could have been a computer released in 1987, it should be called Something87, or perhaps with a hyphen, like Something-87. I briefly thought of calling it the Peddle-87 in honor of the designer of the 6502, but I wouldn't want to imply that he created it or that his estate approved of it. I asked friends to think of words associated with 1987, and after reading that I came up with Gnarly-87 or Gnarlycomp-87, but promptly decided I didn't like that either. Any ideas?

Alternate Paths 

Instead of the 65C265, we could try a Z8S180 or Z8L180, which are enhanced Z80s with additional peripherals, available in 64-pin DIP and 68-pin PLCC. We would probably go for the Z8S180, which can go up to 33 MHz. (The Z8L180, a low power 3.3V version, only goes up to 20 MHz, but we probably want to use 5V anyway). This might be a fun parallel effort, but if we go for just one path, I'm most interested in the 65C265. The Z8S180 version could also be a later effort.

Execution 

This project would naturally lend itself to a division of labor, with different people specializing in different parts, and lots of opportunities for software development. The various parts could be tested separately; for instance, there's all sorts of projects where people interfaced Yamaha soundchips with an Arduino of some sort. Lessons learned in any part of the project could be relevant to many other projects.

1 comment:

  1. I must say that I share some of your enthusiasm for this kind of idea :)

    I think that one of the most important factors that determine the identity of a vintage console/computer is the choice of video and sound chips. If you want to make an alternate reality console, it will definitely be more alternate (and to me, more interesting) with a custom chip for video and/or sound.

    A lot of people seem to feel that FPGAs are off the table in this kind of projects, but I think that FPGAs are the closest that you can get to making that custom chip. (Commodore owned their own chip fab, I can't compete with that.) Of course, it's a lot harder to judge whether your FPGA design could have been a period-appropriate chip; for an existing chip you can just check when it was released.

    But I guess that it all boils down to which part of the design that you are most interested in.

    ReplyDelete