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 

shutdown as update_plugin.prx

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



Joined: 31 Aug 2007
Posts: 17

PostPosted: Fri Aug 31, 2007 6:26 am    Post subject: shutdown as update_plugin.prx Reply with quote

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
View user's profile Send private message
johnmph



Joined: 23 Jul 2005
Posts: 119

PostPosted: Fri Aug 31, 2007 7:12 am    Post subject: Reply with quote

module_start instead main
Back to top
View user's profile Send private message
fr34k*



Joined: 31 Aug 2007
Posts: 17

PostPosted: Fri Aug 31, 2007 7:21 am    Post subject: Reply with quote

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
View user's profile Send private message
johnmph



Joined: 23 Jul 2005
Posts: 119

PostPosted: Fri Aug 31, 2007 7:45 am    Post subject: Reply with quote

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
View user's profile Send private message
fr34k*



Joined: 31 Aug 2007
Posts: 17

PostPosted: Fri Aug 31, 2007 8:05 am    Post subject: Reply with quote

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
View user's profile Send private message
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