Close

Prepping the Pi

A project log for OSI Challenger 4P Reproduction

I am making a full sized Challenger 4P reproduction, a 6502 based personal computer from the late 1970s.

michael-gardiMichael Gardi 02/19/2023 at 17:440 Comments

So far, all of the Challenger 4P emulation development has been done on my Windows laptop using LiClipse.  LiClipse is an extension of the Eclipse development environment. I used Eclipse for the last 25 years of my software development career so I'm familiar with it, and chose the LiClipse variant because it came bundled with PyDev, a Python IDE for Eclipse. 

Now it's time to move the emulator to the Raspberry Pi 4 that will power my Challenger 4P reproduction. One of the reasons that I chose Python for this project was this portability. When I started this project last August, I had hoped that the supply issues which made Pi 4s virtually unobtainable would have been fixed. No such luck. I looks like Pi 4s will not reach unconstrained availability until Q3 2023. Sigh. Fortunately one of my mates at my local makerspace (Kwartzlab) had one to spare that I could use until such time as I can buy one for myself. 

I'm not going to detail getting the Raspberry Pi OS onto the Pi 4 as there are a lot of guides out there like this one from tom'sHARDWARE.  Basically I just loaded a Raspberry Pi OS image onto a 32G microSD card using Raspberry Pi Imager.

I plugged the microSD card into the Pi 4 to which I had attached a small LCD screen, wireless mouse, and keyboard.  You could do the installation completely "headless" as outlined here,  but I prefer to do the configuration interactively with this the setup. I powered up the Pi and went through the initial configuration dialogs to set the login user, keyboard, language, locale, and wireless connection.  Super easy.

Ultimately the Pi will be run headless with no keyboard or mouse. There will however be a display to show the emulator's screen.  My preference is to use VNC to accomplish this. Raspberry Pi OS ships with RealVNC pre-installed.  So the first thing that I did after the basic OS had been installed was to setup a virtual server for the RealVNC client to connect to. The easiest way I have found to do this is to add the following lines to the end of the /etc/rc.local file before the exit 0 on the Pi.

# Setup a virtual screen for the VNC server.
sudo -u xxxxx vncserver -randr=1920x1080

xxxxx is the login user that you setup to access the Raspberry Pi. Set the screen dimension (randr=) to be the same as the machine that you will be accessing the Challenger 4P from.

I found in my setup is that there were a few issues accessing this server with the RealVNC client on my Windows machine. The first was that the menu bar at the top of the desktop was missing.  To restore the desktop menu bar enter the following command.

sudo apt-get remove --purge alsa-base pulseaudio

On a similar note the title bar on open application windows and the corresponding windows controls (v ^ x) were missing as well. To fix this I edited the desktop.conf file,

sudo nano /etc/xdg/lxsession/LXDE-pi/desktop.conf

and changed the line:

   window_manager=mutter
   to
   window_manager=openbox-lxde-pi

then saved the changes.

With these changes made reboot the Pi 4 for them to take effect.

I downloaded and installed the RealVNC client on my Windows machine.  Run the RealVNC VNC Viewer. You should see this window.

From the menu select File->New connection... to bring up the following dialog. Add the Server address and common name then click OK. Note the :1 added to the server address. This references the instance of the VCN Server running. 

To find the VNC Server address you can just hover over the WiFi (or network) connection on the server desktop.

From the main VNC Viewer window double click on the Challenger 4P connection just created.

The first time you attempt a connection you will be prompted to enter the Raspberry Pi's login credentials. Check Remember password if you don't want to have to do this every time you connect. Enter the credentials and click OK.

You should see an instance of the Pi 4's desktop.

To get the emulator onto the Pi 4 you can simply clone the repository from github. Open a terminal window and enter the following command:

git clone https://github.com/kidmirage/OSI-Challenger-1P-Reproduction

 You should see a response similar to this:

Cloning into 'OSI-Challenger-1P-Reproduction'...
remote: Enumerating objects: 70, done.
remote: Counting objects: 100% (3/3), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 70 (delta 0), reused 0 (delta 0), pack-reused 67
Receiving objects: 100% (70/70), 67.60 KiB | 1.04 MiB/s, done.
Resolving deltas: 100% (28/28), done.

To run the emulator run the following commands:

cd OSI-Challenger-1P-Reproduction/
python3 main.py

 You should see the Challenger 4P emulator popup. 

There is still some work to do on the emulator but having it running on the Pi 4 is a big step forward. Next step will be to integrate the hardware keyboard.

Discussions