diff --git a/src/core/Streaming.cpp b/src/core/Streaming.cpp index 17d8d6f6..0727506b 100644 --- a/src/core/Streaming.cpp +++ b/src/core/Streaming.cpp @@ -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 diff --git a/src/skel/wiiu/wiiu.cpp b/src/skel/wiiu/wiiu.cpp index 76a40ac2..0b473301 100644 --- a/src/skel/wiiu/wiiu.cpp +++ b/src/skel/wiiu/wiiu.cpp @@ -13,6 +13,8 @@ #include #include +#include +#include #include #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();