news aggregator

Michael Terry: Universal Emulator Frontend in Ubuntu 12.04

Planet Ubuntu - Sat, 2013-02-02 03:24

I wanted to set up a system hooked up to my TV that let me play NES or SNES games from the comfort of my couch. It was an interesting project, and I wanted to share my findings.

Setup

I have a spare laptop with an NVIDIA card running Ubuntu 12.04. If you also have an NVIDIA card, I highly recommend using the latest experimental NVIDIA drivers. They really increased the performance of and reduced the heat from my laptop.

Gamepads

I ordered two Logitech wireless F710 gamepads. They have a tiny USB dongle that they talk to wirelessly. They work great out of the box, but note that they must be on different USB socket groups. I first tried plugging them into USB sockets right next to each other and one of the gamepads didn’t work. When I put the USB dongles on different sides of the laptop, both gamepads worked again. ::shrug::

I recommend putting a sticker on gamepad 1 so you know which one it is.

Frontend

I installed XBMC then used it to download an add-on for its Programs section called “ROM Collection Browser”.

Using the ROM add-on, you can scan your ROM collections for each emulator. Be prepared for it to take a long time to download screenshots and covers if you have a lot of ROMs. The best feature is the ability to mark ROMs as “favorites” so if you have a huge collection, you don’t have to browse through all the crap each time.

XBMC lets you change the navigation bindings so you can use your gamepad.

NES Emulator

I’m used to the fceu family of emulators (gfceu, fceux, etc). But they did not support binding the direction buttons on my F710 gamepad. Those buttons send “hat” presses instead of simply button presses.

Looking further, I found an NES emulator I had never heard of. Mednafen not only can handle the “hat” presses on my gamepad but can also emulate GameBoy and a few other systems.

Note that the man page shipped with it is not helpful. You’ll need to browse the online documentation.

Press “ALT+SHIFT+1″ to set up bindings for gamepad 1 and “ALT+SHIFT+2″ to set up bindings for gamepad 2.

Press “F2″ to set up a binding to exit the emulator. This is an important theme! Once XBMC launches an emulator, you need a way to quit it with just the gamepad. When it closes, XBMC comes back. But since you don’t want to use an easy-to-accidentally-hit key or a key that a game is likely to use, you have to be careful. Thankfully, the F710 gamepad has a middle button that normally just turns it on. But once the gamepad is on, the button also sends a normal key press. And no game would need to use this special middle button. So make sure to bind the middle power button to the exit command of mednafen.

Also pass “-fs 1″ at least once to turn on fullscreen mode. The option is saved, so you only need to give it once.

When you add your NES collection in XBMC, note that the path to the mednafen command is “/usr/games/mednafen“.

SNES Emulator

I prefer the zsnes emulator for SNES games.

It doesn’t have any weird gotchas. Press “Esc” to bring up its main menu. Use the “Input” menu to set up the gamepads. Use the “Misc” menu to assign the exit button.

And don’t forget to enable full screen.

When you add your SNES collection in XBMC, the path to the zsnes command is the expected “/usr/bin/zsnes”.

Arcade Emulator

I found that the mame emulator works great for arcade games.

Press “Tab” to bring up its main menu. Under “Input (general)”, you can find the close command that is currently bound to “Esc” and replace it with your middle gamepad button. I found that most games needed me to individually set up “Input (this game)” bindings.

When you add your arcade collection in XBMC, note that the path to the mame command is “/usr/games/mame“.

Using the TV

I did hit one weird problem using the TV. Both mednafen and zsnes, if fullscreen, would switch which monitor was turned on. To stop them from doing that, I had to manually set each emulator’s fullscreen resolution to the size of TV.

Tada!

Anyway, that’s “all” it takes. Now you have an awesome emulator station. You can also use the “Advanced Launcher” XBMC add-on to add launchers for Ubuntu games that work well with gamepads, like Jamestown.

To avoid using the mouse or keyboard at all, you can set your user to automatically log in and add XBMC to your startup applications.

RT @freeculture: Announcing the Empowermentors Collective for Women of Color & Queer People of Color in #freeculture and #freesoftwa ...

Twittter Free Software - Sat, 2013-02-02 02:53
RT @freeculture: Announcing the Empowermentors Collective for Women of Color & Queer People of Color in #freeculture and #freesoftwa ...
Categories: Free Software news

@evan Excelent Evan! Thanks for your time! #identica and #freeSoftware forever :D

Twittter Free Software - Sat, 2013-02-02 01:45
@evan Excelent Evan! Thanks for your time! #identica and #freeSoftware forever :D
Categories: Free Software news

100% Give Away: Software Packages To Generate Massive Waves Of Traffic To Your Website http://t.co/hk2FNHbO via @worldprofit

Twittter Free Software - Sat, 2013-02-02 00:27
100% Give Away: Software Packages To Generate Massive Waves Of Traffic To Your Website http://t.co/hk2FNHbO via @worldprofit
Categories: Free Software news

Robohand: how cheap 3D printers built a replacement hand for a five-year old boy http://t.co/y3VAJZQM #freesoftware

Twittter Free Software - Fri, 2013-02-01 21:26
Robohand: how cheap 3D printers built a replacement hand for a five-year old boy http://t.co/y3VAJZQM #freesoftware
Categories: Free Software news

Apple v. Samsung: Magistrate Judge Paul Grewal References Tribbles in Order Re Sealing ~pj

Groklaw - Fri, 2013-02-01 20:27
More denials from the magistrate judge in Apple v. Samsung on new requests from the parties to seal documents. More sealing requests, you ask? Does this ever end? Yes, another long list, mostly denied. To the magistrate judge, the Hon. Paul Grewal, it feels like an invasion of Tribbles -- everywhere where he looks, there are more of them: "What tribbles are to the Starship Enterprise, Captain Kirk, and Mr. Spock, the parties' ever-multiplying sealing and redaction requests are to this case, Judge Koh, and the undersigned." I know. All of a sudden, you like him.

