Code Limits in Eboot??

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

Moderators: cheriff, TyRaNiD

Post Reply
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Code Limits in Eboot??

Post by reefbarman »

Hey everyone,

i came across something really weird during writing my program, my program would refuse to run when i added two new functions in, i went over and over these functions and there was absolutely nothing wrong with them, i then got a hunch that maybe i had too many function and or code in my main.c file so i commented out some other function i knew worked but didnt really need and then compiled and it worked i was amazed, i then went about changing the functions i commented out to make sure it just wasnt a conflict with the first functions i commented out, and no matter which functions i commented out the program worked again, but i tried uncommenting everything and bang the program refuses to run again,

Is there some sort of limit to the amount of code that can be compiled into an eboot or kept in the one .c file?? im using 3.03oeb to test my program
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

Just to confirm my suspicions i added more code into one of my functions, and bang it refuses to run again and just crashes the psp, how can i fix this break my code up into multiple files?? or is there just a limit that i can go past?
weltall
Posts: 310
Joined: Fri Feb 20, 2004 1:56 am
Contact:

Post by weltall »

most probably you have an allignment problem in your code. check if the variables which requires allignment are correctly alligned (like gu lists...)
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

mmmmm im not using gu list or anything like that really, i am using OSLib but i havent had any problems with allignment with it before and the code i add isnt anything special just initializing variables and such mmmm i might swap some positions of things around though
J.F.
Posts: 2906
Joined: Sun Feb 22, 2004 11:41 am

Post by J.F. »

I've seen PSP programs (without embedded roms or such) that were several megs in size (4.6M one was), so I seriously doubt there's any kind of size restriction beyond all the data fitting into the ~24M of RAM available. Maybe you have a compiler switch you're setting that switches on the MIPS equivalent to smallcode model. I don't know if the MIPS even has one, but it would be the first thing I'd think of on an x86 or 68k.
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

mmm i still cant figure it out, im just using boring old cygwin and make files to compile it with maybe i have something bad in my makefile could that be it???? is there any other reason why when i add more code even just an empty for loop or if statement that it crashes the psp??? everything compiles fine
User avatar
groepaz
Posts: 305
Joined: Thu Sep 01, 2005 7:44 am
Contact:

Post by groepaz »

listen to what weltall said, such behaviour is almost certainly caused by some alignment problem.
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

right and usually easy to debug with PSPLINK
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

okay what exactly is an allignment problem?? and im not using psplink should i be?
jockyw2001
Posts: 339
Joined: Thu Sep 29, 2005 4:19 pm

Post by jockyw2001 »

http://www.devx.com/tips/Tip/13265

Psplink allows you to very comfortably run and debug PSP apps. Read the Psplink thread!
reefbarman
Posts: 87
Joined: Mon Jan 08, 2007 12:16 pm
Location: Australia

Post by reefbarman »

okay i dont know what happened but i ran my app through psplink and it worked then compiled it for kxploit eboots and it worked with out psplink too, very weird and i changed nothing in the code, anyways thank for you help and i have to say i LOVE psplink
Post Reply