Friday, April 8, 2011

How to use mod_wpad when compiling your code in other platforms

Following the entry on how to compile directly from the Wii's Homebrew Channel, I'd like to comment on a little "trick" that'll allow you to compile code that uses mod_wpad both on your computer and in your Wii.
The idea is to use preprocessor macros to "hide" the code when compiling in platforms other than the Wii.
Following with the meta.xml from that example, the new one would be as follows:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<app version="1">
    <name>Compile Fancy Game</name>
    <coder>Your name</coder>
    <version>Version number</version>
    <release_date>Release date</release_date>
    <short_description>A short description.</short_description>
    <long_description>A longer description for the entry that'll compile your code.</long_description>

That code would be pretty much like compiling your code in the PC like this:

bgdc boot.prg -o /apps/fancy_game/boot.dcb -D TARGET_WII

And in the code, where you do the mod_wpad import, you'd change it to:

import "mod_wpad"

And, a little bit below that:

#ifndef TARGET_WII
#define wpad_is_ready(a) 0
#define wpad_info(a, b) 0
#define wpad_info_nunchuk(a,b) 0
#define wpad_info_classic(a,b) 0
#define wpad_info_guitar(a,b) 0
#define wpad_info_bb(a,b) 0
#define wpad_rumble(a,b) 0

The first block will only import mod_wpad in case the compiler defines the TARGET_WII macro, and that'll only happen in the Wii, if you adapted the code above.
The second block will void the wpad_* functions. For your program's logic, it'd be as if no Wiimote was connected.

Hope this helps you with the Nintendomax Wii Dev Competition 2011, where you can win a Nintendo 3DS console, and much more".

Happy coding!

Tuesday, April 5, 2011

Streets of Rage Remake v5 final released, it's impressive!

Bomber Games have released the final version of their BennuGD game called Streets of Rage Remake v5 (remember the video I posted about it featuring accelerometer controls?). This release is the culmitaion of 8 years of hard work and features 103 stages, 19 playable characters, 64 enemies. The source code for the game is over 80000 lines of code and tries to faithfully recreate the experience of the original game.

It's really cool, although it seems to have some problem on the Wii. I'll work with BoMbErLiNk to try to make sure the game comes to our Wiis at some point.

Be sure to read their own presentation of the game in their blog.
I leave you with some media from the game:

BTW, in the meantime you can play it in your computer, download it from here.

Congrats, Bomber Games!