Load Go!Cam Modules from an EBOOT?

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

Moderators: cheriff, TyRaNiD

Post Reply
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Load Go!Cam Modules from an EBOOT?

Post by -DaRealXecon- »

Hi,

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

Code: Select all


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-
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

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.
moonlight
Posts: 567
Joined: Wed Oct 26, 2005 7:46 pm

Post by moonlight »

You cannot load camera_plugin in that way. Camrea_plugin requires lot of things of vsh which are not loaded.
Maxiime
Posts: 18
Joined: Thu Jun 19, 2008 11:34 pm

Post by Maxiime »

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
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

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: Select all


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

... *code* ...

sceUtilityLoadUsbModule(PSP_USB_MODULE_CAM);

My compiler says:
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-
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

You need to link -lpsputility
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

hm...

Also I had this in my makefile

Code: Select all

LIBS = -lpsputility
and this in my main.c

Code: Select all

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

...

#define PSP_USB_MODULE_CAM	4

...

sceUtilityLoadUsbModule&#40;PSP_USB_MODULE_CAM&#41;;
and my Compiler can not compil it... *omg* :( or have I something forgotten?

-DaRealXecon-
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Post your full code, makefile and the errors returned.

A statement like 'my compiler cannot compile it' isn't useful.
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

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

My makefile

Code: Select all

TARGET = OpenOS
OBJS = main.o graphics.o framebuffer.o

CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

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

PSP_DIR = ms0&#58;/PSP/GAME/OpenOS

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = OpenOS

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak

and here my main.c

Code: Select all

/* ========================================================================== */
/*                                                                            */
/*   main.c                                                                   */
/*   &#40;c&#41; 2008 Author&#58; -DaRealXecon-                                           */
/*                                                                            */
/*   Description&#58; 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&#40;"OpenOS", 1, 1, 1&#41;;

#define printf pspDebugScreenPrintf
#define clrscr pspDebugScreenClear
#define MAX&#40;X, Y&#41; &#40;&#40;X&#41; > &#40;Y&#41; ? &#40;X&#41; &#58; &#40;Y&#41;&#41;
#define RGB&#40;r, g, b&#41; &#40;&#40;r&#41;|&#40;&#40;g&#41;<<8&#41;|&#40;&#40;b&#41;<<16&#41;&#41;
#define PSP_USB_MODULE_CAM	4


void usb_activated&#40;&#41;
&#123;
	pspSdkLoadStartModule&#40;"flash0&#58;/kd/semawm.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	pspSdkLoadStartModule&#40;"flash0&#58;/kd/usbstor.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	pspSdkLoadStartModule&#40;"flash0&#58;/kd/usbstormgr.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	pspSdkLoadStartModule&#40;"flash0&#58;/kd/usbstorms.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;
	pspSdkLoadStartModule&#40;"flash0&#58;/kd/usbstorboot.prx", PSP_MEMORY_PARTITION_KERNEL&#41;;

	sceUsbStart&#40;PSP_USBBUS_DRIVERNAME, 0, 0&#41;;
	sceUsbStart&#40;PSP_USBSTOR_DRIVERNAME, 0, 0&#41;;
	sceUsbstorBootSetCapacity&#40;0x800000&#41;;

	sceUsbActivate&#40;0x1c8&#41;;
&#125;

void usb_deactivated&#40;&#41;
&#123;
	sceUsbDeactivate&#40;0&#41;;
	sceUsbStop&#40;PSP_USBSTOR_DRIVERNAME, 0, 0&#41;;
	sceUsbStop&#40;PSP_USBBUS_DRIVERNAME, 0, 0&#41;;
&#125;


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


  initGraphics&#40;&#41;;
  
  /*
  char buffer0&#91;200&#93;;  // Splash                                                 // Splash
  Image* splash_0001;

  sprintf&#40;buffer0, "sys/img/splash_0001.png"&#41;;
  splash_0001 = loadImage&#40;buffer0&#41;;
  
  
  int splash_y1 = -272;
  
  int i;
  
  for&#40;i = 0; i < 400; i++ &#41; &#123;
    splash_y1 += 5;
    
    if&#40;splash_y1 >= 0&#41; &#123;
      splash_y1 = 0;
    &#125;
    
    blitAlphaImageToScreen&#40;0 ,0 ,480 , 272, splash_0001, 0,splash_y1&#41;;
    flipScreen&#40;&#41;;
    
  &#125;                                                                             // Splash, END
*/



  char buffer0&#91;200&#93;;  // Splash                                                 // Splash
  char buffer1&#91;200&#93;;  // Splash Credits
  
  Image* splash_0001;
  Image* splash_credits_0001;
  
  sprintf&#40;buffer0, "sys/img/splash_0001.png"&#41;;
  sprintf&#40;buffer1, "sys/img/splash_credits_0001.png"&#41;;
  
  splash_0001 = loadImage&#40;buffer0&#41;;
  splash_credits_0001 = loadImage&#40;buffer1&#41;;
  
  
  int splash_credits_y1 = 148;
  
  int i;
  
  
  for&#40;i = 0; i < 500; i++ &#41; &#123;
    splash_credits_y1 -=  1;
    
    blitAlphaImageToScreen&#40;0 ,0 ,183 , 480, splash_credits_0001, 244,splash_credits_y1&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,480 , 272, splash_0001, 0,0&#41;;
    flipScreen&#40;&#41;;
    
  &#125;                                                                             // Splash, END


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

  SceCtrlData pad;
  

  char buffer2&#91;200&#93;;  // BG Image                                               // Load Images
  char buffer3&#91;200&#93;;  // Cursor 1
  char buffer4&#91;200&#93;;  // Taskbar
  char buffer5&#91;200&#93;;  // Toolbar
  char buffer6&#91;200&#93;;  // UMD Icon &#40;Desktop&#41;
  char buffer7&#91;200&#93;;  // Toolbar USB Button Aktiv
  char buffer8&#91;200&#93;;  // Toolbar USB Button Inaktiv
  char buffer9&#91;200&#93;;  // Toolbar Shutdown Button
  char buffer10&#91;200&#93;;  // Toolbar Go!Cam Button
  char buffer11&#91;200&#93;;  // 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&#40;buffer2, "sys/img/bg_0001.png"&#41;;
  sprintf&#40;buffer3, "sys/img/cursor_0001.png"&#41;;
  sprintf&#40;buffer4, "sys/img/task_bar_0001.png"&#41;;
  sprintf&#40;buffer5, "sys/img/tool_bar_0001.png"&#41;;
  sprintf&#40;buffer6, "sys/img/dsk_icon_umd_0001.png"&#41;;
  sprintf&#40;buffer7, "sys/img/tool_icon_usb_activ_0001.png"&#41;;
  sprintf&#40;buffer8, "sys/img/tool_icon_usb_deactiv_0001.png"&#41;;
  sprintf&#40;buffer9, "sys/img/tool_icon_shutdown_0001.png"&#41;;
  sprintf&#40;buffer10, "sys/img/tool_icon_gocam_0001.png"&#41;;
  sprintf&#40;buffer11, "sys/img/tool_icon_exit_os_0001.png"&#41;;
  
  bg_0001 = loadImage&#40;buffer2&#41;;
  cursor_0001 = loadImage&#40;buffer3&#41;;
  task_bar_0001 = loadImage&#40;buffer4&#41;;
  tool_bar_0001 = loadImage&#40;buffer5&#41;;
  dsk_icon_umd = loadImage&#40;buffer6&#41;;
  tool_bar_usb_activ = loadImage&#40;buffer7&#41;;
  tool_bar_usb_deactiv = loadImage&#40;buffer8&#41;;
  tool_bar_shutdown = loadImage&#40;buffer9&#41;;
  tool_bar_gocam = loadImage&#40;buffer10&#41;;
  tool_bar_exit_os = loadImage&#40;buffer11&#41;;                                       // 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&#40;333&#41;;
	scePowerSetBusClockFrequency&#40;166&#41;;
  
  
  while&#40;1&#41; &#123;
    sceDisplayWaitVblankStart&#40;&#41;;
    
    sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
    if&#40;pad.Buttons & PSP_CTRL_START&#41; &#123;
      if&#40;pad.Buttons & PSP_CTRL_SELECT&#41; &#123;
        sceKernelExitGame&#40;&#41;;
      &#125;
    &#125;
    
    
    if&#40;pad.Buttons & PSP_CTRL_UP&#41; &#123;
      cursor_y1 -= 6;
    &#125;
    if&#40;pad.Buttons & PSP_CTRL_DOWN&#41; &#123;
      cursor_y1 += 6;
    &#125;
    if&#40;pad.Buttons & PSP_CTRL_LEFT&#41; &#123;
      cursor_x1 -= 8;
    &#125;
    if&#40;pad.Buttons & PSP_CTRL_RIGHT&#41; &#123;
      cursor_x1 += 8;
    &#125;
    
    
    if&#40;cursor_x1 <= 0&#41; &#123;
      cursor_x1 = 0;
    &#125;
    if&#40;cursor_y1 <= 0&#41; &#123;
      cursor_y1 = 0;
    &#125;
    if&#40;cursor_x1 >= 480&#41; &#123;
      cursor_x1 = 480;
    &#125;
    if &#40;cursor_y1 >= 272&#41; &#123;
      cursor_y1 = 272;
    &#125;
    
    if&#40;task_bar_x1 <= -470&#41; &#123;
      task_bar_x1 = -470;
    &#125;
    if&#40;task_bar_x1 >= 0&#41; &#123;
      task_bar_x1 = 0;
    &#125;
    
    
    if&#40;task_bar_state == 0&#41; &#123;
      task_bar_x1 = 0;
    &#125;
    else
    if&#40;task_bar_state == 1&#41; &#123;
      task_bar_x1 = -483;
    &#125;
    
    
    
    if&#40;cursor_x1 > 0 && cursor_x1 < 20 && cursor_y1 > 250 && cursor_y1 < 272&#41; &#123; // Taskbar verstecken
      if&#40;pad.Buttons & PSP_CTRL_CROSS && task_bar_state == 0&#41; &#123;
        sceKernelDelayThread&#40;1000000&#41;;
        task_bar_state = 1;
      &#125;
      else
      if&#40;pad.Buttons & PSP_CTRL_CROSS && task_bar_state == 1&#41; &#123;
        sceKernelDelayThread&#40;1000000&#41;;
        task_bar_state = 0;
      &#125;
    &#125;                                                                           // Taskbar verstecken, END
    
    
    if&#40;cursor_x1 > 15 && cursor_x1 < 75 && cursor_y1 > 15 && cursor_y1 < 75&#41; &#123;  // Desktop Icons &#91;Klickfunktion&#93;
      if&#40;pad.Buttons & PSP_CTRL_CROSS&#41; &#123;
        
        inumd = sceUmdCheckMedium&#40;0&#41;;
        
        if&#40;inumd == 1&#41; &#123;
          startPUI&#40;NULL,1&#41;;
        &#125; else &#123;
          pspDebugScreenSetXY&#40; 200, 150&#41;;
          printf&#40;"Keine UMD eingelegt!"&#41;;
          sceKernelDelayThread&#40;2000000&#41;;
          clrscr&#40;&#41;;
        &#125;
      &#125;
    &#125;                                                                           // Desktop Icons &#91;Klickfunktion&#93;, END
    
    
    if&#40;cursor_x1 > 402 && cursor_x1 < 422 && cursor_y1 > 21 && cursor_y1 < 41&#41; &#123;// Toolbar Icons &#91;Klickfunktion&#93;
      if&#40;pad.Buttons & PSP_CTRL_CROSS && usb_state == 1&#41; &#123;
        usb_activated&#40;&#41;;
        usb_state_icon_pos_x1 = 481;
        usb_state_icon_pos_x2 = 402;
        usb_state = 0;
        sceKernelDelayThread&#40;1000000&#41;;
      &#125;
      else
      if&#40;pad.Buttons & PSP_CTRL_CROSS && usb_state == 0&#41; &#123;
        usb_deactivated&#40;&#41;;
        usb_state_icon_pos_x2 = 481;
        usb_state_icon_pos_x1 = 402;
        usb_state = 1;
        sceKernelDelayThread&#40;1000000&#41;;
      &#125;
    &#125;
    
    if&#40;cursor_x1 > 439 && cursor_x1 < 459 && cursor_y1 > 21 && cursor_y1 < 41&#41; &#123;
      if&#40;pad.Buttons & PSP_CTRL_CROSS&#41; &#123;
        sceKernelDelayThread&#40;500000&#41;;
        scePowerRequestSuspend&#40;&#41;;
      &#125;
    &#125;
    
    if&#40;cursor_x1 > 402 && cursor_x1 < 422 && cursor_y1 > 46 && cursor_y1 < 66&#41; &#123;
      if&#40;pad.Buttons & PSP_CTRL_CROSS&#41; &#123;
        sceKernelDelayThread&#40;500000&#41;;
        sceUtilityLoadUsbModule&#40;PSP_USB_MODULE_CAM&#41;;
      &#125;
    &#125;
    
    if&#40;cursor_x1 > 439 && cursor_x1 < 459 && cursor_y1 > 46 && cursor_y1 < 66&#41; &#123;
      if&#40;pad.Buttons & PSP_CTRL_CROSS&#41; &#123;
        sceKernelDelayThread&#40;1000000&#41;;
        sceKernelExitGame&#40;&#41;;
      &#125;
    &#125;                                                                           // Toolbar Icons &#91;Klickfunktion&#93;, END
    
    
    clearScreen&#40;0&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,480 , 272, bg_0001, 0,0&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,180 , 272, tool_bar_0001, 300,0&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,501 , 50, task_bar_0001, task_bar_x1,task_bar_y1&#41;;
    
    blitAlphaImageToScreen&#40;0 ,0 ,60 , 60, dsk_icon_umd, 15,15&#41;;
    
    
    blitAlphaImageToScreen&#40;0 ,0 ,20 , 20, tool_bar_usb_deactiv, usb_state_icon_pos_x1,21&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,20 , 20, tool_bar_usb_activ, usb_state_icon_pos_x2,21&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,20 , 20, tool_bar_shutdown, 439,21&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,20 , 20, tool_bar_gocam, 402,46&#41;;
    blitAlphaImageToScreen&#40;0 ,0 ,20 , 20, tool_bar_exit_os, 439,46&#41;;
    
    blitAlphaImageToScreen&#40;0 ,0 ,10 , 17, cursor_0001, cursor_x1,cursor_y1&#41;;
    
    flipScreen&#40;&#41;;
  &#125;
  
  sceKernelSleepThread&#40;&#41;;
  return 0;
&#125;

and the Error:
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]
Smong
Posts: 82
Joined: Tue Sep 04, 2007 4:44 am

Post by Smong »

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

Is the second parameter supposed to be a 1 there?

Code: Select all

PSP_MODULE_INFO&#40;"OpenOS", 1, 1, 1&#41;;
psputility_usbmodules.h says:

Code: Select all

#define PSP_USB_MODULE_CAM	4 // Requires PSP_USB_MODULE_ACC loading first
I don't see you loading PSP_USB_MODULE_ACC anywhere.
(+[__]%)
-DaRealXecon-
Posts: 31
Joined: Wed Jul 09, 2008 7:50 am

Post by -DaRealXecon- »

oh... :D yes... Thanks :p
Post Reply