MEMWA 2

 

Introduction

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.

Hardware

I made the design using 6 layer PCB. The MCU is absolutely tiny and fits perfectly together with the memory under the SID socket.

DSC_2450DSC_2451

DSC_2454DSC_2453

DSC_2457DSC_2458

The circuit board (MK2) just arrived as you can see in the pictures. Excellent …

And here it is, assembled 🙂

DSC_2470 DSC_2469

IMG_0024IMG_0034

IMG_0041 IMG_0025

Hardware components

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)

Hardware connectors

  • 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.

Schematics

memwa2_schematics

memwa2_front2_smallmemwa2_back2_small

memwa2_front_smallmemwa2_back_small

 

Software

sw_design

  • 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.

Goal (V1.0.0)

The goal for the first release of software was near perfect emulation of the below games:

  1. Boulder Dash
  2. Commando
  3. Bubble Bobble
  4. Paradroid
  5. Giana Sisters

With the exceptions stated in “limitation and bugs” the goal was reached with sw version 1.0.0 (according to me).

Files

Github link

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.

26 thoughts on “MEMWA 2

    1. Even though the Kickstarter project did not go whole way through, I have decided that the project is too fun to be trashed. I will try and make it happen, but without funding it will take longer time to complete. The ones that contributed to the Kickstarter project will get the opportunity to buy a copy 🙂

      I will post updates on the blog as the project progress.

      1. I’m very interested, the Amiga scaler looks great too 🙂
        Very good projects you have here, I wish you all the best.

  1. Any chance to have also Atari 800XE/XL core??? I like your c64 HW emulator.
    As I own RPi zero and Orange Pi One… I like tiny boards. Can I buy 2x MEMWA?
    Maybe you can put there tracker (SIDwizard) and sell it to chipmusicians (chipmusic.org).

    1. Hi matej, no plans to support Atari atm. But it would sure be fun to try that as well. I am soon done with the software for c64, so after that I will definitely consider emulating other computers 🙂
      I will look up the wizard, thanks for the tip.

      I will only sell a limited amount of these, there will be links up on this site in a month or two with more information on how to buy them.

  2. Hi. What’s the state of play on this, it looks rather nifty to me ? I’m not a big C64 fan tbh, but I do like other machines which it looks like this would be a good generic base for – 8 bitters anyway 🙂

    Is there a waiting list or similar ?

    1. I will do what I can. But I have two small kids at home that is taking all my time. Since the source code is open, everyone can help 🙂

    1. A floppy drive connector should be very easy to add. There are many free gpio pins so these can be used to reflect the c64 serial port. The source code is open, so anyone could add this actually.

  3. Awesome, awesome projects! 😀

    I realize it’s an incredible amount of work (I’m a developer as well, and I understand hardware is even more intense) but if you *ever* were to make, essentially, a SID “iPod”, I’d pay good money for one. Basically, I suppose, the MEMWA 2 without the full emulation necessary (certainly not graphics), capable of playing SID files from HVSC on an SD card or similar, through a hardware SID chip and outputting it to a headphone jack. Battery and USB powered (or even AC if necessary). Just a tiny display, if any.

    That’s my dream device. 🙂 All the best to you!

    1. Hi JI,
      I am very happy that you like the my projects. I think your thought is an interesting one and it would not take that long to implement either since it is very similar to memwa2. Also, I do not think there are any such device on market today. There could be issues concerning high power usage but I will definitely consider it, thanks for the suggestion 🙂

      Cheers,
      StaringL

      1. Hey,

        Thanks for the reply! I will keep my eyes open in case you ever decide to build a portable real-SID player and I’ll buy at least two of them. 🙂 I’d carry one everywhere; not afraid to nerd out.

        Take care!

    1. Hi Daniel,
      No problem, I will order the first batch very soon and I see that you have entered your email to the subscription form so you will also be included into this batch.

    1. Hi Chris !
      You are in luck, I have one left in current batch. Check out the webshop asap if you would like to get hold of it.
      Otherwise you will need to wait a few weeks to the next batch.

Leave a Reply

Your email address will not be published. Required fields are marked *