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 

Load Go!Cam Modules from an EBOOT?

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



Joined: 09 Jul 2008
Posts: 31

PostPosted: Mon Jul 14, 2008 12:08 am    Post subject: Load Go!Cam Modules from an EBOOT? Reply with quote

Hi,

How can I load the Go!Cam Modules from an EBOOT.PBP? (User mode)
I had tryed it with:
Code:


pspSdkLoadStartModule("flash0:/kd/usbcam.prx", PSP_MEMORY_PARTITION_KERNEL);
pspSdkLoadStartModule("flash0:/vsh/module/camera_plugin.prx", PSP_MEMORY_PARTITION_KERNEL);



But it doesn't work... :(

Please Help me! :p
Thanks! ;)

-DaRealXecon-
Back to top
View user's profile Send private message MSN Messenger
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Mon Jul 14, 2008 1:41 am    Post subject: Reply with quote

You'll need kernel mode for those under 1.5.

I'd recommend using the usermode equivalents in 3/4xx kernel.

See psputility_usbmodules.h.
Back to top
View user's profile Send private message
moonlight



Joined: 26 Oct 2005
Posts: 567

PostPosted: Mon Jul 14, 2008 3:44 am    Post subject: Reply with quote

You cannot load camera_plugin in that way. Camrea_plugin requires lot of things of vsh which are not loaded.
Back to top
View user's profile Send private message
Maxiime



Joined: 19 Jun 2008
Posts: 18

PostPosted: Mon Jul 14, 2008 6:19 am    Post subject: Reply with quote

You can find a way to use the gocam (load modules, record, etc) in the src code of Furikup (the phone hb of noobz)

Check it out and give us a comment :)

Cyaa
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Tue Jul 15, 2008 6:26 pm    Post subject: Reply with quote

First I thank you all ;)

And the next Problem is... I don't understand the Source Code of Furikup... :(
I am rather still a beginner. :p

And so far I see that with the camera only the microphone be used or?

Ohh man that's complicated :D *lol*

And when I make this with load the Modules... Also...

Code:


#include "psputility_usbmodules.h"
...
#define PSP_USB_MODULE_CAM   4

... *code* ...

sceUtilityLoadUsbModule(PSP_USB_MODULE_CAM);



My compiler says:
Quote:
main.o: In function main:
main.c: (.text+0xc88): undefined reference to 'sceUtilityLoadUsbModule'
collect2: ld returned 1 exit status


What's that?!? :D

I want nevertheless only if I press cross or something it load the modules of camera :D lol...

Thanks! ;)

-DaRealXecon-
Back to top
View user's profile Send private message MSN Messenger
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Tue Jul 15, 2008 8:22 pm    Post subject: Reply with quote

You need to link -lpsputility
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Tue Jul 15, 2008 11:37 pm    Post subject: Reply with quote

hm...

Also I had this in my makefile
Code:
LIBS = -lpsputility


and this in my main.c
Code:

#include <pspusb.h>
#include <pspusbcam.h>
#include <psputility.h>
#include <psputility_usbmodules.h>

...

#define PSP_USB_MODULE_CAM   4

...

sceUtilityLoadUsbModule(PSP_USB_MODULE_CAM);


and my Compiler can not compil it... *omg* :( or have I something forgotten?

-DaRealXecon-
Back to top
View user's profile Send private message MSN Messenger
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Jul 16, 2008 1:51 am    Post subject: Reply with quote

Post your full code, makefile and the errors returned.

A statement like 'my compiler cannot compile it' isn't useful.
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Wed Jul 16, 2008 2:41 am    Post subject: Reply with quote

Ok :) But my Code isn't very nice :p
I'm sure you could it make better! lol :D

My makefile
Code:
TARGET = OpenOS
OBJS = main.o graphics.o framebuffer.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)

LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lpspsystemctrl_user -lpspumd -lpsppower -lpspusb -lpspusbstor -lpspusb -lpsputility
LDFLAGS =

PSP_DIR = ms0:/PSP/GAME/OpenOS

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = OpenOS

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak



and here my main.c
Code:

/* ========================================================================== */
/*                                                                            */
/*   main.c                                                                   */
/*   (c) 2008 Author: -DaRealXecon-                                           */
/*                                                                            */
/*   Description: OpenOS                                                      */
/*                                                                            */
/* ========================================================================== */



