Monday, October 14, 2013

RetroArch Overlay Borders

RetroArch has long had support for fun borders/backgrounds that can fill the unused black space on HDTVs using a specially crafted shader combined with an image, as described in a previous post. However, this system can be finicky and it isn't very forgiving of different screen sizes and aspect ratios. There is another way to achieve a similar outcome, though, using RetroArch's built-in overlay system.
Gameboy border pictured with Harlequin's Gameboy shader
This system was designed to provide onscreen touch controls for the Android and iOS ports of RetroArch, but we can use the same hooks on PC to display our borders. All you have to do is add this to the bottom of your retroarch.cfg:
input_overlay = "/path/to/overlay.cfg"
You can also load overlays directly from the in-game RGUI menu under Settings > Overlay Options.

The overlay.cfg file is extremely simple, containing only 4 short lines (you can either copy these into a blank text file yourself or use the one I include in the download at the bottom of the post):
overlays = 1
overlay0_overlay = border.png
overlay0_descs = 0
overlay0_fullscreen = true
 
This file tells RetroArch that there will only be 1 overlay, which image to load as the border (in this case, border.png, located in the same directory as the overlay.cfg), that there will be no buttons attached to the overlay (that is, for touchscreen controls) and that it will take up the full screen, including any black space.

In addition to these border effects, you can also use this system to apply semi-transparent overlay effects, such as scanlines, which can be useful in very low-power settings, such as on Raspberry Pis, homebrew-capable Nintendo Wiis or older cell phones that can't handle even lightweight scanline shaders. Even some MAME "rgb" effects can be used with this system with minor modification.

This system will work fine with the borders from my previous post, and here's a bunch more (formatted for 1920x1200 displays) from NeoGaf user richisawesome.

Here is the download (contains border.cfg, two example borders and an integer scale Cg shader, though the shader should not be necessary now that you can force integer scaling through RGUI):

Tuesday, July 16, 2013

Fix for "Failed to start game (app already running)" error - Steam

I got a fancy new 144 hz monitor the other day and was messing with some settings on Borderlands 2 to push it up past 60 fps but after poking around a bit, I couldn't load the game and instead got this error:
Failed to start game (app already running)...
I looked online and found a number of potential fixes, none of which worked for me, including the ill-advised "run Steam as an administrator." -_-

Thankfully, someone mentioned that they had also been using the graphics enhancement program SweetFX before getting the error. Removing all of the SweetFX files cleared it up for me, as well.

Here is a list of all of the files used by SweetFX (found in the Borderlands 2 Binaries\Win32 directory, in my case):
d3d9.dll
d3d9.fx
dxgi.dll
dxgi.fx
injector.ini
SweetFX readme.txt
SweetFX_preset.txt
SweetFX_settings.txt
and the SweetFX folder
Move/delete these files/folders from your executable's folder and you should be set.

Saturday, June 29, 2013

Fix for Youtube error: 'This video is currently unavailable' - Ubuntu Chromium

Thankfully, this one's an easy fix and will presumably apply to other browsers and operating systems, as well.

I've been using Chromium as my browser for a while and everything has been great until recently, when some youtube videos wouldn't play reliably and instead would show the error:
This video is currently unavailable.
Learn more
This is apparently caused by being enrolled in Youtube's HTML5 video trial. You can enroll/unenroll from the program by visiting this link.

I had forgotten I was even using HTML5 video, so I never even considered this could be the problem. Once I unenrolled, everything works fine again. Of course, YMMV.

Monday, June 24, 2013

Dedithering Pixel Shaders

Dithering, as it applies to pixel art, is a pattern made up of two or more colors of pixels arranged in a pattern (usually a checkerboard or dotted line) that, when viewed on a CRT television, will blend together, resulting in an average of the adjacent colors. This allows an image to display more colors, perceptually, than may be technically possible to show otherwise, and was also frequently used to produce a transparency effect. Unfortunately, when such dithering is viewed on a modern LCD monitor or TV, the color blending never happens and we're left with ugly checkerboards all over the place. Even worse, pixel art upscaling-interpolation algorithms such as HQx and xBR tend to have a really rough time with dithering.

Recently, though, several different folks all independently developed their own solutions to the dithering problem using pixel shaders. Here are the raw images to which we'll be applying the shaders:



Three of these games are for Sega Genesis, which relied on dithering extensively, and the other is from an SNES game that uses "pseudo-hires transparency," which functioned similar to dithering insofar as the artists expected the vertical lines to be blended together by a CRT TV.

