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 

problem running eboot template on 3.90

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



Joined: 23 Dec 2007
Posts: 15

PostPosted: Wed Jul 30, 2008 3:55 am    Post subject: problem running eboot template on 3.90 Reply with quote

hey i don't know what the hell is going on i ripped through this forum in search of info, and have yet to find anything this shits been killing me for days, i compile this piece of code the most basic form of EBOOT and when i fire it up my PSP shuts off, this didn't USED to happen it used to work perfectly fine on other firmwares. has there been a change I'm unaware of ?

Also I've noticed theres problems with buttons callbacks and other unusual shit, perhaps its the SDK or tool chain I've installed it on fedora core 8 shouldn't be a problem but who knows, its been known to do weirder things. They are the latest versions by the way.

Here is the sample i used the same old sample i been using as a template forever:
main.c
Code:

#include <pspkernel.h>
#include <pspdebug.h>

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO("template", 0, 1, 1);

/* Define the main thread's attribute value (optional) */
PSP_MAIN_THREAD_ATTR(THREAD_ATTR_USER | THREAD_ATTR_VFPU);

int main(int argc, char *argv[])
{
   pspDebugScreenInit();

   pspDebugScreenPrintf("Hello World\n");

   return 0;
}


Makefile
Code:

TARGET = template
OBJS = main.o

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

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$(shell psp-config --pspsdk-path)
include $(PSPSDK)/lib/build.mak
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jul 30, 2008 4:56 am    Post subject: Reply with quote

Well, other than needing a delay and a proper exit, it seems fine.

Code:
...

   sceKernelDelayThread(4*1000*1000);
   sceKernelExitGame();
   return 0;
}


If you still cant read the text and shut down cleanly, it's either the compiler or the PSP firmware. Related question - why are you on 3.90? 4.01 has been out for weeks now.
Back to top
View user's profile Send private message AIM Address
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Wed Jul 30, 2008 5:58 am    Post subject: Reply with quote

and add

BUILD_PRX=1


in your makefile
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Wed Jul 30, 2008 6:46 am    Post subject: Reply with quote

pspZorba wrote:
and add

BUILD_PRX=1


in your makefile


If he does that, he'll also need to set the heap size in main.c (or whatever you call the file with main() ).

Code:
PSP_HEAP_SIZE_KB(-256);
Back to top
View user's profile Send private message AIM Address
dmonchild



Joined: 23 Dec 2007
Posts: 15

PostPosted: Wed Jul 30, 2008 6:53 am    Post subject: Reply with quote

thanks for the help guys i'm a boob and edited this post for the sake of saving myself further embarresment hehe!

Last edited by dmonchild on Wed Jul 30, 2008 4:49 pm; edited 1 time in total
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Jul 30, 2008 9:40 am    Post subject: Reply with quote

If only you knew as much as you thought you do.
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Wed Jul 30, 2008 9:50 am    Post subject: Reply with quote

BUILD_PRX=1

