twin16.c: Fixed cuebrick nvram size, added XTALs, various cleanups [Alex Jackson]

This commit is contained in:
Alex W. Jackson 2013-12-16 09:41:17 +00:00
parent 149cc90dde
commit 94b7d45594
6 changed files with 95 additions and 157 deletions

View File

@ -123,12 +123,6 @@ WRITE16_MEMBER(gradius3_state::cpuB_irqtrigger_w)
logerror("%04x MISSED cpu B irq 4 %02x\n",space.device().safe_pc(),data);
}
WRITE16_MEMBER(gradius3_state::sound_command_w)
{
if (ACCESSING_BITS_8_15)
soundlatch_byte_w(space, 0, (data >> 8) & 0xff);
}
WRITE16_MEMBER(gradius3_state::sound_irq_w)
{
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
@ -159,7 +153,7 @@ static ADDRESS_MAP_START( gradius3_map, AS_PROGRAM, 16, gradius3_state )
AM_RANGE(0x0d0002, 0x0d0003) AM_READ_PORT("DSW2")
AM_RANGE(0x0d8000, 0x0d8001) AM_WRITE(cpuB_irqtrigger_w)
AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0e8000, 0x0e8001) AM_WRITE(sound_command_w)
AM_RANGE(0x0e8000, 0x0e8001) AM_WRITE8(soundlatch_byte_w, 0xff00)
AM_RANGE(0x0f0000, 0x0f0001) AM_WRITE(sound_irq_w)
AM_RANGE(0x100000, 0x103fff) AM_RAM AM_SHARE("share1")
AM_RANGE(0x14c000, 0x153fff) AM_READWRITE(k052109_halfword_r, k052109_halfword_w)

View File

