From abf2db8198c4a2d5e72af3b938bf34eb544041f0 Mon Sep 17 00:00:00 2001 From: EkeEke Date: Sat, 17 Oct 2015 19:06:35 +0200 Subject: [PATCH] [Gamecube/Wii] minor optimizations (no need to invalidate D-cache) --- gx/gui/font.c | 4 ++-- gx/gui/font.h | 2 +- gx/gx_audio.c | 4 ++-- gx/gx_audio.h | 2 +- gx/gx_video.c | 12 ++++++------ gx/gx_video.h | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/gx/gui/font.c b/gx/gui/font.c index 3658214..1b26d0e 100644 --- a/gx/gui/font.c +++ b/gx/gui/font.c @@ -3,7 +3,7 @@ * * IPL font engine (using GX rendering) * - * Copyright Eke-Eke (2009-2013) + * Copyright Eke-Eke (2009-2015) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: @@ -213,7 +213,7 @@ static void DrawChar(unsigned char c, int xpos, int ypos, int size, GXColor colo /* reinitialize font texture data */ memset(fontTexture,0,fontHeader->cell_width * fontHeader->cell_height / 2); GetFontTexel(c,fontTexture,0,fontHeader->cell_width/2); - DCFlushRange(fontTexture, fontHeader->cell_width * fontHeader->cell_height / 2); + DCStoreRange(fontTexture, fontHeader->cell_width * fontHeader->cell_height / 2); GX_InvalidateTexAll(); /* adjust texture width */ diff --git a/gx/gui/font.h b/gx/gui/font.h index 8f51655..3d0eb21 100644 --- a/gx/gui/font.h +++ b/gx/gui/font.h @@ -3,7 +3,7 @@ * * IPL font engine (using GX rendering) * - * Copyright Eke-Eke (2009-2013) + * Copyright Eke-Eke (2009-2015) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: diff --git a/gx/gx_audio.c b/gx/gx_audio.c index 79901ec..1e619bc 100644 --- a/gx/gx_audio.c +++ b/gx/gx_audio.c @@ -3,7 +3,7 @@ * * Genesis Plus GX audio support * - * Copyright Eke-Eke (2007-2014), based on original work from Softdev (2006) + * Copyright Eke-Eke (2007-2015), based on original work from Softdev (2006) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: @@ -143,7 +143,7 @@ int gx_audio_Update(int status) { /* Retrieve audio samples (size must be multiple of 32 bytes) */ bufferSize = audio_update(sb) * 4; - DCFlushRange((void *)sb, bufferSize); + DCStoreRange((void *)sb, bufferSize); /* Mark current audio frame as being updated */ status &= ~AUDIO_UPDATE; diff --git a/gx/gx_audio.h b/gx/gx_audio.h index c417464..5f0cd8b 100644 --- a/gx/gx_audio.h +++ b/gx/gx_audio.h @@ -3,7 +3,7 @@ * * Genesis Plus GX audio support * - * Copyright Eke-Eke (2007-2014), based on original work from Softdev (2006) + * Copyright Eke-Eke (2007-2015), based on original work from Softdev (2006) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: diff --git a/gx/gx_video.c b/gx/gx_video.c index db90252..95179e0 100644 --- a/gx/gx_video.c +++ b/gx/gx_video.c @@ -3,7 +3,7 @@ * * Genesis Plus GX video & rendering support * - * Copyright Eke-Eke (2007-2014), based on original work from Softdev (2006) + * Copyright Eke-Eke (2007-2015), based on original work from Softdev (2006) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: @@ -682,7 +682,7 @@ static void gxResetScaler(u32 width) square[2] = square[4] = xshift + xscale; square[1] = square[3] = yshift + yscale; square[5] = square[7] = yshift - yscale; - DCFlushRange(square, 32); + DCStoreRange(square, 32); GX_InvVtxCache(); } @@ -1057,7 +1057,7 @@ void gxCopyScreenshot(gx_texture *texture) GX_LoadTexObj(&texobj, GX_TEXMAP0); GX_InvalidateTexAll(); GX_Flush(); - DCFlushRange(texture->data, texture->width * texture->height * 4); + DCStoreRange(texture->data, texture->width * texture->height * 4); } /* Take Screenshot */ @@ -1310,8 +1310,8 @@ gx_texture *gxTextureOpenPNG(const u8 *png_data, FILE *png_file) /* release memory */ free(img_data); - /* flush texture data from cache */ - DCFlushRange(texture->data, height * stride); + /* force texture data update in memory */ + DCStoreRange(texture->data, height * stride); return texture; } @@ -1768,7 +1768,7 @@ int gx_video_Update(int status) /* texture is now directly mapped by the line renderer */ /* force texture cache update */ - DCFlushRange(bitmap.data, vwidth*vheight*2); + DCStoreRange(bitmap.data, vwidth*vheight*2); GX_InvalidateTexAll(); /* disable EFB copy until rendering is done */ diff --git a/gx/gx_video.h b/gx/gx_video.h index 60305d1..60922bb 100644 --- a/gx/gx_video.h +++ b/gx/gx_video.h @@ -3,7 +3,7 @@ * * Genesis Plus GX video support * - * Copyright Eke-Eke (2007-2014), based on original work from Softdev (2006) + * Copyright Eke-Eke (2007-2015), based on original work from Softdev (2006) * * Redistribution and use of this code or any derivative works are permitted * provided that the following conditions are met: