<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Wiibrew Forums - Coding</title>
<description>General Wii programming questions go here</description><link>http://forum.wiibrew.org/list.php?11</link><lastBuildDate>Sun, 19 May 2013 17:03:06 +0200</lastBuildDate>
<generator>Phorum 5.2.7</generator>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72952,72952#msg-72952</guid>
<title>How to do a split screen ? (2 replies)</title><link>http://forum.wiibrew.org/read.php?11,72952,72952#msg-72952</link><description><![CDATA[ Hello,<br /><br />I would like make another " Kurushi Wii " with two players and a split screen :-) I use GX/GRRLIB but I don't find how to initialize this split screen.<br />Somebody knows how to initialize a split screen ? or somebody has a link ? an example ?<br />Thanks :-)]]></description>
<dc:creator>tchagui</dc:creator>
<category>Coding</category><pubDate>Sun, 19 May 2013 16:14:44 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72867,72867#msg-72867</guid>
<title>multi-item text menu with navigation? (3 replies)</title><link>http://forum.wiibrew.org/read.php?11,72867,72867#msg-72867</link><description><![CDATA[ I am taking a open source app (SMGExtractor) and taking it further to dump files from other games.<br /><br />I am wanting to know how to handle a multi-item text menu and navigation to different files.<br /><br />Thanks,<br />timehacker11.]]></description>
<dc:creator>timehacker11</dc:creator>
<category>Coding</category><pubDate>Mon, 22 Apr 2013 04:48:37 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72762,72762#msg-72762</guid>
<title>Wii Remote Plus Bluetooth Communication (2 replies)</title><link>http://forum.wiibrew.org/read.php?11,72762,72762#msg-72762</link><description><![CDATA[ Hi to all!<br /><br />I bought a Wii Remote Plus (RVL-CNT-01-TR) for using to comunicate with my computer. I was able to pair it (programmatically in Java and using bluetooth tools from MacOs), but all the other successive communication fails. I am not sure if all the software I used to test it was written using some protocol supported only by the previous version of the wiimote. So far, the best place I got information about the protocol of the wiimote was on the wiibrew. I am using MacOS and I am trying to do the communication using Java bluetooth stack. My main objective is to respond on the button events as well as the accelerometer, but I even could run any simple test, such as controlling the LEDs for example.<br /><br />So, given my scenario, let's ask the questions:<br />1 - What is the best piece of software for me to look at that communicates well with this version of Wiimote (RVL-CNT-01-TR)? No problem at all with Linux only implementations but MacOS or Java is preferred.<br />2 - Is there any documentation describing the protocol and messages in detail?<br />3 - If this isn't the right place for asking this kind of question, I appreciate to be pointed to the right place :)<br /><br />Thanks in advance for everyone!<br /><br />Kind regards,<br /><br /><br />Teston]]></description>
<dc:creator>feu.teston</dc:creator>
<category>Coding</category><pubDate>Mon, 01 Apr 2013 20:44:40 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72724,72724#msg-72724</guid>
<title>Writing to the XFB -- when is it doable properly? (5 replies)</title><link>http://forum.wiibrew.org/read.php?11,72724,72724#msg-72724</link><description><![CDATA[ This is about our SMG2.5 project again. We want to attach a debug screen to the game so we can diagnose crashes we encounter while designing levels.<br /><br />The crash handler is hooked to the game's internal panic function (a function that enters an endless loop) and a few useful PPC exception vectors (ISI, DSI and two others).<br /><br />When entered, the crash handler turns audio off (because in most crashes, the game is still playing sound, which ends up rather ear-raping). It then retrieves the address of the current XFB via the VI regs, and writes there to display the crash report.<br /><br /><br />I am currently testing the display aspect inside a Wii homebrew. It currently fills the XFB with blue, then writes some text. Getting the XFB address works fine, however writing to it is more problematic.<br /><br />I have interrupts disabled during the whole process to prevent them from messing with stuff badly.<br /><br />Of course, filling the XFB works fine under Dolphin because it's inaccurate. However, on a Wii, the first half of the screen is filled properly, and the bottom half is almost fully black, with a few blue lines/blocks here and there.<br /><br />I figured that this happens because the XFB can't be written to while the VI is reading from it. However, I haven't found a way to either keep the VI from accessing the XFB at all, or detect the start of the VBlank without interrupts.<br /><br />Bit0 of the VI control register (0xCC002002) supposedly controls 'video timing generation and data request'. However changing it has no effect. Setting the VI timing register (0xCC002000) has no effect either.<br /><br />The Y position register also seems to work weirdly or not work at all.<br /><br /><br />Basically, is there a way to keep the VI from accessing the XFB? 'Forcing blank' like it's called on some consoles?]]></description>
<dc:creator>Mega_Mario</dc:creator>
<category>Coding</category><pubDate>Mon, 25 Mar 2013 20:35:12 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72632,72632#msg-72632</guid>
<title>Trying to port tempest but i might need a little help (8 replies)</title><link>http://forum.wiibrew.org/read.php?11,72632,72632#msg-72632</link><description><![CDATA[ <a rel="nofollow" href="http://code.google.com/p/port-of-tempest/downloads/list">tempest files</a><br />I am trying to port a blitzmax rendition of tempest but i might be barking up the wrong tree. If you would like to help you can post here and I will load what i have so far on code google and post a link soon. Thanks Cliff44.<br />I just uploaded the source zip named T3MP3ST.zip.]]></description>
<dc:creator>Cliff44</dc:creator>
<category>Coding</category><pubDate>Sat, 16 Mar 2013 00:50:20 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72603,72603#msg-72603</guid>
<title>Wii balance board with android ? (no replies)</title><link>http://forum.wiibrew.org/read.php?11,72603,72603#msg-72603</link><description><![CDATA[ How to connect android with wii balance board ?<br /><br />Is there any library that support it on android ?<br /><br />Please guide me . . .]]></description>
<dc:creator>jirat12279</dc:creator>
<category>Coding</category><pubDate>Wed, 27 Feb 2013 03:27:30 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72469,72469#msg-72469</guid>
<title>DI issues -- seems to just not work (26 replies)</title><link>http://forum.wiibrew.org/read.php?11,72469,72469#msg-72469</link><description><![CDATA[ So, first, a bit of background. I'm into SMG hacking (I have my own board about it but that's not my point here), and getting into a project called SMG2.5. We're aiming at removing the requirement of obtaining an ISO to get into SMG hacking, for obvious legality reasons. For that, I'm trying to code a little Wii program that will dump all the needed files from a SMG1 or SMG2 disc.<br /><br />I was looking at the provided APIs for DVD access, and I must say the documentation is poor. But I found a nice little pearl into ftpii, called libfst, that handles reading Wii discs for me.<br /><br />Problem is, I can't even get the DI interface to work.<br /><br />My code is available here: [<a rel="nofollow" href="https://github.com/Mega-Mario/SMGExtractor/blob/master/source/main.c">github.com</a>]<br /><br />The Wii I'm running this on, runs off system menu 4.3E with no modifications other than a standard HBC install done via Letterbomb.<br /><br />My version of devkitPro is recent enough I think. installed.ini says my libogc version is 1.8.11.1, and devkitPPC version is 26.<br /><br />Now, about what happens when running that code:<br />* DI_Init() returns zero, which would indicate a success.<br />* DI_GetError() however, always returns -6 (ENXIO). As if di_fd wasn't initialized properly. According to the code, there is a possibility that DI_Init() returns zero without initializing it, if AHBPROT isn't 0xFFFFFFFF. I don't know how AHBPROT works, though. All I know is that it has to do with restricting PPC access to certain I/O ports.<br />* DI_GetStatus() always returns 0xA, which causes my code to enter an endless loop. The drive also never spins up or attempts to do anything.<br /><br />I have searched a lot but failed to find anything helpful. All the code I've seen either does the same thing as mine, or goes through weirdass libraries and abstraction layers I'm too lazy to try to reverse-engineer.<br /><br />So I figured I'd come here and ask. Did I do something wrong in my code, or do I just need to install something particular on my Wii? I found mentions of DVDX but according to the wiki it is outdated and HBC handles its functionality.]]></description>
<dc:creator>Mega_Mario</dc:creator>
<category>Coding</category><pubDate>Sun, 10 Feb 2013 23:59:01 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72401,72401#msg-72401</guid>
<title>Tutorial: Shadow mapping and reflections in TEV (no replies)</title><link>http://forum.wiibrew.org/read.php?11,72401,72401#msg-72401</link><description><![CDATA[ I was playing around with Graficos 3D para Wii (PDF + Ejemplos) over the weekend. It works well on its own but is a bit tricky to hack into grrlib. So if anybody has not seen this code before;<br /><br />Examples and documentation on how to do shadows and reflections in TEV. The documentation and comments are in Spanish but can be easily translated. The code does work and is complete. For advanced GX programmers only.<br /><br />[<a rel="nofollow" href="http://www.elotrolado.net/hilo_wii-graficos-3d-para-wii-pdf-ejemplos_1049703">www.elotrolado.net</a>]]]></description>
<dc:creator>owen</dc:creator>
<category>Coding</category><pubDate>Fri, 25 Jan 2013 14:23:59 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72293,72293#msg-72293</guid>
<title>take screenshot libwiigui (1 reply)</title><link>http://forum.wiibrew.org/read.php?11,72293,72293#msg-72293</link><description><![CDATA[ Hello,<br />i'm trying to figure out how to take screenshots from my app, based on libwiigui.<br />that's what i tried so far:<br /><br />in video.cpp:<br /><pre class="bbcode">
static u8* videoScreen = NULL;

