• 🇬🇧󠁿 🇸🇪 🇿🇦 🇮🇪 🇬🇭 🇩🇪 🇪🇺
    European & African
    Drug Discussion


    Welcome Guest!
    Posting Rules Bluelight Rules
  • EADD Moderators: Pissed_and_messed | Shinji Ikari

Raspberry Pi flavoured Fun: Back to the '80s with Emulation.

BecomingJulie

Bluelight Crew
Joined
Nov 28, 2010
Messages
4,323
Location
The Banks of the Trent and Mersey Canal
O.K. This is the first part of an occasional series on using the Raspberry Pi fag-packet computer to emulate 1980s 9-bit home computers, for the purpose for which these computers were originally bought for: playing games! O.K., you might get a little bit of homework done on it .....

You will need to connect your Raspberry Pi to a TV set, preferrably using a HDMI cable for best picture quality; otherwise you will have to use composite video and audio connections. Later Raspberry Pi models have a special 4-way 3.5 mm. jack socket; make sure that you get the right cable, as there may be similar-looking ones wired in different ways. Earlier Raspberry Pi models just need a phono-to-phono lead for the video, and a stereo 3.5 mm. to two phono plugs for the audio. Finally, if you haven't already done so, download NOOBS and burn a fresh copy to a new 8GB micro SD card, so you know where you are starting from. (The same disk image will work with the card inserted directly into a new-style Pi, or with the full-size adaptor into an old-style one). There's a compressed image you can download from here.

Under Linux:
Code:
$ sudo fdisk -l[code]and note what devices are listed.  Insert your SD card, wait about 10 seconds for it to be recognised, and type[code]$ sudo fdisk -l
again. Note the device that wasn't mentioned before. Say this is sdc. (sdc is the device itself; sdc1 is partition no. 1 on device sdc. You are going to be writing to the device itself, overwriting any existing partition structure.) Now enter
Code:
$ wget http://earthshod.co.uk/~julie/NOOBS.img.bz2
$ bunzip2 NOOBS.img.bz2
$ sudo dd if=NOOBS.img of=/dev/[u]sdc[/u] bs=4M
(All these commands will take some time. The first two -- downloading the compressed image and uncompressing it, respectively -- need only be performed once. If you ever need to burn a fresh SD card image, you only need the `dd` command (as root).

If anyone has instructions to do this under Windowa, please say so .....

You can type commands on a keyboard plugged straight into the Raspberry Pi or, if you have it plugged into your network cable using a cable to the router or an already-configured USB wi-fi adaptor, you can connect to it from a laptop. First, on the Pi, type
Code:
$ sudo ifconfig
and make a note of the I.P. address (it's a set of 4 numbers separated by dots, labelled "inet addr." -- mine was 192.168.32.227, and that's what I'll be using in this tutorial, but yours almost certainly will be different.) If you are on Windows, you will need to download a program called PuTTY, which is an SSH client; on Linux, or a Mac, you can just type in a terminal
Code:
ssh pi@[u]192.168.32.227[/u]
replacing 192.168.32.227 with the correct IP address from before) and give the password raspberry when prompted. In PuTTY, give the protocol as ssh, port as 22, host as the IP address of the Raspberry Pi, username as pi and password as raspberry.

Type into the Raspberry Pi, either directly or via a laptop, the following commands:
Code:
$ sudo apt-get install fuse-emulator-gtk$ sudo apt-get install spectrum-roms
The second command downloads some copyright-restricted ROM images (they are freely available for non-commercial purposes, but if you turn a profit then the copyright holders expect a cut of it). Start the graphical user interface with
Code:
$ startx
Open lxterminal and type
Code:
$ fuse
If all has gone to plan, you will have a window with a Spectrum emulator in it! If you are using a HD TV, you will need to biggerise the window to see what is going on.

You can actually try programming this Spectrum. The keyboard is emulated perfectly, modes and all; CTRL is symbol shift:

10 p (it will display PRINT) ctrl+P (it will display a double speech mark) Julie Is Ace ctrl+P ctrl+O (it will display a semicolon)
20 g (it will display GO TO) 10
r (it will display RUN)

That should be enouh to be going on with for now. Next stop: Downloading some games!
 
Last edited:
True. If you're running Debian or Ubuntu on a laptop, you don't even need the Raspberry Pi; you can use the same apt-get commands to install fuse-emulator and spectrum-roms on that. But the thing about doing it on a Raspberry Pi is ..... well, it's like climbing a mountain: You do it becaue it's there.
 
True. If you're running Debian or Ubuntu on a laptop, you don't even need the Raspberry Pi; you can use the same apt-get commands to install fuse-emulator and spectrum-roms on that. But the thing about doing it on a Raspberry Pi is ..... well, it's like climbing a mountain: You do it becaue it's there.

Got ya. It certainly sounds like a challenge - and as you said earlier, if you build a cabinet round it you can have your own dedicated arcade machine with all your old favourites on. I'd love to do that - just need to get rid of the wife and kids first...
 
By now you should have downloaded and installed the packages fuse-emulator and spectrum-roms and discovered a new menu entry for Fuse under the Games menu. Now it's time to download some games to play on your emulated Spectrum!

There is an amazing website at http://worldofspectrum.org/ with much Spectrum-related material, and games to download and play under emulation -- except where the copyright holders have stepped in to prevent such distribution (killjoy bastards). In which case, if there's a game you really wanted but it's not available for copyright reasons, you might have to acquire an original cassette of the game and convert it to a tape image using another computer (the Raspberry Pi doesn't have an audio input .....) -- but that's definitely one for later.

Open the World of Spectrum site in the Raspberry Pi's web browser, and find a game. Let's try Manic Miner. That can be found at http://www.worldofspectrum.org/infoseekid.cgi?id=0003012 . Right-click on the first tzx file, and select "Save Link As". Create a new folder; call it spectrum or something. Save the file in your new folder.

Now the file you have just downloaded needs to be decompressed. Open terminal and type
Code:
$ ls
Note your new folder. Type
Code:
$ cd spectrum
(or whatever you named the folder, and remember it's capitalisation-sensitive.) If you are successful, the prompt should change to show you are now in the folder where your games are saved. Type
Code:
$ ls
again to see the contents of this folder. Now type
Code:
$ unzip ManicMiner.tzx.zip
Actually, you only need to type the first letter or two of a filename, then you can press TAB and the computer will try and fill in as much as it can for you. Type
Code:
$ ls
one more time and see that the unzipped file is now there. You don't need the .zip file anymore, so you can get rid of it. Type
Code:
$ rm *zip
The "rm" means "remove", and "*zip" means "any filename that ends with the sequnce zip". Prove it has gone with
Code:
$ ls
again.

All that you need to do now is start Fuse from the menu, adjust the window size, then go File, Open, find your games folder and open the unzipped tzx file. And you should be playing Manic Miner!

Go and explore the World of Spectrum site, and download some more games .....
 
Top