Help Load a PRX from flash0:

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

Moderators: cheriff, TyRaNiD

Post Reply
PiCkDaT
Posts: 69
Joined: Thu Oct 04, 2007 9:49 pm

Help Load a PRX from flash0:

Post by PiCkDaT »

Hi,
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&#40;"AdHoc", 0x1000, 1, 1&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

#define clearScr		pspDebugScreenClear
#define printf			pspDebugScreenPrintf
#define goToXY			pspDebugScreenSetXY
#define changeColor		pspDebugScreenSetTextColor


/* Exit CallBack */
int exit_callback&#40;int arg1, int arg2, void *common&#41;&#123;
	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;

/* CallBack Thread */
int CallbackThread&#40;SceSize args, void *argp&#41;&#123;
	int cbid;

	cbid = sceKernelCreateCallback&#40;"Exit Callback", exit_callback, NULL&#41;;
	sceKernelRegisterExitCallback&#40;cbid&#41;;

	sceKernelSleepThreadCB&#40;&#41;;

	return 0;

&#125;


/* Sets up the callback thread and returns its thread id */
int SetupCallbacks&#40;void&#41;&#123;
	int thid = 0;

	thid = sceKernelCreateThread&#40;"update_thread", CallbackThread, 0x11, 0xFA0, 0, 0&#41;;
	if&#40;thid >= 0&#41;&#123;
		sceKernelStartThread&#40;thid, 0, 0&#41;;
	&#125;

	return thid;

&#125;


int main&#40;&#41;&#123;

	pspDebugScreenInit&#40;&#41;;
	SetupCallbacks&#40;&#41;;
	

	SceCtrlData pad;
	int init = 0;

	pspSdkInstallNoDeviceCheckPatch&#40;&#41;;



	sceCtrlSetSamplingCycle&#40;0&#41;;
	sceCtrlSetSamplingMode&#40;1&#41;;
	
	sceWlanDevAttach&#40;&#41;;

	while&#40;sceWlanDevIsPowerOn&#40;&#41; < 0&#41;
	&#123;
		sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		if&#40;pad.Buttons & PSP_CTRL_START&#41;
			sceKernelExitGame&#40;&#41;;
		printf&#40;"Turn Lan ON!"&#41;;
	&#125;

	printf&#40;"Running in Kernel Mode with Kernel Thread\n\n"&#41;;
	init = pspSdkLoadStartModule&#40;"flash0&#58;/kd/pspnet_adhoc.prx", PSP_MEMORY_PARTITION_USER&#41;;
	printf&#40;"Ad-Hoc&#58; %x\n", init&#41;;


	while&#40;1&#41;&#123;
		sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
		if&#40;pad.Buttons & PSP_CTRL_START&#41;
			sceKernelExitGame&#40;&#41;;
	&#125;

	sceWlanDevDetach&#40;&#41;;
	sceKernelSleepThread&#40;&#41;;
	sceKernelExitGame&#40;&#41;;
	return 0;

&#125;

Enlighten me, Reveal my fate -- Follow - Breaking Benjamin
PiCkDaT
Posts: 69
Joined: Thu Oct 04, 2007 9:49 pm

Post by PiCkDaT »

Uhm.. I dont know why it didnt work but I tried something different

Code: Select all

init = sceUtilityLoadNetModule&#40;PSP_NET_MODULE_ADHOC&#41;;
when I use this it doesnt give me < 0 but it gives me 42.... wth? its either <0 or 0 Right? what does 42 mean lol
Enlighten me, Reveal my fate -- Follow - Breaking Benjamin
Post Reply