Wouldn’t it be cool to carry your favorite computer with you at all times? 😀
Well, this is perhaps a little too geeky even for me, but that was the initial thought when starting up this project. Personally I would love to have a tiny box behind my TV set at home to be able to play some good ol’ games whenever I felt like it, or just bring it along without feeling like you have anything extra with you at all. Ideally the box should be able to fit in a keychain, but as it looks today it is too big for that. Because of this the form factor is crucial and custom hardware is definitely needed in order to accomplish this tiny footprint. The motivation for the project was never on the pioneering side, many emulators of this kind have already been made (although in a bigger package), rather it was the challenge that comes with making something as complex as this using, at least for the purpose, very limited resources. Almost putting myself in the same shoes as the guys back in the days when writing software for the c64, which of course you all know, has its very own limitations.
That brings us to the question:
Is it possible to emulate a complete c64 computer (excluding SID) cycle perfect with full frame rate by using an ARM Cortex-M7 processor at 216Mhz.
The answer to this question is… not really.
However, if you lessen the requirements a bit, it is very much possible to get a decent emulator going. For example, and as seen in this project, if you decrese the emulated frame rate by a factor of 2 and not running everything cycle perfect, then the the performance of the cortex starts to keep up with the emulation even with all 8 sprites activated and moving around.
I made the design using 6 layer PCB. The MCU is absolutely tiny and fits perfectly together with the memory under the SID socket.
The circuit board (MK2) just arrived as you can see in the pictures. Excellent …
And here it is, assembled 🙂
MCU: STM32F756IGK6 (ARM Cortex-M7, 216Mhz, UFBGA176)
HDMI transmitter: ADV7511W (165Mhz, LQFP-64)
SDRAM: IS42S16400J-5BL (200Mhz, 64 Mbit, FBGA)
Partlist: U3, 1 MCU, STM32F756IGK6 (to be changed) U4, 1 HDMI transmitter, ADV7511WBSWZ U2, 1 SDRAM, IS42S16400J-5BL CN1, 1 SDCARD, 104031-0811 P5, 1 Audio connector, SJ-3523-SMT-TR P7, 1 DC power connector, PJ-037A P1, 1 HDMI connector, 10029449-001RLF P4, 1 USB-A connector, 62900416021 P6, 1 USB micro connector, 47590-0001 U1, 1 IC-sockel, DIL 28 SMD, 114-87-628-41-117101 C10, 1 Tantalum Capacitor, TAJB226M016RNJ C0-C2, 3 Tantalum Capacitors, TMCMB0J227MTRF C70, 1 AUDIO capacitor, RFS-50V010ME3#5 U6, 1 Volt regulator (3.3V), NCP5662DS33R4G U5, 1 Volt regulator (1.8V), NCP5662DS18R4G G1, 1 1Mhz Oscillator (SID), FXO-HC735-1MHZ X1, 1 8Mhz Crystal, FQ7050B-8 U7-U9, 3 TPD4S010DQAR C4-C5, 2 2.2uF (0603) C21, 1 15pF (0603) C22-C23, 2 10pF (0603) C30-C33, 4 10nF (0603) C40-C46, C47-C48, C80-C88, 14 100nF (0603) C50-C54, 5 1.0uF (0603) C60-C61, 2 2.2nF (0603) R0-R5, 6 10K (0603) R14, 1 0 (0603) R15, 1 DNI (0603) R20, 1 887 (0603) R30-R34, 5 47K (0603) R50, 1 1K (0603)
- USB keyboard
- 2 DSUB9 Joystick Ports
- 12V power input (when using original MOS6581)
- Micro USB connector (main power)
- External SID socket
- 3.5mm audio jack
- SD card push-pull socket
Using real SID
12V is needed to run with original sid chip (MOS6581). This can either be supplied using external source and the dedicated power connector on the board or with a boost converter, such as this. The converter can be hooked up to the 3.3V, GND and 12V solder pads on the backside of the board.
- Full C64 emulator with graphics (sound is handled separately)
- Full disk drive emulator
- Support for T64, D64, PRG and TAP files
- Firmware updates through SD card
- USB CDC support with custom command interface
- USB HID keyboard support
- Reset from keyboard
- Separate emulator libraries (host can be changed easily)
- Configurable palette (palette config file)
- Configurable key mapping (keyboard config file)
Limitations and bugs (V1.0.0):
- Half frame rate is needed to make the emulator reach correct frequency (Approx. 1Mhz/50fps). This will have major impact on some games where collisions are not detected at every frame. Also it will make “blinking effects” (like blinking sprites in commando and ghost ‘n goblins) not being displayed as it should be.
- Due to performance reasons the emulator is not cycle perfect. This means it will queue up cycles for the emulated components to a specific threshold before acting on them. This basically makes the timing wrong but will, under normal circumstances, not lead to any big problems with the emulation as a whole.
- The granularity for keeping the correct frequency is poor. Today it is set to 40ms (every second frame). This means that the emulator will go through 40ms of real time as fast as it can and enter a wait state in order to meet the emulated speed of approx. 1Mhz. The drawback of this is obvious, the timing will be adjusted 25 times a second so the real speed will be faster between these points leading to somewhat fast forward graphics and sound. Personally, I cannot really tell that it is doing this and I do not see or hear any negative things related to this limitation.
- No sprites will be rendered (and collided with) outside the display window so titles like wizball will not get a correct emulation when it comes to graphics.
- When the disk drive is turned on, then there are actually 2 complete computers being emulated and talking to each other through the serial port. This will have negative effect on the speed and the emulation will drop a bit. Luckily the disk drive can safely be paused when it is not needed and turned on again when it is.
- There are many “bugs” left in the code that will make many games either not working at all or partly working. Mostly graphic problems and crashes involved in the emulation process.
The goal for the first release of software was near perfect emulation of the below games:
- Boulder Dash
- Bubble Bobble
- Giana Sisters
With the exceptions stated in “limitation and bugs” the goal was reached with sw version 1.0.0 (according to me).
Interested in buying one ?
There will be a very limited batch of these. The good folks that supported me with kickstarter campaign will come first. Visit the shop if it is open.