void TakeScreenshot()
{
    int size = VIDEO_GetFrameBufferSize(vmode);
    videoScreen = (u8*)memalign(32,size);
    if (videoScreen)
        memcpy(videoScreen,xfb[whichfb],VIDEO_GetFrameBufferSize(vmode));
}</pre>
in menu.cpp i call TakeScreenshot() and try to display the image:<br /><pre class="bbcode">
    TakeScreenshot();
    ...
    GuiImage screen(videoScreen,640,480);
    HaltGui();
    mainWindow-&gt;Append(&screen);
    ResumeGui();</pre><br />but all i get is a stripe of random pixels at the center of the screen<br />looking into wiimc/wiixplorer sources didn't help either<br /><br />thanks in advance]]></description>
<dc:creator>gave92</dc:creator>
<category>Coding</category><pubDate>Sun, 13 Jan 2013 22:16:38 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,72251,72251#msg-72251</guid>
<title>check if the dol/elf is booted form sd or hdd... (22 replies)</title><link>http://forum.wiibrew.org/read.php?11,72251,72251#msg-72251</link><description><![CDATA[ has started to code a way to load config file to wiicraft. and i need help. i will check if the file is booted from SD/SDHC/USB/Internet(send over the file) is this possible?]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Wed, 09 Jan 2013 10:41:30 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71974,71974#msg-71974</guid>
<title>change looking derection using wii motes ir in GRRlib? (12 replies)</title><link>http://forum.wiibrew.org/read.php?11,71974,71974#msg-71974</link><description><![CDATA[ is there somewan thats can help me.. i want too look around using wiimote and point it at the screen. and so i will look to left when i hold the wimote to left. anyway to do this?]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Tue, 04 Dec 2012 15:47:52 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71892,71892#msg-71892</guid>
<title>Fps from 60 to 12?!? (22 replies)</title><link>http://forum.wiibrew.org/read.php?11,71892,71892#msg-71892</link><description><![CDATA[ i have made a simpel block placment game and wen i place one block will it drop to 12 fps from 60! -_- easy way to fix this?<br /><pre class="bbcode">//Standard libray:
#include <string.h>
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <malloc.h>
#include <asndlib.h>
#include <mp3player.h>
#include <time.h>
#include <gccore.h>
#include <wiiuse/wpad.h>
#include <ogc/lwp.h>
#include <ogc/lwp_watchdog.h>
#include <ogcsys.h>
#include <wiiuse/wpad.h>
#include <network.h>
#include <errno.h>
//Home menu:
//Coming Soon
//GRRLIB:
#include <grrlib.h>

//Classes:
#include "Blocks.h"
#include "oggplayer.h"
#include "drawcube.h"
//#include "NETWORK_SERVER.H"
//#include "minecraft.h"

//Fonts:
#include "minecraftFont_ttf.h"
#include "gfx/BMfont5.h"

