From 72f5a61378f82163fd0719b307ca13a39aa85990 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Banaan=20Ananas?= Date: Sun, 27 May 2012 23:43:00 +0000 Subject: [PATCH] cleanup --- src/mame/drivers/taitojc.c | 32 +++++--------------------------- src/mame/includes/taitojc.h | 4 ++++ src/mame/video/taitojc.c | 4 ---- 3 files changed, 9 insertions(+), 31 deletions(-) diff --git a/src/mame/drivers/taitojc.c b/src/mame/drivers/taitojc.c index 7afd29d372c..dbcff4f6117 100644 --- a/src/mame/drivers/taitojc.c +++ b/src/mame/drivers/taitojc.c @@ -366,7 +366,6 @@ Notes: READ32_MEMBER(taitojc_state::taitojc_palette_r) { - return m_palette_ram[offset]; } @@ -452,7 +451,6 @@ READ32_MEMBER(taitojc_state::jc_control_r) WRITE32_MEMBER(taitojc_state::jc_coin_counters_w) { - COMBINE_DATA(&m_outputs); coin_lockout_w(machine(), 0, !(data & 0x01000000)); @@ -743,7 +741,6 @@ static void debug_dsp_command(running_machine &machine) WRITE32_MEMBER(taitojc_state::dsp_shared_w) { - //mame_printf_debug("dsp_shared: %08X, %04X at %08X\n", offset, data >> 16, cpu_get_pc(&space.device())); if (ACCESSING_BITS_24_31) { @@ -764,7 +761,7 @@ WRITE32_MEMBER(taitojc_state::dsp_shared_w) #endif if (offset == 0x1ff8/4) - cputag_set_input_line(machine(), "maincpu", 6, CLEAR_LINE); + device_set_input_line(m_maincpu, 6, CLEAR_LINE); if (offset == 0x1ffc/4) { @@ -782,13 +779,13 @@ WRITE32_MEMBER(taitojc_state::dsp_shared_w) */ if (!m_first_dsp_reset || !m_has_dsp_hack) { - cputag_set_input_line(machine(), "dsp", INPUT_LINE_RESET, CLEAR_LINE); + device_set_input_line(m_dsp, INPUT_LINE_RESET, CLEAR_LINE); } m_first_dsp_reset = 0; } else { - cputag_set_input_line(machine(), "dsp", INPUT_LINE_RESET, ASSERT_LINE); + device_set_input_line(m_dsp, INPUT_LINE_RESET, ASSERT_LINE); } } } @@ -821,7 +818,6 @@ WRITE32_MEMBER(taitojc_state::f3_share_w) WRITE32_MEMBER(taitojc_state::jc_meters_w) { - // printf("jc_output_w: %08x, %08x %08x\n", offset, data,mem_mask); if(offset == 0 && ACCESSING_BITS_16_31) m_speed_meter = taitojc_odometer_table[(data >> 16) & 0xff]; @@ -870,18 +866,15 @@ ADDRESS_MAP_END READ8_MEMBER(taitojc_state::hc11_comm_r) { - return m_mcu_comm_hc11; } WRITE8_MEMBER(taitojc_state::hc11_comm_w) { - } READ8_MEMBER(taitojc_state::hc11_data_r) { - m_mcu_comm_hc11 |= 0x04; m_mcu_comm_main |= 0x20; return m_mcu_data_hc11; @@ -889,7 +882,6 @@ READ8_MEMBER(taitojc_state::hc11_data_r) WRITE8_MEMBER(taitojc_state::hc11_data_w) { - m_mcu_data_main = data; } @@ -928,7 +920,6 @@ READ16_MEMBER(taitojc_state::dsp_rom_r) WRITE16_MEMBER(taitojc_state::dsp_rom_w) { - if (offset == 0) { m_dsp_rom_pos &= 0xffff; @@ -961,13 +952,11 @@ WRITE16_MEMBER(taitojc_state::dsp_texture_w) READ16_MEMBER(taitojc_state::dsp_texaddr_r) { - return m_dsp_tex_address; } WRITE16_MEMBER(taitojc_state::dsp_texaddr_w) { - m_dsp_tex_address = data; // mame_printf_debug("texaddr = %08X at %08X\n", data, cpu_get_pc(&space.device())); @@ -996,13 +985,11 @@ READ16_MEMBER(taitojc_state::dsp_unk_r) WRITE16_MEMBER(taitojc_state::dsp_viewport_w) { - m_viewport_data[offset] = (INT16)(data); } WRITE16_MEMBER(taitojc_state::dsp_projection_w) { - m_projection_data[offset] = (INT16)(data); if (offset == 2) @@ -1022,7 +1009,6 @@ WRITE16_MEMBER(taitojc_state::dsp_projection_w) READ16_MEMBER(taitojc_state::dsp_projection_r) { - if (offset == 0) { return m_projected_point_y; @@ -1037,7 +1023,6 @@ READ16_MEMBER(taitojc_state::dsp_projection_r) WRITE16_MEMBER(taitojc_state::dsp_unk2_w) { - if (offset == 0) { taitojc_clear_frame(machine()); @@ -1049,13 +1034,11 @@ WRITE16_MEMBER(taitojc_state::dsp_unk2_w) WRITE16_MEMBER(taitojc_state::dsp_intersection_w) { - m_intersection_data[offset] = (INT32)(INT16)(data); } READ16_MEMBER(taitojc_state::dsp_intersection_r) { - return (INT16)((m_intersection_data[0] * m_intersection_data[1]) / m_intersection_data[2]); } @@ -1082,14 +1065,12 @@ READ16_MEMBER(taitojc_state::dsp_intersection_r) READ16_MEMBER(taitojc_state::dsp_to_main_r) { - return m_dsp_shared_ram[0x7fe]; } WRITE16_MEMBER(taitojc_state::dsp_to_main_w) { - - cputag_set_input_line(machine(), "maincpu", 6, ASSERT_LINE); + device_set_input_line(m_maincpu, 6, ASSERT_LINE); COMBINE_DATA(&m_dsp_shared_ram[0x7fe]); } @@ -1365,7 +1346,7 @@ static MACHINE_RESET( taitojc ) memset(state->m_intersection_data, 0, sizeof(state->m_intersection_data)); // hold the TMS in reset until we have code - cputag_set_input_line(machine, "dsp", INPUT_LINE_RESET, ASSERT_LINE); + device_set_input_line(state->m_dsp, INPUT_LINE_RESET, ASSERT_LINE); } static INTERRUPT_GEN( taitojc_vblank ) @@ -1425,7 +1406,6 @@ MACHINE_CONFIG_END READ16_MEMBER(taitojc_state::taitojc_dsp_idle_skip_r) { - if(cpu_get_pc(&space.device())==0x404c) device_spin_until_time(&space.device(), attotime::from_usec(500)); @@ -1434,7 +1414,6 @@ READ16_MEMBER(taitojc_state::taitojc_dsp_idle_skip_r) READ16_MEMBER(taitojc_state::dendego2_dsp_idle_skip_r) { - if(cpu_get_pc(&space.device())==0x402e) device_spin_until_time(&space.device(), attotime::from_usec(500)); @@ -1443,7 +1422,6 @@ READ16_MEMBER(taitojc_state::dendego2_dsp_idle_skip_r) WRITE16_MEMBER(taitojc_state::dsp_idle_skip_w) { - COMBINE_DATA(&m_dsp_shared_ram[0x7f0]); } diff --git a/src/mame/includes/taitojc.h b/src/mame/includes/taitojc.h index 57d0cbde6e4..5b49a8fc9d4 100644 --- a/src/mame/includes/taitojc.h +++ b/src/mame/includes/taitojc.h @@ -5,6 +5,8 @@ class taitojc_state : public driver_device public: taitojc_state(const machine_config &mconfig, device_type type, const char *tag) : driver_device(mconfig, type, tag), + m_maincpu(*this,"maincpu"), + m_dsp(*this,"dsp"), m_vram(*this, "vram"), m_objlist(*this, "objlist"), m_f3_shared_ram(*this, "f3_shared"), @@ -47,6 +49,8 @@ public: poly_manager *m_poly; + required_device m_maincpu; + required_device m_dsp; optional_shared_ptr m_f3_shared_ram; required_shared_ptr m_main_ram; required_shared_ptr m_dsp_shared_ram; diff --git a/src/mame/video/taitojc.c b/src/mame/video/taitojc.c index fd74215632f..f04423779bc 100644 --- a/src/mame/video/taitojc.c +++ b/src/mame/video/taitojc.c @@ -41,26 +41,22 @@ static TILE_GET_INFO( taitojc_tile_info ) READ32_MEMBER(taitojc_state::taitojc_tile_r) { - return m_tile_ram[offset]; } READ32_MEMBER(taitojc_state::taitojc_char_r) { - return m_char_ram[offset]; } WRITE32_MEMBER(taitojc_state::taitojc_tile_w) { - COMBINE_DATA(m_tile_ram + offset); m_tilemap->mark_tile_dirty(offset); } WRITE32_MEMBER(taitojc_state::taitojc_char_w) { - COMBINE_DATA(m_char_ram + offset); gfx_element_mark_dirty(machine().gfx[m_gfx_index], offset/32); }