From 87c0e06926d89ce9c650c3f76ce2b5c1d41f4c33 Mon Sep 17 00:00:00 2001 From: Vas Crabb Date: Fri, 5 Jan 2024 00:53:30 +1100 Subject: taito/kikikai.cpp: Added Kiki KaiKai microcontroller program ROM dump. [Madov, Raki, Travis Goodspeed] --- hash/msx2_flop.xml | 6 ++-- src/mame/taito/kikikai.cpp | 8 +++--- src/mame/taito/kikikai.h | 66 +++++++++++++++++++++++--------------------- src/mame/taito/kikikai_m.cpp | 6 ++-- 4 files changed, 45 insertions(+), 41 deletions(-) diff --git a/hash/msx2_flop.xml b/hash/msx2_flop.xml index e8f8a804b6f..094619b1346 100644 --- a/hash/msx2_flop.xml +++ b/hash/msx2_flop.xml @@ -8525,7 +8525,7 @@ The following floppies came with the machines. - Kounai Shasei Vol. 1 (Japan) + Konai Shasei Vol. 1 (Japan) 1991 Fairytale @@ -8558,7 +8558,7 @@ The following floppies came with the machines. - Kounai Shasei Vol. 2 (Japan) + Konai Shasei Vol. 2 (Japan) 1991 Fairytale @@ -8591,7 +8591,7 @@ The following floppies came with the machines. - Kounai Shasei Vol. 3 (Japan) + Konai Shasei Vol. 3 (Japan) 1991 Fairytale diff --git a/src/mame/taito/kikikai.cpp b/src/mame/taito/kikikai.cpp index 043daeb5180..90ce298fe48 100644 --- a/src/mame/taito/kikikai.cpp +++ b/src/mame/taito/kikikai.cpp @@ -727,7 +727,7 @@ void kikikai_state::base(machine_config &config) m_ymsnd->add_route(3, "mono", 1.00); } -void kikikai_state::kicknrun(machine_config& config) +void kikikai_state::kicknrun(machine_config &config) { base(config); @@ -762,7 +762,7 @@ void kikikai_simulation_state::kikikai(machine_config &config) } -void mexico86_state::mexico86_68705(machine_config& config) +void mexico86_state::mexico86_68705(machine_config &config) { base(config); m_maincpu->set_irq_acknowledge_callback(FUNC(mexico86_state::mcram_vect_r)); @@ -790,7 +790,7 @@ void kikikai_state::knightba(machine_config &config) config.device_remove("sub"); - m_screen->set_screen_update(FUNC(kikikai_simulation_state::screen_update_kikikai)); + m_screen->set_screen_update(FUNC(kikikai_state::screen_update_kikikai)); } @@ -811,7 +811,7 @@ ROM_START( kikikai ) ROM_REGION( 0x1000, "mcu", 0 ) /* 4k for the microcontroller (MC6801U4 type MCU) */ /* MCU labeled TAITO A85 01, JPH1020P, 185, PS4 */ - ROM_LOAD( "a85-01.g8", 0x0000, 0x1000, NO_DUMP ) + ROM_LOAD( "a85-01_jph1020p.h8", 0x0000, 0x1000, CRC(01771197) SHA1(84430a56c66ff2781fe1ff35d4f15b332cd0af37) ) ROM_REGION( 0x40000, "gfx1", ROMREGION_INVERT ) ROM_LOAD( "a85-15.a1", 0x00000, 0x10000, CRC(aebc8c32) SHA1(77347cf5780f084a77123eb636cd0bad672a39e8) ) diff --git a/src/mame/taito/kikikai.h b/src/mame/taito/kikikai.h index 503a061b14f..68220f9585b 100644 --- a/src/mame/taito/kikikai.h +++ b/src/mame/taito/kikikai.h @@ -11,8 +11,8 @@ class kikikai_state : public driver_device { public: - kikikai_state(const machine_config &mconfig, device_type type, const char *tag) - : driver_device(mconfig, type, tag), + kikikai_state(const machine_config &mconfig, device_type type, const char *tag) : + driver_device(mconfig, type, tag), m_maincpu(*this, "maincpu"), m_audiocpu(*this, "audiocpu"), m_screen(*this, "screen"), @@ -26,16 +26,10 @@ public: { } - void base(machine_config &config); void kicknrun(machine_config &config); void knightba(machine_config &config); protected: - required_device m_maincpu; - required_device m_audiocpu; - required_device m_screen; - optional_shared_ptr m_mcu_sharedram; - u32 screen_update_kicknrun(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); u32 screen_update_kikikai(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect); @@ -44,7 +38,33 @@ protected: IRQ_CALLBACK_MEMBER(mcram_vect_r); + void base(machine_config &config); + + required_device m_maincpu; + required_device m_audiocpu; + required_device m_screen; + optional_shared_ptr m_mcu_sharedram; + private: + void kicknrun_sub_output_w(uint8_t data); + virtual void main_f008_w(uint8_t data); + + void main_bankswitch_w(uint8_t data); + uint8_t kiki_ym2203_r(offs_t offset); + + virtual INTERRUPT_GEN_MEMBER(kikikai_interrupt); + + void main_map(address_map &map); + void sound_map(address_map &map); + void kicknrun_sub_cpu_map(address_map &map); + void knightba_main_map(address_map &map); + + void kikikai_mcu_port1_w(uint8_t data); + void kikikai_mcu_port2_w(uint8_t data); + uint8_t kikikai_mcu_port3_r(); + void kikikai_mcu_port3_w(uint8_t data); + void kikikai_mcu_port4_w(uint8_t data); + /* memory pointers */ required_shared_ptr m_mainram; @@ -62,18 +82,6 @@ private: //u8 m_queue[64]{}; //int m_qfront = 0; //int m_qstate = 0; - void kicknrun_sub_output_w(uint8_t data); - virtual void main_f008_w(uint8_t data); - - void main_bankswitch_w(uint8_t data); - uint8_t kiki_ym2203_r(offs_t offset); - - virtual INTERRUPT_GEN_MEMBER(kikikai_interrupt); - - void main_map(address_map &map); - void sound_map(address_map &map); - void kicknrun_sub_cpu_map(address_map &map); - void knightba_main_map(address_map &map); /* Kiki KaiKai / Kick 'n Run MCU */ uint8_t m_port3_in = 0U; @@ -81,24 +89,18 @@ private: uint8_t m_port2_out = 0U; uint8_t m_port3_out = 0U; uint8_t m_port4_out = 0U; - - void kikikai_mcu_port1_w(uint8_t data); - void kikikai_mcu_port2_w(uint8_t data); - uint8_t kikikai_mcu_port3_r(); - void kikikai_mcu_port3_w(uint8_t data); - void kikikai_mcu_port4_w(uint8_t data); }; class mexico86_state : public kikikai_state { public: - mexico86_state(const machine_config& mconfig, device_type type, const char* tag) - : kikikai_state(mconfig, type, tag), + mexico86_state(const machine_config &mconfig, device_type type, const char *tag) : + kikikai_state(mconfig, type, tag), m_68705mcu(*this, "68705mcu") { } - void mexico86_68705(machine_config& config); + void mexico86_68705(machine_config &config); void knightb(machine_config &config); protected: @@ -126,12 +128,12 @@ private: class kikikai_simulation_state : public kikikai_state { public: - kikikai_simulation_state(const machine_config& mconfig, device_type type, const char* tag) - : kikikai_state(mconfig, type, tag) + kikikai_simulation_state(const machine_config &mconfig, device_type type, const char *tag) : + kikikai_state(mconfig, type, tag) { } - void kikikai(machine_config& config); + void kikikai(machine_config &config); protected: virtual void machine_start() override; diff --git a/src/mame/taito/kikikai_m.cpp b/src/mame/taito/kikikai_m.cpp index aed7ef17ef5..b405674d79e 100644 --- a/src/mame/taito/kikikai_m.cpp +++ b/src/mame/taito/kikikai_m.cpp @@ -353,11 +353,13 @@ void kikikai_state::kikikai_mcu_port1_w(uint8_t data) //logerror("%04x: 6801U4 port 1 write %02x\n", m_mcu->pc(), data); // bit 0, 1: coin counters (?) - if (data & 0x01 && ~m_port1_out & 0x01) { + if (data & 0x01 && ~m_port1_out & 0x01) + { machine().bookkeeping().coin_counter_w(0, data & 0x01); } - if (data & 0x02 && ~m_port1_out & 0x02) { + if (data & 0x02 && ~m_port1_out & 0x02) + { machine().bookkeeping().coin_counter_w(1, data & 0x02); } -- cgit v1.2.3