Lukas Sabota Ramblings of a coder, musician, and a debatably nice guy.

6Mar/124

FCEUX on OS X

To be honest, FCEUX was not built with OS X in mind.  I have never owned an Apple product (other than an iPod) and most of the FCEUX developers are PC-centric as well.  However, the SDL port is actively maintained and once I managed to succeed at compiling it on OS X and I was playing Castlevania on OS X.  A few commits later and FCEUX was actually quite usable on OS X.  The problem was that it was difficult to obtain all of the tools and libraries required to build FCEUX.  On Linux systems, grabbing the compiler and libraries are a yum/apt-get/pacman command away, but it was not always this easy on OS X.

Enter Homebrew. Homebrew is a source-based package manager for OS X with ruby-based packaging scripts. I'm no Ruby expert, but the documentation made it easy enough for me to put together a script to patch FCEUX to make it OS X compatible and to actually compile and build FCEUX. If you have homebrew installed, you can build FCEUX and the necessary dependencies with the following command:

brew install fceux

If you want to compile a command-line only version, you can use this command:

brew install --no-gtk fceux

Currently, the emulation window and the GTK GUI window are in two separate windows due to a limitation in the OS X X11 implementation. I have not yet tried Quartz yet, but it might work properly in a single window with that. Keep in mind that FCEUX was not originally intended for OS X, but SDL and the rest of the libraries utilized by FCEUX are available for OS X.

As always, patches are welcome.  If you run into issues first check the website and file a bug on the sourceforge tracker if necessary. Feel free to drop by #fceu in irc.freenode.net for any fceux-related discussion.

Here is the Ruby "Formula" for FCEUX in Homebrew's GitHub that I wrote if you want to check it out. You don't need that link if you want to build FUCEX however -- you can simply use the brew commands above

.

Cheers!

Filed under: Code, Fceux, NES 4 Comments
19Jan/126

Google CR-48 – Fix random reboots and erratic behavior

I have been thrilled to be one of the lucky individuals that were included in Google's ChromeOS beta project in which beta participants that were selected received the CR-48 to beta test. I have been very pleased with the CR-48 and ChromeOS in general to the point of where I have integrated the device into my daily habits and school routines.  To my displeasure I had begun to notice increasingly frequent seemingly random reboots and periods in which I could not access the WiFi device at all. I wasn't sure if I was being plagued with a software glitch or a hardware issue.

This was really disastrous for me, as I have come accustomed to using the CR-48 for college regularly. It's much more convenient to carry around a 3.8 lb book sized computer rather than my Dell XPS, which is a monstrosity in comparison. Although the CR-48 doesn't carry a whole lot of processing power (1.66Ghz Atom), with SSH built into the "crosh" shell you can easily offload your heavy processing to a sweet VPS or a home computer running Linux or BSD. You can also use the "ssh" linux command directly by enabling developer mode -- which is as simple as flipping a switch beneath the battery.

To get back on topic, the random reboots and erratic WiFi behavior were easily fixed in my case by reseating the SSD ribbon cable that attaches the SSD to the CR48's motherboard. Sure enough, after opening the case I found that one the clamps holding the ribbon cable was loose. After tightening the cables, I haven't had a single reboot that I have not issued (knock on wood). This seems to be a somewhat common issue on the CR-48. If you want one and want to try this fix, you'll need a small Philips screwdriver, about twenty minutes of your time, and this guide. There is also an excellent guide with pictures that shows you how to easily open the CR-48 to ease you through this process.

I hope this helps someone out! Thanks cr-48.wikispaces.com for the comprehensive guide! There isn't a whole lot of information on the web about the Google CR-48 (I presume because not too many devices were given out) so I figured I would share this knowledge with anyone else that might be having a similar problem.  I encourage any CR-48 user that may be experiencing similar symptoms to give this fix a try.

Cheers!

4Sep/118

Gracefully killing “stuck” SSH sessions

