From 4c693d72a551eecf7ea7cabb1ff810aa7488cb5e Mon Sep 17 00:00:00 2001 From: Aaron Giles Date: Wed, 4 Aug 2010 15:52:00 +0000 Subject: [PATCH] Removed global variables from gaelco, namco, and nile sound cores. [Atari Ace] -- From: Atari Ace Date: Mon, Aug 2, 2010 at 5:07 AM Subject: [patch] Remove globals from gaelco, namco and nile sound cores To: submit@mamedev.org Cc: atariace@hotmail.com Hi mamedev, This patch removes some global variables from the gaelco, namco and nile sound cores. Properly implemented devices should have all their variables in their device state to allow for multiple instances. ~aa --- src/emu/sound/gaelco.c | 48 ++++++++-------- src/emu/sound/gaelco.h | 2 - src/emu/sound/namco.c | 106 +++++++++++++++++++----------------- src/emu/sound/namco.h | 10 +--- src/emu/sound/nile.c | 13 ++--- src/emu/sound/nile.h | 2 - src/mame/drivers/20pacgal.c | 4 +- src/mame/drivers/baraduke.c | 2 +- src/mame/drivers/gaelco2.c | 12 ++-- src/mame/drivers/galaga.c | 8 +-- src/mame/drivers/gaplus.c | 23 +------- src/mame/drivers/jrpacman.c | 2 +- src/mame/drivers/mappy.c | 22 +++----- src/mame/drivers/namcos1.c | 2 +- src/mame/drivers/namcos86.c | 4 +- src/mame/drivers/pacland.c | 2 +- src/mame/drivers/pacman.c | 18 +++--- src/mame/drivers/pengo.c | 4 +- src/mame/drivers/polepos.c | 2 +- src/mame/drivers/rallyx.c | 2 +- src/mame/drivers/skykid.c | 4 +- src/mame/drivers/srmp6.c | 8 ++- src/mame/drivers/tceptor.c | 2 +- src/mame/drivers/toypop.c | 19 +------ 24 files changed, 140 insertions(+), 181 deletions(-) diff --git a/src/emu/sound/gaelco.c b/src/emu/sound/gaelco.c index da5890f0e6c..f814bfc8fcb 100644 --- a/src/emu/sound/gaelco.c +++ b/src/emu/sound/gaelco.c @@ -49,8 +49,6 @@ Registers per channel: #define GAELCO_NUM_CHANNELS 0x07 #define VOLUME_LEVELS 0x10 -UINT16 *gaelco_sndregs; - /* this structure defines a channel */ typedef struct _gaelco_sound_channel gaelco_sound_channel; struct _gaelco_sound_channel @@ -69,6 +67,8 @@ struct _gaelco_sound_state int banks[4]; /* start of each ROM bank */ gaelco_sound_channel channel[GAELCO_NUM_CHANNELS]; /* 7 stereo channels */ + UINT16 sndregs[0x38]; + /* table for converting from 8 to 16 bits with volume control */ INT16 volume_table[VOLUME_LEVELS][256]; }; @@ -115,47 +115,47 @@ static STREAM_UPDATE( gaelco_update ) base_offset = ch*8 + chunkNum*4; /* get channel parameters */ - type = ((gaelco_sndregs[base_offset + 1] >> 4) & 0x0f); - bank = info->banks[((gaelco_sndregs[base_offset + 1] >> 0) & 0x03)]; - vol_l = ((gaelco_sndregs[base_offset + 1] >> 12) & 0x0f); - vol_r = ((gaelco_sndregs[base_offset + 1] >> 8) & 0x0f); - end_pos = gaelco_sndregs[base_offset + 2] << 8; + type = ((info->sndregs[base_offset + 1] >> 4) & 0x0f); + bank = info->banks[((info->sndregs[base_offset + 1] >> 0) & 0x03)]; + vol_l = ((info->sndregs[base_offset + 1] >> 12) & 0x0f); + vol_r = ((info->sndregs[base_offset + 1] >> 8) & 0x0f); + end_pos = info->sndregs[base_offset + 2] << 8; /* generates output data (range 0x00000..0xffff) */ if (type == 0x08){ /* PCM, 8 bits mono */ - data = info->snd_data[bank + end_pos + gaelco_sndregs[base_offset + 3]]; + data = info->snd_data[bank + end_pos + info->sndregs[base_offset + 3]]; ch_data_l = info->volume_table[vol_l][data]; ch_data_r = info->volume_table[vol_r][data]; - gaelco_sndregs[base_offset + 3]--; + info->sndregs[base_offset + 3]--; } else if (type == 0x0c){ /* PCM, 8 bits stereo */ - data = info->snd_data[bank + end_pos + gaelco_sndregs[base_offset + 3]]; + data = info->snd_data[bank + end_pos + info->sndregs[base_offset + 3]]; ch_data_l = info->volume_table[vol_l][data]; - gaelco_sndregs[base_offset + 3]--; + info->sndregs[base_offset + 3]--; - if (gaelco_sndregs[base_offset + 3] > 0){ - data = info->snd_data[bank + end_pos + gaelco_sndregs[base_offset + 3]]; + if (info->sndregs[base_offset + 3] > 0){ + data = info->snd_data[bank + end_pos + info->sndregs[base_offset + 3]]; ch_data_r = info->volume_table[vol_r][data]; - gaelco_sndregs[base_offset + 3]--; + info->sndregs[base_offset + 3]--; } } else { - LOG_SOUND(("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, gaelco_sndregs[base_offset + 3])); + LOG_SOUND(("(GAE1) Playing unknown sample format in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", ch, type, bank, end_pos, info->sndregs[base_offset + 3])); channel->active = 0; } /* check if the current sample has finished playing */ - if (gaelco_sndregs[base_offset + 3] == 0){ + if (info->sndregs[base_offset + 3] == 0){ if (channel->loop == 0){ /* if no looping, we're done */ channel->active = 0; } else { /* if we're looping, swap chunks */ channel->chunkNum = (channel->chunkNum + 1) & 0x01; /* if the length of the next chunk is 0, we're done */ - if (gaelco_sndregs[ch*8 + channel->chunkNum*4 + 3] == 0){ + if (info->sndregs[ch*8 + channel->chunkNum*4 + 3] == 0){ channel->active = 0; } } @@ -194,9 +194,11 @@ static STREAM_UPDATE( gaelco_update ) READ16_DEVICE_HANDLER( gaelcosnd_r ) { + gaelco_sound_state *info = get_safe_token(device); + LOG_READ_WRITES(("%s: (GAE1): read from %04x\n", cpuexec_describe_context(device->machine), offset)); - return gaelco_sndregs[offset]; + return info->sndregs[offset]; } /*============================================================================ @@ -213,17 +215,17 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w ) /* first update the stream to this point in time */ stream_update(info->stream); - COMBINE_DATA(&gaelco_sndregs[offset]); + COMBINE_DATA(&info->sndregs[offset]); switch(offset & 0x07){ case 0x03: /* trigger sound */ - if ((gaelco_sndregs[offset - 1] != 0) && (data != 0)){ + if ((info->sndregs[offset - 1] != 0) && (data != 0)){ if (!channel->active){ channel->active = 1; channel->chunkNum = 0; channel->loop = 0; - LOG_SOUND(("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (gaelco_sndregs[offset - 2] >> 4) & 0x0f, gaelco_sndregs[offset - 2] & 0x03, gaelco_sndregs[offset - 1] << 8, data)); + LOG_SOUND(("(GAE1) Playing sample channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (info->sndregs[offset - 2] >> 4) & 0x0f, info->sndregs[offset - 2] & 0x03, info->sndregs[offset - 1] << 8, data)); } } else { channel->active = 0; @@ -232,8 +234,8 @@ WRITE16_DEVICE_HANDLER( gaelcosnd_w ) break; case 0x07: /* enable/disable looping */ - if ((gaelco_sndregs[offset - 1] != 0) && (data != 0)){ - LOG_SOUND(("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (gaelco_sndregs[offset - 2] >> 4) & 0x0f, gaelco_sndregs[offset - 2] & 0x03, gaelco_sndregs[offset - 1] << 8, data)); + if ((info->sndregs[offset - 1] != 0) && (data != 0)){ + LOG_SOUND(("(GAE1) Looping in channel: %02d, type: %02x, bank: %02x, end: %08x, Length: %04x\n", offset >> 3, (info->sndregs[offset - 2] >> 4) & 0x0f, info->sndregs[offset - 2] & 0x03, info->sndregs[offset - 1] << 8, data)); channel->loop = 1; } else { channel->loop = 0; diff --git a/src/emu/sound/gaelco.h b/src/emu/sound/gaelco.h index 334e782b132..0acfc044048 100644 --- a/src/emu/sound/gaelco.h +++ b/src/emu/sound/gaelco.h @@ -12,8 +12,6 @@ struct _gaelcosnd_interface int banks[4]; /* start of each ROM bank */ }; -extern UINT16 *gaelco_sndregs; - WRITE16_DEVICE_HANDLER( gaelcosnd_w ); READ16_DEVICE_HANDLER( gaelcosnd_r ); diff --git a/src/emu/sound/namco.c b/src/emu/sound/namco.c index 9e01a71f376..904da17f150 100644 --- a/src/emu/sound/namco.c +++ b/src/emu/sound/namco.c @@ -51,16 +51,14 @@ typedef struct } sound_channel; -/* globals available to everyone */ -UINT8 *namco_soundregs; -UINT8 *namco_wavedata; - typedef struct _namco_sound namco_sound; struct _namco_sound { /* data about the sound system */ sound_channel channel_list[MAX_VOICES]; sound_channel *last_channel; + UINT8 *soundregs; + UINT8 *wavedata; /* global sound parameters */ int wave_size; @@ -122,9 +120,8 @@ static void build_decoded_waveform(running_machine *machine, namco_sound *chip, int offset; int v; - if (rgnbase != NULL) - namco_wavedata = rgnbase; - + chip->wavedata = (rgnbase != NULL) ? rgnbase : auto_alloc_array_clear(machine, UINT8, 0x400); + /* 20pacgal has waves in RAM but old sound system */ if (rgnbase == NULL && chip->num_voices != 3) { @@ -146,10 +143,10 @@ static void build_decoded_waveform(running_machine *machine, namco_sound *chip, } /* We need waveform data. It fails if region is not specified. */ - if (namco_wavedata) + if (chip->wavedata) { for (offset = 0; offset < 256; offset++) - update_namco_waveform(chip, offset, namco_wavedata[offset]); + update_namco_waveform(chip, offset, chip->wavedata[offset]); } } @@ -373,6 +370,8 @@ static DEVICE_START( namco ) chip->last_channel = chip->channel_list + chip->num_voices; chip->stereo = intf->stereo; + chip->soundregs = auto_alloc_array_clear(device->machine, UINT8, 0x400); + /* adjust internal clock */ chip->namco_clock = device->clock(); for (clock_multiple = 0; chip->namco_clock < INTERNAL_RATE; clock_multiple++) @@ -463,14 +462,14 @@ WRITE8_DEVICE_HANDLER( pacman_sound_w ) int ch; data &= 0x0f; - if (namco_soundregs[offset] == data) + if (chip->soundregs[offset] == data) return; /* update the streams */ stream_update(chip->stream); /* set the register */ - namco_soundregs[offset] = data; + chip->soundregs[offset] = data; if (offset < 0x10) ch = (offset - 5) / 5; @@ -497,11 +496,11 @@ WRITE8_DEVICE_HANDLER( pacman_sound_w ) case 0x14: /* the frequency has 20 bits */ /* the first voice has extra frequency bits */ - voice->frequency = (ch == 0) ? namco_soundregs[0x10] : 0; - voice->frequency += (namco_soundregs[ch * 5 + 0x11] << 4); - voice->frequency += (namco_soundregs[ch * 5 + 0x12] << 8); - voice->frequency += (namco_soundregs[ch * 5 + 0x13] << 12); - voice->frequency += (namco_soundregs[ch * 5 + 0x14] << 16); /* always 0 */ + voice->frequency = (ch == 0) ? chip->soundregs[0x10] : 0; + voice->frequency += (chip->soundregs[ch * 5 + 0x11] << 4); + voice->frequency += (chip->soundregs[ch * 5 + 0x12] << 8); + voice->frequency += (chip->soundregs[ch * 5 + 0x13] << 12); + voice->frequency += (chip->soundregs[ch * 5 + 0x14] << 16); /* always 0 */ break; case 0x15: @@ -559,14 +558,14 @@ WRITE8_DEVICE_HANDLER( polepos_sound_w ) sound_channel *voice; int ch; - if (namco_soundregs[offset] == data) + if (chip->soundregs[offset] == data) return; /* update the streams */ stream_update(chip->stream); /* set the register */ - namco_soundregs[offset] = data; + chip->soundregs[offset] = data; ch = (offset & 0x1f) / 4; @@ -577,8 +576,8 @@ WRITE8_DEVICE_HANDLER( polepos_sound_w ) case 0x00: case 0x01: /* the frequency has 16 bits */ - voice->frequency = namco_soundregs[ch * 4 + 0x00]; - voice->frequency += namco_soundregs[ch * 4 + 0x01] << 8; + voice->frequency = chip->soundregs[ch * 4 + 0x00]; + voice->frequency += chip->soundregs[ch * 4 + 0x01] << 8; break; case 0x23: @@ -588,17 +587,17 @@ WRITE8_DEVICE_HANDLER( polepos_sound_w ) case 0x03: voice->volume[0] = voice->volume[1] = 0; // front speakers ? - voice->volume[0] += namco_soundregs[ch * 4 + 0x03] >> 4; - voice->volume[1] += namco_soundregs[ch * 4 + 0x03] & 0x0f; + voice->volume[0] += chip->soundregs[ch * 4 + 0x03] >> 4; + voice->volume[1] += chip->soundregs[ch * 4 + 0x03] & 0x0f; // rear speakers ? - voice->volume[0] += namco_soundregs[ch * 4 + 0x23] >> 4; - voice->volume[1] += namco_soundregs[ch * 4 + 0x02] >> 4; + voice->volume[0] += chip->soundregs[ch * 4 + 0x23] >> 4; + voice->volume[1] += chip->soundregs[ch * 4 + 0x02] >> 4; voice->volume[0] /= 2; voice->volume[1] /= 2; /* if 54XX or 52XX selected, silence this voice */ - if (namco_soundregs[ch * 4 + 0x23] & 8) + if (chip->soundregs[ch * 4 + 0x23] & 8) voice->volume[0] = voice->volume[1] = 0; break; } @@ -631,20 +630,20 @@ void mappy_sound_enable(running_device *device, int enable) chip->sound_enable = enable; } -WRITE8_DEVICE_HANDLER( namco_15xx_w ) +static WRITE8_DEVICE_HANDLER( namco_15xx_w ) { namco_sound *chip = get_safe_token(device); sound_channel *voice; int ch; - if (namco_soundregs[offset] == data) + if (chip->soundregs[offset] == data) return; /* update the streams */ stream_update(chip->stream); /* set the register */ - namco_soundregs[offset] = data; + chip->soundregs[offset] = data; ch = offset / 8; if (ch >= chip->num_voices) @@ -663,9 +662,9 @@ WRITE8_DEVICE_HANDLER( namco_15xx_w ) case 0x04: case 0x05: /* the frequency has 20 bits */ - voice->frequency = namco_soundregs[ch * 8 + 0x04]; - voice->frequency += namco_soundregs[ch * 8 + 0x05] << 8; - voice->frequency += (namco_soundregs[ch * 8 + 0x06] & 15) << 16; /* high bits are from here */ + voice->frequency = chip->soundregs[ch * 8 + 0x04]; + voice->frequency += chip->soundregs[ch * 8 + 0x05] << 8; + voice->frequency += (chip->soundregs[ch * 8 + 0x06] & 15) << 16; /* high bits are from here */ break; } } @@ -712,16 +711,16 @@ static WRITE8_DEVICE_HANDLER( namcos1_sound_w ) return; } - namco_soundregs = namco_wavedata + 0x100; + chip->soundregs = chip->wavedata + 0x100; - if (namco_soundregs[offset] == data) + if (chip->soundregs[offset] == data) return; /* update the streams */ stream_update(chip->stream); /* set the register */ - namco_soundregs[offset] = data; + chip->soundregs[offset] = data; ch = offset / 8; if (ch >= chip->num_voices) @@ -740,9 +739,9 @@ static WRITE8_DEVICE_HANDLER( namcos1_sound_w ) case 0x02: case 0x03: /* the frequency has 20 bits */ - voice->frequency = (namco_soundregs[ch * 8 + 0x01] & 15) << 16; /* high bits are from here */ - voice->frequency += namco_soundregs[ch * 8 + 0x02] << 8; - voice->frequency += namco_soundregs[ch * 8 + 0x03]; + voice->frequency = (chip->soundregs[ch * 8 + 0x01] & 15) << 16; /* high bits are from here */ + voice->frequency += chip->soundregs[ch * 8 + 0x02] << 8; + voice->frequency += chip->soundregs[ch * 8 + 0x03]; break; case 0x04: @@ -758,15 +757,16 @@ static WRITE8_DEVICE_HANDLER( namcos1_sound_w ) WRITE8_DEVICE_HANDLER( namcos1_cus30_w ) { + namco_sound *chip = get_safe_token(device); + if (offset < 0x100) { - if (namco_wavedata[offset] != data) + if (chip->wavedata[offset] != data) { - namco_sound *chip = get_safe_token(device); /* update the streams */ stream_update(chip->stream); - namco_wavedata[offset] = data; + chip->wavedata[offset] = data; /* update the decoded waveform table */ update_namco_waveform(chip, offset, data); @@ -775,27 +775,31 @@ WRITE8_DEVICE_HANDLER( namcos1_cus30_w ) else if (offset < 0x140) namcos1_sound_w(device, offset - 0x100,data); else - namco_wavedata[offset] = data; + chip->wavedata[offset] = data; } READ8_DEVICE_HANDLER( namcos1_cus30_r ) { - return namco_wavedata[offset]; + namco_sound *chip = get_safe_token(device); + + return chip->wavedata[offset]; } -WRITE8_DEVICE_HANDLER( _20pacgal_wavedata_w ) +READ8_DEVICE_HANDLER( namco_snd_sharedram_r ) { namco_sound *chip = get_safe_token(device); - if (namco_wavedata[offset] != data) + return chip->soundregs[offset]; +} + +WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w ) +{ + if (offset < 0x40) + namco_15xx_w(device, offset, data); + else { - /* update the streams */ - stream_update(chip->stream); - - namco_wavedata[offset] = data; - - /* update the decoded waveform table */ - update_namco_waveform(chip, offset, data); + namco_sound *chip = get_safe_token(device); + chip->soundregs[offset] = data; } } diff --git a/src/emu/sound/namco.h b/src/emu/sound/namco.h index 39d485cdf0d..a85c16b6b96 100644 --- a/src/emu/sound/namco.h +++ b/src/emu/sound/namco.h @@ -19,18 +19,12 @@ void polepos_sound_enable(running_device *device, int enable); WRITE8_DEVICE_HANDLER( polepos_sound_w ); void mappy_sound_enable(running_device *device, int enable); -WRITE8_DEVICE_HANDLER( namco_15xx_w ); WRITE8_DEVICE_HANDLER( namcos1_cus30_w ); /* wavedata + sound registers + RAM */ READ8_DEVICE_HANDLER( namcos1_cus30_r ); -WRITE8_DEVICE_HANDLER( _20pacgal_wavedata_w ); - -extern UINT8 *namco_soundregs; -extern UINT8 *namco_wavedata; - -#define pacman_soundregs namco_soundregs -#define polepos_soundregs namco_soundregs +READ8_DEVICE_HANDLER( namco_snd_sharedram_r ); +WRITE8_DEVICE_HANDLER( namco_snd_sharedram_w ); DECLARE_LEGACY_SOUND_DEVICE(NAMCO, namco); DECLARE_LEGACY_SOUND_DEVICE(NAMCO_15XX, namco_15xx); diff --git a/src/emu/sound/nile.c b/src/emu/sound/nile.c index bf39ee41abb..3a39636406f 100644 --- a/src/emu/sound/nile.c +++ b/src/emu/sound/nile.c @@ -52,13 +52,12 @@ enum -UINT16 *nile_sound_regs; - typedef struct _nile_state nile_state; struct _nile_state { sound_stream * stream; UINT8 *sound_ram; + UINT16 sound_regs[0x80]; int vpos[NILE_VOICES], frac[NILE_VOICES], lponce[NILE_VOICES]; UINT16 ctrl; }; @@ -104,7 +103,7 @@ READ16_DEVICE_HANDLER( nile_snd_r ) if(reg==2 || reg==3) { int slot=offset/16; - int sptr = ((nile_sound_regs[slot*16+3]<<16)|nile_sound_regs[slot*16+2])+info->vpos[slot]; + int sptr = ((info->sound_regs[slot*16+3]<<16)|info->sound_regs[slot*16+2])+info->vpos[slot]; if(reg==2) { @@ -115,7 +114,7 @@ READ16_DEVICE_HANDLER( nile_snd_r ) return sptr>>16; } } - return nile_sound_regs[offset]; + return info->sound_regs[offset]; } WRITE16_DEVICE_HANDLER( nile_snd_w ) @@ -125,7 +124,7 @@ WRITE16_DEVICE_HANDLER( nile_snd_w ) stream_update(info->stream); - COMBINE_DATA(&nile_sound_regs[offset]); + COMBINE_DATA(&info->sound_regs[offset]); v = offset / 16; r = offset % 16; @@ -135,7 +134,7 @@ WRITE16_DEVICE_HANDLER( nile_snd_w ) info->vpos[v] = info->frac[v] = info->lponce[v] = 0; } -// printf("v%02d: %04x to reg %02d (PC=%x)\n", v, nile_sound_regs[offset], r, cpu_get_pc(space->cpu)); + //printf("v%02d: %04x to reg %02d (PC=%x)\n", v, info->sound_regs[offset], r, cpu_get_pc(space->cpu)); } static STREAM_UPDATE( nile_update ) @@ -155,7 +154,7 @@ static STREAM_UPDATE( nile_update ) for (v = 0; v < NILE_VOICES; v++) { - slot = &nile_sound_regs[v * 16]; + slot = &info->sound_regs[v * 16]; if (info->ctrl&(1<machine, "LIGHT1 static ADDRESS_MAP_START( bang_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ - AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) AM_BASE(&gaelco_sndregs) /* Sound Registers */ + AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_BASE_SIZE_GENERIC(spriteram) /* Video RAM */ AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_BASE_GENERIC(paletteram) /* Palette */ AM_RANGE(0x218004, 0x218009) AM_READONLY /* Video Registers */ @@ -435,7 +435,7 @@ ROM_END static ADDRESS_MAP_START( alighunt_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ - AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) AM_BASE(&gaelco_sndregs) /* Sound Registers */ + AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_BASE_SIZE_GENERIC(spriteram) /* Video RAM */ AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_BASE_GENERIC(paletteram) /* Palette */ AM_RANGE(0x218004, 0x218009) AM_RAM AM_BASE(&gaelco2_vregs) /* Video Registers */ @@ -647,7 +647,7 @@ static READ16_HANDLER ( dallas_kludge_r ) static ADDRESS_MAP_START( touchgo_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ - AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) AM_BASE(&gaelco_sndregs) /* Sound Registers */ + AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_BASE_SIZE_GENERIC(spriteram) /* Video RAM */ AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_BASE_GENERIC(paletteram) /* Palette */ AM_RANGE(0x218004, 0x218009) AM_RAM AM_BASE(&gaelco2_vregs) /* Video Registers */ @@ -912,7 +912,7 @@ ROM_END static ADDRESS_MAP_START( snowboar_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ - AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) AM_BASE(&gaelco_sndregs) /* Sound Registers */ + AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_BASE_SIZE_GENERIC(spriteram) /* Video RAM */ AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_BASE_GENERIC(paletteram) /* Palette */ AM_RANGE(0x212000, 0x213fff) AM_RAM /* Extra RAM */ @@ -1098,7 +1098,7 @@ ROM_END static ADDRESS_MAP_START( wrally2_map, ADDRESS_SPACE_PROGRAM, 16 ) AM_RANGE(0x000000, 0x0fffff) AM_ROM /* ROM */ - AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) AM_BASE(&gaelco_sndregs) /* Sound Registers */ + AM_RANGE(0x202890, 0x2028ff) AM_DEVREADWRITE("gaelco", gaelcosnd_r, gaelcosnd_w) /* Sound Registers */ AM_RANGE(0x200000, 0x20ffff) AM_RAM_WRITE(gaelco2_vram_w) AM_BASE_SIZE_GENERIC(spriteram) /* Video RAM */ AM_RANGE(0x210000, 0x211fff) AM_RAM_WRITE(gaelco2_palette_w) AM_BASE_GENERIC(paletteram) /* Palette */ AM_RANGE(0x212000, 0x213fff) AM_RAM /* Extra RAM */ diff --git a/src/mame/drivers/galaga.c b/src/mame/drivers/galaga.c index ce7a8eb9651..49c5bdd6197 100644 --- a/src/mame/drivers/galaga.c +++ b/src/mame/drivers/galaga.c @@ -914,7 +914,7 @@ static MACHINE_RESET( battles ) static ADDRESS_MAP_START( bosco_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_WRITENOP /* the only area different for each CPU */ AM_RANGE(0x6800, 0x6807) AM_READ(bosco_dsw_r) - AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs) + AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */ AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w) AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx_0", namco_06xx_data_r, namco_06xx_data_w) @@ -936,7 +936,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( galaga_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_WRITENOP /* the only area different for each CPU */ AM_RANGE(0x6800, 0x6807) AM_READ(bosco_dsw_r) - AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs) + AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */ AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w) AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w) @@ -953,7 +953,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( xevious_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_WRITENOP /* the only area different for each CPU */ AM_RANGE(0x6800, 0x6807) AM_READ(bosco_dsw_r) - AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs) + AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */ AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w) AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w) @@ -973,7 +973,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( digdug_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROM AM_WRITENOP /* the only area different for each CPU */ - AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs) + AM_RANGE(0x6800, 0x681f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x6820, 0x6827) AM_WRITE(bosco_latch_w) /* misc latches */ AM_RANGE(0x6830, 0x6830) AM_WRITE(watchdog_reset_w) AM_RANGE(0x7000, 0x70ff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w) diff --git a/src/mame/drivers/gaplus.c b/src/mame/drivers/gaplus.c index 812b889830d..c92d3170c59 100644 --- a/src/mame/drivers/gaplus.c +++ b/src/mame/drivers/gaplus.c @@ -167,20 +167,6 @@ static WRITE8_HANDLER( gaplus_spriteram_w ) gaplus_spriteram[offset] = data; } -static READ8_HANDLER( gaplus_snd_sharedram_r ) -{ - return namco_soundregs[offset]; -} - -static WRITE8_DEVICE_HANDLER( gaplus_snd_sharedram_w ) -{ - if (offset < 0x40) - namco_15xx_w(device,offset,data); - else - namco_soundregs[offset] = data; -} - - static WRITE8_HANDLER( gaplus_irq_1_ctrl_w ) { int bit = !BIT(offset, 11); @@ -268,8 +254,7 @@ static INTERRUPT_GEN( gaplus_interrupt_1 ) static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_READWRITE(gaplus_videoram_r, gaplus_videoram_w) AM_BASE(&gaplus_videoram) /* tilemap RAM (shared with CPU #2) */ AM_RANGE(0x0800, 0x1fff) AM_READWRITE(gaplus_spriteram_r, gaplus_spriteram_w) AM_BASE(&gaplus_spriteram) /* shared RAM with CPU #2 (includes sprite RAM) */ - AM_RANGE(0x6000, 0x63ff) AM_READ(gaplus_snd_sharedram_r) /* shared RAM with CPU #3 */ - AM_RANGE(0x6000, 0x63ff) AM_DEVWRITE("namco", gaplus_snd_sharedram_w) /* shared RAM with CPU #3 */ + AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with CPU #3 */ AM_RANGE(0x6800, 0x680f) AM_DEVREADWRITE("56xx", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x6810, 0x681f) AM_DEVREADWRITE("58xx", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x6820, 0x682f) AM_READWRITE(gaplus_customio_3_r, gaplus_customio_3_w) AM_BASE(&gaplus_customio_3) /* custom I/O chip #3 interface */ @@ -284,8 +269,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( gaplusa_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_READWRITE(gaplus_videoram_r, gaplus_videoram_w) AM_BASE(&gaplus_videoram) /* tilemap RAM (shared with CPU #2) */ AM_RANGE(0x0800, 0x1fff) AM_READWRITE(gaplus_spriteram_r, gaplus_spriteram_w) AM_BASE(&gaplus_spriteram) /* shared RAM with CPU #2 (includes sprite RAM) */ - AM_RANGE(0x6000, 0x63ff) AM_READ(gaplus_snd_sharedram_r) /* shared RAM with CPU #3 */ - AM_RANGE(0x6000, 0x63ff) AM_DEVWRITE("namco", gaplus_snd_sharedram_w) /* shared RAM with CPU #3 */ + AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with CPU #3 */ AM_RANGE(0x6800, 0x680f) AM_DEVREADWRITE("58xx", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x6810, 0x681f) AM_DEVREADWRITE("56xx", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x6820, 0x682f) AM_READWRITE(gaplus_customio_3_r, gaplus_customio_3_w) AM_BASE(&gaplus_customio_3) /* custom I/O chip #3 interface */ @@ -306,8 +290,7 @@ static ADDRESS_MAP_START( cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) ADDRESS_MAP_END static ADDRESS_MAP_START( cpu3_map, ADDRESS_SPACE_PROGRAM, 8 ) - AM_RANGE(0x0000, 0x03ff) AM_READ(gaplus_snd_sharedram_r) /* shared RAM with CPU #1 */ - AM_RANGE(0x0000, 0x03ff) AM_DEVWRITE("namco", gaplus_snd_sharedram_w) AM_BASE(&namco_soundregs) /* shared RAM with the main CPU + sound registers */ + AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the main CPU + sound registers */ AM_RANGE(0x2000, 0x3fff) AM_READWRITE(watchdog_reset_r, watchdog_reset_w) /* watchdog? */ AM_RANGE(0x4000, 0x7fff) AM_WRITE(gaplus_irq_3_ctrl_w) /* interrupt enable/disable */ AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */ diff --git a/src/mame/drivers/jrpacman.c b/src/mame/drivers/jrpacman.c index bff3609ae1e..2c4086a378f 100644 --- a/src/mame/drivers/jrpacman.c +++ b/src/mame/drivers/jrpacman.c @@ -128,7 +128,7 @@ static ADDRESS_MAP_START( main_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5001, 0x5001) AM_DEVWRITE("namco", pacman_sound_enable_w) AM_RANGE(0x5003, 0x5003) AM_WRITE(pacman_flipscreen_w) AM_RANGE(0x5040, 0x507f) AM_READ_PORT("P2") - AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x5070) AM_WRITE(pengo_palettebank_w) AM_RANGE(0x5071, 0x5071) AM_WRITE(pengo_colortablebank_w) diff --git a/src/mame/drivers/mappy.c b/src/mame/drivers/mappy.c index ad85a981e04..e562cddc6e6 100644 --- a/src/mame/drivers/mappy.c +++ b/src/mame/drivers/mappy.c @@ -577,14 +577,6 @@ TODO: /***************************************************************************/ -static WRITE8_DEVICE_HANDLER( mappy_snd_sharedram_w ) -{ - if (offset < 0x40) - namco_15xx_w(device,offset,data); - else - namco_soundregs[offset] = data; -} - static WRITE8_HANDLER( superpac_latch_w ) { running_device *namcoio_1 = space->machine->device("namcoio_1"); @@ -884,7 +876,7 @@ static ADDRESS_MAP_START( superpac_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(superpac_videoram_w) AM_BASE_MEMBER(mappy_state,videoram) /* video RAM */ AM_RANGE(0x0800, 0x1fff) AM_RAM AM_BASE_MEMBER(mappy_state,spriteram) /* work RAM with embedded sprite RAM */ AM_RANGE(0x2000, 0x2000) AM_READWRITE(superpac_flipscreen_r, superpac_flipscreen_w) - AM_RANGE(0x4000, 0x43ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") /* shared RAM with the sound CPU */ + AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the sound CPU */ AM_RANGE(0x4800, 0x480f) AM_DEVREADWRITE("namcoio_1", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x4810, 0x481f) AM_DEVREADWRITE("namcoio_2", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x5000, 0x500f) AM_WRITE(superpac_latch_w) /* various control bits */ @@ -895,7 +887,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( phozon_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(superpac_videoram_w) AM_SHARE("share2") AM_BASE_MEMBER(mappy_state,videoram) /* video RAM */ AM_RANGE(0x0800, 0x1fff) AM_RAM AM_BASE_MEMBER(mappy_state,spriteram) AM_SHARE("share3") /* shared RAM with CPU #2/sprite RAM*/ - AM_RANGE(0x4000, 0x43ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") /* shared RAM with the sound CPU */ + AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the sound CPU */ AM_RANGE(0x4800, 0x480f) AM_DEVREADWRITE("namcoio_1", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x4810, 0x481f) AM_DEVREADWRITE("namcoio_2", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x5000, 0x500f) AM_WRITE(phozon_latch_w) /* various control bits */ @@ -907,7 +899,7 @@ static ADDRESS_MAP_START( mappy_cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x0fff) AM_RAM_WRITE(mappy_videoram_w) AM_BASE_MEMBER(mappy_state,videoram) /* video RAM */ AM_RANGE(0x1000, 0x27ff) AM_RAM AM_BASE_MEMBER(mappy_state,spriteram) /* work RAM with embedded sprite RAM */ AM_RANGE(0x3800, 0x3fff) AM_WRITE(mappy_scroll_w) /* scroll */ - AM_RANGE(0x4000, 0x43ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") /* shared RAM with the sound CPU */ + AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the sound CPU */ AM_RANGE(0x4800, 0x480f) AM_DEVREADWRITE("namcoio_1", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x4810, 0x481f) AM_DEVREADWRITE("namcoio_2", namcoio_r, namcoio_w) /* custom I/O chips interface */ AM_RANGE(0x5000, 0x500f) AM_WRITE(mappy_latch_w) /* various control bits */ @@ -917,18 +909,18 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( superpac_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) - AM_RANGE(0x0000, 0x03ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") AM_BASE(&namco_soundregs) /* shared RAM with the main CPU (also sound registers) */ + AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the main CPU (also sound registers) */ AM_RANGE(0x2000, 0x200f) AM_WRITE(superpac_latch_w) /* various control bits */ AM_RANGE(0xe000, 0xffff) AM_ROM ADDRESS_MAP_END static ADDRESS_MAP_START( phozon_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) - AM_RANGE(0x0000, 0x03ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") AM_BASE(&namco_soundregs) /* shared RAM with the main CPU + sound registers */ + AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the main CPU + sound registers */ AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */ ADDRESS_MAP_END static ADDRESS_MAP_START( mappy_cpu2_map, ADDRESS_SPACE_PROGRAM, 8 ) - AM_RANGE(0x0000, 0x03ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") AM_BASE(&namco_soundregs) /* shared RAM with the main CPU (also sound registers) */ + AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the main CPU (also sound registers) */ AM_RANGE(0x2000, 0x200f) AM_WRITE(mappy_latch_w) /* various control bits */ AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM code */ ADDRESS_MAP_END @@ -938,7 +930,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( phozon_cpu3_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(superpac_videoram_w) AM_SHARE("share2") /* video RAM */ AM_RANGE(0x0800, 0x1fff) AM_RAM AM_SHARE("share3") /* shared RAM with CPU #2/sprite RAM*/ - AM_RANGE(0x4000, 0x43ff) AM_RAM_DEVWRITE("namco", mappy_snd_sharedram_w) AM_SHARE("share1") /* shared RAM with CPU #2 */ + AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with CPU #2 */ AM_RANGE(0xa000, 0xa7ff) AM_RAM /* RAM */ AM_RANGE(0xe000, 0xffff) AM_ROM /* ROM */ ADDRESS_MAP_END diff --git a/src/mame/drivers/namcos1.c b/src/mame/drivers/namcos1.c index e5cad6c6219..a2f99cfe4ba 100644 --- a/src/mame/drivers/namcos1.c +++ b/src/mame/drivers/namcos1.c @@ -466,7 +466,7 @@ static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x3fff) AM_ROMBANK("bank17") /* Banked ROMs */ AM_RANGE(0x4000, 0x4001) AM_DEVREAD("ymsnd", ym2151_status_port_r) AM_RANGE(0x4000, 0x4001) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w) - AM_RANGE(0x5000, 0x53ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_MIRROR(0x400) AM_BASE(&namco_wavedata) /* PSG ( Shared ) */ + AM_RANGE(0x5000, 0x53ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_MIRROR(0x400) /* PSG ( Shared ) */ AM_RANGE(0x7000, 0x77ff) AM_RAMBANK("bank18") /* TRIRAM (shared) */ AM_RANGE(0x8000, 0x9fff) AM_RAM /* Sound RAM 3 */ AM_RANGE(0xc000, 0xc001) AM_WRITE(namcos1_sound_bankswitch_w) /* ROM bank selector */ diff --git a/src/mame/drivers/namcos86.c b/src/mame/drivers/namcos86.c index 233317d4a26..2e12a29da7e 100644 --- a/src/mame/drivers/namcos86.c +++ b/src/mame/drivers/namcos86.c @@ -356,7 +356,7 @@ static ADDRESS_MAP_START( cpu1_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x1fff) AM_READWRITE(rthunder_videoram1_r,rthunder_videoram1_w) AM_BASE(&rthunder_videoram1) AM_RANGE(0x2000, 0x3fff) AM_READWRITE(rthunder_videoram2_r,rthunder_videoram2_w) AM_BASE(&rthunder_videoram2) - AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namcos1_cus30_r,namcos1_cus30_w) AM_BASE(&namco_wavedata) /* PSG device, shared RAM */ + AM_RANGE(0x4000, 0x43ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ AM_RANGE(0x4000, 0x5fff) AM_READWRITE(rthunder_spriteram_r,rthunder_spriteram_w) @@ -411,7 +411,7 @@ CPU2_MEMORY( wndrmomo, 0x2000, 0x4000, 0x6000, UNUSED, UNUSED, 0xc000, 0xc800 ) static ADDRESS_MAP_START( NAME##_mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) \ AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_internal_registers_r,hd63701_internal_registers_w) \ AM_RANGE(0x0080, 0x00ff) AM_RAM \ - AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r,namcos1_cus30_w) /* PSG device, shared RAM */ \ + AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ \ AM_RANGE(0x1400, 0x1fff) AM_RAM \ AM_RANGE(ADDR_INPUT+0x00, ADDR_INPUT+0x01) AM_DEVREADWRITE("ymsnd", ym2151_r, ym2151_w) \ AM_RANGE(ADDR_INPUT+0x20, ADDR_INPUT+0x20) AM_READ_PORT("IN0") \ diff --git a/src/mame/drivers/pacland.c b/src/mame/drivers/pacland.c index e1f08d9c404..a73bab1eae6 100644 --- a/src/mame/drivers/pacland.c +++ b/src/mame/drivers/pacland.c @@ -267,7 +267,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_internal_registers_r, hd63701_internal_registers_w) AM_RANGE(0x0080, 0x00ff) AM_RAM - AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_BASE(&namco_wavedata) /* PSG device, shared RAM */ + AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ AM_RANGE(0x2000, 0x3fff) AM_WRITE(watchdog_reset_w) /* watchdog? */ AM_RANGE(0x4000, 0x7fff) AM_WRITE(pacland_irq_2_ctrl_w) AM_RANGE(0x8000, 0xbfff) AM_ROM diff --git a/src/mame/drivers/pacman.c b/src/mame/drivers/pacman.c index d0fb39917c6..a2e3ba1d065 100644 --- a/src/mame/drivers/pacman.c +++ b/src/mame/drivers/pacman.c @@ -904,7 +904,7 @@ static ADDRESS_MAP_START( pacman_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP @@ -931,7 +931,7 @@ static ADDRESS_MAP_START( mspacman_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP @@ -971,7 +971,7 @@ static ADDRESS_MAP_START( woodpek_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP @@ -996,7 +996,7 @@ static ADDRESS_MAP_START( alibaba_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x506f) AM_MIRROR(0xaf00) AM_WRITE(alibaba_sound_w) AM_BASE(&pacman_soundregs) /* the sound region is not contiguous */ + AM_RANGE(0x5040, 0x506f) AM_MIRROR(0xaf00) AM_WRITE(alibaba_sound_w) /* the sound region is not contiguous */ AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) /* actually at 5050-505f, here to point to free RAM */ AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP @@ -1029,7 +1029,7 @@ static ADDRESS_MAP_START( dremshpr_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) -// AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) +// AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP @@ -1056,7 +1056,7 @@ static ADDRESS_MAP_START( epos_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP @@ -1136,7 +1136,7 @@ static ADDRESS_MAP_START( rocktrv2_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5001, 0x5001) AM_DEVWRITE("namco", pacman_sound_enable_w) AM_RANGE(0x5003, 0x5003) AM_WRITE(pacman_flipscreen_w) AM_RANGE(0x5007, 0x5007) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w) AM_RANGE(0x5fe0, 0x5fe3) AM_WRITE(rocktrv2_prot_data_w) AM_BASE(&rocktrv2_prot_data) AM_RANGE(0x5ff0, 0x5ff0) AM_WRITE(rocktrv2_question_bank_w) @@ -1163,7 +1163,7 @@ static ADDRESS_MAP_START( bigbucks_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5001, 0x5001) AM_DEVWRITE("namco", pacman_sound_enable_w) AM_RANGE(0x5003, 0x5003) AM_WRITE(pacman_flipscreen_w) AM_RANGE(0x5007, 0x5007) AM_WRITENOP /*?*/ - AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x50c0, 0x50c0) AM_WRITE(watchdog_reset_w) AM_RANGE(0x5000, 0x503f) AM_READ_PORT("IN0") /* IN0 */ AM_RANGE(0x5040, 0x507f) AM_READ_PORT("IN1") /* IN1 */ @@ -1189,7 +1189,7 @@ static ADDRESS_MAP_START( mschamp_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x5004, 0x5005) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_leds_w) AM_RANGE(0x5006, 0x5006) AM_MIRROR(0xaf38) AM_WRITENOP // AM_WRITE(pacman_coin_lockout_global_w) AM_RANGE(0x5007, 0x5007) AM_MIRROR(0xaf38) AM_WRITE(pacman_coin_counter_w) - AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x5040, 0x505f) AM_MIRROR(0xaf00) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x5060, 0x506f) AM_MIRROR(0xaf00) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x5070, 0x507f) AM_MIRROR(0xaf00) AM_WRITENOP AM_RANGE(0x5080, 0x5080) AM_MIRROR(0xaf3f) AM_WRITENOP diff --git a/src/mame/drivers/pengo.c b/src/mame/drivers/pengo.c index 16e971c2488..b36a08a728d 100644 --- a/src/mame/drivers/pengo.c +++ b/src/mame/drivers/pengo.c @@ -102,7 +102,7 @@ static ADDRESS_MAP_START( pengo_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8400, 0x87ff) AM_RAM_WRITE(pacman_colorram_w) AM_BASE(&pacman_colorram) AM_RANGE(0x8800, 0x8fef) AM_RAM AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) - AM_RANGE(0x9000, 0x901f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x9000, 0x901f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x9020, 0x902f) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x9000, 0x903f) AM_READ_PORT("DSW1") AM_RANGE(0x9040, 0x907f) AM_READ_PORT("DSW0") @@ -124,7 +124,7 @@ static ADDRESS_MAP_START( jrpacmbl_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8000, 0x87ff) AM_RAM_WRITE(jrpacman_videoram_w) AM_BASE(&pacman_videoram) AM_RANGE(0x8800, 0x8fef) AM_RAM AM_RANGE(0x8ff0, 0x8fff) AM_RAM AM_BASE_SIZE_GENERIC(spriteram) - AM_RANGE(0x9000, 0x901f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&pacman_soundregs) + AM_RANGE(0x9000, 0x901f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0x9020, 0x902f) AM_WRITEONLY AM_BASE_GENERIC(spriteram2) AM_RANGE(0x9030, 0x9030) AM_WRITE(jrpacman_scroll_w) AM_RANGE(0x9040, 0x904f) AM_READ_PORT("DSW") diff --git a/src/mame/drivers/polepos.c b/src/mame/drivers/polepos.c index 061fa8dbc02..96fe963d478 100644 --- a/src/mame/drivers/polepos.c +++ b/src/mame/drivers/polepos.c @@ -486,7 +486,7 @@ static ADDRESS_MAP_START( z80_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x8000, 0x83ff) AM_MIRROR(0x0c00) AM_READONLY /* Sound Memory */ AM_RANGE(0x8000, 0x83bf) AM_MIRROR(0x0c00) AM_WRITEONLY /* Sound Memory */ - AM_RANGE(0x83c0, 0x83ff) AM_MIRROR(0x0c00) AM_DEVWRITE("namco", polepos_sound_w) AM_BASE(&polepos_soundregs)/* Sound data */ + AM_RANGE(0x83c0, 0x83ff) AM_MIRROR(0x0c00) AM_DEVWRITE("namco", polepos_sound_w) /* Sound data */ AM_RANGE(0x9000, 0x9000) AM_MIRROR(0x0eff) AM_DEVREADWRITE("06xx", namco_06xx_data_r, namco_06xx_data_w) AM_RANGE(0x9100, 0x9100) AM_MIRROR(0x0eff) AM_DEVREADWRITE("06xx", namco_06xx_ctrl_r, namco_06xx_ctrl_w) diff --git a/src/mame/drivers/rallyx.c b/src/mame/drivers/rallyx.c index ee94b5a08b1..fc4a6fe9b82 100644 --- a/src/mame/drivers/rallyx.c +++ b/src/mame/drivers/rallyx.c @@ -323,7 +323,7 @@ static ADDRESS_MAP_START( rallyx_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0xa100, 0xa100) AM_READ_PORT("DSW") AM_RANGE(0xa000, 0xa00f) AM_WRITEONLY AM_BASE_MEMBER(timeplt_state, radarattr) AM_RANGE(0xa080, 0xa080) AM_WRITE(watchdog_reset_w) - AM_RANGE(0xa100, 0xa11f) AM_DEVWRITE("namco", pacman_sound_w) AM_BASE(&namco_soundregs) + AM_RANGE(0xa100, 0xa11f) AM_DEVWRITE("namco", pacman_sound_w) AM_RANGE(0xa130, 0xa130) AM_WRITE(rallyx_scrollx_w) AM_RANGE(0xa140, 0xa140) AM_WRITE(rallyx_scrolly_w) AM_RANGE(0xa170, 0xa170) AM_WRITENOP /* ? */ diff --git a/src/mame/drivers/skykid.c b/src/mame/drivers/skykid.c index dc4396a8670..26e11cfe44d 100644 --- a/src/mame/drivers/skykid.c +++ b/src/mame/drivers/skykid.c @@ -120,7 +120,7 @@ static ADDRESS_MAP_START( skykid_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x4800, 0x5fff) AM_RAM AM_BASE(&skykid_spriteram) /* RAM + Sprite RAM */ AM_RANGE(0x6000, 0x60ff) AM_WRITE(skykid_scroll_y_w) /* Y scroll register map */ AM_RANGE(0x6200, 0x63ff) AM_WRITE(skykid_scroll_x_w) /* X scroll register map */ - AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namcos1_cus30_r,namcos1_cus30_w) AM_BASE(&namco_wavedata)/* PSG device, shared RAM */ + AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ AM_RANGE(0x7000, 0x7fff) AM_WRITE(skykid_irq_1_ctrl_w) /* IRQ control */ AM_RANGE(0x7800, 0x7fff) AM_READ(watchdog_reset_r) /* watchdog reset */ AM_RANGE(0x8000, 0xffff) AM_ROM /* ROM */ @@ -132,7 +132,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_internal_registers_r, hd63701_internal_registers_w) AM_RANGE(0x0080, 0x00ff) AM_RAM - AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_BASE(&namco_wavedata) /* PSG device, shared RAM */ + AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) /* PSG device, shared RAM */ AM_RANGE(0x2000, 0x3fff) AM_WRITE(watchdog_reset_w) /* watchdog? */ AM_RANGE(0x4000, 0x7fff) AM_WRITE(skykid_irq_2_ctrl_w) AM_RANGE(0x8000, 0xbfff) AM_ROM diff --git a/src/mame/drivers/srmp6.c b/src/mame/drivers/srmp6.c index 944e0514a44..6f5dc60193b 100644 --- a/src/mame/drivers/srmp6.c +++ b/src/mame/drivers/srmp6.c @@ -324,10 +324,12 @@ static WRITE16_HANDLER( video_regs_w ) { case 0x5e/2: // bank switch, used by ROM check + { + const UINT8 *rom = memory_region(space->machine, "nile"); LOG(("%x\n",data)); - - memory_set_bankptr(space->machine, "bank1",(UINT16 *)(memory_region(space->machine, "nile") + (data & 0x0f)*0x200000)); + memory_set_bankptr(space->machine, "bank1",(UINT16 *)(rom + (data & 0x0f)*0x200000)); break; + } // set by IT4 case 0x5c/2: // either 0x40 explicitely in many places, or according $2083b0 (IT4) @@ -548,7 +550,7 @@ static ADDRESS_MAP_START( srmp6, ADDRESS_SPACE_PROGRAM, 16 ) //AM_RANGE(0x5fff00, 0x5fffff) AM_WRITE(dma_w) AM_BASE_MEMBER(srmp6_state,dmaram) AM_RANGE(0x4c0000, 0x4c006f) AM_READWRITE(video_regs_r, video_regs_w) AM_BASE_MEMBER(srmp6_state,video_regs) // ? gfx regs ST-0026 NiLe - AM_RANGE(0x4e0000, 0x4e00ff) AM_DEVREADWRITE("nile", nile_snd_r, nile_snd_w) AM_BASE(&nile_sound_regs) + AM_RANGE(0x4e0000, 0x4e00ff) AM_DEVREADWRITE("nile", nile_snd_r, nile_snd_w) AM_RANGE(0x4e0100, 0x4e0101) AM_DEVREADWRITE("nile", nile_sndctrl_r, nile_sndctrl_w) //AM_RANGE(0x4e0110, 0x4e0111) AM_NOP // ? accessed once ($268dc, written $b.w) //AM_RANGE(0x5fff00, 0x5fff1f) AM_RAM // ? see routine $5ca8, video_regs related ??? diff --git a/src/mame/drivers/tceptor.c b/src/mame/drivers/tceptor.c index 800133bb87c..fd99465816e 100644 --- a/src/mame/drivers/tceptor.c +++ b/src/mame/drivers/tceptor.c @@ -231,7 +231,7 @@ ADDRESS_MAP_END static ADDRESS_MAP_START( mcu_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x001f) AM_READWRITE(hd63701_internal_registers_r, hd63701_internal_registers_w) AM_RANGE(0x0080, 0x00ff) AM_RAM - AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_BASE(&namco_wavedata) + AM_RANGE(0x1000, 0x13ff) AM_DEVREADWRITE("namco", namcos1_cus30_r, namcos1_cus30_w) AM_RANGE(0x1400, 0x154d) AM_RAM AM_RANGE(0x17c0, 0x17ff) AM_RAM AM_RANGE(0x2000, 0x20ff) AM_RAM AM_SHARE("share3") diff --git a/src/mame/drivers/toypop.c b/src/mame/drivers/toypop.c index 62e09e04aa0..a4b17f02264 100644 --- a/src/mame/drivers/toypop.c +++ b/src/mame/drivers/toypop.c @@ -37,19 +37,6 @@ TODO: #include "includes/toypop.h" -static READ8_DEVICE_HANDLER( toypop_sound_sharedram_r ) -{ - return namco_soundregs[offset]; -} - -static WRITE8_DEVICE_HANDLER( toypop_sound_sharedram_w ) -{ - if (offset < 0x40) - namco_15xx_w(device,offset,data); - else - namco_soundregs[offset] = data; -} - static READ16_HANDLER( toypop_m68000_sharedram_r ) { toypop_state *state = space->machine->driver_data(); @@ -201,7 +188,7 @@ static ADDRESS_MAP_START( liblrabl_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x0000, 0x07ff) AM_RAM_WRITE(toypop_videoram_w) AM_BASE_MEMBER(toypop_state,videoram) /* video RAM */ AM_RANGE(0x0800, 0x1fff) AM_RAM AM_BASE_MEMBER(toypop_state,spriteram) /* general RAM, area 1 */ AM_RANGE(0x2800, 0x2fff) AM_RAM AM_BASE_MEMBER(toypop_state,m68000_sharedram) /* shared RAM with the 68000 CPU */ - AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("namco", toypop_sound_sharedram_r, toypop_sound_sharedram_w) /* shared RAM with sound CPU */ + AM_RANGE(0x6000, 0x63ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with sound CPU */ AM_RANGE(0x6800, 0x680f) AM_DEVREADWRITE("58xx", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6810, 0x681f) AM_DEVREADWRITE("56xx_1", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6820, 0x682f) AM_DEVREADWRITE("56xx_2", namcoio_r, namcoio_w) /* custom I/O */ @@ -222,7 +209,7 @@ static ADDRESS_MAP_START( toypop_map, ADDRESS_SPACE_PROGRAM, 8 ) AM_RANGE(0x6000, 0x600f) AM_DEVREADWRITE("58xx", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6010, 0x601f) AM_DEVREADWRITE("56xx_1", namcoio_r, namcoio_w) /* custom I/O */ AM_RANGE(0x6020, 0x602f) AM_DEVREADWRITE("56xx_2", namcoio_r, namcoio_w) /* custom I/O */ - AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", toypop_sound_sharedram_r, toypop_sound_sharedram_w) /* shared RAM with sound CPU */ + AM_RANGE(0x6800, 0x6bff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with sound CPU */ AM_RANGE(0x7000, 0x7000) AM_READWRITE(toypop_main_interrupt_enable_r, toypop_main_interrupt_disable_w) /* disable interrupt */ AM_RANGE(0x8000, 0x8000) AM_WRITE(toypop_m68000_clear_w) /* reset 68000 */ AM_RANGE(0x8800, 0x8800) AM_WRITE(toypop_m68000_assert_w) /* reset 68000 */ @@ -240,7 +227,7 @@ ADDRESS_MAP_END *************************************/ static ADDRESS_MAP_START( sound_map, ADDRESS_SPACE_PROGRAM, 8 ) - AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", toypop_sound_sharedram_r, toypop_sound_sharedram_w) AM_BASE(&namco_soundregs) /* shared RAM with the main CPU + sound registers */ + AM_RANGE(0x0000, 0x03ff) AM_DEVREADWRITE("namco", namco_snd_sharedram_r, namco_snd_sharedram_w) /* shared RAM with the main CPU + sound registers */ AM_RANGE(0x2000, 0x2000) AM_WRITE(toypop_sound_interrupt_disable_w) /* ??? toypop doesn't write here */ AM_RANGE(0x4000, 0x4000) AM_WRITE(toypop_sound_interrupt_enable_acknowledge_w) AM_RANGE(0x6000, 0x6000) AM_WRITE(watchdog_reset_w)