problem running eboot template on 3.90

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

Moderators: cheriff, TyRaNiD

Post Reply
dmonchild
Posts: 15
Joined: Sun Dec 23, 2007 5:46 pm

problem running eboot template on 3.90

Post by dmonchild »

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: Select all

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

#define printf pspDebugScreenPrintf

/* Define the module info section */
PSP_MODULE_INFO&#40;"template", 0, 1, 1&#41;;

/* Define the main thread's attribute value &#40;optional&#41; */
PSP_MAIN_THREAD_ATTR&#40;THREAD_ATTR_USER | THREAD_ATTR_VFPU&#41;;

int main&#40;int argc, char *argv&#91;&#93;&#41;
&#123;
	pspDebugScreenInit&#40;&#41;;

	pspDebugScreenPrintf&#40;"Hello World\n"&#41;;

	return 0;
&#125;
Makefile

Code: Select all

TARGET = template
OBJS = main.o

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

LIBDIR =
LDFLAGS =

EXTRA_TARGETS = EBOOT.PBP
PSP_EBOOT_TITLE = Template

PSPSDK=$&#40;shell psp-config --pspsdk-path&#41;
include $&#40;PSPSDK&#41;/lib/build.mak
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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

Code: Select all

...

	sceKernelDelayThread&#40;4*1000*1000&#41;;
	sceKernelExitGame&#40;&#41;;
	return 0;
&#125;
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.
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

and add

BUILD_PRX=1


in your makefile
--pspZorba--
NO to K1.5 !
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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: Select all

PSP_HEAP_SIZE_KB&#40;-256&#41;;
dmonchild
Posts: 15
Joined: Sun Dec 23, 2007 5:46 pm

Post by dmonchild »

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.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

If only you knew as much as you thought you do.
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

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 !
dmonchild
Posts: 15
Joined: Sun Dec 23, 2007 5:46 pm

Post by dmonchild »

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!
dmonchild
Posts: 15
Joined: Sun Dec 23, 2007 5:46 pm

Post by dmonchild »

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.
Insert_witty_name
Posts: 376
Joined: Wed May 10, 2006 11:31 pm

Post by Insert_witty_name »

Because your original post (before you edited it) was as far wrong as you could get :)
kralyk
Posts: 114
Joined: Sun Apr 06, 2008 8:18 pm
Location: Czech Republic, central EU

Post by kralyk »

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: Select all

PSP_HEAP_SIZE_KB&#40;-256&#41;;
I think PSP_HEAP_SIZE_MAX() is better, isnt it?

(unless youre pspsdk is outdated, of course)
pspZorba
Posts: 156
Joined: Sat Sep 22, 2007 11:45 am
Location: NY

Post by pspZorba »

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 !
kralyk
Posts: 114
Joined: Sun Apr 06, 2008 8:18 pm
Location: Czech Republic, central EU

Post by kralyk »

Ok thanks for explanation
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

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.
dmonchild
Posts: 15
Joined: Sun Dec 23, 2007 5:46 pm

Post by dmonchild »

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
Post Reply