Blog

MWR HackLab - MWRcade

By on 16 May, 2013

mwrcadeMenu

Occasionally at “MWR Towers”, people have disagreements. If Nils is using all the CPU power on the shell server to run his fuzzer and you need it to handle your reverse shell, or there’s no room in the lab because John is busy pwning an ATM and you’re needing to set up something on the test network, sometimes you just have to put your foot down and say ‘come at me, Bro.’.

Up until recently, settling scores has fallen to a battle to the death in front of the office Playstation 3, where the two parties involved throw down in some Street Fighter IV action with Ken vs Ryu or Chun-Li vs Vega. The victor gets their CPU time, whilst the loser is resigned to dwell on their failure whilst making a cup of sweet tasting coffee (everyone knows a coffee tastes better if it was made by someone else!).

Unfortunately, that sweet coffee was spilled on the Playstation 3 which made it disappear from the centre of the office. Without a way to settle disputes, tensions run high. We could just buy a new PS3, and return to normality, but where’s the fun in that? With the HackLab weekend looming, and plenty of cash to spend, we set out to build the ultimate in grudge-match technology. An old school Arcade machine with a modern twist.

The idea was to build a machine capable of playing every console game known to man, such that any disagreement or leisure period can be catered for. All we need is the ability to run the cartridges we have bought legally on our emulator. To the lawyers! The list of consoles we chose to support in our project were as follows:

  • NES
  • SNES
  • Sega Megadrive
  • GameCube
  • Nintendo 64
  • Wii
  • Playstation X
  • Playstation 2
  • MAME

There were a few criteria that we wanted to satisfy, primarily we wanted the unit to look the part, a real arcade unit with proper sticks and 6 buttons per player, not just some old computer with a screen and a couple of wireless controllers. We found a vendor of flatpack skeleton arcade cases like this one:

http://www.gremlinsolutions.co.uk/products/flatpackuprightarcadecab.htm

which is ready for purchase when the project is nearing its completion.

Secondly, as MWR have opened a new office in London, we needed a way for people in both offices to be able to battle against each other remotely. Fortunately, most of the Emulators we chose to install have some sort of network play feature, regardless as to whether the games support online play, by streaming the screen and forwarding the controls used by the second player over the network, as though they were playing locally. If we’re going to be authentic about it, we might as well build some unified user interface that allows players to seamlessly switch between games, regardless of consoles, controller bindings, or anything else emulator specific. In order to achieve this, we wrote an interface using SDL and python using the OpenSource PyGame libraries, and simply wrapped the functionality of each emulator in our interface, invoking them from the command line to both start, and quit the games, configure the emulator options and start network play.

The Hardware for the Machine that was going to be running all the emulators was kindly donated by Mike, and the budget of 200 notes more than covered the cost of two Playstation 3 SixAxis Controllers, a bluetooth dongle to connect them up, and a new 500Gb hard drive for storage. A few issues arose throughout development, as the Playstation SixAxis support on Linux is a little flakey when using multiple controllers over bluetooth. They work perfectly over USB, but things start to go a little bit mental when trying to use two controllers wirelessly. This doesn’t matter in the grand scheme of things, though, as when the flat-pack arcade unit is ordered, we’ll likely be replacing the controllers altogether with fight sticks and they will be wired over USB. As well as issues with the controllers, it was an issue to get PyGame to play nicely with the emulators and controllers in tandem. We had to implement workarounds to relinquish the controllers and screen when the chosen emulator should be in focus, and re-grab it when the user tried to quit.

Most of the functionality was implemented within the time allotted, however a few things need finishing off to make it look the part. All functionality is implemented into the interface aside from the network play features, and users are able to start and stop games seamlessly. Only issue now is it doesn’t look as aesthetically pleasing as it could, but most of the legwork is done and we’re nearly there!