Tuesday, February 16, 2016

A DIY Arcade Console That Plays All Your Favorite Games in 240p RGB



DISCLAIMER: The GroovyCube is a DIY project, NOT a real product! In no way do I take credit for the amazing work by the MAME team or Calamity (creator of CRT Emudriver and maintainer of GroovyMAME). This guide is just a collection of my research and notes assembled to hopefully help others out. I do NOT take responsibility to any damage you may cause to your system or hardware. Proceed at your own risk!



I. Introduction


If you're a die-hard retro enthusiast, you probably already have every console under the sun hooked up in the best possible quality via SCART RGB to a CRT TV or PVM (for anyone left scratching their head over these terms, please check out my Introduction Guide). Even with every retro console ever made, you're still missing out on a huge chunk of gaming history: the arcade. While people have been building amazing MAME cabinets for years, some of us just don't have the space or resources for one. Thankfully, over the last few years conditions have ripened for easily building the ultimate 240p arcade console that never was.

You may be asking yourself, why go through all this trouble when you can just use a Raspberry Pi or hacked Wii? While the Pi is a great and inexpensive way to play games on digital displays, it's not able to output high-quality analog video signals like RGB or Component yet (Update: there are a couple solutions out there now like Pi2Scart and Gert666, but as far as I know Pi is still not able to seamlessly switch resolutions). Hacked Wii's are also great for playing various console emulators on CRTs, but it's arcade support is dismal, and can't even load ROMs over 20mb due to memory restrictions.

GroovyMAME emulating Street Fighter II: CE on Olympus OEV203

Luckily, a saint that goes by the name Calamity took it upon himself to create the perfect combination of software for PCs that can detect an arcade game's native resolution and output it exactly as the real hardware would to your CRT TV. The purpose of this guide is to build a small, fast machine that fits comfortably into your existing SCART setup and allows you to play any arcade game from Donkey Kong to DoDonPachi in perfect 240p RGB. I dubbed this hobby project "GroovyCube" as a shorthand, but really there is nothing special about it versus any other PC with this software setup.


II. How it works


Displaying the front-end on a consumer Toshiba via RGB->Component converter

Before we start talking about the system, let's quickly cover how all this works. The biggest obstacle to displaying computer video on a CRT TV is that computers output at a frequency of 31kHz, while TVs expect a much lower 15kHz. CRT TVs operate at 480i (640x480 interlaced), and retro game consoles run at almost half that at 240p (320x240 progressive). Computers, on the other hand, use much higher resolutions (640x480 progressive and beyond), and therefore require a much higher frequency. Because of this, modern video cards don't commonly support the super low resolutions we need for retro games.

This is where Calamity comes to the rescue. He created a hacked video driver just for this situation called CRT Emudriver that enables compatible Radeon video cards to output the low resolution 15kHz signals needed for TVs. Just being able to output at a single frequency isn't enough though. Unlike game consoles, arcade games used a myriad of different resolutions and frequencies.

GroovyMAME emulating classic arcade games on an Olympus OEV203 in TATE mode

