PRX turns off psp

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

Moderators: cheriff, TyRaNiD

zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

PRX turns off psp

Post by zydeoN »

Hey, anyone here who made a prx that turns off the psp when a button is pressed ? I need help with that. I compiled one but there is no result. Here is the code (without callback):

Code: Select all

#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspkernel.h>
#include <pspsyscon.h>

PSP_HEAP_SIZE_KB&#40;10*1024&#41;;
PSP_MODULE_INFO&#40;"Turn off", 0, 1, 1&#41;; 
#define printf pspDebugScreenPrintf 
SceCtrlData pad; 

&#40;...callback...&#41;

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

pspDebugScreenInit&#40;&#41;;
SetupCallbacks&#40;&#41;; 
sceCtrlReadBufferPositive&#40;&pad, 1&#41;; 
  if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41; &#123;
                              sceSysconPowerStandby&#40;&#41;;
                              &#125;

sceKernelSleepThread&#40;&#41;; 

return 0; 
&#125; 
In this case i used "sceSysconPowerStandby();" because e hadnt found a function yet, but the idea is pretty the same.
psPea
Posts: 60
Joined: Sat Sep 01, 2007 12:51 pm

Post by psPea »

shouldn't this be in kernel mode

Code: Select all

PSP_MODULE_INFO&#40;"Turn off", PSP_KERNEL_MODE_KERNEL, 1, 1&#41;; 
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

psPea wrote:shouldn't this be in kernel mode

Code: Select all

PSP_MODULE_INFO&#40;"Turn off", PSP_KERNEL_MODE_KERNEL, 1, 1&#41;; 
most Prx files dont have to be in kernel mode, but its best to have them in ether vsh or kernel mode so that they can access the right functions needed.
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Re: PRX turns off psp

Post by Dariusc123456 »

zydeoN wrote:Hey, anyone here who made a prx that turns off the psp when a button is pressed ? I need help with that. I compiled one but there is no result. Here is the code (without callback):

Code: Select all

#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspkernel.h>
#include <pspsyscon.h>

PSP_HEAP_SIZE_KB&#40;10*1024&#41;;
PSP_MODULE_INFO&#40;"Turn off", 0, 1, 1&#41;; 
#define printf pspDebugScreenPrintf 
SceCtrlData pad; 

&#40;...callback...&#41;

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

pspDebugScreenInit&#40;&#41;;
SetupCallbacks&#40;&#41;; 
sceCtrlReadBufferPositive&#40;&pad, 1&#41;; 
  if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41; &#123;
                              sceSysconPowerStandby&#40;&#41;;
                              &#125;

sceKernelSleepThread&#40;&#41;; 

return 0; 
&#125; 
In this case i used "sceSysconPowerStandby();" because e hadnt found a function yet, but the idea is pretty the same.
Your code wont work (from the looks of it) because if you hold the L-Trigger while booting the psp on, it might go on standby, but if you try to press it while in the vsh, game, etc., it wont do anything because you dont have a loop, or dont have it to where the psp will know to shut off, in the memory.

and dont it have to be like this

Code: Select all

int main_thread&#40;SceSize args, void *argp&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;
        sceCtrlReadBufferPositive&#40;&pad, 1&#41;; 
        if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41; &#123;
                          sceSysconPowerStandby&#40;&#41;;
       &#125;


	return 0;
&#125;

/* Entry point */
int module_start&#40;SceSize args, void *argp&#41;
&#123;
	int thid;

	thid = sceKernelCreateThread&#40;"template", main_thread, 7, 0x800, 0, NULL&#41;;
	if&#40;thid >= 0&#41;
	&#123;
		sceKernelStartThread&#40;thid, args, argp&#41;;
	&#125;
	return 0;
&#125;

/* Module stop entry */
int module_stop&#40;SceSize args, void *argp&#41;
&#123;
	return 0;
&#125;
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
Art
Posts: 642
Joined: Wed Nov 09, 2005 8:01 am

Post by Art »

would you not have to also include psppower.h for the power functions???
If not actually, then potentially.
Davee
Posts: 43
Joined: Mon Jun 22, 2009 3:58 am

