Jul 17

Cave Story (nxengine) on the Raspberry Pi

UPDATE: New Raspbian Binaries Available

I got a request today to see if I could get Cave Story working on the Raspberry Pi.  It took me about 4 hours but I’ve gotten a decent version running.  This uses the NXengine open source cave story project, along with the english translation patch the freeware data files.

Cave Story Raspberry Pi

Steps to run:

  1. Download binaries
  2. Run unzip nxengine.zip
  3. cd into nxengine
  4. run sudo chmod 777 /dev/fb0
  5. run sudo modprobe snd_bcm2835
  6. run ./nx
  7. Play Cave Story!

Let me know if you have any issues with the binaries or running the program.  I’ve only ever played about 5 minutes of Cave Story so I’m not sure how well it’s running, but it seemed to be fine to me.  Looking forward to the feedback.

-Shea

Link to source code: https://github.com/suapapa/NXEngine

Jul 01

Raspberry Pi and MESS – Multi Emulator Super System – NES, GameGear, Genesis

UPDATE: New Raspbian Binaries Available

Hey All!

Today I present the binaries for AdvanceMESS.  The Multi Emulator Super System.  MESS can emulate somewhere around 250 different home consoles and computers.  It’s not perfect in any sense, but it works for most consoles.

I have currently tested:

  • NES (some games are slow, but it works).
  • GameGear (works)
  • Genesis (slow but works)
  • SNES (couldn’t get it to work…yet)