Luckily, through a combination of software (VMMaker and GroovyMAME, Calamity's own modified version of MAME), you can build all the needed resolutions for your games once and your system will switch seamlessly between them when the games are launched. The result is perfect scrolling with zero screen tearing or juddering for virtually any arcade game out there with no effort from you beyond the initial setup!

I will quickly mention here that the ArcadeVGA cards sold by Ultimarc skip the hacked drivers and have only the CRT-safe 15kHz resolutions burned into their ROM. The huge downside to these cards though is that they ship with a limited number of timings built-in, and may or may not include ones for the games you want to play. The CRT Emudriver setup on the other hand allows you to play all games without concern of whether it's supported by the card or not.


III. Hardware


No, that's definitely not a hard drive zip tied to the case.

The following are the specs of the machine I built for this project. It's comprised of some old parts I had, as well as some new ones I purchased. The only unique component in the system that you must have is the video card, which I will describe further below.

  • Intel Core i3-4170 3.7 GHz Processor
  • ASRock H97M-ITX 1150 mITX Intel Motherboard
  • Crucial Ballistix Sport 8GB 240-Pin DDR3 1600 SDRAM
  • Sapphire ATI Radeon HD4350 PCI-E Video Card
  • Silverstone Sugo SG05W Mini-ITX Case w/ 300W Power Supply
  • 80GB SSD Boot drive + 600GB 2.5" Storage drive
  • 2x GELID Solutions FN-PX12-15 120mm Case cooler (one for case, one for CPU)
  • Prolimatech PRO-SAM17 Samuel 17 CPU Cooler
  • Windows 7 Professional
  • Mad Catz Fightstick Tournament Edition

And a few important notes on the system:
  • Video Card: The video card is crucial to getting everything working! You must find an AMD graphics card that's compatible with CRT Emudriver, so take a look at the official compatibility list on the site and find the one that's right for you on eBay. The HD 4xxx series seems to be the best right now, especially if you find one that's passive-cooled. We're not using the card for anything other than pushing out a 15kHz signal, so it doesn't need to be powerful. Lastly, keep in mind the DVI port is the primary port on most of the cards, so a DVI-VGA adapter is probably required.
  • Windows 7: XP is also compatible with CRT Emudriver, but I believe the install process may be a little different. For simplicity's sake, this guide assumes you are using Windows 7. Update: I've also received confirmation Windows 10 works as well.
  • Form Factor: Mini-ITX is a newer form factor, and is much smaller than ATX or even MicroATX motherboards while still supporting powerful processors. I looked for the smallest case I could find, but the major limiting factor on the physical side is that it must have a PCI-E slot for the graphics card. My top three contenders for cases were the Silverstone SG05 and ML05B, as well as the Thermaltake SD101. The thing about cases this small is that one dimension is bound to disappoint you. In the case of the SG05 it's the height, while the ML05B is much wider and the SD101 is deeper. I looked at the space in my setup and found the SG05 to be the best fit for me.
  • Processor: MAME can only use two cores simultaneously at most, so having more than that won't help performance. By default, the target system is emulated entirely by your processor on a single thread, even if it's a 3d game. (It's possible to offload the audio and some other subsystems to a second thread, but I haven't tried it yet.) For this reason, I went with one of the fastest dual core processors I could find. The higher the clock speed of the processor, the faster a frame can be crunched. I've ran everything from 3d fighters to CAVE shmups with the i3, and haven't had a single hiccup so far.
  • Hard Drive: I used an SSD as the primary drive for the quickest boot time possible. After enabling Fast Boot in the BIOS the system can go from powered off to the front-end ready to play in just 30 seconds - usually before the CRT is even warmed up.
  • Cooling: I initially started with the stock CPU cooler and case fan that came with the SG05, but during testing I found it to be running a little loud and hot. I decided to upgrade it with a couple GELID 120mm fans and the Samuel 17 CPU cooler, and the load temperatures went from 65C to 40-45C while staying whisper quiet. I got the idea for the combo from this handy HTPC build video.
  • Fightstick: Thankfully, Street Fighter IV caused the fightstick market to explode, and now there's all kinds of awesome USB fightsticks with real arcade parts out there that are compatible with PCs. This is an entire topic on it's own, but the one thing I'll mention is that if you're interested in mainly playing older games, you'll want to find an easily moddable one. The reason for this is that modern joysticks are 8-direction, and classic games like Pac-man, Donkey Kong, Galaga, and others are either only 2 or 4-way. While it may sound like 8 can surely handle 4 or 2 (which it can), it's VERY frustrating to control due to the diagonals interfering with the input registering. If you get a stick with the Sanwa JLF like the Mad Catz Tournament Edition, they actually have a square plate on the bottom of the joystick that can be rotated to a diamond for 4-way only.


IV. VGA to SCART Cable


Custom VGA and 3.5mm stereo to SCART cable

One of the keys to making all this work is the video cable. We need to get from the DVI or VGA output of the graphics card to a male SCART connector. From there you can easily adapt it to a PVM with a breakout cable or a standard CRT with a Component converter. You have a few options here: you can either build your own cable, buy a premade cable, or use the Ultimate SCART Adapter

The cheapest way by far is building your own cable. You can start with a male to male SCART cable, desolder one end, and then solder on a VGA connector. I used this VGA to SCART schematic to make a cable, and it looks amazing via breakout cables on a PVM or through a Component converter on a consumer TV. If you're using either of those methods then you don't need to bother with the Molex power detailed in the schematic. The power lines are only used for specifying 4:3 aspect ratio and RGB videos modes on consumer Euro TVs, so you can safely skip them if not using one of those sets.

Lastly, just a word of caution on buying cables. There are various VGA to SCART cables you can find on eBay and such, but without seeing their wiring it's impossible to tell if they'll actually work for our purposes. There's always the option of buying one and then modding it, but it will be a risk whether it has enough wires in the cable. If anyone finds a good solution, please let me know!

WARNING! You can damage your TV by sending it bad signals! Always double check your wiring before plugging it in.


V. Setup Guide


A custom GroovyCube theme for the Attract-Mode frontend

Once the hardware is assembled and you have a VGA to SCART cable, you're ready to set it all up. The following guide will take you from installing Windows through having the front-end automatically launch and ready to play games. I was originally just going to link to cools invaluable guide that greatly helped me out, but it's old enough now that there are some differences that will confuse beginners. Consider this guide a major revision to his, but with the focus on TVs instead of arcade monitors.


Step 1: Windows 7 Installation and Configuration
  1. Hook up a standard computer monitor (not our eventual CRT TV) and keyboard/mouse.
  2. Install a fresh copy of Windows 7.
  3. Install all drivers EXCEPT for video card (do NOT install Catalyst)
  4. Install 7-Zip
  5. OPTIONAL: Install RealVNC server. This is a safety net, and comes in handy if you get into a situation where neither CRT or LCD will display anything. It's also convenient after the box is setup if you want to access it without hooking up keyboard and mouse. One thing that might trip you up later on is that if you're connected to the machine and trying to play games in 240p you will get interlaced resolutions instead of progressive. Just always remember to disconnect your session before playing.
  6. Run Windows Update.. and wait (ensure no graphics drivers are installed in the Optional updates)
  7. Now is a good time to configure Windows while waiting:


Step 2: GroovyMAME Setup

  1. Download vanilla MAME 64-bit (0.170b at time of writing) from the official site and extract to C:\MAME
  2. Delete the file C:\MAME\mame64.exe (it will be replaced with GroovyMAME)
  3. Download the latest GroovyMAME (0.170 at time of writing). Go to the latest folder, and find the file in the format groovymame64_xxxx.xxxx.7z
  4. Extract GroovyMAME with 7-Zip to C:\MAME, and rename the file to groovymame64.exe
  5. Now generate a config file (mame.ini) for GroovyMAME:
    • Click Start and type "C:\MAME\groovymame64.exe -cc" (without quotes) and press Enter
    • Navigate to C:\MAME and open our new config file, mame.ini, with Notepad
    • Find the following settings in the file, change them, then Save and Close the file:
      • gamma 0.7
      • skip_gameinfo 1
      • disable_nagscreen_patch 0
      • disable_loading_patch 0
      • frame_delay 1
  6. OPTIONAL: If you're using a PVM or smaller TV and would like to manually rotate your display to play vertical or horizontal games how they were intended then do the following (always remember to turn off your monitor before rotating it!):
    • Open a new copy of Notepad
    • Add the line "orientation rotate_r" (no quotes)
    • Click File, Save As, and navigate to C:\MAME
    • Save as "vertical.ini"
  7. Finally, add your test ROMs and BIOSs to C:\MAME\roms


Step 3: CRT Emudriver and VMMaker

  1. Download CRT Emudriver 1.2b + VMMaker + ArcadeOSD for Windows 7 and extract to C:\
  2. Rename the folder C:\crt_emudriver_13.1_1.2b_w7_64 to C:\VMMAKER for simplicity
  3. Download GroovyMAME 0.161. This may seem odd since we downloaded a newer version above, but this is the last good version for generating a resolution list for all games, and we'll use it only for that purpose - not for actually playing games. If you try to use the latest version for generating resolutions, some games will work, but others with special refresh rates like Mortal Kombat and R-Type will use incorrect interlaced resolutions. Update: This appears to have been fixed in the latest version of Groovymame, so you can just copy the groovymame64.exe you put in the MAME folder over.
  4. Extract GroovyMAME 0.161 to C:\VMMAKER, and rename it to oldgroovy.exe
  5. Open C:\VMMAKER\VMMaker.ini with Notepad
    • Change MameExe's value from "\Emu\Mame\mame.exe" to "C:\VMMaker\oldgroovy.exe"
    • Save the file and close it
  6. Navigate to C:\VMMaker\driver, right-click Setup.exe and Run as Administrator
    • Click OK to accept warning of Calamity as publisher
    • Click Next to begin and wait patiently. If asked to restart at any point, say NO.
    • When finished you will be prompted if you'd like to enable Test Mode on reboot, say YES.
    • Do not reboot yet!
  7. Navigate to C:\VMMaker, right-click VMMaker.exe and Run as Administrator
  8. When it says completed press the spacebar to close the window
  9. Reboot your machine now.
  10. Navigate to C:\VMMaker and run Arcade_OSD.exe
  11. Press Enter to select Video Modes
  12. Scroll down and find the resolution lowest on the list that's not greater than 640x480 at 15kHz. Do not pick a greyed out line (even though it might let you switch to it)! For me it was 640x240 at 15kHz.
  13. Press Enter to select the resolution, you should see a test screen appear on your LCD (it might be squished)
  14. Unplug your LCD from the system and plug in your CRT
  15. You may just have a black screen at first, just hit Escape if nothing pops up right away. If you find yourself at the Windows Desktop and don't see the Arcade_OSD on screen, just right click it in the taskbar and close it, then re-open it.
  16. Arcade_OSD should look normal at this point on your CRT, but the desktop might look weird
  17. Go into Video Modes again, and find 640x480 at 15kHz on the list and select it.
  18. If everything looks good, scroll down to "Set as desktop Mode" and press Enter
  19. It might drop you back out to the Desktop now, but you should see a popup for Arcade_OSD asking to Keep or Revert. It may be squished and deformed, but just hit Enter to Keep it.
  20. Press Escape a couple times to exit Arcade_OSD and you should have a decent looking (but probably flickery) interlaced desktop
  21. WARNING! While Windows is safe now, when your computer boots up it will still be outputting 31kHz signals which may damage your 15kHz CRT. Until you flash your card with ATOM-15 below, always shutoff your monitor and don't turn it back on until you hear the Windows startup chime.


Step 4: (Sanity) Test It!

  1. Open a Command Prompt (Click Start, type cmd and press Enter)
  2. Navigate to C:\MAME ("cd .." twice to go up to the root, then "cd MAME" to switch to MAME directory)
  3. Type "groovymame64.exe myrom" where myrom is the part before the .zip of the game you want to run
  4. You should have a beautiful 240p 15kHz picture if everything worked right!
  5. If there was a problem you should see it described there. I highly recommend learning vanilla MAME on your desktop computer first before beginning this whole process. Getting together your ROMs and BIOSs and learning how to execute them by command line before starting will make things much simpler.
  6. Press TAB to access MAME settings and map your buttons
  7. In addition to mapping the Player 1 Coin and Start buttons, make sure to map a button in the MAME User Interface controls to the Cancel action so you can exit the game via your joystick/gamepad. Once you get the front-end installed, pressing it will dump you back to pick another game to play. Something like Down + Start should make it unlikely to be hit accidentally.


Step 5: Final Configuration

  1. Enable "Fast Boot" mode in your BIOS. This will bypass looking for extra boot drives and speeds up getting into Windows. Only enable this once your done setting up your hardware since its tough to get back into your BIOS after you enable it. In the worst case, just set your CMOS jumper and wipe it.
  2. Turn off Automatic Windows Updates. This will prevent the system interrupting your gameplay. Just remember to do maintenance once in a while and manually run it!
  3. If you're all up to date now, the Windows 10 nags are probably already annoying you. Kill them! They will pop up over your frontend, so it's best just to get rid of them. I found GWX Control Panel to be quick and painless.


Step 6: ATOM-15 (OPTIONAL, but recommended!)

  1. WARNING! This step is very useful, but not required, and could possibly damage or brick your graphics card. ATOM-15 is basically designed to remove all the 31 kHz modes from your graphics card during boot, so it only outputs safe 15 kHz signals like an ArcadeVGA. Keep in mind this only protects it during boot, so if you change the resolution in Windows it will not help.
  2. Also note, if you have a UEFI BIOS you may not be able to see it after flashing your card. They tend to be higher resolution like 800x600 which isn't supported at 15 kHz. You have two options then, pull out the card and use your onboard video, or just reflash it back to factory. It only takes a second to re-flash it and reboot, so just make sure to hold onto your bios files!
  3. Follow the directions in this post closely. I did the Windows version without any issues.


Step 7: Front-End

  1. There are tons of front-ends out there so feel free to skip this step and do your own thing. I just picked one that was compatible with 4:3, 640x480, and wasn't too over the top (ahem.. Hyperspin).
  2. Download the latest version of Attract-Mode and extract it to C:\ATTRACT
  3. OPTIONAL: Download the GroovyCube theme, and extract the ZIP. Place the extracted "groovy" folder in C:\ATTRACT\layouts
  4. Navigate to C:\ATTRACT and run attract.exe
  5. Pick your language and press Enter
  6. OPTIONAL: If you'd like video previews and extra artwork, go to Scraper and press Enter. Change Fan Art and Videos to YES, then hit Escape to go back.
  7. OPTIONAL: If you'd like to hide all the parenthesis and brackets from the game titles, go to General, set it to off, then press Escape to go back.
  8. Select Emulators
  9. Select "mame"
  10. Select Executable, change it to "C:\MAME\groovymame64.exe" (no quotes), and press Enter
  11. Select Rom Path, change it to "C:\MAME\roms" (no quotes), and press Enter
  12. Select Generate Collection/ROM List
  13. Select Scrape Artwork
  14. Hit Escape a couple times to return to the top menu (if you go too far press TAB to get it back)
  15. OPTIONAL: If you'd like to use the GroovyCube layout:
    1. Select Displays
    2. Select mame
    3. Select Layout
    4. Press down until you see "groovy" and press Enter
  16. Escape back until you are out of the settings menus. Try out a couple games and make sure everything works.
  17. When happy press Escape, and pick Yes to exit.
  18. Right-click attract.exe and click Create Shortcut.
  19. Right-click the new shortcut and click Cut
  20. Click Start, go to All Programs, scroll down until you see the Startup folder. Right-click it and click Open.
  21. Paste the shortcut in this folder.
  22. Restart your computer.
  23. Attract mode should automatically launch, so sit back, relax, and play some games! When you're done just press the power button and Windows will handle a graceful shutdown for you.


VI. Conclusion



Hopefully this guide has been of some use to you. As you can probably tell, this is a very deep subject. There are many other emulators and games that could work with this setup, and I may explore them more in future posts. If you have any questions or comments or find anything confusing, please leave them in the comments below. And as always, happy gaming!

Continue Reading...