| View previous topic :: View next topic |
| Author |
Message |
fr34k*
Joined: 31 Aug 2007 Posts: 17
|
Posted: Fri Aug 31, 2007 6:26 am Post subject: shutdown as update_plugin.prx |
|
|
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
| Quote: |
#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
| Quote: |
# 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
| Quote: |
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! |
|
| Back to top |
|
 |
johnmph
Joined: 23 Jul 2005 Posts: 119
|
Posted: Fri Aug 31, 2007 7:12 am Post subject: |
|
|
| module_start instead main |
|
| Back to top |
|
 |
fr34k*
Joined: 31 Aug 2007 Posts: 17
|
Posted: Fri Aug 31, 2007 7:21 am Post subject: |
|
|
THX for your post but now i have an error and i cant compile it!
Error:
EDIT:
makefile (now*)
| Quote: | #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!!!!! |
|
| Back to top |
|
 |
johnmph
Joined: 23 Jul 2005 Posts: 119
|
Posted: Fri Aug 31, 2007 7:45 am Post subject: |
|
|
main.c
| Code: |
#include <pspkernel.h>
#include <stdio.h>
#include <pspsyscon.h>
PSP_MODULE_INFO("poweroff", 0x1000, 1, 1);
int module_start (SceSize args, void *argp)
{
sceSysconPowerStandby();
return 0;
}
/* Exported function returns the address of module_info */
void* getModuleInfo(void)
{
return (void *) &module_info;
}
|
makefile
| Code: |
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 =
LDFLAGS = -mno-crt0 -nostartfiles
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
|
|
|
| Back to top |
|
 |
fr34k*
Joined: 31 Aug 2007 Posts: 17
|
Posted: Fri Aug 31, 2007 8:05 am Post subject: |
|
|
Oh Yes thank you so much!
But i have 2 quastions ^^
My first quations, why thes code:
| Code: | | LDFLAGS = -mno-crt0 -nostartfiles |
in the makefile?
My second quastion:
must this | Code: | | (SceSize args, void *argp) | stay in all *.prx files?
Or only in that? _________________ SORRY FOR MY BAD ENGLISH!!!!! |
|
| Back to top |
|
 |
|