Post by Davee »

As this imports from syscon, the PRX will have to be kernel mode.
ab5000
Posts: 74
Joined: Tue May 06, 2008 2:37 am

Post by ab5000 »

1) make it kernel mode
2) use a cycle to check the buttons: in your code, buttons are checked only at startup. you'll have to check them every time, but remember: sleep the thread or you will freeze the psp!
3) use the sceCtrlPeekBuffer* insted of sceCtrlReadBuffer*. Peek only reads the buttons from a certain memory address, read reads the buttons AND clear them. if you use Read, only you prx will read the keys!!!

Code: Select all

%&#58;include<stdio.h>
int _&#40;int __,int ___,int ____,int _____&#41;
<%for&#40;;____<___;_____=_____*__,____++&#41;;
return _____;%>main&#40;&#41;<%printf
&#40;"%d\n",_&#40;2,5,0,1&#41;&#41;;%>
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

hum...psppower.h is not necessary for this because i only use sceSysconPowerStandby. Tried in kernel mode but does not compile it says that PSP_KERNEL_MODE_KERNEL is not declared. I should include something on there.. Why does it have to be on a loop ?
Btw, i didnt understand a bit of your code, Dariusc123456:

Code: Select all

int main_thread&#40;SceSize args, void *argp&#41;
&#123;
   pspDebugScreenInit&#40;&#41;;
        sceCtrlReadBufferPositive&#40;&pad, 1&#41;;
        if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41; &#123;
                          sceSysconPowerStandby&#40;&#41;;
       &#125;


   return 0;
&#125;

/* Entry point */
int module_start&#40;SceSize args, void *argp&#41;
&#123;
   int thid;

   thid = sceKernelCreateThread&#40;"template", main_thread, 7, 0x800, 0, NULL&#41;;
   if&#40;thid >= 0&#41;
   &#123;
      sceKernelStartThread&#40;thid, args, argp&#41;;
   &#125;
   return 0;
&#125;

/* Module stop entry */
int module_stop&#40;SceSize args, void *argp&#41;
&#123;
   return 0;
&#125;
psPea
Posts: 60
Joined: Sat Sep 01, 2007 12:51 pm

Post by psPea »

I was joking with the PSP_KERNEL_MODE_KERNEL, sorry bout that.
kernel mode is 0x1000
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

tried again with kernel mode, but i can not compile either:
Image

Any suggestion ?
Last edited by zydeoN on Wed Jul 22, 2009 6:02 am, edited 2 times in total.
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

I did a plugin like this a ways back, was basically using it to test grabbing button presses. Get the makefile from prx template and add -lpsppower to the LIBS line (use scePowerRequest* instead of syscon to avoid possibility of skipping power off processes like flushing writes to MS), delayThread (which also lets other threads to run) and the 0x30 in createThread together dictate how often the code is given processor time by the "thread dispatcher".

Code: Select all

#include <pspsdk.h>
#include <psppower.h>
#include <pspctrl.h>

PSP_MODULE_INFO&#40;"poweroff", 0x1007, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

int main_thread&#40;SceSize args, void *argp&#41;
&#123;	
	SceCtrlData pad;

	while&#40;1&#41; // loop is required so buttons get checked more than ONCE
	&#123;
		sceCtrlReadBufferPositive&#40;&pad, 1&#41;; // update the var inside the loop
		if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41;
		&#123;
			if&#40;pad.Buttons & PSP_CTRL_TRIANGLE&#41;
				scePowerRequestStandby&#40;&#41;; // scePowerRequestSuspend&#40;&#41;; suspend is sleep
		&#125;
    	sceKernelDelayThread&#40;100000&#41;;// don't use processor for around 1/10 of a second
	&#125;
	return 0;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;
	// Create a thread
	int thid = sceKernelCreateThread&#40;"poweroff", main_thread, 0x30, 0x1000, 0, NULL&#41;; // 0x30 thread priority lower is higher, 0x1000 initial stack size
	if&#40;thid >= 0&#41;
		sceKernelStartThread&#40;thid, args, argp&#41;;

	return 0;