is not prx shit, if you want to code for slim and fat with firmware > 3.xx without 1.5 support (I mean for all PSP that haven't 1.5K support) it is mandatory, and it produces still an Eboot.
If you don't do that you will have an error code like 800200d2 (I think) when launching it on those PSP.

Concerning the heap, the size of your Eboot has nothing to do with it, the heap is linked to the memory you dynamically allocate.

A very small hb may need lots of memory and a very big one may need a small amount of dynamic mem.

It is wise to define the Heap and Stack even if there are default values (which I don't know).
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
dmonchild



Joined: 23 Dec 2007
Posts: 15

PostPosted: Wed Jul 30, 2008 10:37 am    Post subject: Reply with quote

pspZorba wrote:
BUILD_PRX=1

is not prx shit, if you want to code for slim and fat with firmware > 3.xx without 1.5 support (I mean for all PSP that haven't 1.5K support) it is mandatory, and it produces still an Eboot.
If you don't do that you will have an error code like 800200d2 (I think) when launching it on those PSP.

Concerning the heap, the size of your Eboot has nothing to do with it, the heap is linked to the memory you dynamically allocate.

A very small hb may need lots of memory and a very big one may need a small amount of dynamic mem.

It is wise to define the Heap and Stack even if there are default values (which I don't know).


lol well what i ment to say was my program isnt taking more then a measly half a mb of ram its features are to move a file which is 44kb but the above shit about coding for 3.xx WITH OUT 1.50 i didnt know this should help me i appreciate the details! now i have a better understanding of what NOT to do in the future thanks again!
Back to top
View user's profile Send private message
dmonchild



Joined: 23 Dec 2007
Posts: 15

PostPosted: Wed Jul 30, 2008 4:47 pm    Post subject: Reply with quote

Insert_witty_name wrote:
If only you knew as much as you thought you do.


hmm sup with that homie? i was just askin a question you dont have to get personal on me.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Wed Jul 30, 2008 6:08 pm    Post subject: Reply with quote

Because your original post (before you edited it) was as far wrong as you could get :)
Back to top
View user's profile Send private message
kralyk



Joined: 06 Apr 2008
Posts: 114
Location: Czech Republic, central EU

PostPosted: Wed Jul 30, 2008 8:10 pm    Post subject: Reply with quote

J.F. wrote:

If he does that, he'll also need to set the heap size in main.c (or whatever you call the file with main() ).

Code:
PSP_HEAP_SIZE_KB(-256);


I think PSP_HEAP_SIZE_MAX() is better, isnt it?

(unless youre pspsdk is outdated, of course)
Back to top
View user's profile Send private message
pspZorba



Joined: 22 Sep 2007
Posts: 156
Location: NY

PostPosted: Wed Jul 30, 2008 10:02 pm    Post subject: Reply with quote

better ..well no

It depends on what you want to do, but if you set PSP_HEAP_SIZE_MAX(), it means your hb takes all the heap space and that it remains nothing for other PRXes you may have to load.

so J.F. is right (like most of the time)
_________________
--pspZorba--
NO to K1.5 !
Back to top
View user's profile Send private message
kralyk



Joined: 06 Apr 2008
Posts: 114
Location: Czech Republic, central EU

PostPosted: Wed Jul 30, 2008 10:05 pm    Post subject: Reply with quote

Ok thanks for explanation
Back to top
View user's profile Send private message
J.F.



Joined: 22 Feb 2004
Posts: 2906

PostPosted: Thu Jul 31, 2008 5:20 am    Post subject: Reply with quote

Not just other prxs - other THREADS. Most PSP apps create threads to do things (like install the exit callback in virtually every app). Memory for the thread's stack is NOT taken from the space of the app that spawns the thread - it's taken from the memory left over after the heap is allocated. Allocate too much memory (MAX) for the heap and nothing is left for threads. When you try to create the threads, they fail. Depending on the app, this causes the app to fail or act funny. Some programs will work without their helper threads, but at reduced functionality. For example, SNES9xTYL creates threads for the sound. If you set the heap too big and those threads fail to be created, SNES keeps running, but you don't get any sound.
Back to top
View user's profile Send private message AIM Address
dmonchild



Joined: 23 Dec 2007
Posts: 15

PostPosted: Thu Jul 31, 2008 5:35 am    Post subject: Reply with quote

Insert_witty_name wrote:
Because your original post (before you edited it) was as far wrong as you could get :)


yes i realized that after i read it back sometimes i type with out thinking hence why i came back n fixed it. its the worst with programming cuz its intangible so i get a little confused or mixed up and then i come back and I'm like WHAT THE HELL WAS I THINKING. but yo if im wrong TELL ME WHY cuz sometimes i need a reminder hey dummy thats wRONG DARRR! lmao i'm not the kinda guy to take offence to correction. but i do if people tell me im a dummy and dont tell me WHY lol then i wonder
_________________
hmm
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