Hacking programing language .ELF

arctic_flame

GBAtemp ATMEGA8 Fan
Member
Joined
Nov 4, 2006
Messages
2,835
Trophies
0
Age
32
Location
England land
XP
168
Country
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".
 

Prime

Well-Known Member
OP
Member
Joined
Nov 7, 2007
Messages
3,663
Trophies
0
Age
33
Location
Under your bed
Website
Visit site
XP
571
Country
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
 

superrob

H4X H4X H4X!
Member
Joined
Apr 4, 2007
Messages
2,464
Trophies
0
Age
30
Location
GBATemp factory.
Website
zabbo.dk
XP
359
Country
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
 

Prime

Well-Known Member
OP
Member
Joined
Nov 7, 2007
Messages
3,663
Trophies
0
Age
33
Location
Under your bed
Website
Visit site
XP
571
Country
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.
 

tredes

Well-Known Member
Member
Joined
Mar 17, 2008
Messages
180
Trophies
0
XP
73
Country
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....
 

Prime

Well-Known Member
OP
Member
Joined
Nov 7, 2007
Messages
3,663
Trophies
0
Age
33
Location
Under your bed
Website
Visit site
XP
571
Country
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.
 

arctic_flame

GBAtemp ATMEGA8 Fan
Member
Joined
Nov 4, 2006
Messages
2,835
Trophies
0
Age
32
Location
England land
XP
168
Country
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

General chit-chat
Help Users
    K3Nv2 @ K3Nv2: Watching the fallout series it is pretty decent