SuperGNESTM
SNES Emulator for Android Phones

Creating Controller Themes

January 17th, 2012

As of SuperGNES version 1.2.21 support for theme-able controllers skins has been implemented. Coming soon is the feature to add user created controller skins. So you can make any theme you can think of! I wanted to make this blog post available first so users can prepare for creating their own controller skins. So lets take a look at one of the SuperGNES controller skins.

This is the default transparent controller skin that comes with SuperGNES. Controllers skins are simply PNG images with extra information embedded in them describing different regions of the controls.  You can see from the image elements like the D-Pad and Button Pad. There are action elements that depict the buttons pressed down. Embedding the information in the image makes it easy to share and distribute.

Now lets take a look at the meta information embedded in the image. Inside is the comment text (or PNG tEXtComment ) which contains a structured JSON string. This string holds the controllers name, background color and a list of graphics regions called elements. Each element defines it’s own region, id and button type. Formatted below is the actual JSON string for reference.

Here is a hexadecimal dump of the image header.
89 50 4e 47 0d 0a 1a 0a  00 00 00 0d 49 48 44 52  |.PNG........IHDR|
00 00 02 39 00 00 00 ae  08 06 00 00 00 d4 17 1c  |...9............|
bf 00 00 00 01 73 52 47  42 00 ae ce 1c e9 00 00  |.....sRGB.......|
04 6d 74 45 58 74 43 6f  6d 6d 65 6e 74 00 7b 22  |.mtEXtComment.{"|
6e 61 6d 65 22 3a 22 54  72 61 6e 73 70 61 72 65  |name":"Transpare|
...
...

{
// Controller name displayed
"name": "Transparent Default",  

// Background Color see http://developer.android.com/reference/android/graphics/Color.html
"backgroundColor": "#00000000", 

    // Element regions
    "elements": [
         // First element object
        {
            // Unique Element id
            "id": "dpad",

            // Element Type (supported values: dpad, buttonpad, ltrig, rtrig, start, select, menu, abutton, bbutton, xbutton, ybutton)
            "type": "dpad",

            // Rectangular region of graphic
            "staticBounds": {
                "bottom": 141,
                "left": 0,
                "right": 141,
                "top": 0
            },

            // Rectangular region of graphic when pressed
            "activeBounds": {
                "bottom": 141,
                "left": 143,
                "right": 284,
                "top": 0
            }
        },

        // More elements ...
        {
            "activeBounds": {
                "bottom": 141,
                "left": 428,
                "right": 569,
                "top": 0
            },
            "type": "buttonpad",
            "id": "buttonpad",
            "staticBounds": {
                "bottom": 141,
                "left": 286,
                "right": 427,
                "top": 0
            }
        },
        {
            "activeBounds": {
                "bottom": 173,
                "left": 47,
                "right": 93,
                "top": 142
            },
            "type": "ltrig",
            "id": "ltrig",
            "staticBounds": {
                "bottom": 173,
                "left": 0,
                "right": 46,
                "top": 142
            }
        },
        {
            "activeBounds": {
                "bottom": 173,
                "left": 141,
                "right": 187,
                "top": 142
            },
            "type": "rtrig",
            "id": "rtrig",
            "staticBounds": {
                "bottom": 173,
                "left": 94,
                "right": 140,
                "top": 142
            }
        },
        {
            "activeBounds": {
                "bottom": 173,
                "left": 188,
                "right": 250,
                "top": 142
            },
            "type": "menu",
            "id": "menu",
            "staticBounds": {
                "bottom": 173,
                "left": 188,
                "right": 250,
                "top": 142
            }
        },
        {
            "activeBounds": {
                "bottom": 173,
                "left": 251,
                "right": 324,
                "top": 142
            },
            "type": "start",
            "id": "start",
            "staticBounds": {
                "bottom": 173,
                "left": 251,
                "right": 324,
                "top": 142
            }
        },
        {
            "activeBounds": {
                "bottom": 173,
                "left": 325,
                "right": 404,
                "top": 142
            },
            "type": "select",
            "id": "select",
            "staticBounds": {
                "bottom": 173,
                "left": 325,
                "right": 404,
                "top": 142
            }
        }
    ]
}

You can simply download the image above and replace it with your own graphics if you stay within the same regions and use an image editor that preserve image comments. Beyond that you need to understand how the JSON format and element regions work.

Each element has a staticBounds property. This consist of four other properties left, right, top and bottom that define the boundary of the control element. To visualize how these relate take a look at the box model below. In addition there is the activeBounds property defining the image pressed or activated state. This allows for an animated interaction. The activeBounds and staticBounds bounds must have the same width and height to be considered valid. If you don’t want to create the active graphics simply set the activeBounds to the same coordinates as the staticBounds. Each element must be set a type such as dpad, buttonpad, ltrig, rtrig, start, select, menu, abutton, bbutton, xbutton or ybutton. The dpad and buttonpad types are unique as they require the bounds to be perfectly square for calculating touch regions. It’s recommended to use the buttonpad instead of using each abutton, bbutton, xbutton or ybutton. Finally give each element it’s own unique identifier.

Included below is the Java classes matching with the JSON string for use inside SuperGNES. This is mainly provided for easy reference.

package com.bubblezapgames.supergnes.touchcontrol;

import android.graphics.Rect;

public class ControllerGraphic
{
	// Controller name displayed
	public String name;

	// Background Color see http://developer.android.com/reference/android/graphics/Color.html
	public String backgroundColor;

	// Element regions
	public ControllerGraphicElement elements[];
}

public class ControllerGraphicElement
{
	// Unique Element id
 	public String id;

	// Element Type (supported values: dpad, buttonpad, ltrig, rtrig, start, select, menu, abutton, bbutton, xbutton, ybutton)
 	public String type;

	// Rectangular region of graphic
  	public Rect staticBounds;

	// Rectangular region of graphic when pressed
 	public Rect activeBounds;
}

// No copyright reserved. Public Domain

So now you have an idea of the format of a SuperGNES controller use a photo editing program to create the graphics for your controls. For help inserting comments into images, Gimp has a handy option for doing so. Go to Menu, Image, Image Properties and click on the Comment tab. Also make sure you save your controllers in PNG format and check the “Save comment” option.

Gimp

Thanks for checking out this blog entry. Look for future releases of SuperGNES with full support and a new controller gallery area here on supergnes.com.

SuperFX Support!

September 9th, 2010


After a month of development the brand new high speed SuperFX assembler core is complete and ready for you to play some StarFox and Yoshi’s Island! Once again SuperGNES has done a first by developing the fastest and most stable emulation core available. Please download the latest release to play!

SuperGNES Lite Released!

May 20th, 2010

SuperGNES Lite has been released to Android Market! It’s time (if you haven’t already) to give this SNES emulator a spin! The only differences between the full version and lite is save state support and multiple cheat codes. All the other features are available free of charge! Please give it a try and give us your feedback. Thanks!

SuperGNES Lite

New SA-1 Support

April 29th, 2010

Today SuperGNES has become the first in emulation history to support the SA-1 chip using a full ARM assembler core. Games that were previously unsupported like Super Mario RPG and Kirby can be played using the SuperGNES emulator. We hope to keep demonstrating our commitment to excellence by bringing the most technically advanced features to you the gamers! Now that SA-1 is complete SuperFX development for StarFox can begin!

Here is the full list of titles that are now playable with SA-1 support.

  • Super Mario RPG: Legend of the Seven Stars
  • Kirby Super Star
  • Kirby’s Dream Land 3
  • Super Bomberman Panic Bomber World
  • SD Gundam G NEXT
  • Dragon Ball Z: Hyper Dimension
  • Daisenryaku Expert WWII: War in Europe
  • Derby Jockey 2
  • SD F-1 Grand Prix
  • Itoi Shigesato no Bass Tsuri No. 1
  • J. League ‘96 Dream Stadium
  • Jikkyou Oshaberi Parodius
  • Jumpin’ Derby
  • Kakinoki Shogi
  • Marvelous: Mouhitotsu no Takarajima
  • Masters New: Haruka Naru Augusta 3
  • PGA Tour ‘96
  • Super Robot Taisen Gaiden: Masō Kishin - The Lord Of Elemental
  • Mini 4WD Shining Scorpion Let’s & Go!!
  • Pebble Beach no Hotou: New Tournament Edition
  • PGA European Tour
  • Power Rangers Zeo: Battle Racers
  • Shin Shogi Club
  • Shogi Saikyou
  • Shogi Saikyou 2

SuperGNES on Market!

March 20th, 2010

Finally after a year and a half of development, a number of false starts, endless coding and game debugging sessions; SuperGNES has shipped and is now available on the Android Marketplace! It’s been a harrowing journey but very rewarding to at last bring our vision of Super Nintendo for mobile devices to everyone. A big thanks to my developers and Beta testers. You guys rock! The future of SuperGNES is going to be very exciting!

Dedicated to the gamers,
Nate SuperGNES Dev

SuperGNES Multi-touch

March 12th, 2010

SuperGNES Multi-touch
Finally full multi-touch support is here for SuperGNES. Using the on screen controller you can simultaneously direct and button press at the same time. To help the Android phones that do not have build in keyboard there is one now built into the screen. Works for any Android Phone with multi-touch API support.

Are we there yet?

October 6th, 2009

Okay so why is SuperGNES taking so long and why aren’t we there yet? First let me say sorry of the lack of insight into what’s been going on. It’s been a bit heck-it lately for different reasons but we want to ensure you that SuperGNES will get done … no matter what. We want to put out the highest quality and competitive product we possibly can. Unfortunately we don’t have a venture capitalist to fund development 24/7. It’s just us and the time we commit to making things happen. All that said SuperGNES is making great progress. We welcome you to join the Beta testers using the contact form to help us squash all the bugs.

On Screen Controls

August 31st, 2009

Using on screen controls Mario grabs the shell, jumps in the air and kicks the shell

After working hard to development on screen controls we finally found a control configuration that is easy to use and allows for precise game control. The newest screen only phones have been in desperate need of better controls as most games have been modeled around the hard keyboard. What we have created is a controller pad using on screen buttons, combined with the track ball or D-Pad for directional controls. For the track ball you simply scroll in the direction you want to go, press the ball in to continue your path of travel and release it to stop. When you want to super speed and jump hold the speed button down and then slide your thumb down to the jump button to press both buttons at the same time. Theses controls have proven to be quite effective in kicking some koopa shell and we hope to add some more controller skins in the future. Checkout the in-game screen shot using the new touch controls.

Beta Progress

August 13th, 2009

Since we released the Beta of SuperGNES we’ve gotten great feedback and help from the SuperGNES Beta testers. We’ve been able to cut our testing cycles down, quality has gone up, speed has increased and we’re very happy to say that a majority of the SNES titles are now fully playable. We are also very happy with the quality of the sound as it is right on par with the original SNES. There is still a little bit of lag it but we are certain it will go away once we put some more APU optimizations in. Special chips for the Mega Man X series are working. For those with Android Generation 2 phones, not to worry we are saving the best for last and are working on on-screen controls unlike any other emulators for Android.

Full Disclosure

July 31st, 2009


It’s game day and time to get the testing on with SuperGNES. However first we need to go over what’s working and what’s still a work in progress. Right now SuperGNES is not a finished product and needs some more love. So lets start with what IS working.

  • CPU and APU Cores
  • Keyboard Controls
  • Game Scanner with cover art
  • DSP1-4
  • Sound. It’s really slow right now but everything is rendering correct.

Here is what isn’t working yet or not available.

  • SA1, SuperFX, C4
  • Screen Controls (just ran out of time on this one)
  • Certain games are crashing an exhibit graphical glitches

And here is what will not be enabled for the beta.

  • Save State (Well technically you can save but just you can’t load)
  • Save / Load SRAM or battery backup

We are working on a release candidate right now and will email everyone today as soon as we get it together.