diff options
Diffstat (limited to 'src/mame/barcrest/mpu3.cpp')
-rw-r--r-- | src/mame/barcrest/mpu3.cpp | 81 |
1 files changed, 42 insertions, 39 deletions
diff --git a/src/mame/barcrest/mpu3.cpp b/src/mame/barcrest/mpu3.cpp index b403f8970a8..578d4ec0444 100644 --- a/src/mame/barcrest/mpu3.cpp +++ b/src/mame/barcrest/mpu3.cpp @@ -161,14 +161,16 @@ TODO: - Distinguish door switches using manual #include "m3winstr.lh" #include "m3xchngg.lh" - #ifdef MAME_DEBUG -#define MPU3VERBOSE 1 +#define VERBOSE (LOG_GENERAL) #else -#define MPU3VERBOSE 0 +#define VERBOSE (0) #endif -#define LOG(x) do { if (MPU3VERBOSE) logerror x; } while (0) +#include "logmacro.h" + + +namespace { class mpu3_state : public driver_device { @@ -200,26 +202,26 @@ protected: required_device<cpu_device> m_maincpu; private: - template <unsigned N> DECLARE_WRITE_LINE_MEMBER(reel_optic_cb) { if (state) m_optic_pattern |= (1 << N); else m_optic_pattern &= ~(1 << N); } + template <unsigned N> void reel_optic_cb(int state) { if (state) m_optic_pattern |= (1 << N); else m_optic_pattern &= ~(1 << N); } void mpu3ptm_w(offs_t offset, uint8_t data); uint8_t mpu3ptm_r(offs_t offset); - DECLARE_WRITE_LINE_MEMBER(ic2_o1_callback); - DECLARE_WRITE_LINE_MEMBER(ic2_o2_callback); - DECLARE_WRITE_LINE_MEMBER(ic2_o3_callback); + void ic2_o1_callback(int state); + void ic2_o2_callback(int state); + void ic2_o3_callback(int state); uint8_t pia_ic3_porta_r(); void pia_ic3_portb_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(pia_ic3_ca2_w); + void pia_ic3_ca2_w(int state); uint8_t pia_ic4_porta_r(); void pia_ic4_porta_w(uint8_t data); void pia_ic4_portb_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(pia_ic4_ca2_w); - DECLARE_WRITE_LINE_MEMBER(pia_ic4_cb2_w); + void pia_ic4_ca2_w(int state); + void pia_ic4_cb2_w(int state); void pia_ic5_porta_w(uint8_t data); uint8_t pia_ic5_portb_r(); void pia_ic5_portb_w(uint8_t data); - DECLARE_WRITE_LINE_MEMBER(pia_ic5_ca2_w); - DECLARE_WRITE_LINE_MEMBER(pia_ic5_cb2_w); + void pia_ic5_ca2_w(int state); + void pia_ic5_cb2_w(int state); uint8_t pia_ic6_porta_r(); uint8_t pia_ic6_portb_r(); void pia_ic6_porta_w(uint8_t data); @@ -327,17 +329,17 @@ void mpu3_state::machine_reset() /* IC2 6840 PTM handler probably clocked from elsewhere*/ -WRITE_LINE_MEMBER(mpu3_state::ic2_o1_callback) +void mpu3_state::ic2_o1_callback(int state) { } //FIXME FROM HERE -WRITE_LINE_MEMBER(mpu3_state::ic2_o2_callback) +void mpu3_state::ic2_o2_callback(int state) { } -WRITE_LINE_MEMBER(mpu3_state::ic2_o3_callback) +void mpu3_state::ic2_o3_callback(int state) { } @@ -421,7 +423,7 @@ uint8_t mpu3_state::pia_ic3_porta_r() { static const char *const portnames[] = { "ORANGE1", "ORANGE2", "BLACK1", "BLACK2", "DIL1", "DIL1", "DIL2", "DIL2" }; int data=0,swizzle; - LOG(("%s: IC3 PIA Read of Port A (MUX input data)\n", machine().describe_context())); + LOG("%s: IC3 PIA Read of Port A (MUX input data)\n", machine().describe_context()); //popmessage("%x",m_input_strobe); switch (m_input_strobe) { @@ -462,14 +464,14 @@ uint8_t mpu3_state::pia_ic3_porta_r() void mpu3_state::pia_ic3_portb_w(uint8_t data) { - LOG(("%s: IC3 PIA Port B Set to %2x (Triac)\n", machine().describe_context(),data)); + LOG("%s: IC3 PIA Port B Set to %2x (Triac)\n", machine().describe_context(),data); m_triac_ic3 =data; } -WRITE_LINE_MEMBER(mpu3_state::pia_ic3_ca2_w) +void mpu3_state::pia_ic3_ca2_w(int state) { - LOG(("%s: IC3 PIA Port CA2 Set to %2x (input A)\n", machine().describe_context(),state)); + LOG("%s: IC3 PIA Port CA2 Set to %2x (input A)\n", machine().describe_context(),state); m_IC11GA = state; ic21_setup(); ic11_update(); @@ -491,7 +493,7 @@ uint8_t mpu3_state::pia_ic4_porta_r() /* IC4, 7 seg leds */ void mpu3_state::pia_ic4_porta_w(uint8_t data) { - LOG(("%s: IC4 PIA Port A Set to %2x (DISPLAY PORT)\n", machine().describe_context(),data)); + LOG("%s: IC4 PIA Port A Set to %2x (DISPLAY PORT)\n", machine().describe_context(),data); m_ic4_input_a=data; switch (m_disp_func) { @@ -524,7 +526,7 @@ void mpu3_state::pia_ic4_porta_w(uint8_t data) void mpu3_state::pia_ic4_portb_w(uint8_t data) { - LOG(("%s: IC4 PIA Port B Set to %2x (Lamp)\n", machine().describe_context(),data)); + LOG("%s: IC4 PIA Port B Set to %2x (Lamp)\n", machine().describe_context(),data); if (m_ic11_active) { if (m_lamp_strobe != m_input_strobe) @@ -541,23 +543,23 @@ void mpu3_state::pia_ic4_portb_w(uint8_t data) } } -WRITE_LINE_MEMBER(mpu3_state::pia_ic4_ca2_w) +void mpu3_state::pia_ic4_ca2_w(int state) { - LOG(("%s: IC4 PIA Port CA2 Set to %2x (Input B)\n", machine().describe_context(),state)); + LOG("%s: IC4 PIA Port CA2 Set to %2x (Input B)\n", machine().describe_context(),state); m_IC11GB = state; ic11_update(); } -WRITE_LINE_MEMBER(mpu3_state::pia_ic4_cb2_w) +void mpu3_state::pia_ic4_cb2_w(int state) { - LOG(("%s: IC4 PIA Port CA2 Set to %2x (Triac)\n", machine().describe_context(),state)); + LOG("%s: IC4 PIA Port CA2 Set to %2x (Triac)\n", machine().describe_context(),state); m_triac_ic4=state; } /* IC5, AUX ports, coin lockouts and AY sound chip select (MODs below 4 only) */ void mpu3_state::pia_ic5_porta_w(uint8_t data) { - LOG(("%s: IC5 PIA Port A Set to %2x (Reel)\n", machine().describe_context(),data)); + LOG("%s: IC5 PIA Port A Set to %2x (Reel)\n", machine().describe_context(),data); m_reels[0]->update( data & 0x03); m_reels[1]->update((data>>2) & 0x03); m_reels[2]->update((data>>4) & 0x03); @@ -587,16 +589,16 @@ void mpu3_state::pia_ic5_portb_w(uint8_t data) m_ic3_data = data; } -WRITE_LINE_MEMBER(mpu3_state::pia_ic5_ca2_w) +void mpu3_state::pia_ic5_ca2_w(int state) { - LOG(("%s: IC5 PIA Port CA2 Set to %2x (C)\n", machine().describe_context(),state)); + LOG("%s: IC5 PIA Port CA2 Set to %2x (C)\n", machine().describe_context(),state); m_IC11GC = state; ic11_update(); } -WRITE_LINE_MEMBER(mpu3_state::pia_ic5_cb2_w) +void mpu3_state::pia_ic5_cb2_w(int state) { - LOG(("%s: IC5 PIA Port CB2 Set to %2x (Triac)\n", machine().describe_context(),state)); + LOG("%s: IC5 PIA Port CB2 Set to %2x (Triac)\n", machine().describe_context(),state); m_triac_ic5 = state; } @@ -615,7 +617,7 @@ uint8_t mpu3_state::pia_ic6_portb_r() void mpu3_state::pia_ic6_porta_w(uint8_t data) { - LOG(("%s: IC6 PIA Port A Set to %2x (Alpha)\n", machine().describe_context(),data)); + LOG("%s: IC6 PIA Port A Set to %2x (Alpha)\n", machine().describe_context(),data); m_vfd->por((data & 0x08)); m_vfd->data((data & 0x20) >> 5); m_vfd->sclk((data & 0x10) >>4); @@ -623,7 +625,7 @@ void mpu3_state::pia_ic6_porta_w(uint8_t data) void mpu3_state::pia_ic6_portb_w(uint8_t data) { - LOG(("%s: IC6 PIA Port B Set to %2x (AUX2)\n", machine().describe_context(),data)); + LOG("%s: IC6 PIA Port B Set to %2x (AUX2)\n", machine().describe_context(),data); m_aux2_input = data; } @@ -819,13 +821,13 @@ void mpu3_state::mpu3base(machine_config &config) m_ptm2->o3_callback().set(FUNC(mpu3_state::ic2_o3_callback)); m_ptm2->irq_callback().set("mainirq", FUNC(input_merger_device::in_w<0>)); - PIA6821(config, m_pia3, 0); + PIA6821(config, m_pia3); m_pia3->readpa_handler().set(FUNC(mpu3_state::pia_ic3_porta_r)); m_pia3->writepb_handler().set(FUNC(mpu3_state::pia_ic3_portb_w)); m_pia3->ca2_handler().set(FUNC(mpu3_state::pia_ic3_ca2_w)); m_pia3->irqb_handler().set("mainirq", FUNC(input_merger_device::in_w<1>)); - PIA6821(config, m_pia4, 0); + PIA6821(config, m_pia4); m_pia4->readpa_handler().set(FUNC(mpu3_state::pia_ic4_porta_r)); m_pia4->writepa_handler().set(FUNC(mpu3_state::pia_ic4_porta_w)); m_pia4->writepb_handler().set(FUNC(mpu3_state::pia_ic4_portb_w)); @@ -833,14 +835,14 @@ void mpu3_state::mpu3base(machine_config &config) m_pia4->cb2_handler().set(FUNC(mpu3_state::pia_ic4_cb2_w)); m_pia4->irqa_handler().set("mainirq", FUNC(input_merger_device::in_w<2>)); - PIA6821(config, m_pia5, 0); + PIA6821(config, m_pia5); m_pia5->readpb_handler().set(FUNC(mpu3_state::pia_ic5_portb_r)); m_pia5->writepa_handler().set(FUNC(mpu3_state::pia_ic5_porta_w)); m_pia5->writepb_handler().set(FUNC(mpu3_state::pia_ic5_portb_w)); m_pia5->ca2_handler().set(FUNC(mpu3_state::pia_ic5_ca2_w)); m_pia5->cb2_handler().set(FUNC(mpu3_state::pia_ic5_cb2_w)); - PIA6821(config, m_pia6, 0); + PIA6821(config, m_pia6); m_pia6->readpa_handler().set(FUNC(mpu3_state::pia_ic6_porta_r)); m_pia6->readpb_handler().set(FUNC(mpu3_state::pia_ic6_portb_r)); m_pia6->writepa_handler().set(FUNC(mpu3_state::pia_ic6_porta_w)); @@ -852,7 +854,7 @@ void mpu3_state::mpu3base(machine_config &config) m_reels[0]->optic_handler().set(FUNC(mpu3_state::reel_optic_cb<0>)); REEL(config, m_reels[1], MPU3_48STEP_REEL, 96, 2, 0x00, 2); m_reels[1]->optic_handler().set(FUNC(mpu3_state::reel_optic_cb<1>)); - REEL(config, m_reels[2], MPU3_48STEP_REEL, 96, 2, 0x00, 2);; + REEL(config, m_reels[2], MPU3_48STEP_REEL, 96, 2, 0x00, 2); m_reels[2]->optic_handler().set(FUNC(mpu3_state::reel_optic_cb<2>)); REEL(config, m_reels[3], MPU3_48STEP_REEL, 96, 2, 0x00, 2); m_reels[3]->optic_handler().set(FUNC(mpu3_state::reel_optic_cb<3>)); @@ -1562,13 +1564,14 @@ ROM_START( m3winstra ) ROM_COPY( "maincpu", 0x0000, 0x8000, 0x8000 ) ROM_END +} // anonymous namespace /* Barcrest */ // search for cmpa (x+$01) in trace logs to find protection accesses -#define GAME_FLAGS MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_REQUIRES_ARTWORK|MACHINE_MECHANICAL|MACHINE_CLICKABLE_ARTWORK +#define GAME_FLAGS MACHINE_NOT_WORKING|MACHINE_NO_SOUND|MACHINE_REQUIRES_ARTWORK|MACHINE_MECHANICAL |