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 

Library needed for sceGeEdramSetSize?
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
MDave



Joined: 09 May 2005
Posts: 84

PostPosted: Fri Jul 04, 2008 10:05 pm    Post subject: Reply with quote

It's what happens when you try to get cygwin working on multiple drives on multiple window OS's :P

I'm having problems figuring out why the psp crashes if I have a byte over 1.75MB, yet the same code works fine on the PC version. It's probably a very easy fix, since I think I'm getting blind from looking at the same bits of code all the time :P Unless its a psp specific problem. Crashes even on a slim psp with the extra ram, so I'm doubtful its a limited ram issue.

The code is here:

video_hardware_draw.cpp

and here is another piece related to it.

video_hardware_surface.cpp

I will be very grateful if anyone can see where the problem is! Thanks.
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Jul 04, 2008 10:15 pm    Post subject: Reply with quote

Just a random thought while glancing over the code...

Maybe the crash isn't because of the massive global array, but with how this array is indexed or used etc.

As a test I would suggest leaving the MAX_LIGHTMAPS as is as 28, and just declare the array something like...

Code:
byte      lightmaps[1835008 + 10]; // If the total amount of bytes exceeds 1835008


If that works, then hard code whatever size it is that you require and try that too.

I have a sneaky feeling your crash has nothing to do with the size of your lightmaps variable, but with how it's used after that point.
Back to top
View user's profile Send private message
MDave



Joined: 09 May 2005
Posts: 84

PostPosted: Fri Jul 04, 2008 11:12 pm    Post subject: Reply with quote

I think I might be wrong about the 1835008, it looks to be higher then that now if I set it manually. It seems to be more about 2622152 before I get a black screen. What I would ideally need is 4194304 to display all the lightmaps in a map.

Something perculier happens if I start using more then 1835008 though! Some sounds don't play anymore, and at 2622152, no sounds play.

I guess its overwriting some of the quake heap. And the more I use, it must start using up memory thats needed to run the game. Heap size is 40MB though. Any idea on how to solve that? :P Thanks for the help so far!
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Jul 04, 2008 11:26 pm    Post subject: Reply with quote

Try playing with the size you're setting for the heap, initially I would decrease it - then try increasing it.

See if that makes any difference.
Back to top
View user's profile Send private message
MDave



Joined: 09 May 2005
Posts: 84

PostPosted: Fri Jul 04, 2008 11:39 pm    Post subject: Reply with quote

hmm, no difference, except it freezes during loading if I set the heap too high. (the quake heap, not the psp app heap).
Back to top
View user's profile Send private message
Insert_witty_name



Joined: 10 May 2006
Posts: 376

PostPosted: Fri Jul 04, 2008 11:57 pm    Post subject: Reply with quote

I was unaware that there was a internal Quake heap.

How is it allocated?
Back to top
View user's profile Send private message
MDave



Joined: 09 May 2005
Posts: 84

PostPosted: Sat Jul 05, 2008 1:46 am    Post subject: Reply with quote

It'll be easier for me to explain if shown you this:

main.cpp
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
Goto page Previous  1, 2
Page 2 of 2

 
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