I have checked the forum out with the search to try to find the solution to my problem but I couldn't so I made a thread sorry if its a repeat that I didnt find.
okay I know I'm probably going the wrong way with trying to load Ad-Hoc(which I dont care for at the moment) but I dont understand why it wont load the PRX. It wont even load other PRX's I'm going to go home tonight and recompile the new Ad-Hoc Lib so maybe I can get pspnet_adhoc.h etc. to work.
p.s. I'm using 3.03OE-C and sdk-beta2 (Im upgrading tonight)
edit: I think the error was lib not found. could it have anything to do with I'm using beta-2?
Code: Select all
//Ad-Hoc Test
#include <pspkernel.h>
#include <pspmodulemgr.h>
#include <pspdisplay.h>
#include <pspdebug.h>
#include <pspthreadman.h>
#include <pspctrl.h>
#include <pspsdk.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <pspwlan.h>
#include <pspnet.h>
#include <pspnet_adhoc.h>
#include <pspnet_adhocctl.h>
#include <pspnet_adhocmatching.h>
PSP_MODULE_INFO("AdHoc", 0x1000, 1, 1);
PSP_MAIN_THREAD_ATTR(0);
#define clearScr pspDebugScreenClear
#define printf pspDebugScreenPrintf
#define goToXY pspDebugScreenSetXY
#define changeColor pspDebugScreenSetTextColor
/* Exit CallBack */
int exit_callback(int arg1, int arg2, void *common){
sceKernelExitGame();
return 0;
}
/* CallBack Thread */
int CallbackThread(SceSize args, void *argp){
int cbid;
cbid = sceKernelCreateCallback("Exit Callback", exit_callback, NULL);
sceKernelRegisterExitCallback(cbid);
sceKernelSleepThreadCB();
return 0;
}
/* Sets up the callback thread and returns its thread id */
int SetupCallbacks(void){
int thid = 0;
thid = sceKernelCreateThread("update_thread", CallbackThread, 0x11, 0xFA0, 0, 0);
if(thid >= 0){
sceKernelStartThread(thid, 0, 0);
}
return thid;
}
int main(){
pspDebugScreenInit();
SetupCallbacks();
SceCtrlData pad;
int init = 0;
pspSdkInstallNoDeviceCheckPatch();
sceCtrlSetSamplingCycle(0);
sceCtrlSetSamplingMode(1);
sceWlanDevAttach();
while(sceWlanDevIsPowerOn() < 0)
{
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_START)
sceKernelExitGame();
printf("Turn Lan ON!");
}
printf("Running in Kernel Mode with Kernel Thread\n\n");
init = pspSdkLoadStartModule("flash0:/kd/pspnet_adhoc.prx", PSP_MEMORY_PARTITION_USER);
printf("Ad-Hoc: %x\n", init);
while(1){
sceCtrlReadBufferPositive(&pad, 1);
if(pad.Buttons & PSP_CTRL_START)
sceKernelExitGame();
}
sceWlanDevDetach();
sceKernelSleepThread();
sceKernelExitGame();
return 0;
}