mirror of
https://gitlab.com/GaryOderNichts/re3-wiiu.git
synced 2024-11-26 19:14:15 +01:00
wiiu: don't hardcode free memory
This commit is contained in:
parent
676f71e2d1
commit
91893ff104
@ -222,7 +222,7 @@ CStreaming::Init2(void)
|
||||
desiredNumVehiclesLoaded = (int32)((ms_memoryAvailable / MB - 50) / 3 + 12);
|
||||
if(desiredNumVehiclesLoaded > MAXVEHICLESLOADED)
|
||||
desiredNumVehiclesLoaded = MAXVEHICLESLOADED;
|
||||
debug("Memory allocated to Streaming is %zuMB", ms_memoryAvailable/MB); // original modifier was %d
|
||||
debug("Memory allocated to Streaming is %u", ms_memoryAvailable/MB);
|
||||
#undef MB
|
||||
#endif
|
||||
|
||||
|
@ -13,6 +13,8 @@
|
||||
#include <padscore/wpad.h>
|
||||
|
||||
#include <coreinit/time.h>
|
||||
#include <coreinit/memheap.h>
|
||||
#include <coreinit/memexpheap.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include "rwcore.h"
|
||||
@ -286,8 +288,17 @@ psInitialize(void)
|
||||
|
||||
#endif
|
||||
|
||||
// memory required to have all vehicles loaded
|
||||
_dwMemAvailPhys = 1024*1024*170;
|
||||
MEMHeapHandle heapHandle = MEMGetBaseHeapHandle(MEM_BASE_HEAP_MEM2);
|
||||
if (heapHandle) {
|
||||
_dwMemAvailPhys = MEMGetTotalFreeSizeForExpHeap(heapHandle);
|
||||
}
|
||||
else {
|
||||
debug("Can't get heap handle");
|
||||
// fall back to hardcoded value
|
||||
_dwMemAvailPhys = 1024*1024*500;
|
||||
}
|
||||
|
||||
debug("_dwMemAvailPhys: %u MB", _dwMemAvailPhys/1024/1024);
|
||||
|
||||
TheText.Unload();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user