Hacking programing language .ELF

  • Thread starter Thread starter Prime
  • Start date Start date
  • Views Views 2,298
  • Replies Replies 14
I assume you're on windows. Get the devkitPro installer from devkitpro.org. Make sure you install devkitPPC (GC/Wii) (devkitARM is for the GBA/DS, take a guess for devkitPSP).

After the install is done, restart, or logoff/logon. Then find Msys in your start menu under devkitPro, this will get you a shell. To compile, navigate to the folder (cd /c/devkitPro/.../project/) (CASE SENSITIVE) and type "make".
 
When i do what you said it says "nothing to be done".

I thought i'd go ahead and put it on my SD Card. I rename it boot.elf but when i start up twilight princess it freezes trying to load the .elf i think.

frown.gif
 
Try your projects .dol format in the included emulator
wink.gif

If it doesn't work in that in most likely also wont work on the Wii.
And remember to watch the compile log for errors
wink.gif
 
Wait i might this completely wrong. Can i just make a .elf which contain a simple "Hello World" written in C?

CODE#include

int main(void)
{
ÂÂÂÂprintf("hello, world\n");
ÂÂÂÂreturn 0;
}

maybe i need to have a special code or something to make it work on the twilight hack.
 
im very interested in this too..i would like to know the difference and how to compile a program to run on the twliilight hack...

any help is great...iv followed to above instructions....
 
tredes said:
im very interested in this too..i would like to know the difference and how to compile a program to run on the twliilight hack...

any help is great...iv followed to above instructions....

Well just keep a eye on this thread. Hopefully arctic_flame will write back.
 
metroid_phobia said:
Wait i might this completely wrong. Can i just make a .elf which contain a simple "Hello World" written in C?

CODE#include

int main(void)
{
ÂÂÂÂprintf("hello, world\n");
ÂÂÂÂreturn 0;
}

maybe i need to have a special code or something to make it work on the twilight hack.

Uh, yeah, this isn't like programming for the PC. Check the /c/devkitPro/examples/wii/template (There's a makefile too, so you can compile it by navigating to that folder and typing "make"

Hello, World! for the Wiilooks like this:

CODE#include
#include
#include
#include
#include
#include

static void *xfb = NULL;
static GXRModeObj *rmode = NULL;

int main(int argc, char **argv) {

ÂÂÂÂVIDEO_Init();
ÂÂÂÂPAD_Init();
ÂÂÂÂ
ÂÂÂÂswitch(VIDEO_GetCurrentTvMode()) {
ÂÂÂÂÂÂÂÂcase VI_NTSC:
ÂÂÂÂÂÂÂÂÂÂÂÂrmode = &TVNtsc480IntDf;
ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
ÂÂÂÂÂÂÂÂcase VI_PAL:
ÂÂÂÂÂÂÂÂÂÂÂÂrmode = &TVPal528IntDf;
ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
ÂÂÂÂÂÂÂÂcase VI_MPAL:
ÂÂÂÂÂÂÂÂÂÂÂÂrmode = &TVMpal480IntDf;
ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
ÂÂÂÂÂÂÂÂdefault:
ÂÂÂÂÂÂÂÂÂÂÂÂrmode = &TVNtsc480IntDf;
ÂÂÂÂÂÂÂÂÂÂÂÂbreak;
ÂÂÂÂ}

ÂÂÂÂxfb = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode));
ÂÂÂÂconsole_init(xfb,20,20,rmode->fbWidth,rmode->xfbHeight,rmode->fbWidth*VI_DISPLAY_PIX_SZ);
ÂÂÂÂ
ÂÂÂÂVIDEO_Configure(rmode);
ÂÂÂÂVIDEO_SetNextFramebuffer(xfb);
ÂÂÂÂVIDEO_SetBlack(FALSE);
ÂÂÂÂVIDEO_Flush();
ÂÂÂÂVIDEO_WaitVSync();
ÂÂÂÂif(rmode->viTVMode&VI_NON_INTERLACE) VIDEO_WaitVSync();


ÂÂÂÂprintf("Hello World!\n");

ÂÂÂÂwhile(1) {

ÂÂÂÂÂÂÂÂVIDEO_WaitVSync();
ÂÂÂÂ}

ÂÂÂÂreturn 0;
}
 

Site & Scene News

Popular threads in this forum