 |
forums.ps2dev.org Homebrew PS2, PSP & PS3 Development Discussions
|
| View previous topic :: View next topic |
| Author |
Message |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Tue Sep 15, 2009 6:42 pm Post subject: How to export functions in an eboot.pbp, to loaded PRX? |
|
|
Hello everybody,
I am making a new application for the PSP, a window environment where the threads can create windows, write in them... etc
Now, I have a problem.
In all the examples that I have seen, there is an EBOOT.PBP that loads a PRX and then, some function in the PRX can be used by the EBOOT.PBP.
But I need just the opposite.
I have an EBOOT.PBP with lots of functions, and I need to export them to all the PRX that this EBOOT loads.
I have tried mixing the PRX export commands and the .S libraries in the EBOO.PBP, but it is not working.
I am able to run my program, but when I load the PRX, it just freezes.
I have also tried to compile my program as a PRX, and load it trough an EBOOT, but it shows nothing in the screen.
I have asked this only in the ps2dev.org forum because I know that someone will solve my problem :-)
Thanks a lot :-D |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Tue Sep 15, 2009 9:09 pm Post subject: |
|
|
| Just use BUILD_PRX=1 in the makefile. Your EBOOT will contain a PRX. Export functions normally from it. Any other PRX can import the functions of your EBOOT's PRX. |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Tue Sep 15, 2009 9:23 pm Post subject: |
|
|
| Torch wrote: | | Just use BUILD_PRX=1 in the makefile. Your EBOOT will contain a PRX. Export functions normally from it. Any other PRX can import the functions of your EBOOT's PRX. |
Hmm I did that, but when I tried to run the eboot it returned to the XMB and shown an error.
Thanks
Edit: The error is "800200D9" (failed to allocate the memory block)
Edit again:
OK I fixed a few lines in the code and now it compiles and run the EBOOT with the PRX and it exports the functions.
Now, the problem is when I load the PRX that tries to use those functions. The PSP just freezes. I have tried with other PRX (music.prx) and it works, so the problem is not loading the PRX, but the PRX itself.
Thanks for your help :-)
Last edited by usertestprueba on Tue Sep 15, 2009 11:34 pm; edited 2 times in total |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Tue Sep 15, 2009 9:43 pm Post subject: |
|
|
Here is the EBOOT.PBP's Makefile:
| Code: | PSPSDK = $(shell psp-config --pspsdk-path)
PSPLIBSDIR = $(PSPSDK)/..
TARGET = multiTasKing
OBJS = main.o graphics.o framebuffer.o
BUILD_PRX = 1
PRX_EXPORTS = exports.exp
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LIBS = -lpspgu -lpsppower -lpng -lz -lm
LDFLAGS =
EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = multiTasKing
#PSP_EBOOT_ICON = ICON0.png
include $(PSPSDK)/lib/build.mak
|
And the exports.exp:
| Code: | # Define the exports for the prx
PSP_BEGIN_EXPORTS
# Export our functions
PSP_EXPORT_START(multiTasKingLib, 0, 0x0001)
PSP_EXPORT_FUNC(delay)
PSP_EXPORT_FUNC(redondear)
PSP_EXPORT_FUNC(limpiarVentana)
PSP_EXPORT_FUNC(numeroDeVentanasAbiertas)
PSP_EXPORT_FUNC(crearNuevaVentana)
PSP_EXPORT_FUNC(eliminarVentana)
PSP_EXPORT_FUNC(ventanaPasaAPrimerPlano)
PSP_EXPORT_FUNC(existeVentana)
PSP_EXPORT_FUNC(printTextImage)
PSP_EXPORT_FUNC(fillImageRect)
PSP_EXPORT_END
PSP_END_EXPORTS |
And this is the "multiTasKingLib.S" that I include in the PRX: (generated with prxtools)
| Code: | .set noreorder
#include "pspimport.s"
IMPORT_START "multiTasKingLib",0x00090000
IMPORT_FUNC "multiTasKingLib",0x024F46AB,delay
IMPORT_FUNC "multiTasKingLib",0x843B7EAC,redondear
IMPORT_FUNC "multiTasKingLib",0x33A23BA9,limpiarVentana
IMPORT_FUNC "multiTasKingLib",0x93952B2A,numeroDeVentanasAbiertas
IMPORT_FUNC "multiTasKingLib",0xD4467F17,crearNuevaVentana
IMPORT_FUNC "multiTasKingLib",0x907F84B4,eliminarVentana
IMPORT_FUNC "multiTasKingLib",0x90435DD8,ventanaPasaAPrimerPlano
IMPORT_FUNC "multiTasKingLib",0x7EEEDC14,existeVentana
IMPORT_FUNC "multiTasKingLib",0x630D6778,printTextImage
IMPORT_FUNC "multiTasKingLib",0x04C6A497,fillImageRect
|
And also the exports.exp of the PRX:
| Code: | # 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
PSP_END_EXPORTS |
And the PRX's makefile:
| Code: | release: all
TARGET = aplicacion
OBJS = main.o multiTasKingLib.o
INCDIR =
CFLAGS = -O2 -G0 -Wall
CXXFLAGS = $(CFLAGS) -fno-exceptions -fno-rtti
ASFLAGS = $(CFLAGS)
LIBDIR =
LDFLAGS =
LIBS =
USE_KERNEL_LIBC = 1
USE_KERNEL_LIBS = 1
BUILD_PRX = 1
PRX_EXPORTS = exports.exp
PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build_prx.mak
|
Thanks again for your help :-)
Edit: I have added the ones that I have now.
The problem is that the PSP freezes when I start the PRX that is suposed to use the functions in "multiTasKingLib" |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Wed Sep 16, 2009 8:34 am Post subject: |
|
|
I have managed to make it work
Lots of searching examples, but finally, it works!!!
I have made a window environment capable of giving each PRX a window where write
Thanks a lot for your help Torch (not much, but I know you would have helped me until I make it work xDD)
Now I have to start programming PRX for my app :-P
Let see where it gets ;-)
Cheers,
Carlos
PD: For the curious: http://psp.scenebeta.com/node/38280 |
|
| Back to top |
|
 |
