smallest ps2 program.

Discuss the development of software, tools, libraries and anything else that helps make ps2dev happen.

Moderators: cheriff, Herben

Post Reply
shdi_us
Posts: 4
Joined: Wed Jul 15, 2009 3:57 pm

smallest ps2 program.

Post by shdi_us »

Im trying to build a really small elf, that relies on the least amount of hardware or calls i guess. here is and example i found but i cant get it to compile.

#include <kernel.h>
#include <sifrpc.h>

int main (void)
{
SifInitRpc (0);
init_scr();
scr_printf ("ps2dev");
SleepThread (();
return 1;
}

what do i name this file?
I guessed and named it main.cpp, but it returns errors at int main (

can you explain these to me?
ee-gcc main.cpp -c -o main.o -Ic:/ps2dev/ps2lib/ee/include/

ee-gcc main.o -Tlinkfile -o ps2.elf -Lc:/ps2dev/ps2lib/ee/lib -lgcc -lkernel -lmc -lpad

im using ps2dev.exe from here:
http://resource.gameres.com/ps2DevEnvironment.exe
misfire
Posts: 110
Joined: Mon Sep 06, 2004 7:53 am
Location: Germany

Post by misfire »

Use the prebuilt PS2SDK provided here for Windows dev and take a look at the samples.
shdi_us
Posts: 4
Joined: Wed Jul 15, 2009 3:57 pm

Post by shdi_us »

prebuilt PS2SDK installed. thank you
still a little clues on compiling this, but im do some attempts

notepad

#include <kernel.h>
#include <sifrpc.h>

int main (void)
{
SifInitRpc (0);
init_scr();
scr_printf ("PS2 roolz!");
SleepThread (();
return 1;
}

and saved as main.cpp

k, now when i run this command

ee-gcc main.cpp -c -o main.o -Ic:/mysys/1.0/local/ps2dev/ps2dev/ps2lib/ee/include


i get a huge list of errors starting with
kernel.h no such file or directory
shdi_us
Posts: 4
Joined: Wed Jul 15, 2009 3:57 pm

Post by shdi_us »

is a make file similar to a batch file?
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

shdi_us wrote:is a make file similar to a batch file?
No, now go away and learn to use gcc before coming back. We don't give basic lessons on programming here. There are literally THOUSANDS of other sites the DO give basic lessons.
shdi_us
Posts: 4
Joined: Wed Jul 15, 2009 3:57 pm

Post by shdi_us »

uhm, well thanks for the warm invitation, but i now have the .elf i wanted. thank you misfire.


hahahahaha j.f.= jerk fiend.
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

You misunderstand - I'm the NICE one. You don't want to see the response you get from asking things like "what's the difference between makefiles and batch files?" for some of the people here. I simply told you to go learn some basic skills first. Your parentage, ancestry, and mating habits didn't come into question at all. :)
jgrimm
Posts: 27
Joined: Sun Nov 29, 2009 2:00 am

Post by jgrimm »

hey shdi_us could u plz show me how u got it to work because i tried a similar program wich compiled with no errors but only show a black screen when i run it with ulaunchELF
Post Reply