#include <pspdisplay.h>
#include <pspctrl.h>
#include <pspkernel.h>
#include <pspdebug.h>
#include <pspgu.h>
#include <psppower.h>
#include <pspsdk.h>
#include <psptypes.h>
#include <png.h>
#include <stdio.h>
#include <pspusb.h>
#include <pspusbstor.h>
#include <pspusbcam.h>
#include <psppower.h>
#include "graphics.h"
#include "startPbpUmdIso.h"
#include "psploadexec_kernel.h"
#include "pspumd.h"
#include <psputility.h>
#include <psputility_usbmodules.h>
// #include "callback.h"

PSP_MODULE_INFO("OpenOS", 1, 1, 1);

#define printf pspDebugScreenPrintf
#define clrscr pspDebugScreenClear
#define MAX(X, Y) ((X) > (Y) ? (X) : (Y))
#define RGB(r, g, b) ((r)|((g)<<8)|((b)<<16))
#define PSP_USB_MODULE_CAM   4


void usb_activated()
{
   pspSdkLoadStartModule("flash0:/kd/semawm.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstor.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstormgr.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstorms.prx", PSP_MEMORY_PARTITION_KERNEL);
   pspSdkLoadStartModule("flash0:/kd/usbstorboot.prx", PSP_MEMORY_PARTITION_KERNEL);

   sceUsbStart(PSP_USBBUS_DRIVERNAME, 0, 0);
   sceUsbStart(PSP_USBSTOR_DRIVERNAME, 0, 0);
   sceUsbstorBootSetCapacity(0x800000);

   sceUsbActivate(0x1c8);
}

void usb_deactivated()
{
   sceUsbDeactivate(0);
   sceUsbStop(PSP_USBSTOR_DRIVERNAME, 0, 0);
   sceUsbStop(PSP_USBBUS_DRIVERNAME, 0, 0);
}