: )

But Apple and Samsung must be groaning. The trouble with Tribbles, of course, is that there's no seeming end to them -- "they are born pregnant" and threaten to consume all the onboard supplies, but Judge Grewal, like Spock, is immune to their effects, so he refuses most of the requests, saying over and over that the parties have failed to show in a particularized way how revealing the materials would be harmful.

But as I read the list I can see how they might be, particularly because the parties are suing each other all over the place, not just in this one courtroom. Having said that, as a member of the public, I'm personally looking forward to reading every last one of them. I find these Tribbles adorably appealing.

Categories: Free Software news

100% Give Away: Software Packages To Generate Massive Waves Of Traffic To Your Website http://t.co/q3ZMnUzT via @worldprofit

Twittter Free Software - Fri, 2013-02-01 20:04
100% Give Away: Software Packages To Generate Massive Waves Of Traffic To Your Website http://t.co/q3ZMnUzT via @worldprofit
Categories: Free Software news

Appel à communication Salon Solutions Linux soumettre avant le 1er mars : http://t.co/k9KrMfe9 #freesoftware #opensource

Twittter Free Software - Fri, 2013-02-01 20:04
Appel à communication Salon Solutions Linux soumettre avant le 1er mars : http://t.co/k9KrMfe9 #freesoftware #opensource
Categories: Free Software news

Where do you go to learn more about the #freesoftware community? Taking a few beers at Delirium Café #fosdem13

Twittter Free Software - Fri, 2013-02-01 17:45
Where do you go to learn more about the #freesoftware community? Taking a few beers at Delirium Café #fosdem13
Categories: Free Software news

Michael Rooney: The Startup Double Standard

Planet Ubuntu - Fri, 2013-02-01 15:50

Part of my disenchantment with startups has come from the ways that startup employees are discouraged from making responsible investment choices, while the VCs that fund them are allowed and encouraged to use sound investment principals in their own companies. There are two interrelated principals that I found at odds in the startup world, which ultimately caused me to leave it.

Investing in more than one startup

In the investment world, investing your money in only one stock is a huge no-no. Diversify, diversify, diversify. If the company fails for reasons you weren’t able to foresee, you’re out of luck if that was your only investment. VCs understand responsible investing and invest in many startups at once to diversify and both increase their chances of picking a winner and decrease their exposure to a particular failure.

Yet, as an employee, investing your time in a handful of startups at once is frowned upon; you are expected to work full-time at a single company at irresponsible investment risk. Oh, and don’t pull out early just because the forecast isn’t good like a smart investor would, or you might be labelled a job hopper.

Working part-time

When I asked if I could do work on the side for another company, it was rejected. I then asked if I could work part-time so that I could diversify my time between work and personal growth in other ways. The response was that that would be tantamount to quitting, so I had to choose.

And yet VCs only spend a fraction of their time each week or month on one particular startup, so that they each get attention, because that’s healthy. Why is it considered unhealthy for an employee to do the same? Isn’t in unhealthy to spend the majority of one’s waking hours during the week on one particular thing? How often have you seen a bug tracker response / project status analogous to “Sorry, I don’t have time to work on this anymore, I have a real job now.”?

Some might argue that VCs are paying, while employees are getting paid, so VCs are both at more risk and deserve more control. What I’m trying to point out though, is that we’re both investing; VCs invest with money, employees invest with time. However, lost money can be re-gained, while lost time cannot. Which is the riskier and more meaningful investment?

Brendan Donegan: Sorting lists of objects in Jinja

Planet Ubuntu - Fri, 2013-02-01 11:48

Part of my duties as a Hardware Certification Engineer is to develop and maintain our test and bug reports. Previously these have been Python scripts containing lots of inline HTML (yuck :/), which I’m ashamed to admit it because I didn’t know any better when I initially wrote them. I’m currently in the middle of refactoring (hopefully not ref**ktoring) the scripts to take advantage of a new API that’s available for querying data from the Certification website and have decided to use Jinja (precisely Jinja2) as the template engine.

So I have a list of systems which may be in different locations and I want to sort them by location. Initially I did this in the Python code which gathered the data, using a simple .sort(key = lambda obj: obj.datacentre). Then the template code used the sorted list and all was well. Later on when reading the Jinja template documentation I discovered a way to sort a list in the template itself. I considered this to be a cleaner, more transparent way to modify the list (somebody looking at the template asking ‘why does it come out in this order’ has the answer right in front of them). So I gave it a try by changing

for hw in {%reported_hardware %}

to

{% for hw in reported_hardware|sort(attribute='datacentre') %}

and was unfortunately confronted with a traceback from the template engine:

Traceback (most recent call last):
...
AttributeError: Hardware instance has no attribute '__getitem__'

This looks like it’s saying that the ‘Hardware’ object (which I’ll introduce in a second) isn’t the type that the template engine was expecting.

Initially I defined the Hardware object like this:

class Hardware:

def __init__(self..., datacentre):
...
self.datacentre = datacentre

My first attempt to fix this involved making datacentre a property:

@property

def datacentre(self):

return self._datacentre

But this didn’t seem to do the trick. Eventually I read in the Python documentation about the property built in working only on new-style classes and this set off the lightbulb

class Hardware(object):

This seemed to be the magic ingredient, and the sort in the template engine started working. I also realised that making datacentre a property wasn’t really necessary, so reverted that change.

Update: I found out that this whole problem is avoided by using Python3.x because all classes there are new-style classes. So the advice above only applies if you’re stuck with Python2.x


Pages

Subscribe to Free Software Magazine aggregator