//Images:
#include "terrain_png.h"
#include "gfx/mojang.h"
#include "gfx/pointer1.h"
#include "gfx/pointer2.h"
//#include "gfx/pointer3.h"
//#include "gfx/pointer4.h"
#include "gfx/grrlib_logo.h"
#include "gfx/panorama4.h"

//OGG:
#include "main_ogg.h"

//Server:
/*#include"_FindFirst.h"
#include"AutopatcherPatchContext.h"
#include"AutopatcherRepositoryInterface.h"
#include"BitStream.h"
#include"CCRakNetSlidingWindow.h"
#include"CCRakNetUDT.h"
#include"CheckSum.h"
#include"CloudClient.h"
#include"CloudCommon.h"
#include"CloudServer.h"
#include"CommandParserInterface.h"
#include"ConnectionGraph2.h"
#include"ConsoleServer.h"
#include"DataCompressor.h"
#include"RakPeer.h"
#include"RakPeerInterface.h"
#include"SimpleTCPServer.h"
#include"NetworkIDManager.h"
#include<stdio.h>
#include<string.h>
#include"RakPeerInterface.h"
#include"MessageIdentifiers.h"
#include"RakNetTime.h"
#include"RakNetTypes.h"
#include"SendToThread.h"
#include"BitStream.h"
#include"RakNetDefines.h"
#include"NetworkIDManager.h"
#include"RakNetTypes.h"*/

//RGBA Colors
#define BLACK  0x000000FF
#define MAROON  0x800000FF
#define GREEN  0x008000FF
#define OLIVE  0x808000FF
#define NAVY    0x000080FF
#define PURPLE  0x800080FF
#define TEAL    0x008080FF
#define GRAY    0x808080FF
#define SILVER  0xC0C0C0FF
#define RED    0xFF0000FF
#define LIME    0x00FF00FF
#define YELLOW  0xFFFF00FF
#define BLUE    0x0000FFFF
#define FUCHSIA 0xFF00FFFF
#define AQUA    0x00FFFFFF
#define WHITE  0xFFFFFFFF
//Wiilight
#define HW_GPIO            0xCD0000C0;

#define DISC_SLOT_LED      0x20
//DEBUG:
#define DEBUG                0
//Server:
#define MAX_CLIENTS 6
#define SERVER_PORT 19132

using namespace std;
//using namespace minecraft;

    //Initialize the IR
    ir_t ir1;
    ir_t ir2;
    //ir_t ir3;
    //ir_t ir4;

    //--------------------------------------------------
    //Wiilight
    //--------------------------------------------------
    lwp_t light_thread = 0;

    void *light_loop (void *arg);

    vu32 *light_reg = (u32*) HW_GPIO;

    bool light_on = false;

    u8 light_level = 0;

    struct timespec light_timeon = { 0 };

    struct timespec light_timeoff = { 0 };


    static u8 CalculateFrameRate();

    //----------------------------------------------------------
    //Function's:
    //----------------------------------------------------------

    void WIILIGHT_TurnOn()
    {

    *(u32*)0xCD0000C0 |= 0x20;

}
    void WIILIGHT_TurnOff()
    {
    *(u32*)0xCD0000C0 &= ~0x20;
}
void WIILIGHT_SetLevel(int level)
    {

    light_level = MIN(MAX(level, 0), 100);



    // Calculate the new on/off times for this light intensity

    u32 level_on;

    u32 level_off;

    level_on = (light_level * 2.55) * 40000;

    level_off = 10200000 - level_on;

    light_timeon.tv_nsec = level_on;

    light_timeoff.tv_nsec = level_off;

}



    void init(){
    //Disk light turn on and init
    //WIILIGHT_Init();
    WIILIGHT_SetLevel(255);
    WIILIGHT_TurnOn();
    // Initialise the Graphics & Video subsystem
    GRRLIB_Init();
    //VIDEO_Init();
    // button initialization
    WPAD_Init();
    WPAD_SetDataFormat(WPAD_CHAN_ALL, WPAD_FMT_BTNS_ACC_IR);
    // Initialse the sound system
    ASND_Init();
    //MP3Player_Init(); /*filfat: We don't need this for the moment...*/

    //Disk light turn off
    WIILIGHT_TurnOff();
}

void cleanup(){
    //ToDo
    GRRLIB_Exit();
    exit(EXIT_SUCCESS);
}

void network();

