Show JPG image on Wii screen

The following function shows a jpg image.

void drawJpegImage(char *pictureData, int pictureLength, int x, int y )
{
  JPEGIMG         jpeg;
  int             row,
  col,
  pix,
  offset;
  unsigned int   *jpegout;

  memset(&jpeg, 0, sizeof(JPEGIMG));

  jpeg.inbuffer = pictureData;
  jpeg.inbufferlength = pictureLength;

  JPEG_Decompress(&jpeg);

  pix = 0;

  jpegout = (unsigned int *) jpeg.outbuffer;

  offset=(y+yjpegOffset)*320;
  for (row = 0; row < jpeg.height; row++)
  {
      for (col = 0; col < (jpeg.width >> 1); col++)
      {
         frameBuffer[0][offset + col + x] = jpegout[pix++];
      }
      offset+=320;
  }

  free(jpeg.outbuffer);
}

Compiled Libogc 1.7.1

To help beginner Wii developers i have compiled the latest available libogc 1.7.1 library. I have added to this library libfat 1.0.2 and libsnd 1.0. Please click on the below link to download this library.

Update on 06-02-2010. I removed the download link. Now libogc 1.8.1 with integrated sound module is available. So there is not need anymore for this download!

Wii network library

The following Wii network library was developed by dhewg, and adapted by me. This library also contain functionality to log the start of an application. This event with optional user data (for example highscore information) is send to Google analytics.

Short API description

# Start http / tcp thread
extern int tcp_start_thread(char *name, char *version, char *id1, char *url1, char*id2, char *url2, char *id3, char *url3, char *token, char *userData2, char *userData3);

# Stop network thread
extern int tcp_stop_thread(void);

# Get current state of network statemachine as digit
extern int tcp_get_state_nr(void);

# Get current state of network statemachine as text label
extern char *tcp_get_state(void);

# Set new state 
int tcp_set_state(int state, char *userData3);

# Get newest application version from a webpage.
extern char *tcp_get_version(void);

# Get release notes information from a webpage.
extern char *tcp_get_releasenote(void);

# Get highscore xml information from a webservice.
extern char *tcp_get_highscore(void);

Download

You can download this library be click to below link.

See for a working example the Pong2, BibleQuiz, RedSquare or SpaceBubble source code.

Wii BibleQuiz 0.70

A new version of BibleQuiz is released with the following changes:

09/12/2008 Version 0.70
– Added release notes screen
– Added functionality to fetch release notes from internet
– Improve highscore information (Show max score pre topic)
– Improve IR pointer
– Added google analytic http request (including highscore information)
– Improve result screen information.
– Build game with new libogc 1.6.0 and devkitPPC r15 compiler

Wii RedSquare 0.50

A new version of RedSquare for Nintendo Wii is released with the following changes:

08/12/2008 Version 0.50
– Added Sound Setting screen.
– Added Release Notes screen.
– Added functionality to fetch release notes from internet.
– Added send highscore to google analytic.
– Added nine music tracks.
– Build game with libogc 1.6.0 and devkitPPC r15 compiler.

First official release for the Wii homebrew scene!

Wii RedSquare 0.2

A new version of RedSquare for Nintendo Wii is released with the following changes:

02/12/2008 Version 0.2
– Improve http (new version check) thread.
– Remove some minor reported bugs.
– Complete redesign of gameboard graphics.
– Add background music.
– Add some sound effects.
– Remove some typo(s).
– Build game with libogc 1.6.0 and devkitPPC r15 compiler.

The software is not released yet!