diff --git a/.github/workflows/doc.yml b/.github/workflows/doc.yml index 53055f1..44d1ca1 100644 --- a/.github/workflows/doc.yml +++ b/.github/workflows/doc.yml @@ -29,7 +29,7 @@ jobs: mv latex/refman.pdf doc/PDF-documentation.pdf - name: Deploy to GitHub Pages - uses: maxheld83/ghpages@v0.2.1 + uses: maxheld83/ghpages@v0.3.0 env: BUILD_DIR: ./doc GH_PAT: ${{ secrets.GH_PAT }} diff --git a/CHANGELOG.md b/CHANGELOG.md index e0ad8d8..e0595fa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# Change Log +# Changelog All notable changes to this project will be documented in this file. diff --git a/GRRLIB/GRRLIB/GRRLIB_core.c b/GRRLIB/GRRLIB/GRRLIB_core.c index e2e9602..38e99df 100644 --- a/GRRLIB/GRRLIB/GRRLIB_core.c +++ b/GRRLIB/GRRLIB/GRRLIB_core.c @@ -80,33 +80,41 @@ int GRRLIB_Init (void) { // 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 + rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 678) / 2; // This probably needs to consider PAL } else { // 4:3 rmode->viWidth = 672; - rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2; + rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672) / 2; } #else // GameCube rmode->viWidth = 672; - rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672)/2; + rmode->viXOrigin = (VI_MAX_WIDTH_NTSC - 672) / 2; #endif // -- VIDEO_Configure(rmode); // Get some memory to use for a "double buffered" frame buffer - if ( !(xfb[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode))) ) return -1; - if ( !(xfb[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode))) ) return -1; + if ( !(xfb[0] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode))) ) { + return -1; + } + if ( !(xfb[1] = MEM_K0_TO_K1(SYS_AllocateFramebuffer(rmode))) ) { + return -1; + } VIDEO_SetNextFramebuffer(xfb[fb]); // Choose a frame buffer to start with VIDEO_Flush(); // flush the frame to the TV VIDEO_WaitVSync(); // Wait for the TV to finish updating // If the TV image is interlaced it takes two passes to display the image - if (rmode->viTVMode & VI_NON_INTERLACE) VIDEO_WaitVSync(); + if (rmode->viTVMode & VI_NON_INTERLACE) { + VIDEO_WaitVSync(); + } // The FIFO is the buffer the CPU uses to send commands to the GPU - if ( !(gp_fifo = memalign(32, DEFAULT_FIFO_SIZE)) ) return -1; + if ( !(gp_fifo = memalign(32, DEFAULT_FIFO_SIZE)) ) { + return -1; + } memset(gp_fifo, 0, DEFAULT_FIFO_SIZE); GX_Init(gp_fifo, DEFAULT_FIFO_SIZE); @@ -179,10 +187,14 @@ int GRRLIB_Init (void) { atexit(GRRLIB_Exit); // Initialise the filing system - if (!fatInitDefault()) error_code = -2; + if (fatInitDefault() == false) { + error_code = -2; + } // Initialise TTF - if (GRRLIB_InitTTF()) error_code = -3; + if (GRRLIB_InitTTF() != 0) { + error_code = -3; + } VIDEO_SetBlack(false); // Enable video output return error_code; @@ -216,9 +228,18 @@ void GRRLIB_Exit (void) { GX_AbortFrame(); // Free up memory allocated for frame buffers & FIFOs - if (xfb[0] != NULL) { free(MEM_K1_TO_K0(xfb[0])); xfb[0] = NULL; } - if (xfb[1] != NULL) { free(MEM_K1_TO_K0(xfb[1])); xfb[1] = NULL; } - if (gp_fifo != NULL) { free(gp_fifo); gp_fifo = NULL; } + if (xfb[0] != NULL) { + free(MEM_K1_TO_K0(xfb[0])); + xfb[0] = NULL; + } + if (xfb[1] != NULL) { + free(MEM_K1_TO_K0(xfb[1])); + xfb[1] = NULL; + } + if (gp_fifo != NULL) { + free(gp_fifo); + gp_fifo = NULL; + } // Done with TTF GRRLIB_ExitTTF();