int main(void) {


  initGraphics();
 
  /*
  char buffer0[200];  // Splash                                                 // Splash
  Image* splash_0001;

  sprintf(buffer0, "sys/img/splash_0001.png");
  splash_0001 = loadImage(buffer0);
 
 
  int splash_y1 = -272;
 
  int i;
 
  for(i = 0; i < 400; i++ ) {
    splash_y1 += 5;
   
    if(splash_y1 >= 0) {
      splash_y1 = 0;
    }
   
    blitAlphaImageToScreen(0 ,0 ,480 , 272, splash_0001, 0,splash_y1);
    flipScreen();
   
  }                                                                             // Splash, END
*/



  char buffer0[200];  // Splash                                                 // Splash
  char buffer1[200];  // Splash Credits
 
  Image* splash_0001;
  Image* splash_credits_0001;
 
  sprintf(buffer0, "sys/img/splash_0001.png");
  sprintf(buffer1, "sys/img/splash_credits_0001.png");
 
  splash_0001 = loadImage(buffer0);
  splash_credits_0001 = loadImage(buffer1);
 
 
  int splash_credits_y1 = 148;
 
  int i;
 
 
  for(i = 0; i < 500; i++ ) {
    splash_credits_y1 -=  1;
   
    blitAlphaImageToScreen(0 ,0 ,183 , 480, splash_credits_0001, 244,splash_credits_y1);
    blitAlphaImageToScreen(0 ,0 ,480 , 272, splash_0001, 0,0);
    flipScreen();
   
  }                                                                             // Splash, END


  // SetupCallbacks();
  pspDebugScreenInit();

  SceCtrlData pad;
 

  char buffer2[200];  // BG Image                                               // Load Images
  char buffer3[200];  // Cursor 1
  char buffer4[200];  // Taskbar
  char buffer5[200];  // Toolbar
  char buffer6[200];  // UMD Icon (Desktop)
  char buffer7[200];  // Toolbar USB Button Aktiv
  char buffer8[200];  // Toolbar USB Button Inaktiv
  char buffer9[200];  // Toolbar Shutdown Button
  char buffer10[200];  // Toolbar Go!Cam Button
  char buffer11[200];  // Toolbar Exit Button

  Image* bg_0001;
  Image* cursor_0001;
  Image* task_bar_0001;
  Image* tool_bar_0001;
  Image* dsk_icon_umd;
  Image* tool_bar_usb_activ;
  Image* tool_bar_usb_deactiv;
  Image* tool_bar_shutdown;
  Image* tool_bar_gocam;
  Image* tool_bar_exit_os;

  sprintf(buffer2, "sys/img/bg_0001.png");
  sprintf(buffer3, "sys/img/cursor_0001.png");
  sprintf(buffer4, "sys/img/task_bar_0001.png");
  sprintf(buffer5, "sys/img/tool_bar_0001.png");
  sprintf(buffer6, "sys/img/dsk_icon_umd_0001.png");
  sprintf(buffer7, "sys/img/tool_icon_usb_activ_0001.png");
  sprintf(buffer8, "sys/img/tool_icon_usb_deactiv_0001.png");
  sprintf(buffer9, "sys/img/tool_icon_shutdown_0001.png");
  sprintf(buffer10, "sys/img/tool_icon_gocam_0001.png");
  sprintf(buffer11, "sys/img/tool_icon_exit_os_0001.png");
 
  bg_0001 = loadImage(buffer2);
  cursor_0001 = loadImage(buffer3);
  task_bar_0001 = loadImage(buffer4);
  tool_bar_0001 = loadImage(buffer5);
  dsk_icon_umd = loadImage(buffer6);
  tool_bar_usb_activ = loadImage(buffer7);
  tool_bar_usb_deactiv = loadImage(buffer8);
  tool_bar_shutdown = loadImage(buffer9);
  tool_bar_gocam = loadImage(buffer10);
  tool_bar_exit_os = loadImage(buffer11);                                       // Load Images, END


  int cursor_x1 = 70;
  int cursor_y1 = 100;

  int task_bar_x1 = 0;
  int task_bar_y1 = 222;
 
 
  int task_bar_state = 0;      // 1 is Hide, 0 is Show
  int usb_state = 1;
 
  int inumd;
 
  int usb_state_icon_pos_x1 = 402;
  int usb_state_icon_pos_x2 = 481;
 
 
  scePowerSetCpuClockFrequency(333);
   scePowerSetBusClockFrequency(166);
 
 
  while(1) {
    sceDisplayWaitVblankStart();
   
    sceCtrlReadBufferPositive(&pad, 1);
    if(pad.Buttons & PSP_CTRL_START) {
      if(pad.Buttons & PSP_CTRL_SELECT) {
        sceKernelExitGame();
      }
    }
   
   
    if(pad.Buttons & PSP_CTRL_UP) {
      cursor_y1 -= 6;
    }
    if(pad.Buttons & PSP_CTRL_DOWN) {
      cursor_y1 += 6;
    }
    if(pad.Buttons & PSP_CTRL_LEFT) {
      cursor_x1 -= 8;
    }
    if(pad.Buttons & PSP_CTRL_RIGHT) {
      cursor_x1 += 8;
    }
   
   
    if(cursor_x1 <= 0) {
      cursor_x1 = 0;
    }
    if(cursor_y1 <= 0) {
      cursor_y1 = 0;
    }
    if(cursor_x1 >= 480) {
      cursor_x1 = 480;
    }
    if (cursor_y1 >= 272) {
      cursor_y1 = 272;
    }
   
    if(task_bar_x1 <= -470) {
      task_bar_x1 = -470;
    }
    if(task_bar_x1 >= 0) {
      task_bar_x1 = 0;
    }
   
   
    if(task_bar_state == 0) {
      task_bar_x1 = 0;
    }
    else
    if(task_bar_state == 1) {
      task_bar_x1 = -483;
    }
   
   
   
    if(cursor_x1 > 0 && cursor_x1 < 20 && cursor_y1 > 250 && cursor_y1 < 272) { // Taskbar verstecken
      if(pad.Buttons & PSP_CTRL_CROSS && task_bar_state == 0) {
        sceKernelDelayThread(1000000);
        task_bar_state = 1;
      }
      else
      if(pad.Buttons & PSP_CTRL_CROSS && task_bar_state == 1) {
        sceKernelDelayThread(1000000);
        task_bar_state = 0;
      }
    }                                                                           // Taskbar verstecken, END
   
   
    if(cursor_x1 > 15 && cursor_x1 < 75 && cursor_y1 > 15 && cursor_y1 < 75) {  // Desktop Icons [Klickfunktion]
      if(pad.Buttons & PSP_CTRL_CROSS) {
       
        inumd = sceUmdCheckMedium(0);
       
        if(inumd == 1) {
          startPUI(NULL,1);
        } else {
          pspDebugScreenSetXY( 200, 150);
          printf("Keine UMD eingelegt!");
          sceKernelDelayThread(2000000);
          clrscr();
        }
      }
    }                                                                           // Desktop Icons [Klickfunktion], END
   
   
    if(cursor_x1 > 402 && cursor_x1 < 422 && cursor_y1 > 21 && cursor_y1 < 41) {// Toolbar Icons [Klickfunktion]
      if(pad.Buttons & PSP_CTRL_CROSS && usb_state == 1) {
        usb_activated();
        usb_state_icon_pos_x1 = 481;
        usb_state_icon_pos_x2 = 402;
        usb_state = 0;
        sceKernelDelayThread(1000000);
      }
      else
      if(pad.Buttons & PSP_CTRL_CROSS && usb_state == 0) {
        usb_deactivated();
        usb_state_icon_pos_x2 = 481;
        usb_state_icon_pos_x1 = 402;
        usb_state = 1;
        sceKernelDelayThread(1000000);
      }
    }
   
    if(cursor_x1 > 439 && cursor_x1 < 459 && cursor_y1 > 21 && cursor_y1 < 41) {
      if(pad.Buttons & PSP_CTRL_CROSS) {
        sceKernelDelayThread(500000);
        scePowerRequestSuspend();
      }
    }
   
    if(cursor_x1 > 402 && cursor_x1 < 422 && cursor_y1 > 46 && cursor_y1 < 66) {
      if(pad.Buttons & PSP_CTRL_CROSS) {
        sceKernelDelayThread(500000);
        sceUtilityLoadUsbModule(PSP_USB_MODULE_CAM);
      }
    }
   
    if(cursor_x1 > 439 && cursor_x1 < 459 && cursor_y1 > 46 && cursor_y1 < 66) {
      if(pad.Buttons & PSP_CTRL_CROSS) {
        sceKernelDelayThread(1000000);
        sceKernelExitGame();
      }
    }                                                                           // Toolbar Icons [Klickfunktion], END
   
   
    clearScreen(0);
    blitAlphaImageToScreen(0 ,0 ,480 , 272, bg_0001, 0,0);
    blitAlphaImageToScreen(0 ,0 ,180 , 272, tool_bar_0001, 300,0);
    blitAlphaImageToScreen(0 ,0 ,501 , 50, task_bar_0001, task_bar_x1,task_bar_y1);
   
    blitAlphaImageToScreen(0 ,0 ,60 , 60, dsk_icon_umd, 15,15);
   
   
    blitAlphaImageToScreen(0 ,0 ,20 , 20, tool_bar_usb_deactiv, usb_state_icon_pos_x1,21);
    blitAlphaImageToScreen(0 ,0 ,20 , 20, tool_bar_usb_activ, usb_state_icon_pos_x2,21);
    blitAlphaImageToScreen(0 ,0 ,20 , 20, tool_bar_shutdown, 439,21);
    blitAlphaImageToScreen(0 ,0 ,20 , 20, tool_bar_gocam, 402,46);
    blitAlphaImageToScreen(0 ,0 ,20 , 20, tool_bar_exit_os, 439,46);
   
    blitAlphaImageToScreen(0 ,0 ,10 , 17, cursor_0001, cursor_x1,cursor_y1);
   
    flipScreen();
  }
 
  sceKernelSleepThread();
  return 0;
}