int main()  {

    init();

    //-------------------------------------------------
    //RAKNET
    //-------------------------------------------------
    /*
    RakNet::RakPeerInterface *peer = RakNet::RakPeerInterface::GetInstance();

    bool isServer;
    RakNet::Packet *packet;
    RakNet::BitStream bsOut;

    RakNet::SocketDescriptor sd(SERVER_PORT,0);
    peer-&gt;Startup(MAX_CLIENTS, &sd, 1);
    isServer = 0;
    */
    //-------------------------------------------------
    //RAKNET
    //-------------------------------------------------
    u8 FPS = 0;
    //int version = 0.3;
    int blockInInventory = 1;
    //int xb = 13;
    //int yb = 12;
    int lookingAttX = 0;
    int lookingAttZ = 0;
    int lookingAttY = 0;
    const int sizex = 32;
    const int sizey = 32;
    const int sizez = 32;
    //int saveX;
    //int saveY;
    //int saveZ;
    bool save_used = false;
    int aUsed = 0;

    //Gets the IR positions
    WPAD_IR(WPAD_CHAN_1, &ir1);
    //WPAD_IR(WPAD_CHAN_2, &ir2);
    //WPAD_IR(WPAD_CHAN_3, &ir3);
    //WPAD_IR(WPAD_CHAN_4, &ir4);

    GRRLIB_ttfFont *minecraftFont = GRRLIB_LoadTTF(minecraftFont_ttf, minecraftFont_ttf_size);
    GRRLIB_texImg *tex_pointer1 = GRRLIB_LoadTexture(pointer1);
    GRRLIB_texImg *tex_pointer2 = GRRLIB_LoadTexture(pointer2);
    GRRLIB_texImg *terrain = GRRLIB_LoadTexture(terrain_png);
    //GRRLIB_texImg *panorama4 = GRRLIB_LoadTexture(panorama4);
    GRRLIB_texImg *tex_BMfont5 = GRRLIB_LoadTexture(BMfont5);
    GRRLIB_InitTileSet(tex_BMfont5, 8, 16, 0);

    //---<Blocks>-----------------------------------------------
    block Stone("Stone", 31, 15, 1);
    block Grass("Grass", 63, 15, 2);
    block Dirt("Dirt", 47/*filfat: can do wrong with the pixels.. please fix this joshua*/, 15, 3);
    block CobbleStone("CobbleStone", 15, 31, 4);
    //---<Blocks>-----------------------------------------------


    //---<Map>--------------------------------------------------
    u8 world[sizex][sizey][sizez];
    //---<Map>--------------------------------------------------

    GRRLIB_Settings.antialias = false;

    //PlayOgg(main_ogg, main_ogg_size, 0, OGG_ONE_TIME);
    GRRLIB_SetBackgroundColour(0x00, 0x00, 0x00, 0xFF);
    GRRLIB_Camera3dSettings(0.0f,0.0f,13.0f, 0,1,0, 0,0,0);

    drawcube cube(lookingAttX, lookingAttZ, lookingAttY);

    //Loop forever
    while (1){

    GRRLIB_2dMode();
    WPAD_SetVRes(0, 640, 480);
    WPAD_ScanPads();

    WPAD_IR(0, &ir1);
    WPAD_IR(0, &ir2);
    //WPAD_IR(0, &ir3);
    //WPAD_IR(0, &ir4);

    GRRLIB_DrawImg(ir1.sx - 48, ir1.sy - 45, tex_pointer1, 0, 1, 1, 0xffffffff);
    //GRRLIB_DrawImg(ir2.sx - 48, ir2.sy - 45, tex_pointer2, 0, 1, 1, 0xffffffAA);
    //GRRLIB_DrawImg(ir3.sx - 48, ir3.sy - 45, tex_pointer3, 0, 1, 1, 0xffffffAA);
    //GRRLIB_DrawImg(ir4.sx - 48, ir4.sy - 45, tex_pointer4, 0, 1, 1, 0xffffffAA);
    GRRLIB_Render();

    cube.drawcube_normal(lookingAttX, lookingAttZ, lookingAttY);

    if(save_used){
        for(int x = 0;x &lt;= sizex; x++){
            for(int y = 0;y &lt;= sizey; y++){
                for(int z = 0;z &lt;= sizez; z++){
                    if(world[x][y][z] == true){
                        do{
                        cube.drawcube_save(x,z,y);
                        }while(!1);
                    }
                }
            }
        }
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_HOME) {
        cleanup();
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_B) {
        world[lookingAttX][lookingAttY][lookingAttZ] = 0;
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_A) {
   
        world[lookingAttX][lookingAttY][lookingAttZ] = blockInInventory;
   
        save_used = true;
   
        /*for(int x = 0;x &lt;= sizex; x++){
            for(int y = 0;y &lt;= sizey; y++){
                for(int z = 0;z &lt;= sizez; z++){
                    if(world[lookingAttX][lookingAttY][lookingAttZ]){
                            saveX = lookingAttX;
                            saveY = lookingAttY;
                            saveZ = lookingAttZ;
                            save_used = true;
                   
                    }
                }
            }
        }*/
        aUsed++;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_MINUS) {
   
        lookingAttZ--;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_PLUS) {
   
        lookingAttZ++;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_UP) {
   
        lookingAttY++;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_DOWN) {
   
        lookingAttY--;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_RIGHT) {
   
        lookingAttX++;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_LEFT) {
   
        lookingAttX--;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_1) {
   
        blockInInventory++;
   
    }

    if (WPAD_ButtonsDown(0) & WPAD_BUTTON_2) {
   
        if(blockInInventory){
            blockInInventory--;
        }
   
    }

    GRRLIB_Printf(5, 18, tex_BMfont5, WHITE, 1, "Minecraft Wii Edition 0.3");
    GRRLIB_Printf(5, 39, tex_BMfont5, WHITE, 1, "Current FPS: %d", FPS);
    GRRLIB_Printf(5, 57, tex_BMfont5, WHITE, 1, "X: %d", static_cast<int>(lookingAttX));
    GRRLIB_Printf(5, 76, tex_BMfont5, WHITE, 1, "Y: %d", static_cast<int>(lookingAttY));
    GRRLIB_Printf(5, 95, tex_BMfont5, WHITE, 1, "Z: %d", static_cast<int>(lookingAttZ));

    //GRRLIB_Render();
    FPS = CalculateFrameRate();


    }

    GRRLIB_FreeTexture(terrain);
    GRRLIB_FreeTexture(tex_pointer1);
    GRRLIB_FreeTexture(tex_pointer2);
    //GRRLIB_FreeTexture(panorama4);
    GRRLIB_FreeTexture(tex_BMfont5);
    GRRLIB_FreeTTF(minecraftFont);

    cleanup();

    exit(0);
}

static u8 CalculateFrameRate() {
    static u8 frameCount = 0;
    static u32 lastTime;
    static u8 FPS = 0;
    u32 currentTime = ticks_to_millisecs(gettime());

    frameCount++;
    if(currentTime - lastTime &gt; 1000) {
        lastTime = currentTime;
        FPS = frameCount;
        frameCount = 0;
    }
    return FPS;
}

