| View previous topic :: View next topic |
| Author |
Message |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Wed Sep 30, 2009 11:22 am Post subject: Slim extra memory Question |
|
|
Hi,
If you set the extra memory flag in the make file to use the slim RAM,
will the program fail to load on a PSP1000 straight away even if the extra RAM was not used?
If not, when will the program fail to load on a PSP1000... when a 40Mb array is defined, or when you go to use it? _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
Salvy
Joined: 30 Jun 2009 Posts: 9
|
Posted: Wed Sep 30, 2009 1:40 pm Post subject: |
|
|
You could take a look at Daedalusx64 source.
J.F did a great job enabling Slim extra RAM and such without breaking any phat functionality. |
|
| Back to top |
|
 |
Torch

Joined: 28 May 2008 Posts: 842
|
Posted: Wed Sep 30, 2009 3:23 pm Post subject: |
|
|
It will work fine on both. The only thing that changes is the amount of memory you can allocate dynamically. Mallocs will simple fail after there is no more free memory.
Since malloc uses the heap defined at compile time, you should use a negative value such as PSP_HEAP_SIZE_KB(-1024) instead of a hardcoded value. So you'll have 23MiB on Phat and 55MiB on the Slim with 1MiB for stacks etc in either case.
Or you could not use that heap at all and create one to use at runtime with the sce* functions after detecting Phat or Slim. Since extra memory isn't hardful, just use the PSP_HEAP_SIZE_KB method and allocate extra in your code depending on the model.
If you declare the 40MiB array at compile time then it will obviously fail on the Phat since 40MiB is statically allocated. The program will not work at all. If you have a pointer to the array, then only the 40MiB malloc will fail but you can handle the error. |
|
| Back to top |
|
 |
Art
Joined: 09 Nov 2005 Posts: 647
|
Posted: Thu Oct 01, 2009 2:16 pm Post subject: |
|
|
Thanks for that.. helpful since I still don't plan on getting one. _________________ If not actually, then potentially. |
|
| Back to top |
|
 |
|