Gen_Witt

Linux HORI Fighting Stick EX 2

time: 25 Oct 06:59 pm
mood: amused
I got back from my second trip to Taipei this weekend. I'm hoping I don't have to go again for sometime as that trip is pretty grueling. In a glorious fit of procrastination, instead of packing I decided to try and get my joystick to work under Linux. I have a Hori Xbox360 Fighting Stick EX 2 which I am relatively happy with. The buttons are a little to stiff and make a bit too much noise, but it's about the best you can buy at that price point.

Step 1. Patch the kernel XBox controller driver to recognize Hori brand controllers.

This is all you have to do to get the controller working. But you'll soon find that the controller is mapped very funny, owing to the way it's used on the XBox. You'll have the same problem in windows, but there are readily available 3rd party tools to remap joystick buttons. To remap the buttons in Linux, you'll have to do some more work.

Step 2. Get the right kernel version. You're going to need a kernel <2.6.28 or >=2.6.31. In particular you're going to need this change.

Step 3. Patch the joystick calibration tools to support button remapping. Some smart guy already had done most of the work, but his patch doesn't work with the changes to button remapping in the kernel. My patch combines Laszlo Kajan's patch with a fix to the change in the ioctls. If you're using a kernel <2.6.28 and a Debian based distribution the joystick utils installed should work.

Step 4. Add udev rules to calibrate the joystick on connect,

KERNEL=="js[0-9]*", ATTRS{name}=="HORI Fighting Stick EX2", ACTION=="add", RUN+="/etc/udev/setup_hori_joystick"

Runs a script, "/etc/udev/setup_hori_joystick", whenever the joystick is attached. The script contains calls to jscal to remap buttons and calibrate the joystick. It looks like this,

jscal -u 8,16,17,0,1,2,3,4,5,11,304,305,307,308,310,311,315,316,317,318,278 "${DEVNAME}"
jscal -s 8,1,0,0,0,536854528,536854528,1,0,0,0,536854528,536854528,1,0,0,0,-2147483648,-2147483648,1,0,0,0,-2147483648,-2147483648,1,0,0,0,-2147483648,-2147483648,1,0,0,0,-2147483648,-2147483648,1,0,0,0,-2147483648,-2147483648,1,0,0,0,-2147483648,-2147483648 "${DEVNAME}"


As you can clearly tell, Linux is ready for the desktop.

Cognac and a Bag of Coins

time: 18 Jul 09:18 pm
mood: happy
I finally got fed up with my job at Graphzilla and quit. I really like the people and working on and around 3D. I learned a lot and met some great folks. But the particular projects I kept being assigned to where unbearably painful. I'm working at the G now, ChromeOS specifically. I can't say it's my dream project, but it's certainly interesting.

Danielle lost her job about 6 months ago. Between that, being out of work for a month and a half, and the general expense of the bay and owning a home, money has been tight. Now were both gainfully employed which has let us buy some frivolous things.

Danielle got a kitten. We're calling him Enzo Ferrari, he's quick, and somewhat rambunctious. We're planning on getting him a cat door so he can come and go as he pleases when he gets to about 6 months of age. I take him outside where he climbs trees and generally acts cat like. I like him, but he is a cat, so he does nefarious things like: sit on keyboards, and knock Danielle's iPhone into the tub. She's not pleased about that. She's considering a Palm Pre as a replacement; I don't think she'd be happy with it, the Apple app store is filled to the brim with just the types of crummy time management games she likes. Speaking of phones, my F3 gave up the ghost, the sim card socket flakes out every 60 seconds or so. I'm considering a Pre but paying more than $35 a month for phone service rubs me the wrong way.

I got an Astro City Arcade Cabinet to replace [info]lifftchi's New Astro City that he took home in May (much to everyone's surprise). I got Mushihimesama Futari in the mail on Friday. It's really enjoyable, fast paced, fun to play, not much thinking or memorizing (some of the patterns are random, heaven forbid). Danielle went to sleep at 7pm, she's setting up the sales ad price tags tomorrow morning, so I'm just having a relaxed evening playing my game.

Rumors Demise, etc etc

time: 17 Mar 06:21 pm
mood: tired
[info]noisetube got pwnded by some script kiddies. I asked [info]lifftchi to deal with it because he has the controlling e-mail address. This FAQ entry contains details on recovering the account. If the Gods are willing taco will ride again.