and the Error:

Quote:
main.o: In function 'main':
main.c:(.text+0xc88): undefined rference to 'sceUtilityLoadUsbModule'
collect2: ld returned 1 exit status
make *** [OpenOS.elf] Error 1


When you got an idea... I haven't one :(

I'm useing pspdev ;)

Thank you! :)

-DaRealXecon-[/quote]
Back to top
View user's profile Send private message MSN Messenger
Smong



Joined: 04 Sep 2007
Posts: 82

PostPosted: Sat Jul 19, 2008 10:23 pm    Post subject: Reply with quote

While this won't fix your link error I notice 2 things:

Is the second parameter supposed to be a 1 there?
Code:
PSP_MODULE_INFO("OpenOS", 1, 1, 1);


psputility_usbmodules.h says:
Code:
#define PSP_USB_MODULE_CAM   4 // Requires PSP_USB_MODULE_ACC loading first

I don't see you loading PSP_USB_MODULE_ACC anywhere.
_________________
(+[__]%)
Back to top
View user's profile Send private message
-DaRealXecon-



Joined: 09 Jul 2008
Posts: 31

PostPosted: Mon Jul 21, 2008 10:26 pm    Post subject: Reply with quote

oh... :D yes... Thanks :p
Back to top
View user's profile Send private message MSN Messenger
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