forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Starting out..

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development
View previous topic :: View next topic  
Author Message
doc.o



Joined: 26 Jul 2006
Posts: 6

PostPosted: Wed Jul 26, 2006 4:02 pm    Post subject: Starting out.. Reply with quote

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:
#include <stdio.h>

int main()
{
    printf("Hello world!\n");
 return(0);
}



Thanks :)
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Wed Jul 26, 2006 4:22 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
doc.o



Joined: 26 Jul 2006
Posts: 6

PostPosted: Wed Jul 26, 2006 4:25 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
doc.o



Joined: 26 Jul 2006
Posts: 6

PostPosted: Thu Jul 27, 2006 10:04 am    Post subject: Reply with quote

nevermind had to use debug.h along with scr_printf.
Back to top
View user's profile Send private message
Drakonite
Site Admin


Joined: 17 Jan 2004
Posts: 989

PostPosted: Thu Jul 27, 2006 9:24 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
doc.o



Joined: 26 Jul 2006
Posts: 6

PostPosted: Fri Jul 28, 2006 2:41 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
JorDy



Joined: 11 Dec 2005
Posts: 121

PostPosted: Fri Jul 28, 2006 7:19 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PS2 Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group