&#125;
This wouldn't need more than a tiny stack, so some mem size optimizations might be possible by finding out exactly how much it needs (it certainly doesn't need 0x1000 or 0x1000*10.) You don't need any additional code to this, this in itself is not for an eboot that gets run but a standalone prx that gets loadStart-ed.

From the looks of your error image, you are trying to add code to another project - don't change that project to kernel mode (which is probably what is causing your undefined references) and just use the scePowerRequestStandby() and -lpsppower - it should do what you want from user mode.
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

Now, tried cory1492's way but nothing... Can't compile either:
Image
Here is my code:

Code: Select all

#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspkernel.h>
#include <psppower.h>
#include <pspsdk.h>

PSP_MODULE_INFO&#40;"poweroff", 0x1007, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

int main_thread&#40;SceSize args, void *argp&#41;
&#123;   
   SceCtrlData pad;

   while&#40;1&#41; // loop is required so buttons get checked more than ONCE
   &#123;
      sceCtrlReadBufferPositive&#40;&pad, 1&#41;; // update the var inside the loop
      if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41;
      &#123;
            scePowerRequestStandby&#40;&#41;; // scePowerRequestSuspend&#40;&#41;; suspend is sleep
      &#125;
       sceKernelDelayThreadCB&#40;100000&#41;;// don't use processor for around 1/10 of a second
   &#125;
   return 0;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;
   // Create a thread
   int thid = sceKernelCreateThread&#40;"poweroff", main_thread, 0x30, 0x1000, 0, NULL&#41;; // 0x30 thread priority lower is higher, 0x1000 initial stack size
   if&#40;thid >= 0&#41;
      sceKernelStartThread&#40;thid, args, argp&#41;;

   return 0;
&#125;
Makefile:

Code: Select all

TARGET = shutdown
OBJS = main.o

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

BUILD_PRX = 1
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lpspgum -lpsppower
LDFLAGS =

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
PSP_EBOOT_TITLE = Shutdown

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak 
Where the hell did you learn all that stuff, cory1492? I just can't find anything on internet...
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

You dont need -lpspgu or -lpspgum.

If you take a look a the samples in the sdk, and the web, you can learn about this stuff more
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
jojojoris
Posts: 255
Joined: Sun Mar 30, 2008 4:06 am

Post by jojojoris »

Same way you just learned it. (i think)

You can find it is open source plugins and in this forum a couple of times.

(Don't blame my if it was a rhetoric question)

Code: Select all

int main&#40;&#41;&#123;
     SetupCallbacks&#40;&#41;;
     makeNiceGame&#40;&#41;;
     sceKernelExitGame&#40;&#41;;
&#125;
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

No i dont blame you xD
But do you understand this error ?
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

It might be because of a old psp sdk. Instead of creating a eboot, try using it as a seplugin prx to see if it works that way.
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

I was not creating the eboot. Im trying to compile the prx, but that isn't even possible
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

Ill compile it to see if it will works.
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
Dariusc123456
Posts: 388
Joined: Tue Aug 12, 2008 12:46 am

Post by Dariusc123456 »

put this in your makefile and try again.

Code: Select all

TARGET = shutdown
OBJS = main.o

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

PSP_FW_VERSION = 500

LIBDIR =
LIBS = -lz -lm -lpsppower -lpspkernel
LDFLAGS =

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build_prx.mak 
PSHN - Playstation Hacking Network
PSX/PS1 - HACK - Game Shark
PS2 - HACK - Swap
PSP - HACK - Pandora
PS3 - ?
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

You must have grabbed the code before I edited it:

Code: Select all

sceKernelDelayThreadCB&#40;100000&#41;;
There should be no real reason to use the CB (call back) variant as this does not register/need a call back, though it seems to work similar even without one to be proper it would be best to just use sceKernelDelayThread.

The template makefile for a kernel prx can be found at psp/sdk/samples/template/kprx_template in your sdk installation - provided you are using an up to date toolchain, that sample dir has a tonne of nifty things people here have contributed (not to mention all the other projects in the PSP repo on ps2dev svn.)

The actual makefile I used back when I initially tried this is

Code: Select all

TARGET = poweroff
OBJS = main.o

BUILD_PRX = 1

INCDIR = 
CFLAGS = -O2 -G0 -Wall -fno-builtin-printf -fshort-wchar -fno-pic -mno-check-zero-division
CXXFLAGS = $&#40;CFLAGS&#41; -fno-exceptions -fno-rtti
ASFLAGS = $&#40;CFLAGS&#41;

LIBDIR =
LDFLAGS =

LIBS = -lpsppower

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build_prx.mak
As you can see I was messing about with CFLAGS which was why I suggested starting with the template.
Where the hell did you learn all that stuff, cory1492? I just can't find anything on internet...
Lurk around here for a few years, read some c/cpp manuals and you'd be surprised what you pick up (doesn't hurt that the topics and search here are pretty broad and cover most everything PSP programming related.) Indexing the sdk source is also a great asset for info, and digging up the PSP programming tutorial site is also a good place to start. Still, there are many aspects of the PSP and it's OS I have absolutely no way to relate to and no explanation/starting point to work with - perhaps ignorance is bliss?

