summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2009-09-24 07:18:45 +0000
committer Aaron Giles <aaron@aarongiles.com>2009-09-24 07:18:45 +0000
commitd72571de57157c756c4669091d025dbf80ec7fb9 (patch)
treede72d0ea1fb39e90a82ed18af19cb1c38a9b50d7
parentaaafda3dd1d51a05968e75e0fe1807c406a27b66 (diff)
From: Christophe Jaillet [christophe.jaillet@wanadoo.fr]
Sent: Wednesday, September 23, 2009 2:54 PM To: submit@mamedev.org Subject: Tiny speed up in 'src\mame\video\neogeo.c' Hi, here is a patch against 'src\mame\video\neogeo.c' This patch give a tiny speed up in neogeo rendering and, IMO, gives the source code more readable. This is achieved by unrolling a loop in 'draw_fixed_layer' Doing so, the logic inside the loop is simplified, less arithmetic is performed and branches are avoided. Hope this helps, Best regards, Christophe Jaillet
-rw-r--r--src/mame/video/neogeo.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/mame/video/neogeo.c b/src/mame/video/neogeo.c
index b64ce75589a..d5b2e288062 100644
--- a/src/mame/video/neogeo.c
+++ b/src/mame/video/neogeo.c
@@ -334,24 +334,24 @@ if (banked)
}
{
- UINT8 data = 0;
+ UINT8 data;
int i;
UINT8 *gfx = &gfx_base[((code << 5) | (scanline & 0x07)) & addr_mask];
pen_t *char_pens = &pens[code_and_palette >> 12 << 4];
- for (i = 0; i < 8; i++)
+ for (i = 0; i < 4; i++)
{
static const UINT32 pix_offsets[] = { 0x10, 0x18, 0x00, 0x08 };
- if (i & 0x01)
- data = data >> 4;
- else
- data = gfx[pix_offsets[i >> 1]];
+ data = gfx[pix_offsets[i]];
if (data & 0x0f)
*pixel_addr = char_pens[data & 0x0f];
+ pixel_addr++;
+ if (data & 0xf0)
+ *pixel_addr = char_pens[(data & 0xf0) >> 4];
pixel_addr++;
}
}