One Year Aniversary

time: 08 Dec 2008 10:52 pm
mood: amused
My wedding cake after having spent a year in the freezer is, quite edible. I am pleased.

Civilization Get

time: 12 Oct 2008 09:12 pm
mood: tired
I managed to run cat 5e through the walls and attic to all the rooms of my house. Let me tell you, the attic is a terrible place to be. It came out looking pretty slick though, cable TV and cat 5e in the same jack in a few rooms. I totally destroyed a borrowed fish tape, that thing was a $15 piece of junk though. Total cost was in the $150 range, far cheaper than having someone do it, or converting everything to wireless networking.

My boss overheard a conversation I was having at lunch about pulling cable for network; he now thinks I'm some sort of Luddite for not believing in wireless networking. Then again I've lost an ungodly portion of my life trying to get WiFi under Linux to work in the bad old days (circa 2001 before iwconfig and friends).

Progress

time: 30 Sep 2008 12:07 am
mood: anoyed
Firefox has had a long standing bug that there is no quit keyboard shortcut (bug 189290). I always thought this was an awesome feature, but it got "fixed" in firefox 3. Here is an extension I wrote to remove the quit shortcut. I've been told that "Quit" doesn't exist in windows, so I guess this is only for the Linux/OS X users out there.

Just so you know, you really shouldn't install this extension, it could do all manner of nefarious things. Unless, of course, you trust me.

Practice Safe Sex

time: 28 Jul 2008 10:25 pm
mood: tired
Back when I was in the 7th grade, in health class, we did an "experiment". Each student was given a vile with some sort of fluid. You were then to find 6 other people, write each others names on your card, and then exchange fluids with that person, you give them half of yours and take half of theirs. After all was said and done you added some other fluid to your fluid to detect the presents of some contaminate. Two students started with the contaminant and at the end inevitably almost everyone is infected. A mighty lesson in epidemiology. For those wanting to play at home, I suspect the contaminate agent was potato starch, and the test iodine.

Given that I had more brains then sense I took home all of the available data, and tried to reverse engineer who the two originally infected students were. I failed miserably. Man I want to invent a machine that can punch my former self in the face.

Now for some reason I thought about this in the shower this morning. And thought, hmm, I bet you could do some sort of topological sort on the graph of pairings and get all sorts of information. It works surprisingly well. I could run a constraint solver as this point, but in the vast majority of cases it wouldn't produce any more information. Here is a trial with 20 people, 1 starting with the infection, and 4 interactions. On the left is the initial graph built out of the available data (final status and a chronological list of partners), on the right is the graph with as much data as can be extrapolated. It's pretty clear that in this case if you knew there was only 1 infected person at the start that it would have to be either "0" or "19".

As an aside, with 34 students, 6 interactions, and 2 starting with the infection, there is a > 80% chance of everyone ending up infected; this makes it a very compelling argument to the dumb (aka children). When everyone is infected at the end, there is very little recoverable information.

Where A Kid Can Be A Kid

time: 08 Jun 2008 02:35 pm
mood: amused
Yesterday, a friends of mine had his 26th birthday party at Chuck E' Cheese in Farifield. I'd say I had a good time, played some ticket games, ate some terrible pizza. The kids seemed to be going nuts there, but I was relatively unimpressed. Then again I seem to remember liking to go to Shakey's pizza as a kid, and they only had maybe a dozen video games. But man three and a half hours at chuck e' cheese is enough for a whole decade, if not a whole lifetime.

Went from Fairfield out to Davis, mostly because we where 2/3rds the way there. Hung out a little, walked around downtown, played some PiU NX2, had a burger and beer at Froggy's. Picked up some stuff from [info]lifftchi's storage unit to take back to the south Bay. That experience just reinforced how much I'm not looking forward to moving. I got back to the south bay around 10:30pm.

Drink O'clock

time: 17 May 2008 10:16 pm
mood: exhausted
It's drink o'clock. You get full points for a Maibock, half points for a classic two or three ingredient cocktail, and honorable mention for any other German style lager. Myself, I'm going to settle for a gin highball.