Instructions:
  1. Download MESS Binaries.
  2. Unzip MESS to the ~/MESS directory.
  3. chmod 777 /dev/fb0
  4. Put your console bios’s into mess/share/advance/rom/
  5. Put your console games into mess/share/advance/image/<console>/ (ie mess/share/advance/image/nes/
  6. CD into mess/bin/
  7. Run advmess with ./advmess
    1. The first time it’s run it will generate a set of folders and files into ~/.advance
  8. edit your ~/.advance/advmess.rc to include the proper display configuration
    1. For HDMI try:
      1. device_video_clock 5 – 50 / 15.62 / 50 ; 5 – 50 / 15.73 / 60
    2. For NTSC TVs try:
      1. device_video_clock 5 – 50 / 15.73 / 60
  9. While still in the mess/bin directory, type ./advmess <console> -cart <filename>
    1. ./advmess nes -cart file.nes
  10. ENJOY!!!

This is one of the weirder setups I’ve tested, but once setup, it works.  If you have any issues, let me know and I will try to help you.

-Shea

P.S. I will NOT help you find console bios or roms.  Please don’t ask.

Official MESS Site

Jun 26

Super Mario Bros. Pocket Watch

Sometimes you just have to buy something nice for yourself.  I saw this watch posted on Reddit Gaming and found a couple on eBay, so I decided to get one :-D.

Hatena Block Pocket Watches

Jun 24

Neo Geo Emulation on the Raspberry Pi

UPDATE: New Raspbian Binaries Available

I’m going to start this with saying that the Neo Geo is one of my favorite systems EVER. Over the years I’ve owned multiple Neo Geo Arcade Cabinets, tons of Neo Geo boards, and a drawer full of cartridges for the system. It’s an amazing piece of hardware. The first games came out in 1989, and the system had games still coming out in 2004. There is even a homebrew scene that is still running which releases a game every couple of years.

Last week I started messing with Gngeo, an open source Neo Geo emulator. I have gotten it compiled and running. King of Fighters 98 is running at 60fps. It looks lovely. The configuration was kind of a pain, but I think I have everything working right. So without further ado, below is the guide for installing and running Gngeo on the Raspberry Pi!

  1. If you havent setup /dev/fb0 yet, just go ahead and do sudo chmod 777 /dev/fb0
  2. Download the Gngeo binaries here
  3. Download the Gngeo config file here
  4. Unzip the binaries. They should unzip to a folder called gneogeo
    1. You should have 3 folders, the ones that matter are “bin” and “roms”. Inside “roms” you need to put in a neogeo bios file as well as any legally obtained game files you have. I will not give any hints or tips on where to obtain these files.
  5. On the command line go into the bin folder (cd ~/gneogeo/bin), and type ./gngeo -i ../roms/
    1. The first time it may fail, crash, lockup your pi, or even get into a small gui looking menu. Immediately exit (this can also sometimes cause a crash).
    2. What this first run has done is create a hidden folder in your home folder called .gngeo.
  6. Go into .gngeo (cd ~/.gngeo), and copy the config file you downloaded earlier. This setups the keys and some video stuffs.
  7. Go back into the gneogeo/bin directory and run ./gngeo -i ../roms/
  8. You should now see a gui, press enter on “load game”. You should see a list of roms available to you. Press up and down to get to your desired game, then press enter to start it.
  9. Press 3 to give Player 1 a credit, 4 to give Player 2 a credit. Press 1 to start player 1, 2 to start player 2. Up down left and right control player 1, and z, x, a, and d map to the Neo Geo’s A B C and D buttons.

Press escape when done 🙂

So far I have played King of Fighters 98, Metal Slug X, and Samurai Shodown 2 at full speed with no issues 🙂

Let me know if anyone has any issues or tips.

Edit:  Here is a link to the official site of gngeo

Jun 22

Installing Django and MySQL on Mac OS X Lion

In the past 6 months I’ve had to setup Django and MySQL 4 times on our various Mac hardware at work.  I figured since I’ve seen to have it down pat now I should document it somewhere 🙂

Python should already be installed.

sudo easy_install pip

download MySQL dmg from mysql.com.  This is the version I’m using.

Mac OS X ver. 10.6 (x86, 64-bit), DMG Archive 5.5.25 111.9M
(mysql-5.5.25-osx10.6-x86_64.dmg) MD5: 081d3345daaae6f5f36a9f245855798b

sudo easy_install django

nano ~/.profile
paste this in:
export PATH=/usr/local/mysql/bin:$PATH
export DYLD_LIBRARY_PATH=”$DYLD_LIBRARY_PATH:/usr/local/mysql/lib/”

Download and install https://github.com/kennethreitz/osx-gcc-installer

sudo easy_install MySQL-python

You are ready to go 🙂

 

Apr 03

Arduino and EL Escudo

Another fixit type post.  Every so often I repurpose my Arduino and EL Wire for a new project, and each time I always forget how to properly get the EL_Escudo library resetup.  I should probably just fork the code on GitHub with the fixes that have been posted, but who remembers to do that.

So, the EL Escudo is a cool shield for the Arduino.  SparkFun sells it.  I highly recommend them.  There is a small bug in the library code that is fixed by bobmct’s post (http://www.sparkfun.com/products/9259#comment-4eaad859757b7fd35100ba5d):

“I realize this is a rehash of what others above have said, but I got mine to work by doing the following.

Getting the El Escudo to work
Two problems:
1. Must fix a mistake in the library code: Needed to make in EL_Escudo.cpp (thanks BMK):
void EL_EscudoClass::on(char channel)
{
pinMode(channel, OUTPUT);
digitalWrite(channel, HIGH);
}
void EL_EscudoClass::off(char channel)
{
pinMode(channel, OUTPUT);
digitalWrite(channel, LOW);
}
2. They also recommend GND and HVGND are tied together. Look at photo (thanks miku) http://dl.dropbox.com/u/3551240/el-escudo.JPG . With the code change made above I also tried to see if the El Scudo would work without this jumber (between GND and HVGND), and it did work and it did work without it. I was using the EL_Blink.pde example when testing this.
The above got things to work with a handheld 3V inverter (two AA battery powered) with the button pressed 3 times (a steady AC supply, no blinking) with the output of this inverter connected to the El Escudo shield’s “EL Driver Inverter Ouput” JST jack.
The Arduino was powered from a 5VDC wall transformer (1A capacity) with the barrel jack plug connected either on the Arduino’s barrel jack connector or connected to the El Scudo’s “EL Driver Raw Voltage” JST connector.
You will need to fabricate the strange El Wire plugs to JST plugs to make all the connections. In my experience above, the polarity was not a factor because the output from the inverter is AC and so is the input to the el wire.
Hope this helps.”

My only issue was with number 1.  Fixing that caused the main library to work again.

With the upgrade to Arduino 1.0, WConstants.h will throw an error since that isn’t being used anymore.  You should be able to safely change all WConstants.h to Arduino.h

 

Mar 27

PhoneGap 1.5.0 and iOS 5.1

Hey All,

Just posting here so I remember some fixes I had to do with the new release of PhoneGap 1.5 (also known as Cordova).

When you initially run your new xCode product, you will get a ton of “semantic” issues.  The fix is to go to Build Settings -> Objective-C  Automatic Reference Counting -> “NO”

I found this clarification from a comment posted by Alejandro Orduz at http://phonegap.com/2012/03/06/phonegap-1-5-released/ 

“ok, i manage to make it work, Cordova, under Xcode 4.3.1…. regarding the www stuff…

First of all, getting into this painful process(more of all because of my lack of knowledge of Xcode), i wen to the process to upgrade my iPhone to the latest iOS 5.1, then had to upgrade Xcode to 4.3.1 to support testing in this device, but also did an upgrade to the latest lion 10.7.3…. so it was a boring weekend of upgrading….

The first time you run a new phone gap project under Cordova, is not like old days, now when you run you get a scary 9 errors warnings about a Semantic Issue in some, NSAutoreleasePool well, for some of us, that is like speaking chinease… but it can be solved very easy… the new Xcode has some Automatic Reference Counting ON by default, so you just go to the project Build Settings, find Objective-C  Automatic Reference Counting and change it to “NO”, after that everything goes to normal…. then it can build, add the www, you get the normal iPhone simulator error, and then, like before, had to drag and drop the www folder into the project root….

Changes like this are very scary for people like me, that found phonegap an amazing tool to build mobile apps with our web development knowledge…. :-{  ”

Also! I finally got the camera example working.  I was receiving a weird “wait_fences: failed to receive reply: 10004003” when I used the Camera example code verbatim.  It would work, but I would only recieve a small blue box on my iPhone.

The issue is that the code on line 40:

smallImage.src = “data:image/jpeg;base64,” + imageData;

is wrong.  PhoneGap 1.5 / iOS 5 stores the taken photo in a temporary directory, so you dont get the base64 data anymore, you have the actual URI for the photo in imageData.  All you need to do is change line 40 to be:

smallImage.src =  imageData;

and it will work.

 

I hope this helps out some people.  It’s working for me, YMMV.

-Shea

Mar 15

PyCon 2012

I’m going to start this blog with an account of my recent trip to PyCon 2012.

My University sent me there to learn, network, and be a representative.  I had a blast.  I have learned an immense amount and met an amazing group of people.

There were 2500 incredibly bright and talented individuals at this event.

To those who could not make it, PyCon has made available recordings of all the sessions at: Pyvideo.org

One of my favorite session talks: Building A Kinect Game With Python

I also have exported my bookmark list.  During the event, whenever someone mentioned any neat tool, company, or site, I went there and bookmarked it.  There are some python sites, some music sties, some random sites, and some fun sites.

You can find my bookmarks here: PyCon 2012 Bookmarks

Enjoy!

-Shea