void network(){
    #ifdef DEBUG
    //GRRLIB_Printf(200, 27, tex_BMfont5, WHITE, 1, "Current ip:");
    #endif
}</pre>]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Mon, 26 Nov 2012 21:15:01 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71891,71891#msg-71891</guid>
<title>u8! (no replies)</title><link>http://forum.wiibrew.org/read.php?11,71891,71891#msg-71891</link><description><![CDATA[ can i remove that an u8 is unisigned char? i need it when i render the world in Minecraft Wii Edition.]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Sun, 25 Nov 2012 14:19:29 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71862,71862#msg-71862</guid>
<title>Read wii disc partition on pc (1 reply)</title><link>http://forum.wiibrew.org/read.php?11,71862,71862#msg-71862</link><description><![CDATA[ I'm trying to write code to read wii isos (I know wit and other tools can do it, but want to roll my own), have made some progress but also have questions. From <a rel="nofollow" href="http://wiibrew.org/wiki/Wii_Disc">here</a> I've been able to get and decrypt the partitions. And from <a rel="nofollow" href="http://blog.delroth.net/2011/06/reading-wii-discs-with-python/">here</a> (search for 'Parsing the filesystem') I'm starting to get a handle on reading the files from the FST.<br /><br />Encrypted partition data is arranged in groups, containing 8 sub-groups, with each of those containing 8 clusters (I say this to nail down the terminology). I can decrypt then re-encrypt (as in fully recreate the encrypted group using JUST the title key and decrypted data, cluster headers removed). How does this work for the end of the partition, where there may only be a partial group (ie a group containing less than 64 clusters)?<br /><br />The 2nd link shows that the fst metadata table starts at 0x424 (edit: I mean it's a pointer to the table), with the variable length string table directly following. Other than these and the files described in the fst, what and where are other important things? From 0x0 to 0x423 inclusive, what is there and can I read any of it? The 2nd link indicates there is an apploader and a dol that's spread about the partition. It's important to get everything actually used, as I want to scrub all the padding out.<br /><br />Are update partitions (and any other partition types) different to game partitions with regard to the above question? Do they have to be handled differently?<br /><br />edit: The pointer at 0x420 seems to point to the start of the dol file, which I'm trying to read with <a rel="nofollow" href="http://wiibrew.org/wiki/DOL">this</a>.<br /><br />Is the dol file and fst contained within apploader, whatever that may be? Am I reading part of apploader when I read the fst or dol file? There seems to be a header at 0x0 in the partition, it must be called something?<br /><br />edit: <a rel="nofollow" href="https://code.google.com/p/dolphin-emu/source/browse/Source/Core/DiscIO/Src/DiscScrubber.cpp?spec=svn54fc4029dd3dad0744fecc192cbee9d26a2601e6&name=master&r=54fc4029dd3dad0744fecc192cbee9d26a2601e6">this</a> helps a little regarding apploader. Anything I should know that's not there?]]></description>
<dc:creator>siplem</dc:creator>
<category>Coding</category><pubDate>Sun, 28 Apr 2013 21:40:32 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71723,71723#msg-71723</guid>
<title>How to &quot;install&quot; Wire3D? (2 replies)</title><link>http://forum.wiibrew.org/read.php?11,71723,71723#msg-71723</link><description><![CDATA[ i wonter how i install wire3d...]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Fri, 02 Nov 2012 23:35:21 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71709,71709#msg-71709</guid>
<title>how do you read a few pixels from an image.. (12 replies)</title><link>http://forum.wiibrew.org/read.php?11,71709,71709#msg-71709</link><description><![CDATA[ how to read one singel block in this image?<br /><img src="http://i.imgur.com/K7spO.png" class="bbcode" alt="http://i.imgur.com/K7spO.png" />]]></description>
<dc:creator>filfat</dc:creator>
<category>Coding</category><pubDate>Fri, 07 Dec 2012 22:55:14 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71619,71619#msg-71619</guid>
<title>Adding Achievements (10 replies)</title><link>http://forum.wiibrew.org/read.php?11,71619,71619#msg-71619</link><description><![CDATA[ So I recently published my asteroids clone and I am thinking of adding achievements for ex. destroy 6 asteroids without getting hit or get a 200 asteroid combo with the default weapon in 2 minutes without getting hit. Something like what the MW3/COD games do in multiplayer. Is there a easy way to do this? is it worth doing?<br /><br />I've been researching online and all roads point to [<a rel="nofollow" href="http://en.wikipedia.org/wiki/Event_calculus">en.wikipedia.org</a>]]]></description>
<dc:creator>owen</dc:creator>
<category>Coding</category><pubDate>Sat, 03 Nov 2012 13:15:21 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71470,71470#msg-71470</guid>
<title>wiispritelib can only draw one image to the screen at a time!? (3 replies)</title><link>http://forum.wiibrew.org/read.php?11,71470,71470#msg-71470</link><description><![CDATA[ So I'm using WiiSpriteLib on a project (for the first time, though I have been coding for about 7-8 years now, and have previously coded on the Wii via homebrew in SDL) and it only seems to draw one sprite on the screen at a time. Anyone know if I'm doing anything wrong? This is my drawing code:<br /><br /><pre class="bbcode">
int drawScene(LayerManager *manager){
	for(int i = 0; i &lt; MAX_PLAYERS; i++){	
		player[i].spr.SetImage(&image[i]);
		player[i].spr.SetPosition(player[i].x, player[i].y);
		manager-&gt;Append(&player[i].spr);
	}
	 
	// Draw everything what's in the manager.
	manager-&gt;Draw(0, 0); 
	gwd.Flush();
	
	return 1;
}</pre>]]></description>
<dc:creator>Cypri</dc:creator>
<category>Coding</category><pubDate>Thu, 20 Sep 2012 23:31:16 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71443,71443#msg-71443</guid>
<title>Playing mod files (no replies)</title><link>http://forum.wiibrew.org/read.php?11,71443,71443#msg-71443</link><description><![CDATA[ I would like to add some music and possibly sound effects to a game I'm working on, but at the moment I can't seem to get any MOD files to play. I'm currently running the latest libraries from Linux. I've gotten the example program over on <a rel="nofollow" href="http://www.codemii.com/2009/04/21/tutorial-12-using-mod-music-sound/">codemii</a> to compile, but I still can't hear any sound.<br /><br />Are there any alternate methods I could be using? Perhaps just to play MP3 files? Well...I'm sure there are alternate methods, but is anyone aware of a tutorial that documents such a method?<br /><br />I heard this could possibly be done with SDL Wii?]]></description>
<dc:creator>childan</dc:creator>
<category>Coding</category><pubDate>Sat, 15 Sep 2012 00:15:31 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71388,71388#msg-71388</guid>
<title>Shotter: How to calcuate coordinates and vector of the pad pointer (8 replies)</title><link>http://forum.wiibrew.org/read.php?11,71388,71388#msg-71388</link><description><![CDATA[ Dear friends,<br /><br />I want to develop a method to calculate position and vector of the pad pointer in a 3D world.<br />For this 3D world I am using the GX library.<br />In this 3D world the user is able to move in any direction (translation and rotation).<br />I already know the position and direction of user. But I do not know how to get the pad pointer position.<br /><br /><br />What I want to do is a shooter. This is the reason why I need to know the vector of pad pointer.<br />Being in this way, I will know wether I aim my enemy or not.<br /><br />Thank you very much for your help.]]></description>
<dc:creator>Paipum</dc:creator>
<category>Coding</category><pubDate>Tue, 11 Sep 2012 09:30:47 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71156,71156#msg-71156</guid>
<title>Porting SDL software to the Wii when you have the source code (3 replies)</title><link>http://forum.wiibrew.org/read.php?11,71156,71156#msg-71156</link><description><![CDATA[ I am learning how to program, and I thought for my first project would be a simple port of Exult (Ultima VII engine) to the Wii. I have the source code, and I have the SDL libraries from WiiBrew...but I am lost. All I see is a mess of folders and files.<br /><br />Which is the file to edit to deal with controls<br />How do I compile the files to work on a wii?<br />Can I set up controls to use both the Wiimote and the Classic Controller at the same time, like use the Wiimote as a mouse and the controller as something as strange as a controller?]]></description>
<dc:creator>BlackKnight</dc:creator>
<category>Coding</category><pubDate>Thu, 23 Aug 2012 20:16:18 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71055,71055#msg-71055</guid>
<title>Are SD card and USB HDD interchangeable in HB development (8 replies)</title><link>http://forum.wiibrew.org/read.php?11,71055,71055#msg-71055</link><description><![CDATA[ Hi,<br /><br />Currently I'm using a SD card to store a Doom 3 PK4 file. However, it takes minutes to just parse the files in the PK4. I know my SDcards only read/write about 100-150 KBytes per second, so I'm wondering if I can easily continue my development using a USB HDD instead of the SD card. My guess is that it will load files much faster then when using SDcard<br /><br />I currently upload the Doom 3 executable (far from finished ofcourse) to my Wii using Wiiload Java client and the app then opens files from SDcard.<br /><br />Basically I have the following questions:<br /><br />* Does lib-ogc support USB HDDs? If so, what version do I need?<br />* Do I have to change my (hardcoded) file locations? For example, do I need to use a different drive name (i.e. instead of /apps/DoomGX /USB0/apps/DoomGX)<br /><br />Does anybody use a HDD to develop any apps?<br /><br />Thanks!<br /><br />Danny]]></description>
<dc:creator>DRS_</dc:creator>
<category>Coding</category><pubDate>Sat, 16 Feb 2013 10:04:40 +0100</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,71016,71016#msg-71016</guid>
<title>GenesisPlus GX - UI and Ergonomic Modification (5 replies)</title><link>http://forum.wiibrew.org/read.php?11,71016,71016#msg-71016</link><description><![CDATA[ In general I am trying to modify the UI from genesis plus gx in order to have the same style as fceu gx, snes9x gx, vba gx.<br /><br /><img src="http://desmond.imageshack.us/Himg402/scaled.php?server=402&filename=iysfimmx.jpg&res=landing" class="bbcode" alt="http://desmond.imageshack.us/Himg402/scaled.php?server=402&filename=iysfimmx.jpg&res=landing" /><br />[<a rel="nofollow" href="http://s1.directupload.net/file/d/2966/iysfimmx_jpg.htm">s1.directupload.net</a>]<br /><br />You can see already the problem in the picture.<br />I dunno how to change the order of the layers.<br />The selection bar should be under the arrow up and should be under the border of the selection list.<br /><br />Another topic is the filelist itself.<br />I would like to add a list item at the top of the filelist which says "previous folder".<br />So I don't need the "B button" anymore, to return to the parent folder.<br /><br />Last but not least I would like to know if I can add buttons into this file selection view.<br />I would like to shift between the buttons and the file list with the B button.<br /><br />That's the main problems.<br />My source is the based on eke-eke 706 revision (filesel.c)<br />(http://code.google.com/p/genplus-gx/source/browse/trunk)<br />Maybe somebody can help (or has an idea to solve the issues)<br /><br /><pre class="bbcode">
static void selector_cb(void)
{
  int i;
  char text[MAXPATHLEN];
  int yoffset = 102; //Starlord: 108

  /* Initialize directory icon */
  gui_image dir_icon;
  dir_icon.texture = gxTextureOpenPNG(Browser_dir_png,0);
  dir_icon.w = dir_icon.texture-&gt;width;
  dir_icon.h = dir_icon.texture-&gt;height;
  dir_icon.x = 26;
  dir_icon.y = (26 - dir_icon.h)/2;


  /* Initialize selection bar */
  gui_image bar_over;
  bar_over.texture = gxTextureOpenPNG(Overlay_bar_png,0);
  bar_over.w = bar_over.texture-&gt;width + 1; //Starlord: extend the bar +1
  bar_over.h = bar_over.texture-&gt;height;
  bar_over.x = 10; //Starlord: 16
  bar_over.y = (26 - bar_over.h)/2;

  /* Draw browser array */
  // Starlord: doesn't fit to new UI
 
  /*
  gxDrawRectangle(15, 108, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 134, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 160, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 186, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 212, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 238, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 264, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 290, 358, 26, 127, (GXColor)BG_COLOR_2);
  gxDrawRectangle(15, 316, 358, 26, 127, (GXColor)BG_COLOR_1);
  gxDrawRectangle(15, 342, 358, 26, 127, (GXColor)BG_COLOR_2);
  */

  /* Draw Files list */
  
  for (i = offset; (i &lt; (offset + 10)) && (i &lt; maxfiles); i++)
  {
    if (i == selection)
    {
      /* selection bar */
      gxDrawTexture(bar_over.texture,bar_over.x,yoffset+bar_over.y,bar_over.w,bar_over.h,255);
	 
      /* scrolling text */
      if ((string_offset/SCROLL_SPEED) &gt;= strlen(filelist[i].filename))
      {
        string_offset = 0;
      }

      if (string_offset)
      {
        sprintf(text,"%s ",filelist[i].filename+string_offset/SCROLL_SPEED);
        strncat(text, filelist[i].filename, string_offset/SCROLL_SPEED);
      }
      else
      {
        strcpy(text, filelist[i].filename);
      }

      /* print text */
      if (filelist[i].flags)
      {
        /* directory icon */
        gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255);
        //if (FONT_write(text,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE))
        if (FONT_write(text,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)BLACK))
        {
          /* text scrolling */
          string_offset ++;
        }
      }
      else
      {
//        if (FONT_write(text,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)WHITE))
        if (FONT_write(text,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)BLACK))
        {
          /* text scrolling */
          string_offset ++;
        }
      }
    }
    else
    {
      if (filelist[i].flags)
      {
        /* directory icon */
        gxDrawTexture(dir_icon.texture,dir_icon.x,yoffset+dir_icon.y,dir_icon.w,dir_icon.h,255);
		//FONT_write(filelist[i].filename,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)WHITE);
        FONT_write(filelist[i].filename,18,dir_icon.x+dir_icon.w+6,yoffset+22,bar_over.w-dir_icon.w-26,(GXColor)BLACK);

      }
      else
      {
        //FONT_write(filelist[i].filename,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)WHITE); 
	    FONT_write(filelist[i].filename,18,dir_icon.x,yoffset+22,bar_over.w-20,(GXColor)BLACK);
      }
    }

    yoffset += 26;
  }

  gxTextureClose(&bar_over.texture);
  gxTextureClose(&dir_icon.texture);
}  </pre>]]></description>
<dc:creator>Paperman</dc:creator>
<category>Coding</category><pubDate>Tue, 31 Jul 2012 11:32:29 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70892,70892#msg-70892</guid>
<title>Decrypt a TMD file (2 replies)</title><link>http://forum.wiibrew.org/read.php?11,70892,70892#msg-70892</link><description><![CDATA[ Hi, i test a nand emulator, and in the test, i saw the need of edit a tmd file, but i search in the web but i don't found the metod, i found 2 webs with good info of this...<br /><br />[<a rel="nofollow" href="http://hackmii.com/2008/04/keys-keys-keys/">hackmii.com</a>]<br /><br />[<a rel="nofollow" href="http://www.elotrolado.net/wiki/Archivos_WAD">www.elotrolado.net</a>]<br /><br />i could not decrypt any tmd, the info says he has a sha1 and aes-128-cbc, but i can't do anything with this, help me please with this and how to decrypt this file.<br /><br />i don't have problem if you explain with windows or linux..]]></description>
<dc:creator>Pipeng</dc:creator>
<category>Coding</category><pubDate>Wed, 18 Jul 2012 04:01:21 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70861,70861#msg-70861</guid>
<title>Strange program freeze [RESOLVED] (6 replies)</title><link>http://forum.wiibrew.org/read.php?11,70861,70861#msg-70861</link><description><![CDATA[ Nothing worst than when you are coding and everything complies fine but one day compile the dol file, run it on the wii and the wii just freezes instanly. I have no clue why it happened. No crash screen, nothing. Just black. Is there anyway to debug this kind of crash?<br /><br />Nothing is apparently wrong with the code because it was working fine the other day and I was just going through my usual changes/adding features etc. It could be the latest update of devkitpro but I didn't notice anything that may affect it. Plus all my other programs compile and run as they should.<br /><br />So I decided to do some trial and error (by placing a exit(0) ) until I found the problem line;<br /><pre class="bbcode">
	for(i=0; i&lt;enemy_list_max; i++) {	
		enemy_add( get_random_world_vector(), randint(2)+1 );
	}</pre><br />If I put the exit(0) before enemy_add() the program runs to completion but if I put it AFTER the code hangs on the first line. It hangs in a weird way, it doesn't do ANY work at all on the wii (printf() calls before that line don't show up on screen). It just hangs as soon as the homebrew channel loads it. Worst thing is even if I comment out that line it still stops on other lines but I cannot identify WHY its stopping.<br /><br />The rest of the functions are;<br /><pre class="bbcode">

