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 

LaunchElf and mcInit

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



Joined: 19 May 2004
Posts: 246
Location: Melbourne, Australia

PostPosted: Tue Nov 23, 2004 9:02 am    Post subject: LaunchElf and mcInit Reply with quote

When I launch mc_example from ps2sdk using LaunchElf the mcInit fails and returns -120. Any ideas on this?
Back to top
View user's profile Send private message
radad



Joined: 19 May 2004
Posts: 246
Location: Melbourne, Australia

PostPosted: Thu Nov 25, 2004 9:20 am    Post subject: Reply with quote

In mcInit at the line:
Code:

ret = SifCallRpc(&cdata, mcRpcCmd[mcType][MC_RPCCMD_INIT], 0, &mcCmd, 48, rdata, 12, 0, 0)

This passes ok and returns 0, however rdata contains all zeros so that this part fails:
Code:

POPDATA( int, UNCACHED_SEG((rdata+4)), ret, i);
if(ret < 0x205)
    printf("libmc: mcserv is too old (%x)\n", ret);

and the memory card fails to initialize.

Any ideas on why this is happening? Is it because rom0:MCSERV is loaded instead of rom0:XMCSERV?

I definately load rom0:XMCSERV but rom0:MCSERV is already loaded by LaunchELF. Does loading rom0:XMCSERV overwrite rom0:MCSERV? Or does the loading of rom0:XMCSERV fail?

If it fails is there a way to unload rom0:MCSERV or even reset the PS2 so that no modules are loaded?
Back to top
View user's profile Send private message
ole



Joined: 08 May 2004
Posts: 92
Location: Czech Republic

PostPosted: Fri Nov 26, 2004 6:17 pm    Post subject: Reply with quote

Look here (how to reset iop): http://forums.ps2dev.org/viewtopic.php?t=13
edit:
or try reset like that:
Code:
void resetIOP() {

   SifInitRpc(0);
   SifExitIopHeap();
   SifLoadFileExit();
   SifExitRpc();


   SifIopReset("rom0:UDNL rom0:EELOADCNF",0);

   while (!SifIopSync()) ;
   SifInitRpc(0);
}
Back to top
View user's profile Send private message
radad



Joined: 19 May 2004
Posts: 246
Location: Melbourne, Australia

PostPosted: Wed Dec 01, 2004 8:53 am    Post subject: Reply with quote

Got to try this out last night. It worked, thanks for your help.

Should this go into the ps2sdk given that most homebrew noobs, like me, will run their elfs from some launcher?

Or should it be the job of the launcher to return the PS2 to a virgin state before executing the elf?
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