shutdown as update_plugin.prx

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

Moderators: cheriff, TyRaNiD

Post Reply
fr34k*
Posts: 17
Joined: Fri Aug 31, 2007 6:19 am

shutdown as update_plugin.prx

Post by fr34k* »

Hello, my name is fr34k*. I have a problem with my *.prx.
I want to programming a update_plugin.prx, how the PSP shutdown! NO RESTART!
At the moment i have this:

main.c
#include <pspkernel.h>
#include <stdio.h>
#include <pspsyscon.h>

PSP_MODULE_INFO("poweroff", 0x1000, 1, 1);


int main(void)
{
sceSysconPowerStandby();
}
/* Exported function returns the address of module_info */
void* getModuleInfo(void)
{
return (void *) &module_info;
}
exports.exp
# Define the exports for the prx
PSP_BEGIN_EXPORTS

# These four lines are mandatory (although you can add other functions like module_stop)
# syslib is a psynonym for the single mandatory export.
PSP_EXPORT_START(syslib, 0, 0x8000)
PSP_EXPORT_FUNC_HASH(module_start)
PSP_EXPORT_VAR_HASH(module_info)
PSP_EXPORT_END

# Export our function
PSP_EXPORT_START(MyLib, 0, 0x0001)
PSP_EXPORT_FUNC_HASH(getModuleInfo)
PSP_EXPORT_END

PSP_END_EXPORTS
Makefile
TARGET = update_plugin
OBJS = main.o

# Define to build this as a prx (instead of a static elf)
BUILD_PRX=1
# Define the name of our custom exports (minus the .exp extension)
PRX_EXPORTS=exports.exp

USE_PSPSDK_LIBC = 1

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

LIBDIR =

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
I use cygwin and i can compile that code, but it doesn't work!
BUT WHY?????

PS: Sorry for my bad english! I'm not so good in english!

Thx 4 ya help!
johnmph
Posts: 119
Joined: Sat Jul 23, 2005 11:48 pm

Post by johnmph »

module_start instead main
fr34k*
Posts: 17
Joined: Fri Aug 31, 2007 6:19 am

Post by fr34k* »

THX for your post but now i have an error and i cant compile it!

Error:
Image

EDIT:
makefile (now*)
#include <pspkernel.h>
#include <stdio.h>
#include <pspsyscon.h>

PSP_MODULE_INFO("poweroff", 0x1000, 1, 1);


int module_start(void)
{
sceSysconPowerStandby();
}
/* Exported function returns the address of module_info */
void* getModuleInfo(void)
{
return (void *) &module_info;
}
SORRY FOR MY BAD ENGLISH!!!!!
johnmph
Posts: 119
Joined: Sat Jul 23, 2005 11:48 pm

Post by johnmph »

main.c

Code: Select all

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

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


int module_start &#40;SceSize args, void *argp&#41;
&#123;
sceSysconPowerStandby&#40;&#41;;
return 0;
&#125;
/* Exported function returns the address of module_info */
void* getModuleInfo&#40;void&#41;
&#123;
return &#40;void *&#41; &module_info;
&#125;
makefile

Code: Select all

TARGET = update_plugin
OBJS = main.o

# Define to build this as a prx &#40;instead of a static elf&#41;
BUILD_PRX=1
# Define the name of our custom exports &#40;minus the .exp extension&#41;
PRX_EXPORTS=exports.exp

USE_PSPSDK_LIBC = 1


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

LIBDIR =

LDFLAGS = -mno-crt0 -nostartfiles
PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
fr34k*
Posts: 17
Joined: Fri Aug 31, 2007 6:19 am

Post by fr34k* »

Oh Yes thank you so much!
But i have 2 quastions ^^
My first quations, why thes code:

Code: Select all

LDFLAGS = -mno-crt0 -nostartfiles
in the makefile?

My second quastion:
must this

Code: Select all

&#40;SceSize args, void *argp&#41;
stay in all *.prx files?
Or only in that?
SORRY FOR MY BAD ENGLISH!!!!!
Post Reply