diff --git a/source/gui/video.cpp b/source/gui/video.cpp index b9e86f69..21e3f305 100644 --- a/source/gui/video.cpp +++ b/source/gui/video.cpp @@ -107,13 +107,12 @@ void CVideo::setAA(u8 aa, bool alpha, int width, int height) void CVideo::init(void) { VIDEO_Init(); + VIDEO_SetBlack(TRUE); m_wide = CONF_GetAspectRatio() == CONF_ASPECT_16_9; m_rmode = VIDEO_GetPreferredMode(NULL); - u32 type = CONF_GetVideo(); m_rmode->viWidth = m_wide ? 700 : 672; - if(m_rmode == &TVPal576IntDfScale || m_rmode == &TVPal576ProgScale) m_50hz = true; else @@ -140,12 +139,8 @@ void CVideo::init(void) m_frameBuf[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode)); m_frameBuf[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(m_rmode)); VIDEO_Configure(m_rmode); - m_curFB = 0; - VIDEO_SetBlack(TRUE); VIDEO_Flush(); - VIDEO_WaitVSync(); - if (m_rmode->viTVMode & VI_NON_INTERLACE) - VIDEO_WaitVSync(); + m_curFB = 0; m_fifo = MEM1_memalign(32, DEFAULT_FIFO_SIZE); memset(m_fifo, 0, DEFAULT_FIFO_SIZE); GX_Init(m_fifo, DEFAULT_FIFO_SIZE); @@ -172,12 +167,18 @@ void CVideo::init(void) GX_SetNumChans(0); GX_SetZCompLoc(GX_ENABLE); setup2DProjection(); - VIDEO_ClearFrameBuffer(m_rmode, m_frameBuf[m_curFB], COLOR_BLACK); + + VIDEO_ClearFrameBuffer(m_rmode, m_frameBuf[0], COLOR_BLACK); + VIDEO_ClearFrameBuffer(m_rmode, m_frameBuf[1], COLOR_BLACK); render(); - VIDEO_ClearFrameBuffer(m_rmode, m_frameBuf[m_curFB], COLOR_BLACK); render(); + VIDEO_SetBlack(FALSE); VIDEO_Flush(); + VIDEO_WaitVSync(); + if(m_rmode->viTVMode & VI_NON_INTERLACE) + VIDEO_WaitVSync(); + m_stencil = MEM1_memalign(32, CVideo::_stencilWidth * CVideo::_stencilHeight); memset(m_stencil, 0, CVideo::_stencilWidth * CVideo::_stencilHeight); } diff --git a/source/loader/sys.c b/source/loader/sys.c index 9adf23f0..f4265a9f 100644 --- a/source/loader/sys.c +++ b/source/loader/sys.c @@ -142,23 +142,3 @@ void Sys_LoadMenu(void) /* Return to the Wii system menu */ WII_ReturnToMenu(); //SYS_ResetSystem doesnt work properly with new libogc } - -void __dsp_shutdown(void) -{ - u32 tick; - - _dspReg[5] = (DSPCR_DSPRESET|DSPCR_HALT); - _dspReg[27] &= ~0x8000; - while(_dspReg[5]&0x400); - while(_dspReg[5]&0x200); - - _dspReg[5] = (DSPCR_DSPRESET|DSPCR_DSPINT|DSPCR_ARINT|DSPCR_AIINT|DSPCR_HALT); - _dspReg[0] = 0; - while((_SHIFTL(_dspReg[2],16,16)|(_dspReg[3]&0xffff))&0x80000000); - - tick = gettick(); - while((gettick()-tick)<44); - - _dspReg[5] |= DSPCR_RES; - while(_dspReg[5]&DSPCR_RES); -} diff --git a/source/loader/sys.h b/source/loader/sys.h index e6b3a2cb..a8a85dc4 100644 --- a/source/loader/sys.h +++ b/source/loader/sys.h @@ -18,17 +18,6 @@ extern "C" { #define EXIT_TO_DISABLE 4 #define EXIT_TO_BOOTMII 5 -// DSPCR bits -#define DSPCR_DSPRESET 0x0800 // Reset DSP -#define DSPCR_DSPINT 0x0080 // * interrupt active (RWC) -#define DSPCR_ARINT 0x0020 -#define DSPCR_AIINT 0x0008 -#define DSPCR_HALT 0x0004 // halt DSP -#define DSPCR_RES 0x0001 // reset DSP - -#define _SHIFTL(v, s, w) \ - ((u32) (((u32)(v) & ((0x01 << (w)) - 1)) << (s))) - /* Prototypes */ void Sys_Init(void); void Sys_LoadMenu(void); @@ -36,7 +25,6 @@ extern "C" { void Sys_Test(void); void Sys_Exit(void); void Sys_ExitTo(int); - void __dsp_shutdown(void); void Open_Inputs(void); void Close_Inputs(void); diff --git a/source/main.cpp b/source/main.cpp index 41c958df..b234e60c 100644 --- a/source/main.cpp +++ b/source/main.cpp @@ -37,12 +37,12 @@ int main(int argc, char **argv) { __exception_setreload(5); MEM1_init((void*)0x80003f00, (void*)0x80b00000); - MEM2_init(52); // Init video CVideo vid; vid.init(); + MEM2_init(52); geckoinit = InitGecko(); gprintf(" \nWelcome to %s (%s-r%s)!\nThis is the debug output.\n", APP_NAME, APP_VERSION, SVN_REV); vid.waitMessage(0.2f); diff --git a/source/menu/menu.cpp b/source/menu/menu.cpp index 5ec4475c..90303cf7 100644 --- a/source/menu/menu.cpp +++ b/source/menu/menu.cpp @@ -483,7 +483,6 @@ void CMenu::cleanup(bool ios_reload) if(!m_reload) { DeviceHandler::DestroyInstance(); - __dsp_shutdown(); m_vid.cleanup(); wiiLightOff(); }