Ok, I've committed the lua.prx in src/luaprx with its own makefile. I haven't modified any of the actual luaPlayer code. I've added the following to main.cpp in user_main
Code: Select all
// change directory.
getcwd(path, 256);
chdir(path);
// load the Lua PRX
strcat(path, "/lua.prx" );
int retVal = sceKernelLoadModule( path, 0, NULL );
if (retVal < 0)
{
debugOutput("Error: failed sceKernelLoadModule load lua.prx\n",
31);
sceKernelSleepThread();
}
debugOutput( "LoadModule\n", 12 );
int fd;
retVal = sceKernelStartModule( retVal, 0, NULL, &fd, NULL );
if ( retVal < 0 )
{
debugOutput("Error: failed sceKernelStartModule lua.prx\n", 44 )
;
}
You will also need at the top of main.cpp the following to ensure that enough memory is available to load the prx.
PSP_HEAP_SIZE_KB(10000);
You also need to modify the makefile to include LuaLib.o in the objects. To create LuaLib.c you run in the luaprx directory:
psp-build-exports --build-stubs exports.exp
You also remove the lua libraries from the Makefile.
After all that is done, it still doesn't work. :) I'm not exactly sure why though. Anyone got any ideas?
[edit: more info] As far as I can tell it now loads the lua.prx correctly, but after that, the screen goes black and nothing happens. I'm using a very basic lua script to check if it works. I'm wondering if anything else needs to be done to link in the PRX exports with the imports of LuaPlayer?
David. aka Oobles.
www.livemedia.com.au/Blog