mypspdev
Joined: 11 Jul 2007 Posts: 178
|
Posted: Thu Sep 17, 2009 3:26 am Post subject: |
|
|
wow!!!
great!!
let me try to do something with MyTouchscreen..... |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Thu Sep 17, 2009 3:32 am Post subject: |
|
|
| mypspdev wrote: |
wow!!!
great!!
let me try to do something with MyTouchscreen..... |
Thank you :-D
Sorry, I don't understand the "let me try to do something with MyTouchscreen....." xD
¿What do you mean?
Thanks again :-)
PD: If you are not registered at psp.scenebeta.com, here it is the program:
http://server.carlosgs.es/PSPhomebrew/multiTasKing/multiTasKing_v70_PDC.rar |
|
| Back to top |
|
 |
mypspdev
Joined: 11 Jul 2007 Posts: 178
|
Posted: Thu Sep 17, 2009 4:06 am Post subject: |
|
|
.sorry ... deleted
... you have a ..PM..
Last edited by mypspdev on Thu Sep 17, 2009 6:29 pm; edited 1 time in total |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Thu Sep 17, 2009 5:28 pm Post subject: |
|
|
| mypspdev wrote: | | .sorry ... deleted |
Now I am completely lost xD |
|
| Back to top |
|
 |
pegasus2000
Joined: 12 Jul 2006 Posts: 160
|
Posted: Fri Sep 18, 2009 2:23 am Post subject: |
|
|
| A Nanodesktop SDK clone ? |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Fri Sep 18, 2009 3:37 am Post subject: Cool |
|
|
| pegasus2000 wrote: | | A Nanodesktop SDK clone ? |
I hadn't seen that app before, thanks for the advise ;-)
But I think it is not the same.
That is an SDK, this is only for managing .prx, so you need to use the PSPSDK.
(are you the author?)
Thanks again ;-) |
|
| Back to top |
|
 |
pegasus2000
Joined: 12 Jul 2006 Posts: 160
|
Posted: Fri Sep 18, 2009 3:39 am Post subject: Re: Cool |
|
|
| usertestprueba wrote: | | pegasus2000 wrote: | | A Nanodesktop SDK clone ? |
I hadn't seen that app before, thanks for the advise ;-)
But I think it is not the same.
That is an SDK, this is only for managing .prx, so you need to use the PSPSDK.
(are you the author?)
Thanks again ;-) |
Oh, yes. The project is mine. |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Fri Sep 18, 2009 4:09 am Post subject: Re: Cool |
|
|
| pegasus2000 wrote: | | usertestprueba wrote: | | pegasus2000 wrote: | | A Nanodesktop SDK clone ? |
I hadn't seen that app before, thanks for the advise ;-)
But I think it is not the same.
That is an SDK, this is only for managing .prx, so you need to use the PSPSDK.
(are you the author?)
Thanks again ;-) |
Oh, yes. The project is mine. |
Cool, congratulations ;-)
You are right, this really sounds like a clone xD
Trust me, it is not.
I'm trying to make multiTasKing as simple as possible, I don't plan to make an SDK for the PSP. Just want to make the coders able to make simple games and apps and have them all in a single EBOOT.PBP.
My first idea was to make only a window environment that uses threads, now I have managed to make .prx to run in it ;-)
And everything in a week ;-) (begun the 9/9/09 :-P)
Your proyect is different, easier to use, but this is lighter, and with less functions. |
|
| Back to top |
|
 |
pegasus2000
Joined: 12 Jul 2006 Posts: 160
|
Posted: Fri Sep 18, 2009 6:09 am Post subject: Re: Cool |
|
|
| usertestprueba wrote: | | pegasus2000 wrote: | | usertestprueba wrote: | | pegasus2000 wrote: | | A Nanodesktop SDK clone ? |
I hadn't seen that app before, thanks for the advise ;-)
But I think it is not the same.
That is an SDK, this is only for managing .prx, so you need to use the PSPSDK.
(are you the author?)
Thanks again ;-) |
Oh, yes. The project is mine. |
Cool, congratulations ;-)
You are right, this really sounds like a clone xD
Trust me, it is not.
I'm trying to make multiTasKing as simple as possible, I don't plan to make an SDK for the PSP. Just want to make the coders able to make simple games and apps and have them all in a single EBOOT.PBP.
My first idea was to make only a window environment that uses threads, now I have managed to make .prx to run in it ;-)
And everything in a week ;-) (begun the 9/9/09 :-P)
Your proyect is different, easier to use, but this is lighter, and with less functions. |
Yes, I understood. |
|
| Back to top |
|
 |
usertestprueba
Joined: 15 Sep 2009 Posts: 12 Location: Spain
|
Posted: Fri Sep 18, 2009 7:51 am Post subject: |
|
|
Wow
I've tried one of the examples of your app, it is great ;-)
But the best are all the examples you have in your website, you are an expert in image manipulation! (face recognition, edge detector.... simply amazing :-) )
Congratulations for all your job ;-) |
|
| Back to top |
|
 |
|
|
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
|