TMS1100 emulator on PIC

I adapted Paul Robson's TMS1100 emulator to run on a PIC microcontroller, then crammed one onto a Microvision cart and ran his Invaders game:

I was going to use as much of his source code verbatim as I could, but I don't think the Microchip XC8 compiler likes giant switch statements, so I tried to optimize the opcode execution code.

I thought 8 MIPS would be fast enough, but using an 18F4620 at 32MHz clock (8 MHz instruction rate), the Microchip free C compiler and the unmodified emulator source code, I was getting about 5KHz execution speed, about 1/10th of what I needed. So I switched to an 18F46K22 at 64MHz, started a trial of Microchip's Pro C compiler and rewrote some of the opcode code. Some instructions still run a little long, but most run at full speed. Update- new source 2/18/2014 improves timing; all instructions run within 12us for full speed emulation.

I took one of the carts that I had removed a TMS1100 from for decapping and drilled 12 more holes so the PIC would fit. Then I cut traces and soldered wires to route all the signals to the right places. The PIC is only rated to 5.5 volts, but the LCD controller data sheet says it works at 5V, so I used a wall-wart adapter for power. There's not as much contrast range as with 9V, but it's workable.

I'm still working on the keyboard input; I can move in Invaders but it constantly fires. I used a cart PCB from Pinball, which uses the paddle, so that might be part of my problem. I had to add 4 pull down resistors since the PIC only has built-in pull-ups. The sound seems to work fine.

Here's the current source code (updated 2/18/2014).

Here's a pic of some signals from the real chip and the emulator

back to TMS1100 page

back to Arcade Game Info page

back to Home page