 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
uberjack

Joined: 17 Jul 2007 Posts: 34 Location: California, USA
|
Posted: Sun Feb 03, 2008 2:22 pm Post subject: Running adhoc-enabled software on fw 2.0 and greater |
|
|
Hi,
I'm having difficulty running an adhoc application under firmware 3.60 (ideally, I'd like to be able to run this application on any firmware revision >= 2.00).
Here are the relevant portions of my makefile:
| Code: | PSP_FW_VERSION=200
LIBS=-lmypsp -lpng -lpspgu -lpspwlan -lpsppower -lz -lm -lc -lpspaudio -lpsprtc -lpspnet_adhocmatching -lpspnet_adhocctl -lpspnet_adhoc |
my macro declarations:
| Code: | #if (_PSP_FW_VERSION >= 200)
/* User mode */
PSP_MODULE_INFO(PSP_APP_NAME, 0, 1, 1);
PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER);
#else
/* Kernel mode */
PSP_MODULE_INFO(PSP_APP_NAME, 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
#endif |
here's my 'main()' routine:
| Code: | int main(int argc, char *argv[])
{
int ret_val = 0;
strcpy(app_path, (char*)argv[0]);
#if (_PSP_FW_VERSION >= 200)
sceUtilityLoadNetModule(PSP_NET_MODULE_COMMON);
sceUtilityLoadNetModule(PSP_NET_MODULE_ADHOC);
ret_val = user_main();
#else
/* Compiled for 1.50 firmware; in kernel mode */
if (!pspAdhocLoadDrivers())
return 1;
/* Create user thread */
SceUID thid = sceKernelCreateThread("User Mode Thread", user_main,
0x11, // default priority
256 * 1024, // stack size (256KB is regular default)
PSP_THREAD_ATTR_USER, NULL);
/* Start user thread; wait for it to complete */
sceKernelStartThread(thid, 0, 0);
sceKernelWaitThreadEnd(thid, NULL);
#endif
return ret_val;
} |
In both cases (fw 1.50 and 2.00) the program compiles and links just fine.
On a fw 1.50 PSP, everything works as expected (adhoc portions work). However, when run on a 3.60 PSP (compiled for 2.00), the program doesn't run, exiting with a 8002013C (library not found?) error.
Any ideas? Thanks for any help! |
|
| Back to top |
|
 |
J.F.
Joined: 22 Feb 2004 Posts: 2906
|
Posted: Sun Feb 03, 2008 6:34 pm Post subject: |
|
|
| Did you miss an _ in the makefile? 'PSP_FW_VERSION' is not the same thing as '_PSP_FW_VERSION'. |
|
| Back to top |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Sun Feb 03, 2008 11:37 pm Post subject: |
|
|
You're getting the 8002013C error because you still have kernel level calls in your 3.xx user mode app.
I assume that the pspAdhocLoadDrivers() function does some kernel level loading of the modules needed, wrap that function in a check for the firmware too. |
|
| Back to top |
|
 |
uberjack

Joined: 17 Jul 2007 Posts: 34 Location: California, USA
|
Posted: Mon Feb 04, 2008 4:37 pm Post subject: |
|
|
| Insert_witty_name wrote: | You're getting the 8002013C error because you still have kernel level calls in your 3.xx user mode app.
I assume that the pspAdhocLoadDrivers() function does some kernel level loading of the modules needed, wrap that function in a check for the firmware too. |
You're right, even though I wasn't using the calls, they were preventing the application from running.
Thanks! |
|
| Back to top |
|
 |
|
|
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
|