On my home WiFi connection, I occasionally find my SSH sessions being stuck and completely unresponsive. The only way to resolve the issue has been to close the window of the terminal emulator, which is usually no big deal. This becomes more of an issue when using ChromeOS on my CR48 where you can't close the shell window by any means other than the "exit" command. Prior to discovering a more graceful solution, I had been using this somewhat lengthy workaround (which requires ChromeOS to be in dev mode):

  • Press Alt-Ctrl-T to open a new crosh shell.
  • Type "shell" to open a Linux shell.
  • Run "ps fax | grep ssh" to find the process id of the stuck ssh session.
  • Kill the stuck session with "kill -9 [process ID]"

Killing the process manually is not ideal, especially when your WiFi drops whenever the router yawns.

This solution that is built into the standard openSSH client takes a lot less time and closes the connection as opposed to just killing the client process. When the session is stuck, press the following keys to close the SSH connection:

  • Enter
  • Tilde ( "~" / shift back-tick )
  • Period

That's it! Your connection will be closed with the "Connection to [host] closed" message. I hope that you find this tip as useful as I did. Happy hacking!

Filed under: ChromeOS, Code 8 Comments
18Jun/112

Exploring Perl

Throughout my years of programming, I have heard abundant praise about the Perl language.  On the other hand, I've known some programmers that refuse to touch Perl with a ten foot pole.  Python had been my scripting language of choice in the past. Regardless, I decided it was in my best interest as a programmer to at least be familiar with the language.

After some quality time with "man perlintro", I began to get fairly comfortable with the syntax.  Diving into "man perlretut" really opened my mind to ways to parse text in new ways with regular expressions instead of complicated code chock-full of nested loops and loads of conditionals that are quite frankly awkward to code.  Another great thing about regular expressions is that many other languages and programs have support for them or a similar syntax (python re and vim for starters). I highly recommend any programmer with some spare time to check out the perlintro and perlretut manpages if they haven't already.

I wanted to dive into a bit of web programming with Perl, so I installed and configured mod_perl for my apache2 server on my Linode.  On Arch Linux, you can install mod_perl with:

pacman -S mod_perl

I added the following entry to my httpd.conf file to enable mod_perl:

<Files ~ "\.(pl|cgi)$">
PerlResponseHandler ModPerl::Registry
Options +ExecCGI
PerlSendHeader On
</Files>

Your mileage may vary with your distribution and version of everything, but that was enough to get me started with mod_perl and apache2.

My first script was a warsow server status checker for my warsow server. You can check it out here and the source can be found here. The script is pretty simple, it basically scrapes the output of qstat (a command-line program to query quake/warsow servers) and formats the output into an HTML friendly format. Regex is used to parse the qstat output into variables that can be used to form the HTML friendly output. The code probably isn't as optimal as it could be -- for anyone checking out the source keep in mind that I was learning everything about the language and regex as I was writing this. The output of the script is currently bare-bones HTML, but with CSS added the output could also be easily improved to be more eye-friendly. Maybe one day I will extend this script further, but as it stands it was a great learning experience and still serves a useful purpose. I'm looking forward to learning more Perl and regex; I feel as if I am only scratching the surface of how much these tools will make my life easier as a programmer.

Tagged as: , , , 2 Comments
4Jun/110

FCEUX 2.1.5 Released!

Hey folks!  After many nights of dark LCD-lit rooms, coffee, and code the FCEUX team is pleased to bring you FCEUX 2.1.5.  Most notably, the GTK GUI for SDL platforms (Linux, BSD, OSX) has been drastically overhauled and moved from the previous two window layout (game window/menu window) into a single integrated window.

For the full list of changes, check the official press release and download it here.

For build instructions for SDL, check out my previous post.

Edit 6/17/11 - Arch Linux now includes fceux 2.1.5 in their community repository, so you can fetch it with "pacman -Sy fceux" (link).