My wife is out of town visiting with her parents before she goes back to work. I haven't been sleeping well while she's been away which is unfortunate. I went down to the mall to stop by the bev'mo, play in the arcade a little, and to just generally get out. Had a gin and tonic and played three games of PiU; I absolutely destroyed FA2 NM. I don't like playing in the evening, there are too many people and I end up attracting a crowd.

There are people at the mall, this is good because it keeps me from becoming a shut in, but it is also bad because is piques my "get off my lawn" tendencies. It may be uncouth, but there are no white women in their early twenties in the south bay. As a male who grew up in a tourist town in southern California, there's precious little eye candy here. I'm displeased that everyone seems to have ignored my moratorium on the baby doll dress. I still think they look like they belong in the bedroom.

Works been crummy but there's light at the end of the tunnel, new assignments will come down in mid-July. Well not "new" but I'll go back to working on what I was working on in November and December of last year. One of my co-workers is redesigning the memory controller, I looked at a picture of his design and said, "I don't think you need all this junk," while pointing to a large section of the design. "You need it to cover the 70ns row cycle time." "No you don't, it just ads latency and serves no purpose." "Are you crazy what are you talking about?" After 20 or 30 minutes of "discussion", he said my idea was just crazy enough that it might work, and retreated to a conference room for a couple hours to pencil it out. I find those kinds of conversations the best part of my job. I don't think we'll go with my crazy idea, it's a large departure from conventional wisdom, and it introduces a lot of risk; but I think my co-worker is going to write a simulator for my design and see how well it works.

I have new neighbors in my apartment building, they've been here two days, and their already fighting. This doesn't bode well.

XBLA Ikaruga

time: 17 Apr 2008 10:38 pm
mood: tired
The XBLA port of Ikaruga came out. I played the demo, level one, I played poorly but finished it (C++), and decided not to get it. It looks great, it has both left and right TATE, and 19:10 monitor compensation. The xbox360 controller makes the game nearly unplayable.

It also turns out that they changed the timing of the bullet patterns the homing laser, completely destroyed the bullet pattern of Shigi (aka the fish, aka the 3rd stage mini-boss), and the third stage bonus enemies. You can find numerous JP blogs with side by side pictures of how "broken" it is. I find it funny how dedicated some of these players are.

That and it turns out I don't like Treasures games that much, too much memorization, not enough mindless shooting. Lets hope Ketsui DS and the new Bangai-O are not as disappointing.

Flash For Free

time: 12 Apr 2008 09:21 pm
mood: anoyed
So against my better judgement I've started trying to learn flash without the aid of Adobe's tools. Only open source tools for me. I started by downloading and reading half of the flash spec, it's not terribly written but it sort of assumes some familiarity with flash concepts. ActionScript and the class library are not mentioned or explained; only the virtual machine bytecode that ActionScript compiles down to.

The tools available are sort of lackluster. There is a compiler (mtasc), but it's only designed to compile full blown classes which you are supposed to attach to other objects (sprites? timelines? i don't know what regular people call them), through Adobe's tool. People say the compiler is good (well far better than Adobe's). I think the people who make it are too arrogant, and it doesn't produce very good bytecode. Through great pains I was able to use the compiler to compile the bulk of my code, and then edit the bytecode (using flasm) to attach the guts of a function to a frame (this is how I know the output quality of mtasc isn't very good). I built the SWF with swfmill, which converts from the on the wire bit stream to XML and vice-versa. I'm not impressed with swfmill; it has zero error checking, happily dropping misspelled tags from of the output file, that and it uses XML which I despise. I generated the vector graphic object by hand with graph paper.

The vector format for flash is highly optimized and quite impressive. I think I need to build a SVG to flash vector converter, but that's a non-trivial amount of work. But then at least I could more easily make vector assets (hopefully with inkscape). I think I need something besides swfmill for output, the python binding to libming has promise; or I could roll my own. I need to write some tools for manipulating the output of mtasc, and possibly a simple pigeon hole optimizer.

MovieClip._rotation always returns a value between [-180, 180), no matter what you last wrote to it. May that be a lesson for you, a lesson that took me over an hour of debugging to discover.

Rolling It Up

time: 09 Apr 2008 11:23 pm
mood: tired
Continuing on my little side project, I added the spans which wrap across zero. Once this happens we start to get graphs that have as many active spans as we have routing channels, but are un-colorable (about 10% in the 3 channel case). We want spans to wrap across zero so that I can wrap this around a square without a seam. Perhaps a picture of a completed game board will make this clear(er).