As to your error image, it is trying to build an eboot from the looks of it - possibly because you didn't specify the firmware version but more likely because you specified an eboot title.
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

Solved !! I had to put this on my Makefile

Code: Select all

LDFLAGS += -mnno-crt0 -nostartfiles
Which means i dont need the SDK initialization, since i defined a module_start and the SDK (src/startup/crt0.c and crt0_prx.c) defines the entry point and call your own main.
The prx is working, now i will try shutdown the psp, instead of standby. I just cant find the function

Code:

Code: Select all

#include <pspctrl.h>
#include <pspdisplay.h>
#include <stdio.h>
#include <pspkernel.h>
#include <psppower.h>
#include <pspsdk.h>

PSP_MODULE_INFO&#40;"poweroff", 0x1000, 1, 0&#41;;
PSP_MAIN_THREAD_ATTR&#40;0&#41;;

int main_thread&#40;SceSize args, void *argp&#41;
&#123;   
   SceCtrlData pad;

   while&#40;1&#41; // loop is required so buttons get checked more than ONCE
   &#123;
      sceCtrlReadBufferPositive&#40;&pad, 1&#41;; // update the var inside the loop
      if&#40;pad.Buttons & PSP_CTRL_LTRIGGER&#41;
      &#123;
            scePowerRequestStandby&#40;&#41;; // scePowerRequestSuspend&#40;&#41;; suspend is sleep
      &#125;
       sceKernelDelayThread&#40;100000&#41;;// don't use processor for around 1/10 of a second
   &#125;
   return 0;
&#125;

int module_start&#40;SceSize args, void *argp&#41;
&#123;
   // Create a thread
   int thid = sceKernelCreateThread&#40;"poweroff", main_thread, 0x30, 0x1000, 0, NULL&#41;; // 0x30 thread priority lower is higher, 0x1000 initial stack size
   if&#40;thid >= 0&#41;
      sceKernelStartThread&#40;thid, args, argp&#41;;

   return 0;
&#125;
Makefile:

Code: Select all

TARGET = shutdown
OBJS = main.o

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

BUILD_PRX = 1
LIBDIR =
LIBS = -lpspgu -lpng -lz -lm -lpspgum -lpsppower
LDFLAGS += -mnno-crt0 -nostartfiles

USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak 
Thanks for the help of all of you :D
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

