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 

ps2link printf question

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



Joined: 27 Sep 2005
Posts: 3
Location: Hamburg

PostPosted: Sun Oct 09, 2005 8:25 pm    Post subject: ps2link printf question Reply with quote

Hello,

I am having some trouble using printf for debugging in InLink. I'm not sure if this is normal or if I'm doing anything wrong...
I have this piece of code from the Hello World example:
Code:
#include <tamtypes.h>
#include <sifcmd.h>
#include <kernel.h>
#include <sifrpc.h>

int main()
{   
   SifInitRpc(0);

   printf("Hello, world!\n");
   nprintf("Hello, again, from Naplink RPC!\n");
   return 0;
}


I can compile it and run the elf file through InLink without any problems. Now whenever I add another printf("something"); recompile the elf and try to execute it through InLink, I get this message and have to manually reset the PS2 :
Code:
Get Reboot Request From EE
ps2ip_ShutDown: Shutting down ps2ip-module

When I execute the same file after the reboot, it works fine until i make new changes. This only happens when I make calls to printf/nprintf from my code. Is there something obvious I'm missing?

I'm using PSLink v1.2.4 and InLink v1.3.7.

Thanks,
kegel
Back to top
View user's profile Send private message
misfire



Joined: 06 Sep 2004
Posts: 120
Location: Germany

PostPosted: Tue Oct 11, 2005 11:15 pm    Post subject: Reply with quote

Add SleepThread(); before returning 0. So ps2link gets control back after your program has finished.
Also, it's better to reset ps2link everytime before executing code.
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