Overly Complicated

time: 09 Apr 2008 09:28 am
mood: tired
I realized last night as I was trying to sleep that graph coloring is overkill for register allocation, if you don't need to spill. If you sort the active variable spans by their left edge, and then pick any free register from them in order you'll get a valid allocation. I hope that the coloring solutions show why they're worth the trouble in situations where you have to spill. This new method is O(n log n) instead of the O(n^2) of the restricted graph coloring algorithm used for register allocation. Since I pre-screen my boards to ensure that they never have more than n (=3) spans overlapping this new method would work.

The proof is straightforward; I'll outline it. When you go to allocate a register for a variable, you know that because the spans are allocated in order you can only interfere with other live variables at your left end. Because of this, if you were out of registers you must have n+1 active variables, thus requiring a spill.

I plan on making the board circular, i.e. a span from 1-12 in the diagram below could go from 1 to 0 to 15 to 14 to 13 to 12. In which case I do need something like the the register coloring algorithm; so my effort is not completely wasted.

Register Allocation

time: 08 Apr 2008 08:29 pm
mood: tired
I took two days off of work to relax from the deluge of home and work stress I've been under. I've been using this time, perhaps, unwisely.

When I was in high school a friend of mine came up with what we would call today, "a casual game". He played a few times using paper and pencil and thought it would be interesting and playable; I'm still unconvinced. The game board is randomly generated, consisting of pairs of points connected by lines. It is key that the player is able to easily tell which points are connected. Back in HS I took a shot at implementing the game, but I couldn't manage to create random boards.

I was trying to create boards by taking a pair of points, using a shortest path algorithm to connect them, and then trying with the next set of points. Repeating with random boards until you actually managed to route a board successfully. This has two problems; it took millions and millions of tries before you got a working board, and the resulting boards were not ascetically pleasing, or easy to understand.

I realized this morning in the shower that I could apply compiler theory to the problem. Every path has to go through 1 of n squares. So we think of those squares as 'n' registers, and the paths as the lifetimes of variables. I implemented Chaitin's global register allocation using graph coloring in Python. I was again impressed at the speed of development and succinctness of Python, my complete register allocator, printer, and random board generator is less than 250 lines and took 3 or 4 hours to develop. I'm still, however, dismayed by Python's execution speed (i can generate a small board in 2/100th of a second, which isn't too bad for a single game, but it's bad for testing a lot of boards). I need to adjust the heuristics of my allocator to produce more "visually" appealing boards.

I may yet implement the full game as a Java applet. But I don't look forward to porting my allocator to Java. I guess the cool kids use flash these days, ActionScript is probably worse than Java though. What does flash cost these days anyway?

Strategic Misrepresentation

time: 15 Feb 2008 05:15 pm
mood: tired
This week $EMPLOYER announced the product I was working on. Obviously my comments are restricted by NDA.

It's nice to be able to sort of talk about something I've worked on. And $DUDE here does a good job of selling it, don't look at the video with $LADY she does a terrible job. Amazingly the HDMI is really nice looking, it rivals most blu-ray disk players at 720p. I remember when they said they where adding HDMI to the chip, everyone I knew thought it was stupid, hell I still think it's stupid, but it's gotten us a lot of press.

Soup Or Bowl

time: 03 Feb 2008 12:59 pm
mood: tired
I take Pat's to win, but loose against the 12 point spread, and under the 55pt over/under.

I got invited to a SuperBowl party this year. Danielle didn't want to go, because she doesn't like it when people holler and yell at the television. Isn't yelling at the television is the whole point, but what do I know. It does remind me of this comic though.

ESPgaluda

time: 09 Jan 2008 12:03 am
mood: tired
For Christmas I "got" Cave's curtain fire shooter ESPgaluda. I say "got" because my wife encouraged me to buy it and it was the only thing I wanted. I told my wife she could wrap it if she wanted, she laughed, and didn't give me anything. Having played ESPgaluda for a couple of hours so far I've determined that it is probably Cave's easiest game, but that it's system is innovative without throwing away the genre, and very enjoyable.