int world_size=18000, hits=0;

int randint(int rmax) { //generate a random number
	return (rand() % rmax + 1);
}

guVector get_random_world_vector(){	
	guVector new_pos={ randint(world_size)-(world_size*0.5f), 0, randint(world_size)-(world_size*0.5f) };
	return new_pos;
}</pre><br />Anybody have any clue what could be the problem or a way to debug it?]]></description>
<dc:creator>owen</dc:creator>
<category>Coding</category><pubDate>Sun, 15 Jul 2012 03:53:16 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70835,70835#msg-70835</guid>
<title>Tile Based OR Side Scroll Source-Code Example(s) (4 replies)</title><link>http://forum.wiibrew.org/read.php?11,70835,70835#msg-70835</link><description><![CDATA[ I've done a lot of game development (since the 1980s, back with Electronic Arts)... and know C/C++.<br /><br />But I've only recently gotten into Wii development and can't seem to find examples of something like<br />tile-based source-code or side-scrolling types of games. Something like a Mario (scrolling wise, and tile-based) or<br />an Ultima (tile-based).<br /><br />If someone knows of a site that has even crude code for such things for the Wii, I'm a quick learner. I don't need it written for me, but seeing<br />page-flipping usage with framebuffer examples and scrolling, etc... would be useful.<br /><br />I did a search for SCROLL and TILE on this site and cannot seem to locate anything relevant.]]></description>
<dc:creator>CodeSculptor</dc:creator>
<category>Coding</category><pubDate>Thu, 19 Jul 2012 21:41:54 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70735,70735#msg-70735</guid>
<title>SSL through IOS support (2 replies)</title><link>http://forum.wiibrew.org/read.php?11,70735,70735#msg-70735</link><description><![CDATA[ I have followed this <a rel="nofollow" href="http://wiibrew.org/wiki//dev/net/ssl">information about /dev/net/ssl</a> but I'm stuck. I did change inputs/outputs which seems to work.<br /><br />How do I determine the heap size? I guess using a big value does no harm but what is the proper way to chose a size? Is using iosCreateHeap() correct (do I have to do anything after that)?<br /><br />I have the very optimistic (it does not check for errors yet) code here: <a rel="nofollow" href="http://pastebin.com/TZY8UWpM">ssl.c</a> and <a rel="nofollow" href="http://pastebin.com/qL92RtrZ">ssl.h</a> on pastebin.<br /><br />I'm trying to connect to twitter.com following the steps described at the bottom of the /dev/net/ssl page:<br />-ssl_new() returns 1<br />-ssl_setbuiltinclient() returns 0<br />-ssl_setrootca() returns 0<br />-ssl_connect() returns 0<br />-ssl_handshake() returns -2<br /><br />I'm hoping 0 means no errors here! I haven't tried to write or read because I was trying to fix the handshake. ssl_shutdown() returns -1 (?).<br /><br />I'm guessing the certificate I'm loading is not what the Wii expects but I have no way to find out what is wrong with it. I am loading the <a rel="nofollow" href="http://www.verisign.com/support/roots.html">VeriSign Class 3 Primary CA - G5</a> certificate (as I mentioned above I'm trying to connect to twitter.com). The problem is probably here (either I'm loading it with the wrong format or I'm not loading what I should be loading). I downloaded that certificate, converted it to der format with ssl converter and loaded it (raw) to memory.<br /><br />Am I missing anything obvious?<br />Thanks<br /><br />EDIT: This is what I'm using to see the return values and everything: <a rel="nofollow" href="https://www.dropbox.com/s/y0myfh8z86x44la/ssltest.zip">ssltest.zip</a>.<br /><br />Don't laugh if my errors are stupid ;(]]></description>
<dc:creator>Aruskano</dc:creator>
<category>Coding</category><pubDate>Tue, 19 Jun 2012 07:49:00 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70709,70709#msg-70709</guid>
<title>Best method for debugging? (16 replies)</title><link>http://forum.wiibrew.org/read.php?11,70709,70709#msg-70709</link><description><![CDATA[ Hello guys, I have a quick question that I was hoping you guys could answer for me. I started porting a game that I wrote before in C++ to the wii and I've seem to run into a little snag, and a good debugger seems like it could be really useful right now. From what I was looking at there are several way to debug on the wii(?)<br />UsbGecko - Id rather not as it seems expensive and isn't supported anymore<br />There was this link for debugging over network <a rel="nofollow" href="http://wiibrew.org/wiki/User:Qiang0/Debugging#Prerequisites">here</a> which I was trying to follow and got really confused :/<br />there was also this <a rel="nofollow" href="http://sourceforge.net/tracker/?func=detail&aid=2707076&group_id=114505&atid=668553">here</a> which seemed really outdated, since it was last updated in 2009<br />and lastly there is debugging over dolphin which I was trying to do and nothing seemed to work :/<br /><br />so my question is what is the best and easiest way to debug on the wii, and it would be really appreciated if you could give me a little tutorial on how to get it set up properly :D<br /><br />P.S. I really like how if you forget to hit the button, it plays the pirate song :D]]></description>
<dc:creator>Hazematman</dc:creator>
<category>Coding</category><pubDate>Sun, 01 Jul 2012 23:39:59 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70694,70694#msg-70694</guid>
<title>VIDEO_GetPreferredMode...again (6 replies)</title><link>http://forum.wiibrew.org/read.php?11,70694,70694#msg-70694</link><description><![CDATA[ Help - with the latest libs, anyone know if we still need to tweak the results from <strong class="bbcode">VIDEO_GetPreferredMode</strong> to get the most from the visible display.<br /><br />I'm thinking the latest lib now has TVPal576IntDfScale, so this code bellow may now be outdated.<br />I.e. I used to do something like this, but I've just refresh to the latest libs and found this may now break things.<br /><br /><pre class="bbcode">
<s class="bbcode">GXRModeObj* WiiManager::GetBestVideoMode()
{
	GXRModeObj* vmode = VIDEO_GetPreferredMode(NULL); // get default video mode

	bool pal = false;

	if (vmode == &TVPal528IntDf)  // this may now be stupid, since I've just found something that will compile for the moment!
	{
		pal = true;
		vmode = &TVPal576IntDfScale; //&TVPal574IntDfScale;  ....574 removed fro libs, Ive just used the new 576
	}

	if (CONF_GetAspectRatio() == CONF_ASPECT_16_9)
	{
	      vmode-&gt;viWidth = 678;  // probably top limit for stretching the display onto your TV
	}
	//else
	//{
	//		vmode-&gt;viWidth = 672;  // not tested...this may work ok
	//}


	if (pal)
	{
		vmode-&gt;viXOrigin = (VI_MAX_WIDTH_PAL - vmode-&gt;viWidth) / 2;
		vmode-&gt;viYOrigin = (VI_MAX_HEIGHT_PAL - vmode-&gt;viHeight) / 2;
	}
	else
	{
		vmode-&gt;viXOrigin = (VI_MAX_WIDTH_NTSC - vmode-&gt;viWidth) / 2;
		vmode-&gt;viYOrigin = (VI_MAX_HEIGHT_NTSC - vmode-&gt;viHeight) / 2;
	}

	s8 hoffset = 0;

	if (CONF_GetDisplayOffsetH(&hoffset) == 0)
		vmode-&gt;viXOrigin += hoffset;

	return vmode;
}</s></pre>]]></description>
<dc:creator>Titmouse</dc:creator>
<category>Coding</category><pubDate>Mon, 25 Jun 2012 21:15:05 +0200</pubDate></item>
<item>
<guid>http://forum.wiibrew.org/read.php?11,70677,70677#msg-70677</guid>
<title>Header variable reference bug (2 replies)</title><link>http://forum.wiibrew.org/read.php?11,70677,70677#msg-70677</link><description><![CDATA[ So I've been updating one of my 3d games in c and I notice that when every I reference a bool variable that was declared in a header file I get a crash screen. If I initialize the variable to false, everything works fine but I am wondering if I am miss using the the header files or something.<br /><br />My set up is like this;<br /><br />common.h has this code;<br /><pre class="bbcode">
#ifndef common_h
#define common_h
bool debug;
#endif</pre><br />main.c has this code;<br /><pre class="bbcode">
include common.h

bool *myboolv;
void store( bool *boolv ){
 myboolv = boolv;

}
void check_value(){
  if( *boolv == true) { /* crashes on this if statement */ }
}
void main(){
 store(&debug);
 check_value();
}</pre><br />common.c doesn't have anything in it. If I initialize debug in the main it works fine but other wise I not sure why I getting the error.]]></description>
<dc:creator>owen</dc:creator>
<category>Coding</category><pubDate>Fri, 08 Jun 2012 04:29:51 +0200</pubDate></item>
</channel>
</rss>