| View previous topic :: View next topic |
| Author |
Message |
MDave
Joined: 09 May 2005 Posts: 84
|
Posted: Fri Jul 04, 2008 10:05 pm Post subject: |
|
|
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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Fri Jul 04, 2008 10:15 pm Post subject: |
|
|
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 |
|
 |
MDave
Joined: 09 May 2005 Posts: 84
|
Posted: Fri Jul 04, 2008 11:12 pm Post subject: |
|
|
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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Fri Jul 04, 2008 11:26 pm Post subject: |
|
|
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 |
|
 |
MDave
Joined: 09 May 2005 Posts: 84
|
Posted: Fri Jul 04, 2008 11:39 pm Post subject: |
|
|
| 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 |
|
 |
Insert_witty_name
Joined: 10 May 2006 Posts: 376
|
Posted: Fri Jul 04, 2008 11:57 pm Post subject: |
|
|
I was unaware that there was a internal Quake heap.
How is it allocated? |
|
| Back to top |
|
 |
MDave
Joined: 09 May 2005 Posts: 84
|
Posted: Sat Jul 05, 2008 1:46 am Post subject: |
|
|
It'll be easier for me to explain if shown you this:
main.cpp |
|
| Back to top |
|
 |
|