@ -142,30 +142,25 @@ WRITE16_MEMBER(tmnt_state::k053244_word_noA1_w)
m_k053245->k053244_w(space, offset + 1, data & 0xff);
}
INTERRUPT_GEN_MEMBER(tmnt_state::cuebrick_interrupt)
/* cuebrick, mia, tmnt */
INTERRUPT_GEN_MEMBER(tmnt_state::tmnt_interrupt)
{
if (m_irq5_mask)
device.execute().set_input_line(M68K_IRQ_5, HOLD_LINE);
}
/* punkshot, blswhstl, tmnt2, ssriders, thndrx2 */
INTERRUPT_GEN_MEMBER(tmnt_state::punkshot_interrupt)
{
if (m_k052109->is_irq_enabled())
irq4_line_hold(device);
device.execute().set_input_line(M68K_IRQ_4, HOLD_LINE);
}
/* lgtnfght, glfgreat, prmrsocr */
INTERRUPT_GEN_MEMBER(tmnt_state::lgtnfght_interrupt)
{
if (m_k052109->is_irq_enabled())
irq5_line_hold(device);
}
WRITE16_MEMBER(tmnt_state::tmnt_sound_command_w)
{
if (ACCESSING_BITS_0_7)
soundlatch_byte_w(space, 0, data & 0xff);
device.execute().set_input_line(M68K_IRQ_5, HOLD_LINE);
}
READ8_MEMBER(tmnt_state::punkshot_sound_r)
@ -183,22 +178,6 @@ WRITE8_MEMBER(tmnt_state::glfgreat_sound_w)
m_audiocpu->set_input_line_and_vector(0, HOLD_LINE, 0xff);
}
READ16_MEMBER(tmnt_state::prmrsocr_sound_r)
{
return soundlatch3_byte_r(space, 0);
}
WRITE16_MEMBER(tmnt_state::prmrsocr_sound_cmd_w)
{
if (ACCESSING_BITS_0_7)
{
data &= 0xff;
if (offset == 0)
soundlatch_byte_w(space, 0, data);
else
soundlatch2_byte_w(space, 0, data);
}
}
WRITE16_MEMBER(tmnt_state::prmrsocr_sound_irq_w)
{
@ -490,19 +469,9 @@ WRITE16_MEMBER(tmnt_state::prmrsocr_eeprom_w)
}
}
READ16_MEMBER(tmnt_state::cuebrick_nv_r)
WRITE8_MEMBER(tmnt_state::cuebrick_nvbank_w)
{
return m_cuebrick_nvram[offset + (m_cuebrick_nvram_bank * 0x400 / 2)];
}
WRITE16_MEMBER(tmnt_state::cuebrick_nv_w)
{
COMBINE_DATA(&m_cuebrick_nvram[offset + (m_cuebrick_nvram_bank * 0x400 / 2)]);
}
WRITE16_MEMBER(tmnt_state::cuebrick_nvbank_w)
{
m_cuebrick_nvram_bank = data >> 8;
membank("nvrambank")->set_entry(data);
}
static ADDRESS_MAP_START( cuebrick_main_map, AS_PROGRAM, 16, tmnt_state )
@ -513,12 +482,11 @@ static ADDRESS_MAP_START( cuebrick_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("COINS") AM_WRITE(tmnt_0a0000_w)
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(tmnt_sound_command_w)
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW2")
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0b0000, 0x0b03ff) AM_READWRITE(cuebrick_nv_r, cuebrick_nv_w) AM_SHARE("nvram")
AM_RANGE(0x0b0400, 0x0b0401) AM_WRITE(cuebrick_nvbank_w)
AM_RANGE(0x0b0000, 0x0b03ff) AM_RAMBANK("nvrambank")
AM_RANGE(0x0b0400, 0x0b0401) AM_WRITE8(cuebrick_nvbank_w, 0xff00)
AM_RANGE(0x0c0000, 0x0c0003) AM_DEVREADWRITE8("ymsnd", ym2151_device, read, write, 0xff00)
AM_RANGE(0x100000, 0x107fff) AM_READWRITE(k052109_word_noA12_r, k052109_word_noA12_w)
AM_RANGE(0x140000, 0x140007) AM_DEVREADWRITE("k051960", k051960_device, k051937_word_r, k051937_word_w)
@ -534,7 +502,7 @@ static ADDRESS_MAP_START( mia_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("COINS") AM_WRITE(tmnt_0a0000_w)
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(tmnt_sound_command_w)
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW2")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
@ -556,7 +524,7 @@ static ADDRESS_MAP_START( tmnt_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P3")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(tmnt_sound_command_w)
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW1") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW2")
AM_RANGE(0x0a0014, 0x0a0015) AM_READ_PORT("P4")
@ -696,8 +664,9 @@ static ADDRESS_MAP_START( prmrsocr_main_map, AS_PROGRAM, 16, tmnt_state )
AM_RANGE(0x11c000, 0x11c01f) AM_WRITE(k053251_glfgreat_w)
AM_RANGE(0x120000, 0x120001) AM_READ_PORT("P1/COINS")
AM_RANGE(0x120002, 0x120003) AM_READ_PORT("P2/EEPROM")
AM_RANGE(0x12100c, 0x12100f) AM_WRITE(prmrsocr_sound_cmd_w)
AM_RANGE(0x121014, 0x121015) AM_READ(prmrsocr_sound_r)
AM_RANGE(0x12100c, 0x12100d) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x12100e, 0x12100f) AM_WRITE8(soundlatch2_byte_w, 0x00ff)
AM_RANGE(0x121014, 0x121015) AM_READ8(soundlatch3_byte_r, 0x00ff)
AM_RANGE(0x122000, 0x122001) AM_WRITE(prmrsocr_eeprom_w) /* EEPROM + video control */
AM_RANGE(0x123000, 0x123001) AM_WRITE(prmrsocr_sound_irq_w)
AM_RANGE(0x200000, 0x207fff) AM_READWRITE(k052109_word_noA12_r, k052109_word_noA12_w)
@ -1144,11 +1113,11 @@ static INPUT_PORTS_START( cuebrick )
PORT_START("P2")
KONAMI16_LSB( 2, IPT_BUTTON3, IPT_UNUSED )
PORT_START("DSW2")
PORT_START("DSW1")
KONAMI_COINAGE_LOC(DEF_STR( Free_Play ), "Invalid", SW1)
/* "Invalid" = both coin slots disabled */
PORT_START("DSW1")
PORT_START("DSW2")
PORT_DIPUNUSED_DIPLOC( 0x01, IP_ACTIVE_LOW, "SW2:1" ) // manual says "not used"
PORT_DIPUNUSED_DIPLOC( 0x02, IP_ACTIVE_LOW, "SW2:2" ) // manual says "not used"
PORT_DIPNAME( 0x04, 0x00, DEF_STR( Cabinet ) ) PORT_DIPLOCATION("SW2:3")
@ -2139,8 +2108,6 @@ MACHINE_START_MEMBER(tmnt_state,common)
save_item(NAME(m_toggle));
save_item(NAME(m_last));
save_item(NAME(m_tmnt_soundlatch));
save_item(NAME(m_cuebrick_snd_irqlatch));
save_item(NAME(m_cuebrick_nvram_bank));
save_item(NAME(m_sprite_colorbase));
save_item(NAME(m_layer_colorbase));
save_item(NAME(m_layerpri));
@ -2152,15 +2119,6 @@ MACHINE_RESET_MEMBER(tmnt_state,common)
m_toggle = 0;
m_last = 0;
m_tmnt_soundlatch = 0;
m_cuebrick_snd_irqlatch = 0;
m_cuebrick_nvram_bank = 0;
}
/* cuebrick, mia and tmnt */
INTERRUPT_GEN_MEMBER(tmnt_state::tmnt_vblank_irq)
{
if(m_irq5_mask)
device.execute().set_input_line(5, HOLD_LINE);
}
@ -2169,7 +2127,7 @@ static MACHINE_CONFIG_START( cuebrick, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 8000000) /* 8 MHz */
MCFG_CPU_PROGRAM_MAP(cuebrick_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, cuebrick_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt)
MCFG_MACHINE_START_OVERRIDE(tmnt_state,common)
MCFG_MACHINE_RESET_OVERRIDE(tmnt_state,common)
@ -2207,7 +2165,7 @@ static MACHINE_CONFIG_START( mia, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/3)
MCFG_CPU_PROGRAM_MAP(mia_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_vblank_irq)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(mia_audio_map)
@ -2258,7 +2216,7 @@ static MACHINE_CONFIG_START( tmnt, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/3)
MCFG_CPU_PROGRAM_MAP(tmnt_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_vblank_irq)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, tmnt_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(tmnt_audio_map)
@ -2310,7 +2268,7 @@ static MACHINE_CONFIG_START( punkshot, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2)
MCFG_CPU_PROGRAM_MAP(punkshot_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(punkshot_audio_map)
@ -2352,7 +2310,7 @@ static MACHINE_CONFIG_START( lgtnfght, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_24MHz/2)
MCFG_CPU_PROGRAM_MAP(lgtnfght_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(lgtnfght_audio_map)
@ -2396,7 +2354,7 @@ static MACHINE_CONFIG_START( blswhstl, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 16000000) /* 16 MHz */
MCFG_CPU_PROGRAM_MAP(blswhstl_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(ssriders_audio_map)
@ -2462,7 +2420,7 @@ static MACHINE_CONFIG_START( glfgreat, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2) /* Confirmed */
MCFG_CPU_PROGRAM_MAP(glfgreat_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(glfgreat_audio_map)
@ -2518,7 +2476,7 @@ static MACHINE_CONFIG_START( prmrsocr, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2) /* Confirmed */
MCFG_CPU_PROGRAM_MAP(prmrsocr_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, lgtnfght_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* ? */
MCFG_CPU_PROGRAM_MAP(prmrsocr_audio_map)
@ -2564,7 +2522,7 @@ static MACHINE_CONFIG_START( tmnt2, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2)
MCFG_CPU_PROGRAM_MAP(tmnt2_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, 8000000) /* 8 MHz; clock is correct, but there's 1 cycle wait for ROM/RAM */
/* access. Access speed of ROM/RAM used on the machine is 150ns, */
@ -2615,7 +2573,7 @@ static MACHINE_CONFIG_START( ssriders, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, XTAL_32MHz/2)
MCFG_CPU_PROGRAM_MAP(ssriders_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, 8000000)
MCFG_CPU_PROGRAM_MAP(ssriders_audio_map)
@ -2698,7 +2656,7 @@ static MACHINE_CONFIG_START( thndrx2, tmnt_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 12000000) /* 12 MHz */
MCFG_CPU_PROGRAM_MAP(thndrx2_main_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_VBLANK_INT_DRIVER("screen", tmnt_state, punkshot_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(thndrx2_audio_map)
@ -4222,7 +4180,11 @@ DRIVER_INIT_MEMBER(tmnt_state,tmnt)
DRIVER_INIT_MEMBER(tmnt_state,cuebrick)
{
membank("nvrambank")->configure_entries(0, 0x20, m_cuebrick_nvram, 0x400);
machine().device<nvram_device>("nvram")->set_base(m_cuebrick_nvram, sizeof(m_cuebrick_nvram));
save_item(NAME(m_cuebrick_nvram));
}
// YEAR, NAME, PARENT, MACHINE, INPUT, INIT, MONITOR,COMPANY,FULLNAME,FLAGS

View File

@ -143,22 +143,6 @@ WRITE16_MEMBER(twin16_state::fround_CPU_register_w)
}
}
READ16_MEMBER(twin16_state::twin16_input_r)
{
switch( offset )
{
case 0x00: return ioport("SYSTEM")->read();
case 0x01: return ioport("P1")->read();
case 0x02: return ioport("P2")->read();
case 0x03: return ioport("P3")->read();
case 0x08: return ioport("DSW2")->read();
case 0x09: return ioport("DSW1")->read();
case 0x0c: return ioport("DSW3")->read();
default: break;
}
return 0;
}
READ8_MEMBER(twin16_state::twin16_upd_busy_r)
{
return m_upd7759->busy_r();
@ -174,21 +158,6 @@ WRITE8_MEMBER(twin16_state::twin16_upd_start_w)
m_upd7759->start_w(data & 1);
}
READ16_MEMBER(twin16_state::cuebrickj_nvram_r)
{
return m_cuebrickj_nvram[offset + (m_cuebrickj_nvram_bank * 0x400 / 2)];
}
WRITE16_MEMBER(twin16_state::cuebrickj_nvram_w)
{
COMBINE_DATA(&m_cuebrickj_nvram[offset + (m_cuebrickj_nvram_bank * 0x400 / 2)]);
}
WRITE16_MEMBER(twin16_state::cuebrickj_nvram_bank_w)
{
m_cuebrickj_nvram_bank = (data >> 8);
}
/* Memory Maps */
static ADDRESS_MAP_START( sound_map, AS_PROGRAM, 8, twin16_state )
@ -210,12 +179,14 @@ static ADDRESS_MAP_START( main_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x060000, 0x063fff) AM_RAM
AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(twin16_paletteram_word_w) AM_SHARE("paletteram")
AM_RANGE(0x081000, 0x081fff) AM_WRITENOP
AM_RANGE(0x0a0000, 0x0a001b) AM_READ(twin16_input_r)
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(twin16_CPUA_register_w)
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(soundlatch_word_w)
AM_RANGE(0x0a0010, 0x0a0011) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0b0000, 0x0b03ff) AM_READWRITE(cuebrickj_nvram_r, cuebrickj_nvram_w) AM_SHARE("nvram")
AM_RANGE(0x0b0400, 0x0b0401) AM_WRITE(cuebrickj_nvram_bank_w)
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("SYSTEM") AM_WRITE(twin16_CPUA_register_w)
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0006, 0x0a0007) AM_READ_PORT("P3")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
AM_RANGE(0x100000, 0x103fff) AM_RAM_WRITE(twin16_text_ram_w) AM_SHARE("text_ram")
@ -244,10 +215,13 @@ static ADDRESS_MAP_START( fround_map, AS_PROGRAM, 16, twin16_state )
AM_RANGE(0x040000, 0x043fff) AM_RAM AM_SHARE("comram")
AM_RANGE(0x060000, 0x063fff) AM_RAM
AM_RANGE(0x080000, 0x080fff) AM_RAM_WRITE(twin16_paletteram_word_w) AM_SHARE("paletteram")
AM_RANGE(0x0a0000, 0x0a001b) AM_READ(twin16_input_r)
AM_RANGE(0x0a0000, 0x0a0001) AM_WRITE(fround_CPU_register_w)
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE(soundlatch_word_w)
AM_RANGE(0x0a0010, 0x0a0011) AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0000, 0x0a0001) AM_READ_PORT("SYSTEM") AM_WRITE(fround_CPU_register_w)
AM_RANGE(0x0a0002, 0x0a0003) AM_READ_PORT("P1")
AM_RANGE(0x0a0004, 0x0a0005) AM_READ_PORT("P2")
AM_RANGE(0x0a0008, 0x0a0009) AM_WRITE8(soundlatch_byte_w, 0x00ff)
AM_RANGE(0x0a0010, 0x0a0011) AM_READ_PORT("DSW2") AM_WRITE(watchdog_reset16_w)
AM_RANGE(0x0a0012, 0x0a0013) AM_READ_PORT("DSW1")
AM_RANGE(0x0a0018, 0x0a0019) AM_READ_PORT("DSW3")
AM_RANGE(0x0c0000, 0x0c000f) AM_WRITE(twin16_video_register_w)
AM_RANGE(0x0c000e, 0x0c000f) AM_READ(twin16_sprite_status_r)
AM_RANGE(0x0e0000, 0x0e0001) AM_WRITE(fround_gfx_bank_w)
@ -676,9 +650,6 @@ MACHINE_START_MEMBER(twin16_state,twin16)
/* register for savestates */
save_item(NAME(m_CPUA_register));
save_item(NAME(m_CPUB_register));
save_item(NAME(m_cuebrickj_nvram_bank));
save_item(NAME(m_cuebrickj_nvram));
}
static MACHINE_CONFIG_START( twin16, twin16_state )
@ -691,7 +662,7 @@ static MACHINE_CONFIG_START( twin16, twin16_state )
MCFG_CPU_PROGRAM_MAP(sub_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUB_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@ -716,11 +687,11 @@ static MACHINE_CONFIG_START( twin16, twin16_state )
// sound hardware
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", 7159160/2)
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MCFG_SOUND_ADD("k007232", K007232, 3579545)
MCFG_SOUND_ADD("k007232", K007232, XTAL_3_579545MHz)
MCFG_SOUND_CONFIG(k007232_config)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.12) // estimated with gradius2 OST
MCFG_SOUND_ROUTE(0, "rspeaker", 0.12)
@ -738,11 +709,11 @@ MACHINE_CONFIG_END
static MACHINE_CONFIG_START( fround, twin16_state )
/* basic machine hardware */
MCFG_CPU_ADD("maincpu", M68000, 10000000)
MCFG_CPU_ADD("maincpu", M68000, XTAL_18_432MHz/2)
MCFG_CPU_PROGRAM_MAP(fround_map)
MCFG_CPU_VBLANK_INT_DRIVER("screen", twin16_state, CPUA_interrupt)
MCFG_CPU_ADD("audiocpu", Z80, 3579545)
MCFG_CPU_ADD("audiocpu", Z80, XTAL_3_579545MHz)
MCFG_CPU_PROGRAM_MAP(sound_map)
MCFG_QUANTUM_TIME(attotime::from_hz(6000))
@ -767,11 +738,11 @@ static MACHINE_CONFIG_START( fround, twin16_state )
/* sound hardware */
MCFG_SPEAKER_STANDARD_STEREO("lspeaker", "rspeaker")
MCFG_YM2151_ADD("ymsnd", 7159160/2)
MCFG_YM2151_ADD("ymsnd", XTAL_3_579545MHz)
MCFG_SOUND_ROUTE(0, "lspeaker", 1.0)
MCFG_SOUND_ROUTE(1, "rspeaker", 1.0)
MCFG_SOUND_ADD("k007232", K007232, 3579545)
MCFG_SOUND_ADD("k007232", K007232, XTAL_3_579545MHz)
MCFG_SOUND_CONFIG(k007232_config)
MCFG_SOUND_ROUTE(0, "lspeaker", 0.12)
MCFG_SOUND_ROUTE(0, "rspeaker", 0.12)
@ -788,7 +759,7 @@ static MACHINE_CONFIG_DERIVED( miaj, twin16 )
MCFG_SCREEN_RAW_PARAMS(XTAL_18_432MHz/2, 576, 1*8, 39*8, 264, 2*8, 30*8)
MACHINE_CONFIG_END
static MACHINE_CONFIG_DERIVED( cuebrickj, twin16 )
static MACHINE_CONFIG_DERIVED_CLASS( cuebrickj, twin16, cuebrickj_state )
MCFG_SCREEN_MODIFY("screen")
MCFG_SCREEN_RAW_PARAMS(XTAL_18_432MHz/2, 576, 1*8, 39*8, 264, 2*8, 30*8)
MCFG_NVRAM_ADD_0FILL("nvram")
@ -1264,10 +1235,25 @@ DRIVER_INIT_MEMBER(twin16_state,fround)
m_custom_video = 1;
}
DRIVER_INIT_MEMBER(twin16_state,cuebrickj)
WRITE8_MEMBER(cuebrickj_state::nvram_bank_w)
{
membank("nvrambank")->set_entry(data);
}
DRIVER_INIT_MEMBER(cuebrickj_state,cuebrickj)
{
address_space &space = m_maincpu->space(AS_PROGRAM);
space.install_readwrite_bank(0x0b0000, 0x0b03ff, "nvrambank");
space.install_write_handler( 0x0b0400, 0x0b0401, WRITE8_DELEGATE(cuebrickj_state, nvram_bank_w), 0xff00);
membank("nvrambank")->configure_entries(0, 0x20, m_nvram, 0x400);
machine().device<nvram_device>("nvram")->set_base(m_nvram, sizeof(m_nvram));
save_item(NAME(m_nvram));
m_custom_video = 0;
machine().device<nvram_device>("nvram")->set_base(m_cuebrickj_nvram, 0x400*0x20);
}
/* Game Drivers */
@ -1286,5 +1272,5 @@ GAME( 1988, gradius2b, vulcan, twin16, vulcan, twin16_state, twin16,
GAME( 1988, fround, 0, fround, fround, twin16_state, fround, ROT0, "Konami", "The Final Round (version M)", GAME_SUPPORTS_SAVE )
GAME( 1988, froundl, fround, fround, fround, twin16_state, fround, ROT0, "Konami", "The Final Round (version L)", GAME_SUPPORTS_SAVE )
GAME( 1988, hpuncher, fround, twin16, fround, twin16_state, twin16, ROT0, "Konami", "Hard Puncher (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, miaj, mia, miaj, miaj, twin16_state, twin16, ROT0, "Konami", "M.I.A. - Missing in Action (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, cuebrickj, cuebrick, cuebrickj, cuebrickj, twin16_state, cuebrickj, ROT0, "Konami", "Cue Brick (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, miaj, mia, miaj, miaj, twin16_state, twin16, ROT0, "Konami", "M.I.A. - Missing in Action (Japan)", GAME_SUPPORTS_SAVE )
GAME( 1989, cuebrickj, cuebrick, cuebrickj, cuebrickj, cuebrickj_state, cuebrickj, ROT0, "Konami", "Cue Brick (Japan)", GAME_SUPPORTS_SAVE )

View File

@ -50,7 +50,6 @@ public:
DECLARE_WRITE16_MEMBER(cpuA_ctrl_w);
DECLARE_WRITE16_MEMBER(cpuB_irqenable_w);
DECLARE_WRITE16_MEMBER(cpuB_irqtrigger_w);
DECLARE_WRITE16_MEMBER(sound_command_w);
DECLARE_WRITE16_MEMBER(sound_irq_w);
DECLARE_READ16_MEMBER(gradius3_gfxrom_r);
DECLARE_WRITE16_MEMBER(gradius3_gfxram_w);

View File

@ -45,8 +45,6 @@ public:
optional_shared_ptr<UINT16> m_sunset_104000;
optional_shared_ptr<UINT16> m_tmnt2_1c0800;
// UINT16 * m_paletteram; // currently this uses generic palette handling
// UINT8 * m_nvram; // currently cuebrick uses generic nvram handling
// UINT8 * m_cuebrick_nvram;
/* video-related */
int m_layer_colorbase[3];
@ -69,11 +67,9 @@ public:
/* misc */
int m_tmnt_soundlatch;
int m_cuebrick_snd_irqlatch;
int m_cuebrick_nvram_bank;
int m_toggle;
int m_last;
UINT16 m_cuebrick_nvram[0x400 * 0x20]; // 32k paged in a 1k window
UINT16 m_cuebrick_nvram[0x400 * 0x20 / 2]; // 32k paged in a 1k window
/* devices */
required_device<cpu_device> m_maincpu;
@ -102,9 +98,6 @@ public:
DECLARE_WRITE16_MEMBER(k053245_scattered_word_w);
DECLARE_READ16_MEMBER(k053244_word_noA1_r);
DECLARE_WRITE16_MEMBER(k053244_word_noA1_w);
DECLARE_WRITE16_MEMBER(tmnt_sound_command_w);
DECLARE_READ16_MEMBER(prmrsocr_sound_r);
DECLARE_WRITE16_MEMBER(prmrsocr_sound_cmd_w);
DECLARE_WRITE16_MEMBER(prmrsocr_sound_irq_w);
DECLARE_WRITE8_MEMBER(prmrsocr_audio_bankswitch_w);
DECLARE_READ8_MEMBER(tmnt_sres_r);
@ -120,9 +113,7 @@ public:
DECLARE_READ16_MEMBER(thndrx2_eeprom_r);
DECLARE_WRITE16_MEMBER(thndrx2_eeprom_w);
DECLARE_WRITE16_MEMBER(prmrsocr_eeprom_w);
DECLARE_READ16_MEMBER(cuebrick_nv_r);
DECLARE_WRITE16_MEMBER(cuebrick_nv_w);
DECLARE_WRITE16_MEMBER(cuebrick_nvbank_w);
DECLARE_WRITE8_MEMBER(cuebrick_nvbank_w);
DECLARE_WRITE16_MEMBER(ssriders_soundkludge_w);
DECLARE_WRITE16_MEMBER(k053251_glfgreat_w);
DECLARE_WRITE16_MEMBER(tmnt2_1c0800_w);
@ -169,10 +160,9 @@ public:
UINT32 screen_update_tmnt2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
UINT32 screen_update_thndrx2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect);
void screen_eof_blswhstl(screen_device &screen, bool state);
INTERRUPT_GEN_MEMBER(cuebrick_interrupt);
INTERRUPT_GEN_MEMBER(tmnt_interrupt);
INTERRUPT_GEN_MEMBER(punkshot_interrupt);
INTERRUPT_GEN_MEMBER(lgtnfght_interrupt);
INTERRUPT_GEN_MEMBER(tmnt_vblank_irq);
void sound_nmi_callback( int param );
inline UINT32 tmnt2_get_word( UINT32 addr );
void tmnt2_put_word( address_space &space, UINT32 addr, UINT16 data );

View File

@ -26,8 +26,6 @@ public:
UINT16 m_CPUA_register;
UINT16 m_CPUB_register;
int m_cuebrickj_nvram_bank;
UINT16 m_cuebrickj_nvram[0x400*0x20];
UINT16 m_custom_video;
UINT16 *m_gfx_rom;
UINT16 m_sprite_buffer[0x800];
@ -44,10 +42,6 @@ public:
DECLARE_WRITE16_MEMBER(twin16_CPUA_register_w);
DECLARE_WRITE16_MEMBER(twin16_CPUB_register_w);
DECLARE_WRITE16_MEMBER(fround_CPU_register_w);
DECLARE_READ16_MEMBER(twin16_input_r);
DECLARE_READ16_MEMBER(cuebrickj_nvram_r);
DECLARE_WRITE16_MEMBER(cuebrickj_nvram_w);
DECLARE_WRITE16_MEMBER(cuebrickj_nvram_bank_w);
DECLARE_WRITE16_MEMBER(twin16_text_ram_w);
DECLARE_WRITE16_MEMBER(twin16_paletteram_word_w);
DECLARE_WRITE16_MEMBER(fround_gfx_bank_w);
@ -56,9 +50,8 @@ public:
DECLARE_READ8_MEMBER(twin16_upd_busy_r);
DECLARE_WRITE8_MEMBER(twin16_upd_reset_w);
DECLARE_WRITE8_MEMBER(twin16_upd_start_w);
DECLARE_DRIVER_INIT(fround);
DECLARE_DRIVER_INIT(twin16);
DECLARE_DRIVER_INIT(cuebrickj);
DECLARE_DRIVER_INIT(fround);
TILE_GET_INFO_MEMBER(get_text_tile_info);
DECLARE_MACHINE_START(twin16);
DECLARE_MACHINE_RESET(twin16);
@ -80,3 +73,17 @@ public:
required_device<k007232_device> m_k007232;
required_device<upd7759_device> m_upd7759;
};
class cuebrickj_state : public twin16_state
{
public:
cuebrickj_state(const machine_config &mconfig, device_type type, const char *tag)
: twin16_state(mconfig, type, tag)
{}
DECLARE_WRITE8_MEMBER(nvram_bank_w);
DECLARE_DRIVER_INIT(cuebrickj);
private:
UINT16 m_nvram[0x400 * 0x20 / 2];
};