Sunday, December 28, 2008

Using configure scripts to cross compile for Wii

Here's something I found while trying to compile ODE SVN for the Wii. It seems that most configure scripts aren't written to support powerpc-gekko targets, but I found a post on the devkitPro forums with an easy fix. You just have to add four lines to config.sub:
@@ -230,6 +230,10 @@
basic_machine=m68k-atari
os=-mint
;;
+ -gekko)
+ basic_machine=powerpc-eabi
+ os=-elf
+ ;;
esac

# Decode aliases for certain CPU-COMPANY combinations.

Now you can invoke the configure script with --host=powerpc-gekko and do some cross-compiling, as long as you have devkitPro set up with the binaries on your path.

Tuesday, December 23, 2008

Adding Wii as a platform

I've had the Wii Homebrew Channel installed for a while (I think I had previously loaded beta 8), but I never got around to setting up DevKitPro and playing with the libraries. Following some of the examples, I figured out how to set up video, load files from SD card, and load PNG images to one of the GX texture formats. After some work I got my Texture and Model classes to compile with libogc GX calls in place of the usual OpenGL ones.

At the moment I have way too many files that include the GL and SDL headers directly. I was planning to write a material/shader system that would keep all of that stuff behind abstraction layers, and supporting the Wii makes this a new priority. I may end up able to run the same core engine code on Windows, Linux, OS X, GameCube, and Wii. No idea yet on performance, but we'll see once I get ODE through the cross-compiler.

This is the crate model (models/crate.model and textures/crate.png) loaded from an SD card and displayed on my Wii. The bottom-right stuff is my Linux desktop on picture-in-picture.

Tuesday, December 16, 2008

Arrgh standards


The SCSI standards are really hard to read. For my project at work I'm trying to implement a USB mass storage device, which seems to require SCSI Primary Commands (SPC), SCSI Block Commands (SBC), and M ... something Commands (MMC). That's at least three standards documents, and they're all written like the damn IEEE Software Requirements Specifications we had to write for the one software engineering class I took. (I changed majors immediately afterward.) They explain just about everything in scary detail, but they never seem to answer the questions that pop into my head while I'm reading it. The info's there, but you have to read the whole damn thing before it makes any sense at all.

Monday, December 15, 2008

Trimeshes, kind of

I'm trying to implement support for ODE's trimesh geom, but it's not working too well. The trimesh data is exported by a Python plugin for Blender, much like the one I've been using to export models. Everything compiles and runs with no warnings or asserts, but I get stuff like this:



I've also noticed that ray-trimesh collisions are very unpredictable, which is bad since I use rays in all of the tools to trace along the player's "shoot" vector. Guess it's time to go digging through the ODE mailing list.

Tuesday, December 9, 2008

Green hair

I dyed my hair green today. Of course by "I" I mean "some friends who have a clue what to do with hair". It's so bright! The dye used was Special Effects Iguana Green purchased from Amphigory. I'm definitely sending them a picture.



Edit: Here's a picture with the Hat of Justice.