diff options
Diffstat (limited to 'src/mame/drivers/gaelco3d.cpp')
-rw-r--r-- | src/mame/drivers/gaelco3d.cpp | 125 |
1 files changed, 55 insertions, 70 deletions
diff --git a/src/mame/drivers/gaelco3d.cpp b/src/mame/drivers/gaelco3d.cpp index b8bb7535756..f2c9e376379 100644 --- a/src/mame/drivers/gaelco3d.cpp +++ b/src/mame/drivers/gaelco3d.cpp @@ -148,7 +148,6 @@ REF. 970429 #include "emu.h" #include "includes/gaelco3d.h" -#include "cpu/adsp2100/adsp2100.h" #include "cpu/m68000/m68000.h" #include "cpu/tms32031/tms32031.h" @@ -192,34 +191,21 @@ void gaelco3d_state::machine_start() MACHINE_RESET_MEMBER(gaelco3d_state,common) { - uint16_t *src; - int i; - m_framenum = 0; /* boot the ADSP chip */ - src = (uint16_t *)memregion("user1")->base(); - for (i = 0; i < (src[3] & 0xff) * 8; i++) + uint16_t *src = (uint16_t *)memregion("user1")->base(); + for (int i = 0; i < (src[3] & 0xff) * 8; i++) { uint32_t opcode = ((src[i*4+0] & 0xff) << 16) | ((src[i*4+1] & 0xff) << 8) | (src[i*4+2] & 0xff); m_adsp_ram_base[i] = opcode; } - /* allocate a timer for feeding the autobuffer */ - m_adsp_autobuffer_timer = machine().device<timer_device>("adsp_timer"); - - membank("bank1")->configure_entries(0, 256, memregion("user1")->base(), 0x4000); - membank("bank1")->set_entry(0); + m_adsp_bank->configure_entries(0, 256, memregion("user1")->base(), 0x4000); + m_adsp_bank->set_entry(0); /* keep the TMS32031 halted until the code is ready to go */ m_tms->set_input_line(INPUT_LINE_RESET, ASSERT_LINE); - - for (i = 0; i < SOUND_CHANNELS; i++) - { - char buffer[10]; - sprintf(buffer, "dac%d", i + 1); - m_dmadac[i] = machine().device<dmadac_sound_device>(buffer); - } } @@ -502,7 +488,9 @@ WRITE16_MEMBER(gaelco3d_state::adsp_control_w) /* see if SPORT1 got disabled */ if ((data & 0x0800) == 0) { - dmadac_enable(&m_dmadac[0], SOUND_CHANNELS, 0); + for (uint8_t i = 0; i < SOUND_CHANNELS; i++) + m_dmadac[i]->enable(0); + m_adsp_autobuffer_timer->reset(); } break; @@ -511,7 +499,9 @@ WRITE16_MEMBER(gaelco3d_state::adsp_control_w) /* autobuffer off: nuke the timer, and disable the DAC */ if ((data & 0x0002) == 0) { - dmadac_enable(&m_dmadac[0], SOUND_CHANNELS, 0); + for (uint8_t i = 0; i < SOUND_CHANNELS; i++) + m_dmadac[i]->enable(0); + m_adsp_autobuffer_timer->reset(); } break; @@ -530,7 +520,7 @@ WRITE16_MEMBER(gaelco3d_state::adsp_rombank_w) { if (LOG) logerror("adsp_rombank_w(%d) = %04X\n", offset, data); - membank("bank1")->set_entry((offset & 1) * 0x80 + (data & 0x7f)); + m_adsp_bank->set_entry((offset & 1) * 0x80 + (data & 0x7f)); } @@ -549,7 +539,10 @@ TIMER_DEVICE_CALLBACK_MEMBER(gaelco3d_state::adsp_autobuffer_irq) /* copy the current data into the buffer */ // logerror("ADSP buffer: I%d=%04X incs=%04X size=%04X\n", m_adsp_ireg, reg, m_adsp_incs, m_adsp_size); if (m_adsp_incs) - dmadac_transfer(&m_dmadac[0], SOUND_CHANNELS, m_adsp_incs, SOUND_CHANNELS * m_adsp_incs, m_adsp_size / (SOUND_CHANNELS * m_adsp_incs), (int16_t *)&m_adsp_fastram_base[reg - 0x3800]); + { + for (uint8_t i = 0; i < SOUND_CHANNELS; i++) + m_dmadac[i]->transfer(i, m_adsp_incs, SOUND_CHANNELS * m_adsp_incs, m_adsp_size / (SOUND_CHANNELS * m_adsp_incs), (int16_t *)&m_adsp_fastram_base[reg - 0x3800]); + } /* increment it */ reg += m_adsp_size; @@ -577,7 +570,7 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback) /* check if SPORT1 is enabled */ if (m_adsp_control_regs[SYSCONTROL_REG] & 0x0800) /* bit 11 */ { - /* we only support autobuffer here (wich is what this thing uses), bail if not enabled */ + /* we only support autobuffer here (which is what this thing uses), bail if not enabled */ if (m_adsp_control_regs[S1_AUTOBUF_REG] & 0x0002) /* bit 1 */ { /* get the autobuffer registers */ @@ -591,7 +584,7 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback) lreg = m_adsp_ireg; /* now get the register contents in a more legible format */ - /* we depend on register indexes to be continuous (wich is the case in our core) */ + /* we depend on register indexes to be continuous (which is the case in our core) */ source = m_adsp->state_int(ADSP2100_I0 + m_adsp_ireg); m_adsp_incs = m_adsp->state_int(ADSP2100_M0 + mreg); m_adsp_size = m_adsp->state_int(ADSP2100_L0 + lreg); @@ -613,10 +606,13 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback) /* now put it down to samples, so we know what the channel frequency has to be */ sample_period *= 16 * SOUND_CHANNELS; - dmadac_set_frequency(&m_dmadac[0], SOUND_CHANNELS, ATTOSECONDS_TO_HZ(sample_period.attoseconds())); - dmadac_enable(&m_dmadac[0], SOUND_CHANNELS, 1); + for (uint8_t i = 0; i < SOUND_CHANNELS; i++) + { + m_dmadac[i]->set_frequency(ATTOSECONDS_TO_HZ(sample_period.attoseconds())); + m_dmadac[i]->enable(1); + } - /* fire off a timer wich will hit every half-buffer */ + /* fire off a timer which will hit every half-buffer */ sample_period = (sample_period * m_adsp_size) / (SOUND_CHANNELS * m_adsp_incs); m_adsp_autobuffer_timer->adjust(sample_period, 0, sample_period); @@ -628,7 +624,8 @@ WRITE32_MEMBER(gaelco3d_state::adsp_tx_callback) } /* if we get there, something went wrong. Disable playing */ - dmadac_enable(&m_dmadac[0], SOUND_CHANNELS, 0); + for (uint8_t i = 0; i < SOUND_CHANNELS; i++) + m_dmadac[i]->enable(0); /* remove timer */ m_adsp_autobuffer_timer->reset(); @@ -738,7 +735,7 @@ void gaelco3d_state::adsp_program_map(address_map &map) void gaelco3d_state::adsp_data_map(address_map &map) { map(0x0000, 0x0001).w(this, FUNC(gaelco3d_state::adsp_rombank_w)); - map(0x0000, 0x1fff).bankr("bank1"); + map(0x0000, 0x1fff).bankr("adspbank"); map(0x2000, 0x2000).r(m_soundlatch, FUNC(generic_latch_8_device::read)).umask16(0x00ff); map(0x2000, 0x2000).w(this, FUNC(gaelco3d_state::sound_status_w)); map(0x3800, 0x39ff).ram().share("adsp_fastram"); /* 512 words internal RAM */ @@ -927,59 +924,59 @@ INPUT_PORTS_END MACHINE_CONFIG_START(gaelco3d_state::gaelco3d) /* basic machine hardware */ - MCFG_DEVICE_ADD("maincpu", M68000, 15000000) + MCFG_DEVICE_ADD(m_maincpu, M68000, 15000000) MCFG_DEVICE_PROGRAM_MAP(main_map) MCFG_DEVICE_VBLANK_INT_DRIVER("screen", gaelco3d_state, vblank_gen) - MCFG_DEVICE_ADD("tms", TMS32031, 60000000) + MCFG_DEVICE_ADD(m_tms, TMS32031, 60000000) MCFG_DEVICE_PROGRAM_MAP(tms_map) MCFG_TMS3203X_MCBL(true) MCFG_TMS3203X_IACK_CB(WRITE8(*this, gaelco3d_state, tms_iack_w)) - MCFG_DEVICE_ADD("adsp", ADSP2115, 16000000) + MCFG_DEVICE_ADD(m_adsp, ADSP2115, 16000000) MCFG_ADSP21XX_SPORT_TX_CB(WRITE32(*this, gaelco3d_state, adsp_tx_callback)) MCFG_DEVICE_PROGRAM_MAP(adsp_program_map) MCFG_DEVICE_DATA_MAP(adsp_data_map) - MCFG_EEPROM_SERIAL_93C66_ADD("eeprom") + MCFG_EEPROM_SERIAL_93C66_ADD(m_eeprom) MCFG_EEPROM_SERIAL_ENABLE_STREAMING() MCFG_QUANTUM_TIME(attotime::from_hz(6000)) MCFG_TIMER_DRIVER_ADD("adsp_timer", gaelco3d_state, adsp_autobuffer_irq) - MCFG_DEVICE_ADD("serial", GAELCO_SERIAL, 0) + MCFG_DEVICE_ADD(m_serial, GAELCO_SERIAL, 0) MCFG_GAELCO_SERIAL_IRQ_HANDLER(WRITELINE(*this, gaelco3d_state, ser_irq)) - MCFG_DEVICE_ADD("mainlatch", LS259, 0) // IC5 on bottom board next to EEPROM - MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE("serial", gaelco_serial_device, tr_w)) - MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE("serial", gaelco_serial_device, rts_w)) - MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, di_write)) - MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, clk_write)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("eeprom", eeprom_serial_93cxx_device, cs_write)) + MCFG_DEVICE_ADD(m_mainlatch, LS259, 0) // IC5 on bottom board next to EEPROM + MCFG_ADDRESSABLE_LATCH_Q0_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, tr_w)) + MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, rts_w)) + MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(m_eeprom, eeprom_serial_93cxx_device, di_write)) + MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(m_eeprom, eeprom_serial_93cxx_device, clk_write)) + MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(m_eeprom, eeprom_serial_93cxx_device, cs_write)) MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gaelco3d_state, tms_reset_w)) MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, gaelco3d_state, tms_irq_w)) MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(*this, gaelco3d_state, unknown_13a_w)) - MCFG_DEVICE_ADD("outlatch", LS259, 0) // IC2 on top board near edge connector + MCFG_DEVICE_ADD(m_outlatch, LS259, 0) // IC2 on top board near edge connector MCFG_ADDRESSABLE_LATCH_Q1_OUT_CB(WRITELINE(*this, gaelco3d_state, tms_control3_w)) MCFG_ADDRESSABLE_LATCH_Q2_OUT_CB(WRITELINE(*this, gaelco3d_state, radikalb_lamp_w)) MCFG_ADDRESSABLE_LATCH_Q3_OUT_CB(WRITELINE(*this, gaelco3d_state, unknown_137_w)) - MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE("serial", gaelco_serial_device, irq_enable)) + MCFG_ADDRESSABLE_LATCH_Q4_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, irq_enable)) MCFG_ADDRESSABLE_LATCH_Q5_OUT_CB(WRITELINE(*this, gaelco3d_state, analog_port_clock_w)) MCFG_ADDRESSABLE_LATCH_Q6_OUT_CB(WRITELINE(*this, gaelco3d_state, analog_port_latch_w)) - MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE("serial", gaelco_serial_device, unknown_w)) + MCFG_ADDRESSABLE_LATCH_Q7_OUT_CB(WRITELINE(m_serial, gaelco_serial_device, unknown_w)) - MCFG_GENERIC_LATCH_8_ADD("soundlatch") - MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE("adsp", ADSP2115_IRQ2)) + MCFG_GENERIC_LATCH_8_ADD(m_soundlatch) + MCFG_GENERIC_LATCH_DATA_PENDING_CB(INPUTLINE(m_adsp, ADSP2115_IRQ2)) /* video hardware */ - MCFG_SCREEN_ADD("screen", RASTER) + MCFG_SCREEN_ADD(m_screen, RASTER) MCFG_SCREEN_REFRESH_RATE(60) MCFG_SCREEN_VBLANK_TIME(ATTOSECONDS_IN_USEC(2500) /* not accurate */) MCFG_SCREEN_SIZE(576, 432) MCFG_SCREEN_VISIBLE_AREA(0, 575, 0, 431) - MCFG_SCREEN_UPDATE_DRIVER(gaelco3d_state, screen_update_gaelco3d) + MCFG_SCREEN_UPDATE_DRIVER(gaelco3d_state, screen_update) MCFG_SCREEN_PALETTE("palette") MCFG_PALETTE_ADD_RRRRRGGGGGBBBBB("palette") @@ -987,16 +984,16 @@ MACHINE_CONFIG_START(gaelco3d_state::gaelco3d) /* sound hardware */ SPEAKER(config, "mono").front_center(); - MCFG_DEVICE_ADD("dac1", DMADAC) + MCFG_DEVICE_ADD(m_dmadac[0], DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: front mono */ - MCFG_DEVICE_ADD("dac2", DMADAC) + MCFG_DEVICE_ADD(m_dmadac[1], DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: left rear */ - MCFG_DEVICE_ADD("dac3", DMADAC) + MCFG_DEVICE_ADD(m_dmadac[2], DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: right rear */ - MCFG_DEVICE_ADD("dac4", DMADAC) + MCFG_DEVICE_ADD(m_dmadac[3], DMADAC) MCFG_SOUND_ROUTE(ALL_OUTPUTS, "mono", 1.0) /* speedup: seat speaker */ MACHINE_CONFIG_END @@ -1256,29 +1253,17 @@ ROM_END /************************************* * - * Driver init - * - *************************************/ - -void gaelco3d_state::init_gaelco3d() -{ -} - - - -/************************************* - * * Game drivers * *************************************/ -GAME( 1996, speedup, 0, gaelco3d, speedup, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco", "Speed Up (Version 1.20)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1996, speedup10, speedup, gaelco3d, speedup, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco", "Speed Up (Version 1.00)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, speedup, 0, gaelco3d, speedup, gaelco3d_state, empty_init, ROT0, "Gaelco", "Speed Up (Version 1.20)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) +GAME( 1996, speedup10, speedup, gaelco3d, speedup, gaelco3d_state, empty_init, ROT0, "Gaelco", "Speed Up (Version 1.00)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE ) -GAME( 1997, surfplnt, 0, gaelco3d, surfplnt, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco (Atari license)", "Surf Planet (Version 4.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) -GAME( 1997, surfplnt40, surfplnt, gaelco3d, surfplnt, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco (Atari license)", "Surf Planet (Version 4.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) +GAME( 1997, surfplnt, 0, gaelco3d, surfplnt, gaelco3d_state, empty_init, ROT0, "Gaelco (Atari license)", "Surf Planet (Version 4.1)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) +GAME( 1997, surfplnt40, surfplnt, gaelco3d, surfplnt, gaelco3d_state, empty_init, ROT0, "Gaelco (Atari license)", "Surf Planet (Version 4.0)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) -GAME( 1998, radikalb, 0, gaelco3d2, radikalb, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco", "Radikal Bikers (Version 2.02)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) -GAME( 1998, radikalba, radikalb, gaelco3d2, radikalb, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco (Atari license)", "Radikal Bikers (Version 2.02, Atari license)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) +GAME( 1998, radikalb, 0, gaelco3d2, radikalb, gaelco3d_state, empty_init, ROT0, "Gaelco", "Radikal Bikers (Version 2.02)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) +GAME( 1998, radikalba, radikalb, gaelco3d2, radikalb, gaelco3d_state, empty_init, ROT0, "Gaelco (Atari license)", "Radikal Bikers (Version 2.02, Atari license)", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE) -GAME( 1999, footbpow, 0, footbpow, footbpow, gaelco3d_state, init_gaelco3d, ROT0, "Gaelco", "Football Power", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_CONTROLS ) +GAME( 1999, footbpow, 0, footbpow, footbpow, gaelco3d_state, empty_init, ROT0, "Gaelco", "Football Power", MACHINE_IMPERFECT_GRAPHICS | MACHINE_SUPPORTS_SAVE | MACHINE_IMPERFECT_CONTROLS ) |