If you're an impatient archlinux user, you can use this PKGBUILD with makepkg to build a fceux 2.1.5 package for your system before the official package is updated in the community repository. Just use the following commands:

  • sudo abs community/fceux
  • cp -R /var/abs/community/fceux /tmp
  • cd /tmp/fceux
  • rm PKGBUILD
  • wget http://xannode.com/PKGBUILD
  • makepkg
  • sudo pacman -U fceux-*.pkg.tar.xz
  • Enjoy!

    -Luke

    Filed under: Code, Fceux, NES No Comments
    27May/111

    Pursuing Solo Music; RIP 4#

    I have not been very public about my music on the Internet, mostly since I was never fond of MySpace Music or uploading my material to Facebook.  For the past two years, I have been playing in a rock (punk/shoegaze/postpunk/ihategenres) band with a couple of good friends.  I'm going to loosely reference this band as 4# (a name we had agreed on for a while), although we've gone through multiple names, drummers, and band members (as well as beer pizza and guitar strings).  We've had sort of a rotating line-up, which gave me the pleasure of playing my share of rhythm and lead guitar, electric bass, and drum kit.  Anyway, due to the lack of a practice area and other factors beyond the bands control, the band has come to an end.  It's pretty disappointing for me, especially since we just about had enough original material to put together an EP...

    As disappointed as I am about this indefinite hiatus, I plan to devote more of my energy to writing and producing my own music.  Between my KORG AX300G, Gibson Les Paul (smartwood series), Presonus Firebox, a Shure SM57 and some free software I should have the tools at hand to make this happen.  I intend to share any wisdom that I might learn along the way while I start to produce my own material.

    Even with all this being said, I am really going to miss the experience of playing with a band: let alone with some of the most talented people I know.  It's going to be tough to not have other friends to bounce ideas off of and give/take critique from.  A large amount of the material that my band wrote would not have happened indepedently: it is the product of a couple guys trying to keep on rockin' in the free world.  But who knows what the future will hold?

    Filed under: Music 1 Comment
    8May/117

    FCEUX 2.1.5

    FCEUX (FCE UltraX) ((FamiComEmulator UltraX heh)) has been a project I've been contributing to since 2007.  FceuX (http://fceux.com/) is a cross-platform NES (Nintendo Entertainment System) (so many acronyms!) emulator written in C++ that sports a wide-feature set, excellent ROM compatibility, and accurate emulation.  Thanks to the hard word of myself (http://sourceforge.net/users/punkrockguy318) and sf:plombo (http://sourceforge.net/users/plombo/), fceuX now also can brag about its integrated GTK2 GUI:

    FceuX 2.1.5 hasn't been officially released yet (as of this posting), but if your running Linux or most other SDL capable platforms you can get the latest code from subversion and enjoy the new features for yourself.  The code in svn is pretty stable right now (the release is imminent), so it's safe to run this and your computer shouldn't explode (no guarantees :) ) It's pretty simple to compile, so I'll just post the instructions here for anyone that is interested.

    First, install the dependencies with your package manager (or from source if you're one of those kinds of people):

    • g++
    • scons
    • libsdl
    • libz
    • libgtk2 (optional)
    • subversion

    Now, let's grab the latest fceux source:

    • svn checkout http://svn.code.sf.net/p/fceultra/code/fceu/trunk fceultra
    • cd fceultra/

    You can edit the "SConstruct" file if you want to turn compile-time options (like GTK) on or off.

    Now compile like so:

    • scons

    After a successful compilation, the fceux binary will exist at ./src/fceux .  You can install it wherever you'd like (or use "./install.sh to install to /usr/local/bin) and start enjoying some damn Nintendo games.

    The release is coming soon, so hopefully your-distro-of-choice will be including fceux 2.1.5 in their repositories (I know Arch will be...).

     

    PS:  Does anyone want to build a Mac OSX Binary?  ;)  If anyone wants to give it a try give me a shout in #fceu in irc.freenode.net

    Filed under: Fceux, NES 7 Comments
    7May/110

    Blog

    Hi internet! I figured I would start a blog to keep track of the projects that I can get in to on my spare time. I don't really have much else to post right now except that wordpress is really easy to install, and it has a decent UI. Anyways, happy trails!

    Tagged as: No Comments