CBOD
First off, we'll look at coastkid's CBOD shader, which uses three shader passes of 4-pixel blur using various threshold values. It can be a bit blurry but does an impressive job of smoothing out the dithering, particularly with regards to vertical dithering patterns, with which the other shaders often have trouble:



GTU
Next up, we have aliaspider's GTU shader, which uses a "pixel bandwidth" variable to determine how much horizontal blurring should occur. This shader also includes light scanlines (which can be lightened or eliminated entirely by manipulating variables within the shader) and gamma correction, making it a one-stop option for people who want the benefits of CRT blending, color and scanlines without any heavy-handed phosphor emulation, etc. Its handling of pseudo-hires transparency is particularly nice:



For reference, the SNES shot used a bandwidth of 512 while the Genesis shots used a bandwidth of 320.

MDAPT
The last shader is Sp00kyFox's MDAPT, which stands for 'merge dithering and pseudo transparency.' This shader uses a modified version of Hyllian's DDT shader's detection code to identify identifies dithering patterns and then replaces them with an average of the component colors (I was mistaken; the algorithm is all Sp00kyFox's) . MDAPT is especially interesting because it is intended to run at 1x to smooth out dithering silently--so to speak--followed by another upscaling shader. On its own, here's how it handles our dithering example images:



Unfortunately, it sometimes has a few false-positives (notice the '200' in the next shot), but nothing too terrible:
When paired with some other shaders, aliaspider was able to use MDAPT to produce some pseudo-hires transparency upscaling that is nothing short of magical:

You can check out a couple more shots from aliaspider here.

Of these shaders, MDAPT and CBOD are available in Cg format, while GTU is in XML/GLSL format

Tuesday, June 11, 2013

HTC One Back Template for DIY Case Artwork

I got a super-cheap, clear hardshell case (price seems to have gone up since I bought it...) for my HTC One and was interested in making some custom art to put between the case and the phone. I wasn't able to find any templates readily available online, so I spent a little bit of time with a flatbed scanner and whipped one up myself: EDIT: turns out that Google resamples images -_- so just taking this image will not work as-is. You'll need to keep the same resolution (i.e., pixels by pixels) but set it to 200 DPI. Or, just download this one.

Note: I make no guarantees about the applicability of this template to your own case. It worked for me and I hope you find it useful, as well. The biggest potential issue would be with the cutaways for the power and volume buttons, which are pretty large on my case, but it should be easy to remove them if your case doesn't have them.

Here's how it looks when it's all finished:
Sorry about the weird picture. I didn't have another camera on hand, and there weren't any good mirrors at work, so I had to just use the reflection from an old hard drive platter...

EDIT: Here's a slightly better picture:
I made this BMO design along with a couple of other Adventure Time designs, ready to print:
Best show on television.

Friday, May 31, 2013

Setting up a Cydia Repository

For RetroArch v0.9.9, the new star platform for support is/was iOS via jailbreak, so we needed to set up a Cydia repository for people to pull down the app. I followed this guide, which was helpful, but there were a few important deficiencies that required additional work. I'm going to cover those issues here.

First off, the directory structure described in the guide, with 'apps' and 'uploads' is unnecessary. All you need is a directory that contains your Packages.gz file and a subdirectory named 'deb' that holds your package. If you keep the directory structure from the guide, your Cydia URL will be http://yoursite.com/cydia/upload, which is tacky.

More importantly, if you follow the guide, your app will not install to the /Applications directory of your iOS device, and any *.info files will be broken, which was very bad news for RetroArch. To fix this, I followed this guide, the important parts from which I will summarize here:

First, you'll need to take create a new directory with the same name as your application--in my case, RetroArch. Then, inside that directory, create another new directory named Applications and one named DEBIAN. In the DEBIAN directory, place your 'control' file, which contains information about your application, and in the Applications directory, place your compiled application (in my case RetroArch.app).

At this point, you're ready to bundle your application using dpkg:
dpkg -b [your.app.name]
Once your deb is created, you can delete the directory structure and then create your Packages.gz:
dpkg-scanpackages -m . /dev/null | gzip -9c >Packages.gz
Create a directory called 'deb' and drop your deb bundle into it and you should be all set.

Wednesday, May 15, 2013

Fix for: Google Voice Search force closes immediately

This is just a quick post and it may or may not work in your case: I installed a nightly of Cyanogenmod 10.1 on my HTC One and the Google Voice Search app force closed every time I clicked on the little microphone icon. Everything else worked fine, including Google Now and so forth.

The fix for it, in my case, was just to go to the Play Store and update the Google Search app. If that doesn't fix it for you, I would recommend uninstalling the Google Search app entirely and then reinstalling. If that doesn't help either, you probably have something more serious amiss.

Analytics Tracking Footer