Starting out..

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

Moderators: cheriff, Herben

Post Reply
doc.o
Posts: 6
Joined: Wed Jul 26, 2006 3:59 pm

Starting out..

Post by doc.o »

Hello, i've just now started getting into ps2dev. I have not found a single example of what the ps2 uses as a header file; as opposed to #include <stdio.h> that window's uses. More like a hello world starter. Maybe more direct if someone could show me a short snippet of 'translation' to this.

Code: Select all

#include <stdio.h>

int main&#40;&#41;
&#123;
    printf&#40;"Hello world!\n"&#41;;
 return&#40;0&#41;;
&#125;

Thanks :)
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

That should pretty much compile and run just fine ;)



....there are lots of examples in svn and with ps2sdk.
Shoot Pixels Not People!
Makeshift Development
doc.o
Posts: 6
Joined: Wed Jul 26, 2006 3:59 pm

Post by doc.o »

Drakonite wrote:That should pretty much compile and run just fine ;)



....there are lots of examples in svn and with ps2sdk.
It doesn't launch after I compile it for some reason, i figured it was because the ps2 use's different header rather than stdio.h.

EDIT: It still is giving problems.. I tried it thru ps2link and emulator, it prints nothing to my TV screen at all but does print into the output of ps2link via PC screen.
doc.o
Posts: 6
Joined: Wed Jul 26, 2006 3:59 pm

Post by doc.o »

nevermind had to use debug.h along with scr_printf.
User avatar
Drakonite
Site Admin
Posts: 990
Joined: Sat Jan 17, 2004 1:30 am
Contact:

Post by Drakonite »

doc.o wrote: EDIT: It still is giving problems.. I tried it thru ps2link and emulator, it prints nothing to my TV screen at all but does print into the output of ps2link via PC screen.
Thats because thats what it's supposed to do...

The PS2 doesn't have a text mode display, so stdio is redirected to the pc console when running ps2link so that you can print out information while debugging.

scr_printf is a hack to render some text on the tv screen, originally intended for debugging purposes
Shoot Pixels Not People!
Makeshift Development
doc.o
Posts: 6
Joined: Wed Jul 26, 2006 3:59 pm

Post by doc.o »

Drakonite wrote:
doc.o wrote: EDIT: It still is giving problems.. I tried it thru ps2link and emulator, it prints nothing to my TV screen at all but does print into the output of ps2link via PC screen.
Thats because thats what it's supposed to do...

The PS2 doesn't have a text mode display, so stdio is redirected to the pc console when running ps2link so that you can print out information while debugging.

scr_printf is a hack to render some text on the tv screen, originally intended for debugging purposes
Oh alright good to know :) thanks. Another question, is there a way to load a ASM into your elf if I was to write some FNC's in it?

Anyways thanks in advance.
JorDy
Posts: 121
Joined: Sun Dec 11, 2005 8:45 am

Post by JorDy »

you can create a "blah.s" file for your asm chekck out some source codes and just include it in the objects inside the makefile
Post Reply