LaunchElf and mcInit

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

Moderators: cheriff, Herben

Post Reply
radad
Posts: 246
Joined: Wed May 19, 2004 4:54 pm
Location: Melbourne, Australia

LaunchElf and mcInit

Post by radad »

When I launch mc_example from ps2sdk using LaunchElf the mcInit fails and returns -120. Any ideas on this?
radad
Posts: 246
Joined: Wed May 19, 2004 4:54 pm
Location: Melbourne, Australia

Post by radad »

In mcInit at the line:

Code: Select all

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: Select all

POPDATA( int, UNCACHED_SEG((rdata+4)), ret, i);
if&#40;ret < 0x205&#41;
    printf&#40;"libmc&#58; mcserv is too old &#40;%x&#41;\n", ret&#41;;
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?
ole
Posts: 92
Joined: Sat May 08, 2004 11:14 pm
Location: Czech Republic

Post by ole »

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

Code: Select all

void resetIOP&#40;&#41; &#123;

	SifInitRpc&#40;0&#41;;
	SifExitIopHeap&#40;&#41;;
	SifLoadFileExit&#40;&#41;;
	SifExitRpc&#40;&#41;;


	SifIopReset&#40;"rom0&#58;UDNL rom0&#58;EELOADCNF",0&#41;;

	while &#40;!SifIopSync&#40;&#41;&#41; ; 
	SifInitRpc&#40;0&#41;;
&#125;
radad
Posts: 246
Joined: Wed May 19, 2004 4:54 pm
Location: Melbourne, Australia

Post by radad »

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?
Post Reply