From f1a3e817709c8eda7afb1e44cad84b6a7635dc89 Mon Sep 17 00:00:00 2001 From: Crayon2000 Date: Fri, 25 Sep 2015 21:20:05 -0400 Subject: [PATCH] The GRRLIB code should now be able to compile for GameCube. --- GRRLIB/GRRLIB/GRRLIB_core.c | 16 +++++++++++++--- GRRLIB/GRRLIB/grrlib/GRRLIB_texSetup.h | 2 +- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/GRRLIB/GRRLIB/GRRLIB_core.c b/GRRLIB/GRRLIB/GRRLIB_core.c index 191d48c..5f5d87c 100644 --- a/GRRLIB/GRRLIB/GRRLIB_core.c +++ b/GRRLIB/GRRLIB/GRRLIB_core.c @@ -72,7 +72,8 @@ int GRRLIB_Init (void) { break; } - // 16:9 and 4:3 Screen Adjustment +#if defined(HW_RVL) + // 16:9 and 4:3 Screen Adjustment for Wii if (CONF_GetAspectRatio() == CONF_ASPECT_16_9) { rmode->viWidth = 678; rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678)/2; // This probably needs to consider PAL @@ -80,6 +81,11 @@ int GRRLIB_Init (void) { rmode->viWidth = 672; rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2; } +#else + // GameCube + rmode->viWidth = 672; + rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2; +#endif // -- VIDEO_Configure(rmode); @@ -181,8 +187,12 @@ int GRRLIB_Init (void) { */ void GRRLIB_Exit (void) { static bool done = false; - if (done || !is_setup) return; - else done = true; + if (done || !is_setup) { + return; + } + else { + done = true; + } // Allow write access to the full screen GX_SetClipMode( GX_CLIP_DISABLE ); diff --git a/GRRLIB/GRRLIB/grrlib/GRRLIB_texSetup.h b/GRRLIB/GRRLIB/grrlib/GRRLIB_texSetup.h index 5c82007..ed9dafd 100644 --- a/GRRLIB/GRRLIB/grrlib/GRRLIB_texSetup.h +++ b/GRRLIB/GRRLIB/grrlib/GRRLIB_texSetup.h @@ -60,6 +60,6 @@ void GRRLIB_FreeTexture (GRRLIB_texImg *tex) { */ INLINE void GRRLIB_ClearTex(GRRLIB_texImg* tex) { - bzero(tex->data, (tex->h * tex->w) << 2); + memset(tex->data, 0, (tex->h * tex->w) << 2); GRRLIB_FlushTex(tex); }