I've leaned some things about ESPgaluda's system. First, the game has rank, that is the game gets harder the better you do. However, in ESPgaluda you get to max rank relativity quickly, and the only real way to play the game is at max rank (goodbye rank management). The game encourages even poor players to try and achieve max rank, which is unique. Higher rank, gives you more bullets, which translate into more points (getting you to the extends faster), and more green crystals. The green crystals can be used to slow down the enemy bullets. I really like the the game both rewards you for aggressive play and punishes you for aggressive play. Also, there's a hidden extend at the end of the 3rd stage right before the boss.

I've learned some things about my television. First it really doesn't like to be TATEd (turned on its side). It scans wobbly, which I assume is from poor shielding on the side from the earths magnetic field. It over scans off the top and right pretty bad, and it makes a high pitched wailing/whining noise. Hover it does make the TV 78% bigger, which improved my play quite a bit. I made it to the 4th stage boss 11.8 million (just shy of the 14 million point second extend).

In other news, [info]noisetube is back, firing on all most cylinders.

Solaris For Dummies

time: 07 Jan 2008 08:28 pm
mood: aggravated
[info]lifftchi and I run an AIM to LiveJournal bridge. Anything said to the AIM user 'tacosapien' gets automagically posted to the LiveJournal account [info]noisetube. There are 3 regular and another 5 infrequent users. I have to admit that I didn't really think it was a good idea at first, but it really goes back to the way LiveJournal used to be when it first started, observe. I hear there is a "new" journaling service that encourages you to post dozens of one liners a day; I forget the name of it though.

The ridiculous server this bot/bridge lives on went down for the count right before the new year. As is our fashion someone decided to replace the server with some eight processored Sun monstrosity that must have cost well into the five digits when it was new. So now I have to fight Solaris to get the bot running again. Have I ever mentioned I hate Solaris, nothing works right there; never has, probably never will.

After a good hour of flailing, I realize that Perl had been compiled with Sun's CC. This means I cannot install modules built with GCC, and thus cannot get the bot working again. I'm going to leave it to someone else to install a second copy of Perl to live along side the first one; because I, for one, am not taking the blame for hosing Perl on this "new, and improved" server. Then just as I'm giving up, I find out the thumbnails hadn't been backed up since July on the server. Fortunately, I have a backup of the thumbnails from mid-December, so I only had to regenerate a few by hand.

Filibuster

time: 18 Dec 2007 12:07 am
mood: amused
One of my coworkers was watching C-SPAN 2 on his laptop. When asked why he was doing such a thing, he responded, with excitement, that Sen. Chris Dodd was posturing to filibuster. We spent a minute wondering what he would read from, before deciding that a cookbook would provide us the most entertainment. I went back to work, but I suspect he was disappointed that the senate resolved to delay the vote.

HW Bugs

time: 13 Dec 2007 01:02 am
mood: tired
Recently there has been a big storm over the a TLB bug in AMDs new processors. At work we got to talking about what it must be like to make such a bug; a bug that punches a big hole in AMDs already sinking ship. I don't blame the guy for making whatever mistake he made, the timing and rarity of it made it almost impossible to find before shipping the processor. A couple of hardware guys seemed to think it would crush you career, like a black cloud you couldn't ever get out from under.

The problem with working on hardware is that it has a finish date, once it ships you cannot fix the bugs, you can only work around them. The beauty of working on hardware is that it has a finish date, software is never finished.

Boring nitty-gritty follows: the CPU has a table that lets the operating system move memory around out from under a program, this is how the OS implements virtual memory. This table is called the "page table" and it is made up of entries called "page table entries (PTEs)". Part of each PTE is 4 status bits (flags) that help the operating system know which pages are in use by the programs running on the computer. The PT (made up of PTEs) lives in RAM and is subject to caching like all other memory.

Now when the CPU needs to go turn on a flag for a PTE and that PTE just happens to be in L2 cache, there is a very tiny window where that L2 cache line can be evicted to L3, while the processor is changing the PTE. Now you've get the same PTE in both L2 and L3 but it's different in both places (this is a cache coherency bug). Sometime later when the processor moves that cache line from L2 to L3 or from L3 to L2, the CPU does arbitrarily bad things, ranging from the processor noticing (it throws a "machine check exception", which causes windows to BSOD) to filling some random piece of the cache with garbage.
20 earlier entries - viewing most recent entries