One of my favority emulators is VICE (the VersatIle Commodore Emulator
). Whenever I buy/get a new device, it is one of the things I like to run on it: all kinds of PCs (windows/linux), phone (android), tablet (android). So when I got my first Raspberry Pi for X-mas, I googled for C64 emulators + raspberry pi. I found PiMAME
which offers more than a C64 emulator (MAME, Atari, Playstation). It is really good. When I tried to get "uinput" (user level input system for linux) working with the C64, I did not get things working:
F12 menu worked fine, but any other character output did not appear in the EMU. (I did work fine in the console, though). So I decided to compile the VICE sources myself to see whether that would solve the problem (probably not). If it doesn't work, I still can change the sources. This blog describes the steps to get VICE, or more specific X64, running from the console.
First we need to install a number of packages via apt-get:
optional packages (necessary for running X64 in X-windows)
- vim (vi IMproved)
Download the VICE-sources. I downloaded vice-2.4.5.tar.gz development sources
from sourceforge on my PC and used FileZilla to get the tar ball to the Raspberry. We need to perform the following steps:
- unzip and untar the file
- goto the newly created directory
- configure the source package (I'm not sure whether the -with-x=no is necessary. It did not harm either, so it's safe to use anyway
- build the package
- install the package
N.B.: I used many iterations to build everything. With every run a "make clean" before doing the next build. In one of the runs I had problems with "uistatusbar.h" not found in the xaw directory. I did a find . -name uistatusbar.h and found two. I copied one to the ./src/arch/unix/x11/xaw directory (I'll try to build again without this hack/sinn)
cp ./src/arch/sdl/uistatusbar.h ./src/arch/unix/x11/xaw/.
When everything has been build and installed, it's time to run the C64 emulator. I first tried x64. The first error I got was 'kernal' could not be loaded. To fix this, you need to manually copy the 'kernals' (and remove some extra copied files).
Attempt 2. The kernal loads, but I get a blank screen without any error. Via ssh I was able to reboot the Pi. So I started browsing for answers to this problem. I found a lot of suggestion, but no solution but enough hints to get things right. Some of the tips:log the output to file. Use alsa for sound.
x64 -sounddev alsa -verbose 1>log.txt 2>&1 (logs both error and info to the file log.txt)
Unfortunately this didn't do the trick. Luckily combining multiply suggestions, resulted in a succesful recipe. I wrapped everything in a Bash shell script:
x64 works like a charm. Speed: 100%, 50fps, sound ok. Tested it with Boulder Dash
N.B. building x64 did not resolve the uinput issue. But I managed to use a different way to get key strokes in x64. I hope to blog about that soon...