Raspberry Pi 3 based arcade box DIY

Posted by admin on February 24, 2018
DIY / No Comments

I recently built an arcade box for emulating old arcade games and old home computers but I wanted an authentic experience with a nice box around it, since emulation can be done with anything these days, computers, a pi connected to the tv with bluetooth controllers etc. I ended up having a friend (thanks Tasos) design and cut a box made out of FOREX PVC, which ended up great. I also cut a plexiglass for the top part and printed a nice retro gaming related graphic under the plexiglass. The final box looks like this:

A little explanation on how this works. I installed an 128GB RetroPie from here: http://www.arcadepunks.com/retro-pi-downloads-page/ for a 200GB microSD card that I put on my Raspberry Pi 3. This saved me a lot of trouble (finding the roms, finding marquees, screenshots, videos, putting everything together etc) but also gave me some space to put some extra stuff that I wanted (I HAD to have the first games I ever loved – namely Blue Max and Alley Cat on the Atari XE emulated in there, I just had to). I then got a USB encoder with 10 fire buttons and a 8way stick from ebay ($27 for everything), which looked like this:

This nice thingy looks like a real mess inside the box, but it gives you a USB controller which I connect from the outside of the box to the Pi, using one of the 4 USB ports available. This was by design for 2 reasons. First of all, at any time, I can disconnect the USB from the Pi and connect it to any PC or laptop and use the controller there. Also, I am planning on creating a second identical small system, without the Pi, to use as a player 2 controller which I will just connect to the same Pi and play with friends. I configured the 8 fire buttons as A,B,X,Y,LT,RT,LS,RS and the 1P and 2P buttons as Start and Select. These map nicely to all systems if they don’t require any analog controls. For these, I can still connect USB controllers (like the excellent 8BIT N30 Pro which works as USB or bluetooth if I want to) for other systems or for more authentic gameplay depending on the system.

Wow, messy I know but it works. The buttons go through the holes and screw from the underneath with their own plastic rings, while the joystick is screwed very tight with 4 metal screws. I also dug a little bit on the top of the FOREX, under the plexiglass, to bury the heads of the screws so they don’t push the plexiglass up. The USB encoder also has options for auto fire and turbo fire, which I connected with small momentary buttons on the back of the box. Speaking of the back of the box, this is what it looks like:

From left to right as we see it, we have an HDMI output (put there with a small internal extension from the Pi), the turbo and normal fire modes (mentioned above), an exhaust fan with a fan switch (more on that later), a restart and a shut down buttons (more on that later), a small hole for status leds (more on that later), the exit hole for the USB joystick and for the power cable (the standard 2.5A RPi supply), the standard Pi ethernet and 4 USB ports and a 3.5 audio jack for headphones (also connected to the Pi with a small internal extension).

Here are the initial schematics for the whole thing, slightly altered as I went along:

There are 2 leds (a red and a green) that both fit inside the small whole I mentioned above. The idea was that the green led will light up when the system starts and the red will light up during the shut down sequence (a safer way to shut down the pi than just pulling the plug). In order to do these, I connected the leds directly to GPIO pins (BCM 16 for the green and BCM 21 for the red) with respective resistors and wrote the following python script for the green led to turn it on at startup:

import RPi.GPIO as GPIO
GreenLed=16
RedLed=21
GPIO.setmode(GPIO.BCM)
GPIO.setup(GreenLed,GPIO.OUT)
GPIO.setup(RedLed,GPIO.OUT)
GPIO.output(GreenLed,GPIO.HIGH)
GPIO.output(RedLed,GPIO.LOW)

I also connected the “shut down” momentary button on BCM 23 and wrote the following python script to perform a clean “sudo shutdown -h now” and also light the red led:

import os
import time
import RPi.GPIO as GPIO
pinNum=23
GPIO.setmode(GPIO.BCM)
GPIO.setup(pinNum,GPIO.IN,pull_up_down=GPIO.PUD_UP)
GPIO.wait_for_edge(pinNum,GPIO.FALLING)
GPIO.setup(21,GPIO.OUT)
GPIO.setup(16,GPIO.OUT)
GPIO.setup(16,GPIO.LOW)
GPIO.output(21,GPIO.HIGH)
print("Shutting down...")
time.sleep(2)
os.system("sudo shutdown -h now")

The restart momentary button is connected to the 2 holes on the pi that reset it without any code. These are the pins I refer to:

In the beginning I used very small heatsinks like these:

but let me tell you, with emulation I had huge problems with overheating, even with an NES running. Maybe it’s the enclosed casing, maybe it was the bad heat sinks, whatever the reason, I had issues. I looked it up a little bit and I found a guy on YouTube who did all sorts of test with different heat sinks, with and without fans. Bottom line, fans and a much bigger heatsink with good thermal paste is the best solution.

Here is the guy explaining why:

