-set down mem2 which wiiflow can use, that should make it

more stable, and I havent seen somebody filling filling it
completely anyways :P
This commit is contained in:
fix94.1 2012-06-28 14:32:58 +00:00
parent 1c281bd0b2
commit 51b62d7e7e
2 changed files with 6 additions and 4 deletions

View File

@ -42,7 +42,7 @@ int main(int argc, char **argv)
CVideo vid; CVideo vid;
vid.init(); vid.init();
MEM2_init(49); //Thats everything we can get anyways MEM2_init(46); //Should be safe to use
vid.waitMessage(0.2f); vid.waitMessage(0.2f);
AllocSDGeckoBuffer(); AllocSDGeckoBuffer();

View File

@ -4,14 +4,16 @@
#include <algorithm> #include <algorithm>
#include <string.h> #include <string.h>
#define IOS_RELOAD_AREA 0x90200000
#include "lockMutex.hpp" #include "lockMutex.hpp"
void CMEM2Alloc::init(unsigned int size) void CMEM2Alloc::init(unsigned int size)
{ {
m_baseAddress = (SBlock *)(((u32)SYS_GetArena2Lo() + 31) & ~31); m_baseAddress = (SBlock *) std::max(((u32)SYS_GetArena2Lo() + 31) & ~31, IOS_RELOAD_AREA);
m_endAddress = (SBlock *)((char *)m_baseAddress + std::min(size * 0x100000, SYS_GetArena2Size() & ~31)); m_endAddress = (SBlock *)((char *)m_baseAddress + std::min(size * 0x100000, SYS_GetArena2Size() & ~31));
if (m_endAddress > (SBlock *)0x93100000) if (m_endAddress > (SBlock *) 0x93300000) //rest is reserved for usb/usb2/network and other stuff... (0xE0000 bytes)
m_endAddress = (SBlock *)0x93100000; m_endAddress = (SBlock *) 0x93300000;
SYS_SetArena2Lo(m_endAddress); SYS_SetArena2Lo(m_endAddress);
LWP_MutexInit(&m_mutex, 0); LWP_MutexInit(&m_mutex, 0);
} }