Running adhoc-enabled software on fw 2.0 and greater

Discuss the development of new homebrew software, tools and libraries.

Moderators: cheriff, TyRaNiD

Post Reply
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

Running adhoc-enabled software on fw 2.0 and greater

Post by uberjack »

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

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

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

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!
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

Did you miss an _ in the makefile? 'PSP_FW_VERSION' is not the same thing as '_PSP_FW_VERSION'.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

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.
User avatar
uberjack
Posts: 34
Joined: Tue Jul 17, 2007 9:09 am
Location: California, USA
Contact:

Post by uberjack »

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