I used a smaller fan which I mounted sideways with a double sided tape on the board blowing through the heat sink, because putting it on top interfered with the joystick. I connected the fan to 5V (it is a 5V fan) but used a transistor connected to GCM 17, to turn the fan on and off depending on the CPU temperature. Here is the python script:

import RPi.GPIO as GPIO
import os
from time import sleep
import sys
fanPin=17
maxTmp=45
minTmp=40
def setup():
	GPIO.setwarnings(False)
	GPIO.setmode(GPIO.BCM)
	GPIO.setup(fanPin,GPIO.OUT)
def getCPUTemperature():
	res=os.popen('vcgencmd measure_temp').readline()
	temp=(res.replace("temp=","").replace("'C\n",""))
	print("CPU temperature is {0}".format(temp))
	return temp
def fanON():
	setPin(True)
	return()
def fanOFF():
	setPin(False)
	return()
def getTemp():
	CPU_Temp=float(getCPUTemperature())
	if CPU_Temp > maxTmp:
		fanON()
	else:
		if CPU_Temp < minTmp:
			fanOFF()
	return()
def setPin(mode):
	GPIO.output(fanPin,mode)
	return()

try:
	setup()
	while True:
		getTemp()
		sleep(5)
except KeyboardInterrupt:
	GPIO.cleanup()

This will pass 5V to the fan if the temperature gets higher than 45 degrees C and cut the power when it’s less than 40 degrees C (checked every 5 seconds). Since this is an enclosed space, I figured that extensive gameplay sessions could result in the heat getting trapped inside the case, so just in case (pun intended) I also added a manual exhaust fan with a simple switch to turn on and off manually if needed. This is the fan you see on the back picture with the grill. Since this is also noisier than the small one, I avoid unnecessary noise. I was also able to slightly overclock the Pi using this system to allow it to play Playstation 1 and N64 games smoother. I also positioned the transistor inside the airflow of the fan, to avoid it overheating.

Here are some pictures of the heat sink and fans:

All scripts are run at startup in the /etc/rc.local:

python /home/pi/power_led_on.py
python /home/pi/reset_button.py
python /home/pi/shutdown_button.py &
python /home/pi/fan_control.py &
exit 0

I finally configured the controls on Emulationstation, updated everything over ethernet and started playing.

How well does it play? Well, it plays GREAT. And it looks like this:

A small update on the Amiga 1200 Gotek External Control Box

Posted by admin on January 30, 2018
DIY / No Comments

This is an update for the previous post, where I added a FlashFloppy Gotek and an external control box to control it which you can read here: http://www.karios.gr/?p=1003

I’ve removed the initial box and replaced it with a modified 3D printed box, which allows me to fix it perfectly and firmly on top of the Amiga 1200 and also to have the OLED screen in front as well as 3 control buttons on the back (previous, select-eject, next). The modification of the 3D model was done by Tasos (thanks Tasos) to fit the buttons as well as the screen. The original box, without the holes for the buttons, was found here: https://www.thingiverse.com/thing:2701629. The modified version can be downloaded from https://www.thingiverse.com/thing:2791237

It works great AND it looks great now. I think this project is complete!

Took me a couple of hours to do a proper rewiring but it works great as you can see below:

 

Amiga 1200 Gotek with FlashFloppy external control box mod

Posted by admin on October 14, 2017
DIY / 1 Comment

Back in the 90s, the dream was to get all the games for my Amiga 1200 and be able to choose what to play anytime. Easier said than done, we are talking about a time before the internet even existed, and games had to come on floppies, so even space wise this was an impossible task. Flash forward to today, even after the Amiga stopped being manufuctured and sold in the late 90s, people kept coming up with new ways to upgrade and enhance their experiences on classic Amigas. One of them came in the form of the Gotek floppy emulator, which can replace the floppy drive of the Amiga with a USB loading system. The Gotek comes with 2 buttons (the up and down buttons) and a 3 digits screen.

My Gotek came with the Cortex firmware which worked like this:

You had to provide a special SELECTOR.adf in the USB stick, which you run by holding both buttons. This allows you to assign ADF files to numbers and then load them by selecting them with the up and down button, and seeing their numbers on the 3 digits screen. The problem with this system is that you had to remember which number corresponds to which adf and if you needed a new adf file, you needed to go through this process again.

