Skip to content

Instantly share code, notes, and snippets.

@jonathlt

jonathlt/ZX81Kiosk.md

Last active Jul 4, 2016
Embed
What would you like to do?
Run a ZX81 Emulator in "kiosk" mode on a Raspberry Pi

Introduction

I wanted to be able to produce an SD Card distribution for the Raspberry PI which would emulate the ZX81 "out of the box". On startup an appropriate splash screen would be shown and the pi would enter an emulator. Saving would be via a sync with Google drive.

Method

For the most part, I have followed the instructions here:

http://blog.qruizelabs.com/2014/04/29/raspberrypi-kiosk-matchbox-uzbl/

but instead of displaying a browser, we will automatically start the emulator sz81. The link for this emulator is here:

http://sz81.sourceforge.net/

Build the emulator (Stock Raspbian)

wget http://sourceforge.net/projects/sz81/files/sz81/2.1.7/sz81-2.1.7-source.tar.gz/download
tar -xvf download

Go to the source directory cd sz81-2.1.7 Edit the makefile, make sure the system wide installation lines are uncommented:

# Comment/uncomment these to choose an installation destination
# System wide installation
PREFIX?=/usr/local
BINDIR?=$(PREFIX)/bin
DOCDIR?=$(PREFIX)/share/doc/$(TARGET)
PACKAGE_DATA_DIR?=$(PREFIX)/share/$(TARGET)

# Local installation within your home folder
#PREFIX?=$(HOME)/Games/$(TARGET)
#BINDIR?=$(PREFIX)
#DOCDIR?=$(PREFIX)/doc
#PACKAGE_DATA_DIR?=$(PREFIX)/data

# Run from current folder i.e. no installation
#PREFIX?=.
#BINDIR?=$(PREFIX)
#DOCDIR?=$(PREFIX)
#PACKAGE_DATA_DIR?=$(PREFIX)/data

May need to install libsdl:

sudo apt-get install libsdl1.2-dev

Run:

make
sudo make install

Test that the emulator runs by typing sz81 at the command prompt

Set up automatic login

sudo apt-get install nodm -y

sudo vi /etc/default/nodm

Update the nodm config file (command above) to look like that below

# nodm configuration

# Set NODM_ENABLED to something different than 'false' to enable nodm
NODM_ENABLED=true

# User to autologin for
NODM_USER=pi

# First vt to try when looking for free VTs
NODM_FIRST_VT=7

# X session
NODM_XSESSION=/etc/X11/Xsession

# Options for the X server
NODM_X_OPTIONS='-nolisten tcp'

# If an X session will run for less than this time in seconds, nodm will wait an
# increasing bit of time before restarting the session.
NODM_MIN_SESSION_TIME=60

Install the matchbox window manager

This is a simple window manager that will only run one application at a time

sudo apt-get install -y matchbox-window-manager
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment