Devkitppc setup (Mac OS X)

From WiiBrew
Jump to navigation Jump to search

A guide for Windows users can be found here


This tutorial aims to:

  • Show you how to setup the devkitppc development environment on a Mac OS X computer
  • Run a hello world example on the Gcube emulator
  • Set you on the road to creating your own homebrew software to be loaded with the Twilight Hack

Installing devkitPPC

  • First make sure you have Xcode tools 3 (note that this requires Leopard) or above installed then go here and download the latest Mac distro. Also download gcube emulator for mac.
  • Double-click the devkitPPC.pkg and follow the set-up instructions then log out and back in or restart.

Compile the Hello World Example

  • Launch Xcode
  • Select "New project..." from the File menu
  • Select "devkitPPC Wii Project"
  • Name your project, and pick a place to save it
  • Hit "Build"
  • The completed .dol file will (by default) be found in build/Development

Run the Hello World Example

  • To run the file again open Terminal and type “gcube ~/Desktop/WiiBrew/devkitPPC\GameCube\Project/build/Development/devkitPPC” no quotes obviously.
  • The resulting dol should be compatible with the Twilight Hack. Unfortunately dols compiled with CVS libogc and future stable releases will not be compatible with Gcube.

Some Code snippets

libogc provides a jump back to the loader through the standard libc exit function. exit(0) will immediately return, all other values will display a console screen with the exit code.

  • Add this in your main while loop, under "VIDEO_WaitVSync()":
int buttonsDown = PAD_ButtonsHeld(0);
if( (buttonsDown & PAD_TRIGGER_Z) && (buttonsDown & PAD_BUTTON_START)) {