Tuesday, July 30, 2013

arcade-game-source-code project update

I finally have enough of the movement engine implemented, so that all the enemies are able to make it successfully to their positions in the home formation. This includes the side-to-side and the "pulsing" components of the motion. Please see video below. I haven't shared many technical details about the project to this point (after all, the source code is there for all to see!). One comment I want to make about the video is that even though the title bar window has Mame32 on it, the game logic is not in emulated Z80 - it is all C-code. However, the program is linked to a cut-down version of MAME which takes care of the "machine" stuff, i.e. graphics and sound rendering.


Thursday, February 14, 2013

Debugging apps that use OSS (Ubuntu)

There are still a few legacy applications out there that rely on OSS for the sound system, and on many distributions such as Ubuntu, these programs can be invoked through the "padsp" utility to provide the needed functionality. But what do you do if you want to debug the program in gdb?

Fortunately, the "padsp" functionality can be obtained without actually invoking padsp, by providing the application with one environment setting: "LD_PRELOAD=/usr/lib/i386-linux-gnu/pulseaudio/libpulsedsp.so".

The exact path of the library may be different on your system. This same environment value can specified in gdb with the "set env" directive. What is even more useful is that it can be specified in the command line to gdb, using the gdb argument "-ex", e.g. '-ex "set env BLAH=blurb"' etc.

This becomes very useful in an IDE such as Code:Blocks, where arbitrary command line options to gdb can be specified in the "Settings:Debugger" dialog. Simply paste the entire construct into the "Argument" text box (note the double quotes):

-ex "set env LD_PRELOAD=/usr/lib/i386-linux-gnu/pulseaudio/libpulsedsp.so"

That's all folks!

Friday, February 8, 2013

Galaga C-code Translation

Video of my Galaga C-code version running in a Code:Blocks debug session: