Raspberry Pi Setup
This page is work in progress. Please check back later. |
This page briefly describes how to set up a Raspberry Pi with a Keyrah to build a low cost retro computer.
Please understand that this page can only give a couple hints on things specific to VICE/UAE or installing Keyrah - it is not a full step by step installation guide - please have a look at the documentation of the OS you will be using.
Contents |
installing the OS image
Download Retropie Recalbox Combian Amibian
The first thing you will have to do is install the OS on an SD card. If you never did this before and have no experience with linux, simply downloading an SD card image and putting that on the card is probably the most hassle free way to get started. Download the SD card image of your choice and then:
on Linux use dd to write the OS image to an SD card
dd bs=4M if=image.img of=/dev/sdX status=progress
on windows you can use Diskimager.
extend the filesystem
The first thing you probably want to do after installing the OS image is extending the filesystem to use the entire capacity of the SD card.
In Raspian based Distributions use
raspi-config
select "Expand Filesystem", confirm, then reboot
initial OS configuration
Retropie
Retropie is a Raspian based distribution that boots into the emulator frontend "Emulation Station".
- /opt/retropie/emulators/retroarch/retroarch.cfg
set keyboard layout
raspi-config
select "Internationalisation Options" -> "Change Keyboard Layout"
set root password
sudo passwd root
permit root login
in /etc/ssh/sshd_config
PermitRootLogin yes
configure composite (PAL)
in /boot/config.txt to switch video output to PAL add
sdtv_mode = 2
in /boot/config.txt fix the overscan area
overscan_left=40 overscan_right=0 overscan_top=-10 overscan_bottom=10
installing / updating VICE
You'll have to install VICE yourself after installing RetroPie. At the time of writing some features and files we use later are not yet available in the binary packages, which is why you should update from source (which will install the bleeding edge SVN version).
Retropie -> Retropie Setup -> Manage Packages -> Manage Optional Packages -> VICE -> Install from Source
or
Retropie -> Retropie Setup -> Manage Packages -> Manage Optional Packages -> VICE -> Update from Source
this will take a while to complete. Time for a cup of tea :)
configuring VICE
Some more hints on configuring Commodore 64 Emulation in Retropie are in their wiki.
- VICE config file is /home/pi/.vice/sdl-vicerc
- VICE data dir is /opt/retropie/emulators/vice/lib/vice/
- copy games to /home/pi/RetroPie/roms/c64/
See below for hints on how to solve keyboard problems.
installing / updating UAE
You'll have to install UAE yourself after installing RetroPie
Retropie -> Retropie Setup -> Manage Packages -> Manage Optional Packages -> UAE4Arm -> Install from Binaries
or
Retropie -> Retropie Setup -> Manage Packages -> Manage Optional Packages -> UAE4Arm -> Update from Binaries
You also have to copy a kickstart ROM to /home/pi/RetroPie/BIOS
cp KICK13.ROM /home/pi/RetroPie/BIOS
configuring UAE
Some more hints on configuring Amiga Emulation in Retropie are in their wiki.
- copy games to /home/pi/RetroPie/roms/amiga/
Recalbox
Recalbox is another distribution that boots into the emulator frontend "Emulation Station". It is more targetted at "zero setup" than Retropie is.
permit root login
Use the username root and the password recalboxroot - You can connect through ssh to the recalbox
configure composite (PAL)
To connect your recalbox to a CRT with Composite do the following:
in /boot/config.txt to switch video output to PAL add
sdtv_mode=2 audio_pwm_mode=2
... also remove all options starting with hdmi_...
global.videomode=default
Amibian
Amibian is a minimal Raspian Distribution that boots directly into UAE
Combian
Combian is a modified Amibian Distribution that boots directly into the x64 (C64) emulator of VICE.
to exit the emulator and access the Linux system, press the VICE menu key (preconfigured is F8) and choose "Quit emulator" at the bottom of the menu
to enter the Combian menu type
menu
- VICE data dir is /usr/local/lib/vice/
- copy games to /root/combian64/games
set root password
passwd root
choose a password you wont forget
enable ssh daemon
to make startup faster, the sshd daemon is not running by default in combian, so start it manually when needed:
/usr/sbin/sshd
configure composite (PAL)
in /boot/config.txt to switch video output to PAL add
sdtv_mode = 2
disable_overscan = 1
makes the framebuffer as large as possible
configure VICE
- VICE config file is /root/.vice/sdl-vicerc
HwScalePossible=0 AspectRatio="1.000000" SDLBitdepth=32 SDLLimitMode=2 VICIIVideoCache=1 VICIIHwScale=0 VICIIFullscreen=1 VICIIFilter=0 VICIIBorderMode=1
SidEngine=0 SidModel=0
Setting up a 1:1 keyboard mapping
Keyrah V2
The Keyrah V2 keymap was originally tweaked for the Windows release of VICE that was current at time. However, during the years the default mapping of VICE was changed and tweaked more to regular PC keyboards - which made Keyrah V2 no more match. To fix this, we have provided extra keymappings for VICE, which restores the original behaviour.
Find the VICE config file as explained above, then change the following:
MenuKey=281
at the top of each [section] enables the "arrow up" key to enter the VICE menu when the Keyrah switch is in "middle" position.
JoyDevice1=2 JoyDevice2=3
in the [c64] section to enable the 1:1 joystick port mapping.
Combian
KeymapUserSymFile="/usr/local/lib/vice/C64/sdl_keyrah_combian.vkm" KeymapUserPosFile="/usr/local/lib/vice/C64/sdl_keyrah_combian.vkm" KeymapIndex=3
in the [c64] section to enable the 1:1 keyboard mapping for Keyrah
Retropie
KeymapUserSymFile="/opt/retropie/emulators/vice/lib/vice/C64/sdl_keyrah_retropie.vkm" KeymapUserPosFile="/opt/retropie/emulators/vice/lib/vice/C64/sdl_keyrah_retropie.vkm" KeymapIndex=3
in the [c64] section to enable the 1:1 keyboard mapping for Keyrah
Keyrah V3
They Keyrah V3 keymap was carefully tweaked to the - now standardized - keymaps of VICE 3.7, WinUAE and STeam, and should work out of the box. Make sure to select the "positional" keymap for your system language in the emulator.
The controller ports are now regular HID game controllers, so they can be configured right in the emulator, just like any other game controller.
Caps-Lock issues
Keyrah V3 relies on the Caps-Lock LED status. Since it is perfectly OK to connect two or more USB keyboards to a host computer, and the Caps-Lock key on the keyboard that is connected to Keyrah might be a "locking" key, Keyrah monitors the state of the LED and if that is different than the current state of the locking Caps-Lock, it will produce another Caps-Lock event in order to keep all connected keyboards in sync.
However, apparently (some) Linux distributions for the Rasperry Pi do NOT produce a Caps-Lock LED event:
"It is because technically the Caps Lock key is not functioning as Caps_Lock. The console behaviour built into the kernel only capitalizes dedicated letter keys, and not Unicode letters composed using dead keys or AltGr. To work around that, Debian sets up a complicated keymap in which Caps Lock is really CtrlL_Lock, and there is no LED for that." [1]
as a result, Keyrah V3 will behave irritatingly when Caps-Lock is pressed.
This can be fixed, by adding the following command into some startup script:
echo keycode 58 = Caps_Lock | sudo loadkeys -
For example like this:
Create a script in the home folder called amigasetup.sh, use chmod +x to make it executable.
#!/bin/bash echo keycode 58 = Caps_Lock | sudo loadkeys -
Then create a service in /etc/systemmd/system/, for example call it amigasetup.service (substitute <yourusername> by your actual user name)
[Unit] Description=Amiga environment setup After=multi-user.target [Service] Type=idle User=root ExecStart=/bin/bash /home/<yourusername>/amigasetup.sh Restart=always RestartSec=60 [Install] WantedBy=multi-user.target
Save the script, and issue the following commands:
sudo systemctl daemon-reload sudo systemctl start amigasetup.service sudo systemctl status amigasetup.service sudo systemctl enable amigasetup.service
Also see this support forum thread.
Links
- Raspberry Pi Foundation
- Raspian Project page
- Amibian Project page
- Combian Project page SD-Card Images
- Retropie Project page Github Repositories
- Recalbox Project Page Manual
- configuring a PS3 controller in Retropie Gentoo
- VICE data directory in the SVN Repository - you can find the most recent Keyrah keymaps here