forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Help Load a PRX from flash0:

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
PiCkDaT



Joined: 04 Oct 2007
Posts: 69

PostPosted: Thu Oct 04, 2007 11:15 pm    Post subject: Help Load a PRX from flash0: Reply with quote

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:

//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;

}


_________________
Enlighten me, Reveal my fate -- Follow - Breaking Benjamin
Back to top
View user's profile Send private message AIM Address
PiCkDaT



Joined: 04 Oct 2007
Posts: 69

PostPosted: Fri Oct 05, 2007 10:04 pm    Post subject: Reply with quote

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

Code:

init = sceUtilityLoadNetModule(PSP_NET_MODULE_ADHOC);


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
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
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