If you create the makefile properly the toolchain handles taking out crt0 on prxs. The problem actually is that your makefile is using build.mak and not build_prx.mak - see the bottom include line in your makefile and look through those two different makefiles (you'll find the prx one already has the two ldflags among others.) The raw template kprx makefile, which I said to use more than once now...

Code: Select all

TARGET = ktemplate
OBJS = main.o 

# Use the kernel's small inbuilt libc
USE_KERNEL_LIBC = 1
# Use only kernel libraries
USE_KERNEL_LIBS = 1

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

LIBDIR =
LIBS = 

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build_prx.mak
Are you sure you want the PSP to power off with just one button (L shoulder) held?
The prx is working, now i will try shutdown the psp, instead of standby. I just cant find the function
I already mentioned this, provided I didn't get them backwards along the way

Code: Select all

scePowerRequestStandby&#40;&#41;; // scePowerRequestSuspend&#40;&#41;; suspend is sleep 
scePowerRequestSuspend = sleep
scePowerRequestStandby = "power off" - actually, there are always some things running and using small amounts of power (which is probably why it is standby), the only way to actually completely power off the PSP is to remove the battery and let the PCB mounted watch looking battery cell drain
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

Are you sure you want the PSP to power off with just one button (L shoulder) held?
No it was just an example. Btw, this prx inside games doesn't work. Yes, turning off the psp completely seems impossible, but im happy with scePowerRequestSuspend();
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

zydeoN wrote:Btw, this prx inside games doesn't work.
Using the code and makefile I posted I compiled the prx, added it to my seplugins folder, added it to game.txt with a 1 after (did you skip this? do you have any other plugins that handle power like hold+ or something?) to enable it and it works just fine - I press L shoulder and triangle and the PSP shuts off in about 2-3 seconds. Slim 2k on 5.0m33-6. I have also used requestStandby to power off from user mode homebrew just fine.
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

Well i forgot to add to game.txt. It works fine. But what function do you use to shut off psp? Does it completely shut off, or it just suspend ?
ne0h
Posts: 386
Joined: Thu Feb 21, 2008 2:15 am

Post by ne0h »

scePowerRequestStandby --> Shutdown
scePowerRequestSuspend --> Sleep mode
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

Any function that can reboot the psp? I tried sceSysconResetDevice(1,1), but that doesnt work... Anybody used a different one ?
cory1492
Posts: 216
Joined: Fri Dec 10, 2004 1:49 pm

Post by cory1492 »

zydeoN wrote:Any function that can reboot the psp? I tried sceSysconResetDevice(1,1), but that doesnt work... Anybody used a different one ?
http://forums.ps2dev.org/viewtopic.php?t=5856
There are a few ways listed there, the ones moonlight mention are (or at least were) used by m33 to exit recovery menu or boot PSP with no coldboot.

Any mode change, like going from vsh to a game or using exitGame to go back to vsh, is pretty much a full environment reset anyway without doing any further 'tricks'.
PsPfReAK
Posts: 61
Joined: Sat Mar 28, 2009 9:02 am
Contact:

Post by PsPfReAK »

cory1492 wrote:
zydeoN wrote:Any function that can reboot the psp? I tried sceSysconResetDevice(1,1), but that doesnt work... Anybody used a different one ?
http://forums.ps2dev.org/viewtopic.php?t=5856
There are a few ways listed there, the ones moonlight mention are (or at least were) used by m33 to exit recovery menu or boot PSP with no coldboot.

Any mode change, like going from vsh to a game or using exitGame to go back to vsh, is pretty much a full environment reset anyway without doing any further 'tricks'.
i'm also looking for a way to reset the psp. i have a kernal mode prx and have tried all of those mentioned but none seem to work. i get the
implicitit declaration error.
zydeoN
Posts: 45
Joined: Sat May 09, 2009 4:01 am

Post by zydeoN »

Well, ive seen what moonlight said about FindProc(). So, we use FindProc() to get the address of the function scePower_0442D852 (which is not in pspsdk) and how the hell do we use that function with only the address?
Help please

EDIT: Well i accidentally found a source on google and it is working now. Here is all i have to do:

In main, use the function scePower_0442D852(0);

Create a file imports.h:
#ifndef IMPORTS_H_
#define IMPORTS_H_

void scePower_0442D852(int unknown);

#endif
Create a file imports.S:

Code: Select all

.set noreorder

# include "pspimport.s"

IMPORT_START "scePower",0x00010000
IMPORT_FUNC "scePower",0x0442D852,scePower_0442D852
Add imports.o in Makefile

Compile and run it on psp xD
Post Reply