summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/video/epos.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-06-05 08:40:22 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-06-05 08:40:22 +0000
commit56279e278024dc354dfe145266cbd53ec58ad4b6 (patch)
treea07dcf4bb87156b1806fd5157163ebee89a9e7a9 /src/mame/video/epos.c
parent9073e622290222127a371722afeddbe01caefdd9 (diff)
From: Atari Ace [mailto:atari_ace@verizon.net]
Subject: [patch] memory_region madness The memory_region and memory_region_length functions are probably the two most common functions in MAME that don't take a machine parameter but probably should given the direction MAME has been going in removing global variable references. Attached are massive patches to accomplish this. I wish they could be smaller, but sadly, this is butchery, not brain surgery. The first patch makes some simplifications to help the second patch along. It is a general improvement as well, and hopefully can be applied even if the second patch is rejected. Specifically: 1. Introduced/updated some include files for files that export functions whose apis will need to be changed (cps1.h, decocrpt.h, ms32.h, pgm.h, fd1089.h, konami1.h). In the case of konami.c, I renamed the file konami1.c and changed the api and callers to only require one function export. 2. Pulled memory_region*() calls out of for loops and folded the occasional duplicated call. The compiler can't likely infer that the results are constant, so this should be a minor performance win as well.
Diffstat (limited to 'src/mame/video/epos.c')
-rw-r--r--src/mame/video/epos.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mame/video/epos.c b/src/mame/video/epos.c
index bfbfe84a677..44c36cc03bb 100644
--- a/src/mame/video/epos.c
+++ b/src/mame/video/epos.c
@@ -29,12 +29,14 @@ static UINT8 palette;
static void get_pens(pen_t *pens)
{
offs_t i;
+ const UINT8 *prom = memory_region(REGION_PROMS);
+ int len = memory_region_length(REGION_PROMS);
- for (i = 0; i < memory_region_length(REGION_PROMS); i++)
+ for (i = 0; i < len; i++)
{
int bit0, bit1, bit2, r, g, b;
- UINT8 data = memory_region(REGION_PROMS)[i];
+ UINT8 data = prom[i];
bit0 = (data >> 7) & 0x01;
bit1 = (data >> 6) & 0x01;