Advertising (This ad goes away for registered users. You can Login or Register)

Optimizing RAM usage

Forum rules
Forum rule Nº 15 is strictly enforced in this subforum.
Locked
hcf
Posts: 8
Joined: Tue Mar 21, 2017 4:00 pm

Optimizing RAM usage

Post by hcf »

Hi! After creating the port of "L'Abbaye des Morts" for PSP, I am working on another project. But this time, I am facing a problem due to the amount of RAM. The needed memory of this software is "around" 24 MB (sometimes a bit higher, sometimes a bit lower) so sometimes I see that it hangs due to lack of RAM.

I am using a PSP-FAT (32MB RAM), because I want that my port works in every PSP (I know that I could probably use a PSP-2000 to solve this RAM problem, but this is not the solution that I am looking for, because people with PSP-1000 would be unable to play it). And I am creating native C++ applications (not LUA ones).

As I am learning PSP development, I would need to know the way to maximize the available RAM for my program. If anyone could give me a few hints, it would be very useful...

Some things that I have investigated and tested:

* I have written "PSP_HEAP_SIZE_KB(-1024)". If I understood properly, this should maximize the available RAM for my port... but I don't see any difference after adding this codeline. I have not done anything related to the stack size (is it important to do it too?)

* I have initialized the video in SDL with HW_SURFACE instead of SW_SURFACE, because it should create the video buffer in video memory (instead of in regular RAM), saving a bit of RAM... but again I have not seen any big difference. Does this do anything different?

* I have packed/splitted my EBOOT.PSP; I don't know if this is useful, I don't know if the EBOOT.PSP or even the ELF are loaded in RAM. My ELF is currently 11MB and my EBOOT.PSP is currently 8 MB. Does this mean that I have 8 (or 11) Megabytes already wasted when I launch it?

* I have read that the memory ranging between 0x88000000 and 0x887FFFFF is the "kernel memory", beyond the available 24 MB. Can I safely use this memory for my port? I have not found any site where this is properly explained, and I don't know if I can even brick my console if I write on that address. Of course, being able to use this extra RAM will help.

If anyone could give me some clues to be sure that I am using the full available RAM, it would be very useful.
Thank you very much in advance!
Advertising
Locked

Return to “Programming and Security”