As you may know, I'm bigtime into Z80 computerey stuff. For the past 20 years or so, I've been hacking Pac-Man ROMs, been maintaining the Ms Pac Disassembly, and have made my own Z80-Pac based programes over the years.
Fairly recently, I got a Kaypro II from a friend at interlock, and it worked perfectly, and looked brand new. I felt like I couldn't hold on to it... "it belongs in a museum!" ...so I donated it to ICHEG/Strong Museum of Play. But it helped whet my appetite for a CP/M computer.
Another project I've been wanting to do was to start with a Commodore 64 (I know it's not Z80, it's 6502ish), a floppy drive, some blank disks and a hardware manual and code up, from scratch, an OS. Start out by making a text editor, assembler, GEOS-like GUI, etc.
These projects recently had an opportunity to overlap, and they all seem to converge on the RC2014 modular Z80 computer.
The RC2014 computer is a backplane-based modular computer created by Spencer Owen, based on the Z80SBC by Grant Searle. There are modules for the CPU, RAM, ROM, Serial Terminal interface, and so on. It is available as a kit from tindie.com. Once assembled, you hook up a serial terminal to it, power it on, and you get a 1980s-esque BASIC prompt onto which you can write your 32kbytes of program. This is based on Grant's simplified Z80 computer, so there is no off-line storage.
My general plan for the RC2014 is:
- Emulation:
- Create an emulator for the system to aid with rapid development
- also bring my "bleu-romtools" from Google Code to github
- Add a serial-based storage solution to the RC2014 emulation to confirm proof-of-concept
- Add ROM swap out to the emulation
- Add 32k of ram to give a full flat 64k of ram to the emulation
- Hardware:
- Get a RC2014 kit
- Build the RC2014 kit
- Make a test ROM to run on real hardware to verify my toolchain is working
- Create a new serial card that sits at port 0xC0 (second serial)
- Create the SD Drive firmware for the serial arduino
- Hack the ROM and Digital IO boards to allow for disabling the ROM
- Add 32k hacked RAM to the system
- Name: RC2014/LL
- At this point, the architecture is different enough and well defined enough that I think a new name for this configuration is in order. I call this configuration "RC2014/LL".
- Port CP/M
- Create the BIOS
- Create the sector-based emulation layer in the SD drive
- Boot CP/M
- Play Zork
I started out by making an emulator using the Z80 Pack emulation system. Once I got this running, I realized the limitations of this emulator and looked around and found another emulator that suited my needs better. (I wanted a way to "swap" memory around, which Z80 Pack would not do in a way that wasn't a major hack.)
I created a layer that adds disableable memory regions, and added emulation of the 6850 ACIA serial chip, and threw the 32k RAM BASIC ROM at it, and it started right up, running BASIC!
I added a second 32k of RAM (easy to do when you're emulating it!), and started creating the SD interface, also using the 6850 ACIA for communications. I then added a port, emulating the IO card, on which bit 0 (0x01), when set, will disable the ROM... So any reads to the low area of memory will read from the ROM. Whether this is set or not, all writes to that area of memory will actually happen to the RAM... they will just be hidden from reads until that bit is set.
I now have the basics of the RC2014/LL system emulated in software! I created a boot/diagnostic ROM which can be used for all RC2014 systems which can probe memory to determine type (ROM, RAM, unpopulated), peek and poke memory, In and out IO, and other utility functions for the SD card interface.
Currently, I'm writing the SD card API which I will port to the Arduino Leonardo and SD breakout board which I have ordered, once those come this weekend, I'll shove them into my own serial board and burn a test ROM and see how it goes....
I googled the Kaypro and boy-o-boy, is that thing a gorgeous little box! Not to mention your RC2014 is one hell of an interesting construction. I love the z80 myself but tend to steer more toward the 65xx's and MC68's simply because of their increased accessibility. By accessibility, I mean availability in VG Consoles such as the NES and Sega. The sega Genesis has a z80 as well, but only for backwards compatibility with the Master System code and audio control.
ReplyDeleteIf you ever happen to get an itch for video game programming, hit me up. I have designed cartridges for NES, Genesis, Master System, Gameboy, Game Gear, etc. for running homebrew software.
Cheer man, love reading your stuff