Difference between revisions of "Devkitppc setup (Windows)"

From WiiBrew
Jump to: navigation, search
m (Run the Hello World Example)
(Some Code snippets)
Line 33: Line 33:
 
Here are some code snippets, that can be very usefully (all without quotes!):
 
Here are some code snippets, that can be very usefully (all without quotes!):
  
Reload .elf: "((void(*)())(0x80001800))();"
+
'''Reload .elf:'''
  
 +
''"((void(*)())(0x80001800))();"''
 +
 +
 +
'''Return to Loader (i.e. USBGecko with geckoloader) on START+Z-Trigger:'''
 +
* Add this to your definitions on the top of your source file:
 +
 +
''typedef void (*Loader_Entry)(void);''
 +
 +
''Loader_Entry loader = (Loader_Entry)0x80001800;''
 +
 +
 +
* Add this in your main while loop, under "VIDEO_WaitVSync()":
 +
 +
''PAD_ScanPads();''\n
 +
 +
''int buttonsDown = PAD_ButtonsHeld(0);''
 +
 +
''if( (buttonsDown & PAD_TRIGGER_Z) && (buttonsDown & PAD_BUTTON_START)) {''
 +
 +
''loader();''
 +
 +
''}''
 +
 +
[[User:Roto|Roto]] 17:25, 24 March 2008 (PDT)
  
 
==Links==
 
==Links==
 
[http://wiki.devkitpro.org/index.php/Getting_Started devkitPro's 'Getting Started' Wiki]
 
[http://wiki.devkitpro.org/index.php/Getting_Started devkitPro's 'Getting Started' Wiki]

Revision as of 02:25, 25 March 2008

Introduction

This tutorial aims to:

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

Installing devkitpro

  • Goto [[1]] and download the latest Windows installer.
  • Let it install to the C:\devkitPro\ to make it easier to follow the tutorial for now.
  • When installing it, you can deselect devkitarm and devkitpsp
  • Click next until it finishes installing

Setup your project folder

  • Browse to C:\devkitPro\msys\ and run msys.bat. This will open a command prompt type window. This is where a bit of your time will be taking place. Close it for now.
  • Now, browse to C:\devkitPro\msys\home\. Depending on your windows username, there should be a folder in here. From now on, I will refer to this folder as your home directory.
  • Copy the folder C:\devkitPro\examples\wii\template\ to (your home directory) and rename it to "helloworld" so that the full path is C:\devkitPro\msys\home\(your username)\helloworld\

Compile the Hello World Example

  • Run msys.bat again.
  • type "ls" and press enter to see the directories in your home directory
  • type "cd helloworld" and press enter to switch into the helloworld directory
  • type "make" and press enter to complile the example

Run the Hello World Example

  • Now, browse to the helloworld folder. There should be a helloworld.dol file here now.
  • Open this file, and when windows asks what program to use, tell it to use C:\devkitpro\emulators\gcube\gcube.exe

The resulting dol should be compatible with the Twilight Hack

Some Code snippets

Here are some code snippets, that can be very usefully (all without quotes!):

Reload .elf:

"((void(*)())(0x80001800))();"


Return to Loader (i.e. USBGecko with geckoloader) on START+Z-Trigger:

  • Add this to your definitions on the top of your source file:

typedef void (*Loader_Entry)(void);

Loader_Entry loader = (Loader_Entry)0x80001800;


  • Add this in your main while loop, under "VIDEO_WaitVSync()":

PAD_ScanPads();\n

int buttonsDown = PAD_ButtonsHeld(0);

if( (buttonsDown & PAD_TRIGGER_Z) && (buttonsDown & PAD_BUTTON_START)) {

loader();

}

Roto 17:25, 24 March 2008 (PDT)

Links

devkitPro's 'Getting Started' Wiki