From c10370ed571d57032f435ddd69877318e7d5bd4b Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 30 Oct 2014 23:55:51 +0100 Subject: Code readability - turn ZeroMemory into memset(a, 0, b) --- source/gfx.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'source/gfx.c') diff --git a/source/gfx.c b/source/gfx.c index ad5ef23..bb9a132 100644 --- a/source/gfx.c +++ b/source/gfx.c @@ -423,8 +423,8 @@ bool8 S9xGraphicsInit() } } } - ZeroMemory(GFX.ZERO, 0x10000 * sizeof(uint16)); - ZeroMemory(GFX.ZERO_OR_X2, 0x10000 * sizeof(uint16)); + memset(GFX.ZERO, 0, 0x10000 * sizeof(uint16)); + memset(GFX.ZERO_OR_X2, 0, 0x10000 * sizeof(uint16)); // Build a lookup table that if the top bit of the color value is zero // then the value is zero, otherwise multiply the value by 2. Used by // the color subtraction code. @@ -3643,8 +3643,8 @@ void S9xUpdateScreen() uint32 y; for (y = starty; y <= endy; y++) { - ZeroMemory(GFX.SubZBuffer + y * GFX.ZPitch, IPPU.RenderedScreenWidth); - ZeroMemory(GFX.ZBuffer + y * GFX.ZPitch, IPPU.RenderedScreenWidth); + memset(GFX.SubZBuffer + y * GFX.ZPitch, 0, IPPU.RenderedScreenWidth); + memset(GFX.ZBuffer + y * GFX.ZPitch, 0, IPPU.RenderedScreenWidth); if (IPPU.Clip [0].Count [5]) { @@ -3685,7 +3685,7 @@ void S9xUpdateScreen() uint32 y; for (y = starty; y <= endy; y++) { - ZeroMemory(GFX.ZBuffer + y * GFX.ZPitch, IPPU.RenderedScreenWidth); + memset(GFX.ZBuffer + y * GFX.ZPitch, 0, IPPU.RenderedScreenWidth); memset(GFX.SubZBuffer + y * GFX.ZPitch, 1, IPPU.RenderedScreenWidth); if (IPPU.Clip [0].Count [5]) @@ -4018,7 +4018,7 @@ void S9xUpdateScreen() { uint32 y; for (y = starty; y <= endy; y++) - ZeroMemory(GFX.ZBuffer + y * GFX.ZPitch, IPPU.RenderedScreenWidth); + memset(GFX.ZBuffer + y * GFX.ZPitch, 0, IPPU.RenderedScreenWidth); GFX.DB = GFX.ZBuffer; RenderScreen(GFX.Screen, FALSE, TRUE, SUB_SCREEN_DEPTH); } @@ -4032,7 +4032,7 @@ void S9xUpdateScreen() { if (PPU.BGMode != 5 && PPU.BGMode != 6 && IPPU.DoubleWidthPixels) { - // Mixure of background modes used on screen - scale width + // Mixture of background modes used on screen - scale width // of all non-mode 5 and 6 pixels. register uint32 y; for (y = starty; y <= endy; y++) -- cgit v1.2.3