Page 1 of 1

simple hello world, can someone help me ?

Posted: Thu Jul 22, 2004 4:33 am
by ps2freak
hello,

i will that this hello world program run under the ps2.
The code is:

Code: Select all

#include "stdio.h";

void main()
{
     printf("Hello World !!!\n");
     printf("(C)2004 by ps2freak");
}
i have found an example in the ps2sdk directory:

Code: Select all

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>
#include <sifrpc.h>
#include "sio.h"

int main&#40;&#41;
&#123;   
   SifInitRpc&#40;0&#41;; 
/*
   init_scr&#40;&#41;;
   scr_printf&#40;"Hello, world!\n"&#41;; // hello world in the screen
*/
   printf&#40;"Hello, world!\n"&#41;;
   nprintf&#40;"Hello, again, from Naplink RPC!\n"&#41;;
   
   sio_init&#40;115200, 0, 0, 0, 0&#41;;
   sio_printf&#40;"Hello from EE SIO!\n"&#41;;

   /* Return to the bootloader or PS2 browser. */
   return 0;
&#125;
this code i have edit into the following:

Code: Select all

#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>

int main&#40;&#41;
&#123;   
   SifInitRpc&#40;0&#41;; 

   printf&#40;"Hello, world!\n"&#41;;
   printf&#40;"&#40;C&#41;2004 by ps2freak"&#41;;

   /* Return to the bootloader or PS2 browser. */
   return 0;
&#125;
Ist this correct ?

my system is winxp and i have visual c++ 6.0 standard

the ps2sdk is under C:\ps2sdk

How can i compile this program for a ps2 system ?

thanks.

Posted: Thu Jul 22, 2004 4:48 am
by pixel
Okay. I have to tell you that you are a bit getting on my nerves.

Please, please, oh pretty please with sugar on top, go READ the other posts on the forum, go READ the various documentations around the website (which is http://ps2dev.org in case you missed something) before posting dumb posts.

First, big hint: the toolchain. This beast is mandatory to get a PS2 compiler. No, you can't compile PS2 code using Microsoft Visual Studio.

Posted: Thu Jul 22, 2004 4:54 am
by ps2freak
hmm very shit support here.

now i have files for visual studio 6 and they works finde. thanks and goodbye. :lol:

Posted: Thu Jul 22, 2004 5:49 am
by blackdroid
its not a kindergarten live with it, if you are told to read up, go read, or dont bother asking.

Posted: Thu Jul 22, 2004 6:01 am
by ooPo
(C)2004 by ooPo