From 0279e10c2610f6b24f409ae17103bb86ca23113b Mon Sep 17 00:00:00 2001 From: Phil Bennett Date: Wed, 21 Oct 2009 10:58:33 +0000 Subject: [PATCH] Sped up ertictac driver VIDEO_UPDATE [Christophe Jaillet] > -----Original Message----- > From: Christophe Jaillet [mailto:christophe.jaillet@wanadoo.fr] > Sent: Saturday, October 17, 2009 9:01 AM > To: submit@mamedev.org > Subject: Speedup drivers/ertictac.c > > Hi, > > in the driver 'drivers/ertictac.c' an array of pen is initialised on > each > VIDEO_UPDATE. > There is no need to do so and this array can be computed only once in > VIDEO_START. > > Hope this help. > Best regards, > > CJ --- src/mame/drivers/ertictac.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/mame/drivers/ertictac.c b/src/mame/drivers/ertictac.c index b452801b7d1..76715409a2f 100644 --- a/src/mame/drivers/ertictac.c +++ b/src/mame/drivers/ertictac.c @@ -29,10 +29,13 @@ TODO: #include "driver.h" #include "cpu/arm/arm.h" +#define NUM_PENS (0x100) + static UINT32 *ertictac_mainram; static UINT32 *ertictac_videoram; static UINT32 IRQSTA, IRQMSKA, IRQMSKB, FIQMSK, T1low, T1high; static UINT32 vidFIFO[256]; +static pen_t pens[NUM_PENS]; static WRITE32_HANDLER(video_fifo_w) { @@ -339,9 +342,7 @@ static INTERRUPT_GEN( ertictac_interrupt ) } -#define NUM_PENS (0x100) - -static void get_pens(pen_t *pens) +static VIDEO_START( ertictac ) { int color; @@ -360,9 +361,6 @@ static void get_pens(pen_t *pens) static VIDEO_UPDATE( ertictac ) { int y, x; - pen_t pens[NUM_PENS]; - - get_pens(pens); for (y = cliprect->min_y; y <= cliprect->max_y; y++) for (x = 0; x < 0x140; x += 4) @@ -395,6 +393,7 @@ static MACHINE_DRIVER_START( ertictac ) MDRV_SCREEN_SIZE(320, 256) MDRV_SCREEN_VISIBLE_AREA(0, 319, 0, 255) + MDRV_VIDEO_START(ertictac) MDRV_VIDEO_UPDATE(ertictac) MACHINE_DRIVER_END