But there is a better way! I found out an awesome firmware, called FlashFloppy (which can be found here : https://github.com/keirf/FlashFloppy) which adds some awesome functionality, including being able to traverse through directory structures to better manage your ADFs. You can find instructions on how to flash the new firmware here:

https://github.com/keirf/FlashFloppy/wiki/Firmware-Programming

Thankfully, once you flash FlashFloppy, you can flash updates by just using the USB drive, as described here:

https://github.com/keirf/FlashFloppy/wiki/Firmware-Update

I used a FTDI FT232RL USB to TTL Serial Adapter Module 5V and 3.3V For Arduino G3 off Ebay to flash mine.
I also 3d printed a mount to be able to mount the Gotek inside the case. If you have access to a 3D printer, you can find the model here:

https://www.thingiverse.com/thing:2102839

Next thing was to replace the 3 digits screen, with a full AMOLED little screen, which is supported brilliantly by the FlashFloppy firmware. I used a 0.91″ IIC I2C SPI128x32 White OLED LCD Display Module For Arduino PIC off Ebay. The little screen looks awesome and it’s detected by the firmware automatically. It shows the name of the current adf as well as the current track and sector while a disk loads.

I used a longer cable and drove the cable off the back of the Amiga. At this point, I could already use the Gotek but it looked bad and I still had to use the side buttons to control the Gotek.

We can do better right? I used a small plastic semi-transparent box from my Samsumg headphones and hotglued the screen inside.

I also opened 2 holes and stuck 2 momentary buttons. I soldered wires below the Gotek, at the original buttons points, so i could use these buttons while being able to use the original buttons if needed.

I also drove these cables below the Gotek and out the back door. I then connected them to the buttons I had on my external control box.

 

And here is the result. Works great AND looks great:)

Half Life: 3 screenshots

Posted by admin on August 20, 2016
Games / No Comments

Here you are. You are welcome!

3
21

These people at Gamescom in Germany made lots of people laugh:)

http://www.pcgamesn.com/half-life-3/hl3-gamescom-2016

My thoughts on VR gaming

Posted by admin on August 12, 2016
Development, Games / No Comments

So VR is here, and this time it will not be like like the 80s, or so we are told:) Actually, it is kinda true, since the technology was just not there during that time and the results was for VR to die out fairly soon back then. It was not only that the display technology made people wear something like a CRT TV on their faces:

5500-0be88426f9d4384bfc85657c77447d23

but also the sensor, 3D graphics and algorithm research did not allow us to pass the threshold that actually fools the brain in a convincing way. This time around, all the pieces seem to finally fall into place so using the Oculus Rift or Vive of today actually accomplishes this goal with today’s technology, which means that if upon launch the technology is already here, there is a bright future for the platform.

But…

There is a but there. The technology is one thing, the adoption of the new platform is another completely. At the moment of writing this, you need a fairly expensive gaming rig to meet the minimum requirements for VR gaming on top of the actual headset cost. This means that this is a pretty expensive platform to get into and to make things worse there just aren’t any “must play” games out there that would justify the high cost of admission. Most of the software is actually bite-sized “experiences” and the deeper games could actually be played on a normal monitor like always.

hero

Like any new platform, there is the circular problem of user base and software availability. Game devs will make games, if there are customers to play them and the customers will get on board if there are games to play. This is why at the point there is a high-risk gold rush happening, with developers that believe in the medium to want to be there when mass adoption finally occurs. Another path some studios are taking is creating special versions, or simple updates to existing games to support VR. This works well on only a few titles, and namely titles that assume players are sitting on the same spot in the virtual world anyway (such as driving, space or flying simulators) since VR game design differs significantly from other platforms when it comes to handling motion. Best practices of VR game design dictates that the user must not move much and have full control of the camera view using head tracking in order to avoid nausea and dizziness due to view-movement differences. It is still work-in-progress and some games are trying alternative approaches to movement, such as teleporting to new fixed spots or fast-dashing to fixed spots (like Doom seems to be doing) with more or less success.

Like I said, it’s still uncharted territory and very interesting from an experimenting point but since things settle down, risky from a market point.

I personally believe that products that will make VR mainstream in the end will not be the Rift or Vive but rather Playstation VR or Project Scorpio VR. The reason is not technical, I am pretty sure that PS VR and … errr… PS VR (damn, Project Scorpio is also PS), will have lower specs than a good gaming rig (they always do) but they will also provide an affordable entry barrier for a larger amount of people to actually experience VR games. And this is important, since it will break the circle I described before and make more game devs make decent VR games. Of course, if the VR hype does not die down (and the consoles VR will help there) VR on the PC will also become affordable in time (a GTX 970 for example, which is now the minimum spec for both the Vive and the Rift, has already become VERY affordable due to the introduction of the 1060, 1070 and 1080 from Nvidia) which will eventually make VR gaming on the PC a no-brainer.

3022752-psvr_s_04_1458057143

So in conclusion, I personally believe there is a future in VR gaming, but it will take a few more years. The wow factor is definitely there, I’ve never seen anyone try a VR headset and not come out impressed by the experience, but the market is very limited. I chose here to to focus on VR gaming and not VR applications which is a whole other discussion altogether. So if you feel lucky, go on and make your VR game, there are lots of incentives from stakeholders to do so and some investors are actually actively betting on the success of VR. But if you want to play it safe, just wait a bit longer so that you actually have an audience for your game.