diff options
author | Phil Bennett <philipjbennett@users.noreply.github.com> | 2009-12-21 23:26:32 +0000 |
---|---|---|
committer | Phil Bennett <philipjbennett@users.noreply.github.com> | 2009-12-21 23:26:32 +0000 |
commit | 2434ce3faba76ee63a8a074883bf72978982d5ee (patch) | |
tree | d00bcb6a46ca0f0fe5e74e7fb1ba5d54394bb5d3 /src/mame/drivers/magicfly.c | |
parent | 2fd263c18b4697eb7b1ff14364445ae604964496 (diff) |
Eliminated the use of generic.colorram and generic.videoram in several drivers [Atari Ace]
---------- Forwarded message ----------
From: Atari Ace <atari_ace@verizon.net>
Date: Mon, Dec 14, 2009 at 5:43 AM
Subject: [patch] Eliminate generic.colorram
To: submit@mamedev.org
Cc: atariace@hotmail.com
Hi mamedev,
generic.colorram and generic.videoram are unused by the MAME core, and
are simply slots convenient for driver use. As such, the drivers are
better off using their own driver_data slots for these. To discourage
further use of colorram, this patch eliminates all current uses of it,
and the uses of videoram as well in the affected drivers. This is
partially a retrograde step, since ideally we'd like to introduce the
driver_data structs as well for these drivers, but eliminating
colorram and disentangling the various uses of generic makes it on the
balance an improvement IMHO.
~aa
Diffstat (limited to 'src/mame/drivers/magicfly.c')
-rw-r--r-- | src/mame/drivers/magicfly.c | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/mame/drivers/magicfly.c b/src/mame/drivers/magicfly.c index cd84fa6f2ba..eafce7b87bb 100644 --- a/src/mame/drivers/magicfly.c +++ b/src/mame/drivers/magicfly.c @@ -405,17 +405,19 @@ * Video Hardware * *************************/ +static UINT8 *videoram; +static UINT8 *colorram; static tilemap *bg_tilemap; static WRITE8_HANDLER( magicfly_videoram_w ) { - space->machine->generic.videoram.u8[offset] = data; + videoram[offset] = data; tilemap_mark_tile_dirty(bg_tilemap, offset); } static WRITE8_HANDLER( magicfly_colorram_w ) { - space->machine->generic.colorram.u8[offset] = data; + colorram[offset] = data; tilemap_mark_tile_dirty(bg_tilemap, offset); } @@ -430,16 +432,16 @@ static TILE_GET_INFO( get_magicfly_tile_info ) x--- ---- Mirrored from bit 3. The code check this one to boot the game. */ - int attr = machine->generic.colorram.u8[tile_index]; - int code = machine->generic.videoram.u8[tile_index]; + int attr = colorram[tile_index]; + int code = videoram[tile_index]; int bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ int color = attr & 0x07; /* bits 0-2 for color */ /* Seems that bit 7 is mirrored from bit 3 to have a normal boot */ /* Boot only check the first color RAM offset */ - machine->generic.colorram.u8[0] = machine->generic.colorram.u8[0] | ((machine->generic.colorram.u8[0] & 0x08) << 4); /* only for 1st offset */ -// machine->generic.colorram.u8[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ + colorram[0] = colorram[0] | ((colorram[0] & 0x08) << 4); /* only for 1st offset */ + //colorram[tile_index] = attr | ((attr & 0x08) << 4); /* for the whole color RAM */ SET_TILE_INFO(bank, code, color, 0); } @@ -460,16 +462,16 @@ static TILE_GET_INFO( get_7mezzo_tile_info ) x--- ---- Mirrored from bit 2. The code check this one to boot the game. */ - int attr = machine->generic.colorram.u8[tile_index]; - int code = machine->generic.videoram.u8[tile_index]; + int attr = colorram[tile_index]; + int code = videoram[tile_index]; int bank = (attr & 0x10) >> 4; /* bit 4 switch the gfx banks */ int color = attr & 0x07; /* bits 0-2 for color */ /* Seems that bit 7 is mirrored from bit 2 to have a normal boot */ /* Boot only check the first color RAM offset */ - machine->generic.colorram.u8[0] = machine->generic.colorram.u8[0] | ((machine->generic.colorram.u8[0] & 0x04) << 5); /* only for 1st offset */ -// machine->generic.colorram.u8[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ + colorram[0] = colorram[0] | ((colorram[0] & 0x04) << 5); /* only for 1st offset */ + //colorram[tile_index] = attr | ((attr & 0x04) << 5); /* for the whole color RAM */ SET_TILE_INFO(bank, code, color, 0); } @@ -556,8 +558,8 @@ static ADDRESS_MAP_START( magicfly_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_RAM AM_BASE_SIZE_GENERIC(nvram) /* MK48Z02B NVRAM */ AM_RANGE(0x0800, 0x0800) AM_DEVWRITE("crtc", mc6845_address_w) AM_RANGE(0x0801, 0x0801) AM_DEVREADWRITE("crtc", mc6845_register_r, mc6845_register_w) - AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(magicfly_videoram_w) AM_BASE_GENERIC(videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ - AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(magicfly_colorram_w) AM_BASE_GENERIC(colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ + AM_RANGE(0x1000, 0x13ff) AM_RAM_WRITE(magicfly_videoram_w) AM_BASE(&videoram) /* HM6116LP #1 (2K x 8) RAM (only 1st half used) */ + AM_RANGE(0x1800, 0x1bff) AM_RAM_WRITE(magicfly_colorram_w) AM_BASE(&colorram) /* HM6116LP #2 (2K x 8) RAM (only 1st half used) */ AM_RANGE(0x2800, 0x2800) AM_READ(mux_port_r) /* multiplexed input port */ AM_RANGE(0x3000, 0x3000) AM_WRITE(mux_port_w) /* output port */ AM_RANGE(0xc000, 0xffff) AM_ROM /* ROM space */ |