diff --git a/source/gui/video.cpp b/source/gui/video.cpp index e5e245af..02da8ed4 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -64,11 +64,6 @@ const int CVideo::_stencilHeight = 128; static lwp_t waitThread = LWP_THREAD_NULL; SmartBuf waitThreadStack; -extern "C" -{ - extern __typeof(memalign) __real_memalign; -} - CVideo::CVideo(void) : m_rmode(NULL), m_frameBuf(), m_curFB(0), m_fifo(NULL), m_yScale(0.0f), m_xfbHeight(0), m_wide(false), @@ -150,7 +145,7 @@ void CVideo::init(void) VIDEO_WaitVSync(); if (m_rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); - m_fifo = __real_memalign(32, DEFAULT_FIFO_SIZE); + m_fifo = MEM1_memalign(32, DEFAULT_FIFO_SIZE); memset(m_fifo, 0, DEFAULT_FIFO_SIZE); GX_Init(m_fifo, DEFAULT_FIFO_SIZE); GX_SetCopyClear(CColor(0), 0x00FFFFFF); @@ -234,7 +229,7 @@ void CVideo::cleanup(void) SMART_FREE(m_aaBuffer[i]); m_aaBufferSize[i] = 0; } - SAFE_FREE(m_fifo); + MEM1_free(m_fifo); } void CVideo::prepareAAPass(int aaStep) diff --git a/source/memory/mem2.cpp b/source/memory/mem2.cpp index e09b1481..f5335f62 100644 --- a/source/memory/mem2.cpp +++ b/source/memory/mem2.cpp @@ -35,6 +35,11 @@ void *MEM1_alloc(unsigned int s) return __real_malloc(s); } +void *MEM1_memalign(unsigned int a, unsigned int s) +{ + return __real_memalign(a, s); +} + void *MEM1_realloc(void *p, unsigned int s) { return __real_realloc(p, s); @@ -45,7 +50,6 @@ void MEM1_free(void *p) __real_free(p); } - void MEM2_init(unsigned int mem2Size) { if(&_end + 0x100 > APPLOADER_START) diff --git a/source/memory/mem2.hpp b/source/memory/mem2.hpp index ff39a624..35b186a2 100644 --- a/source/memory/mem2.hpp +++ b/source/memory/mem2.hpp @@ -13,6 +13,7 @@ extern "C" #define MEM2_PRIORITY_SIZE 0x1000 void *MEM1_alloc(unsigned int s); +void *MEM1_memalign(unsigned int a, unsigned int s); void *MEM1_realloc(void *p, unsigned int s); void MEM1_free(void *p);