From a93426ab33a6b64289595ecdd250e42bcc6a59c5 Mon Sep 17 00:00:00 2001 From: Robbbert Date: Fri, 31 Dec 2021 03:45:43 +1100 Subject: jeutel.cpp: WIP. Both games are playable. --- src/mame/drivers/jeutel.cpp | 449 +++++++++++++++++++++++++++++++++----------- src/mame/drivers/pk8000.cpp | 8 +- src/mame/layout/jeutel.lay | 68 +++---- 3 files changed, 374 insertions(+), 151 deletions(-) diff --git a/src/mame/drivers/jeutel.cpp b/src/mame/drivers/jeutel.cpp index 267892eaa1e..a4fa8b0a5d9 100644 --- a/src/mame/drivers/jeutel.cpp +++ b/src/mame/drivers/jeutel.cpp @@ -2,16 +2,27 @@ // copyright-holders:Robbbert /******************************************************************************* - PINBALL - Jeutel - - There are at least 7 machines from this manufacturer. Unable to find anything - technical at all... so used PinMAME as the reference. Really need a proper - schematic though. +PINBALL +Jeutel (France) System 84 + +Games: +- Apocalypse Now +- Evolution +- Excalibur (not the Gottlieb or Vifico game) +- Le King +- Olympic Games +- Papillon (not the Video Dens game) +- Valkyrie (also shown as Walkyrie in the manual) + +Status: +- All machines are playable. +- Multiball key code is XZ - need to jiggle these keys at start of game. ToDo: -- Everything! -- Each machine has 4 players, 7-digit, 12-segment florescent display +- Speech not working because the TMS5110 INT pin is not emulated +- Le King: Bad sound rom +- Match doesn't display or work +- Mechanical sounds ********************************************************************************/ @@ -19,9 +30,10 @@ ToDo: #include "machine/genpin.h" #include "cpu/z80/z80.h" +#include "machine/clock.h" #include "machine/i8255.h" -#include "machine/timer.h" #include "sound/ay8910.h" +#include "sound/dac.h" #include "sound/tms5110.h" #include "speaker.h" @@ -37,69 +49,93 @@ public: : genpin_class(mconfig, type, tag) , m_maincpu(*this, "maincpu") , m_cpu2(*this, "cpu2") + , m_audiocpu(*this, "audiocpu") + , m_speech(*this, "speech") , m_tms(*this, "tms") - , m_digits(*this, "digit%u", 0U) + , m_ppi(*this, "ppi%d", 0U) + , m_io_dips(*this, "DSW%d", 0U) + , m_io_keyboard(*this, "X%d", 0U) + , m_digits(*this, "digit%d", 0U) + , m_io_outputs(*this, "out%d", 0U) { } - void init_jeutel(); void jeutel(machine_config &config); -protected: - virtual void machine_reset() override; - virtual void machine_start() override { m_digits.resolve(); m_digit = 0; } - private: - uint8_t portb_r(); - void porta_w(uint8_t data); - void ppi0a_w(uint8_t data); - void ppi0b_w(uint8_t data); - void sndcmd_w(uint8_t data); - TIMER_DEVICE_CALLBACK_MEMBER(timer_a); - void jeutel_cpu2(address_map &map); - void jeutel_cpu3(address_map &map); - void jeutel_cpu3_io(address_map &map); - void jeutel_map(address_map &map); - - bool m_timer_a; - uint8_t m_sndcmd; - uint8_t m_digit; + virtual void machine_reset() override; + virtual void machine_start() override; + u8 portb_r(); + void porta_w(u8 data); + void ppi0a_w(u8 data) { m_row = data; } + u8 ppi0b_r() { u8 data = 0xff; for (u8 i = 0; i < 5; i++) if (!BIT(m_row, i)) data &= m_io_keyboard[i]->read(); return data; } + void ppi0c_w(u8 data) { for (u8 i = 0; i < 8; i++) m_io_outputs[i] = BIT(data, i); } + void ppi1a_w(u8 data); + void ppi1b_w(u8 data); + void ppi1c_w(u8 data) { m_lamp_data = data; } + void ppi2a_w(u8 data); + u8 ppi2b_r() { u8 data = 0xff; for (u8 i = 0; i < 4; i++) if (!BIT(m_row, i)) data &= m_io_dips[i]->read(); return data; } + void ppi2c_w(u8 data) { m_sndcmd = data; } + void tmaddr_w(u8 data); + void tminc_w(u8); + u8 tmdata_r(); + DECLARE_WRITE_LINE_MEMBER(clock_w); + void cpu2_map(address_map &map); + void audio_main_map(address_map &map); + void audio_io_map(address_map &map); + void main_map(address_map &map); + + u8 m_sndcmd = 0U; + u8 m_digit = 0U; + u8 m_row = 0U; + u16 m_tmbyte = 0U; + u8 m_tmbit = 0U; + u8 m_tmtemp = 0U; + u8 m_t_c = 0U; + u8 m_lamp_data = 0U; required_device m_maincpu; required_device m_cpu2; + required_device m_audiocpu; + required_region_ptr m_speech; required_device m_tms; + required_device_array m_ppi; + required_ioport_array<4> m_io_dips; + required_ioport_array<5> m_io_keyboard; output_finder<60> m_digits; + output_finder<136> m_io_outputs; }; -void jeutel_state::jeutel_map(address_map &map) +void jeutel_state::main_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x1fff).rom().region("roms", 0); map(0xc000, 0xc3ff).ram().share("shared"); map(0xc400, 0xc7ff).ram(); - map(0xe000, 0xe003).rw("ppi8255_2", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0xe000, 0xe003).rw("ppi2", FUNC(i8255_device::read), FUNC(i8255_device::write)); } -void jeutel_state::jeutel_cpu2(address_map &map) +void jeutel_state::cpu2_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x0fff).rom().region("roms", 0x2000); - map(0x2000, 0x2003).rw("ppi8255_0", FUNC(i8255_device::read), FUNC(i8255_device::write)); - map(0x3000, 0x3003).rw("ppi8255_1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x2000, 0x2003).rw("ppi1", FUNC(i8255_device::read), FUNC(i8255_device::write)); + map(0x3000, 0x3003).rw("ppi0", FUNC(i8255_device::read), FUNC(i8255_device::write)); map(0x4000, 0x4000).nopw(); // writes 12 here many times map(0x8000, 0x83ff).ram(); map(0xc000, 0xc3ff).ram().share("shared"); } -void jeutel_state::jeutel_cpu3(address_map &map) +void jeutel_state::audio_main_map(address_map &map) { map.unmap_value_high(); map(0x0000, 0x0fff).rom().region("roms", 0x3000); map(0x4000, 0x43ff).ram(); - map(0x8000, 0x8000).w(FUNC(jeutel_state::sndcmd_w)); + map(0x6000, 0x7fff).w("dac", FUNC(dac_byte_interface::data_w)); + map(0x8000, 0x8000).w(FUNC(jeutel_state::tmaddr_w)); } -void jeutel_state::jeutel_cpu3_io(address_map &map) +void jeutel_state::audio_io_map(address_map &map) { map.global_mask(0xff); map(0x00, 0x00).w("aysnd", FUNC(ay8910_device::address_w)); @@ -108,20 +144,193 @@ void jeutel_state::jeutel_cpu3_io(address_map &map) } static INPUT_PORTS_START( jeutel ) + PORT_START("DSW0") + PORT_DIPNAME( 0x01, 0x00, "S25") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x01, DEF_STR( Off )) + PORT_DIPNAME( 0x02, 0x02, "S29") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x02, DEF_STR( Off )) + PORT_DIPNAME( 0x04, 0x04, "Tilt Penalty") + PORT_DIPSETTING( 0x00, "Game") + PORT_DIPSETTING( 0x04, "Ball") + PORT_DIPNAME( 0x08, 0x08, "S21") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x08, DEF_STR( Off )) + PORT_DIPNAME( 0x10, 0x10, "Balls") + PORT_DIPSETTING( 0x00, "5") + PORT_DIPSETTING( 0x10, "3") + PORT_DIPNAME( 0x20, 0x20, "S13") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x20, DEF_STR( Off )) + PORT_DIPNAME( 0x40, 0x40, "S1") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x40, DEF_STR( Off )) + PORT_DIPNAME( 0x80, 0x80, "S5") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + + PORT_START("DSW1") + PORT_DIPNAME( 0x01, 0x00, "S26") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x01, DEF_STR( Off )) + PORT_DIPNAME( 0x02, 0x02, "S30") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x02, DEF_STR( Off )) + PORT_DIPNAME( 0x04, 0x04, "S18") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x04, DEF_STR( Off )) + PORT_DIPNAME( 0x08, 0x08, "S22") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x08, DEF_STR( Off )) + PORT_DIPNAME( 0x10, 0x10, "S10") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x10, DEF_STR( Off )) + PORT_DIPNAME( 0x20, 0x20, "S14") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x20, DEF_STR( Off )) + PORT_DIPNAME( 0x40, 0x40, "S2") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x40, DEF_STR( Off )) + PORT_DIPNAME( 0x80, 0x80, "S6") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + + PORT_START("DSW2") + PORT_DIPNAME( 0x01, 0x01, "S27") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x01, DEF_STR( Off )) + PORT_DIPNAME( 0x02, 0x02, "S31") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x02, DEF_STR( Off )) + PORT_DIPNAME( 0x04, 0x04, "S19") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x04, DEF_STR( Off )) + PORT_DIPNAME( 0x08, 0x08, "S23") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x08, DEF_STR( Off )) + PORT_DIPNAME( 0x10, 0x10, "S11") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x10, DEF_STR( Off )) + PORT_DIPNAME( 0x20, 0x20, "S15") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x20, DEF_STR( Off )) + PORT_DIPNAME( 0x40, 0x40, "S3") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x40, DEF_STR( Off )) + PORT_DIPNAME( 0x80, 0x80, "S7") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + + PORT_START("DSW3") + PORT_DIPNAME( 0x01, 0x01, "S28") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x01, DEF_STR( Off )) + PORT_DIPNAME( 0x02, 0x02, "S32") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x02, DEF_STR( Off )) + PORT_DIPNAME( 0x04, 0x04, "S20") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x04, DEF_STR( Off )) + PORT_DIPNAME( 0x08, 0x08, "S24") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x08, DEF_STR( Off )) + PORT_DIPNAME( 0x10, 0x10, "S12") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x10, DEF_STR( Off )) + PORT_DIPNAME( 0x20, 0x20, "S16") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x20, DEF_STR( Off )) + PORT_DIPNAME( 0x40, 0x40, "S4") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x40, DEF_STR( Off )) + PORT_DIPNAME( 0x80, 0x00, "S8") + PORT_DIPSETTING( 0x00, DEF_STR( On )) + PORT_DIPSETTING( 0x80, DEF_STR( Off )) + + PORT_START("X0") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_A) PORT_NAME("INP00") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_B) PORT_NAME("INP01") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_C) PORT_NAME("INP02") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_D) PORT_NAME("INP03") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_E) PORT_NAME("INP04") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_F) PORT_NAME("INP05") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_G) PORT_NAME("INP06") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_H) PORT_NAME("INP07") + + PORT_START("X1") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_I) PORT_NAME("INP10") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_J) PORT_NAME("INP11") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_K) PORT_NAME("INP12") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_L) PORT_NAME("INP13") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_M) PORT_NAME("INP14") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_N) PORT_NAME("INP15") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_O) PORT_NAME("INP16") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_P) PORT_NAME("INP17") + + PORT_START("X2") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_Q) PORT_NAME("INP20") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_R) PORT_NAME("INP21") + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_S) PORT_NAME("INP22") + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_T) PORT_NAME("INP23") + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_U) PORT_NAME("INP24") + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_V) PORT_NAME("INP25") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_W) PORT_NAME("INP26") + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_Y) PORT_NAME("INP27") + + PORT_START("X3") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_COMMA) PORT_NAME("INP30") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_X) PORT_NAME("Outhole") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_Z) PORT_NAME("INP37") + + PORT_START("X4") + PORT_BIT( 0x01, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_9) PORT_NAME("Tilt") + PORT_BIT( 0x02, IP_ACTIVE_LOW, IPT_START ) + PORT_BIT( 0x04, IP_ACTIVE_LOW, IPT_COIN1 ) + PORT_BIT( 0x08, IP_ACTIVE_LOW, IPT_COIN2 ) + PORT_BIT( 0x10, IP_ACTIVE_LOW, IPT_COIN3 ) + PORT_BIT( 0x20, IP_ACTIVE_LOW, IPT_KEYPAD ) PORT_CODE(KEYCODE_0_PAD) PORT_NAME("Test") + PORT_BIT( 0x40, IP_ACTIVE_LOW, IPT_UNUSED ) + PORT_BIT( 0x80, IP_ACTIVE_LOW, IPT_UNUSED ) INPUT_PORTS_END -void jeutel_state::sndcmd_w(uint8_t data) +u8 jeutel_state::tmdata_r() +{ + return BIT(m_speech[m_tmbyte], m_tmbit); +} + +void jeutel_state::tminc_w(u8 data) { - m_sndcmd = data; + m_tmbit = (m_tmbit+1) & 7; + if (!m_tmbit) + m_tmbyte = (m_tmbyte+1) & 0x1fff; } -uint8_t jeutel_state::portb_r() +void jeutel_state::tmaddr_w(u8 data) +{ + m_tmtemp = data; +} + +u8 jeutel_state::portb_r() { return m_sndcmd; } -void jeutel_state::porta_w(uint8_t data) +void jeutel_state::porta_w(u8 data) { + if (!BIT(data, 3)) + m_tmbyte = (m_tmbyte & 0xff) | (m_tmtemp << 8); + if (!BIT(data, 4)) + { + m_tmbyte = (m_tmbyte & 0xff00) | m_tmtemp; + m_tmbit = 0U; + } + if ((data & 0xf0) == 0xf0) { m_tms->ctl_w(tms5110_device::CMD_RESET); @@ -136,36 +345,17 @@ void jeutel_state::porta_w(uint8_t data) } } -void jeutel_state::ppi0a_w(uint8_t data) +void jeutel_state::ppi1a_w(u8 data) { - uint16_t segment; + static const u8 patterns[16] = { 0x3f,0x06,0x5b,0x4f,0x66,0x6d,0x7d,0x07,0x7f,0x6f,0x81,0x79,0x38,0x3e,0x1e,0 }; // 6331 (letters are T,E,L,U,J,blank) bool blank = !BIT(data, 7); if (BIT(data, 6)) { - m_digits[40+m_digit] = 0x3f; //patterns[data&15]; + m_digits[40+m_digit] = patterns[data&15]; return; } - switch (data & 0x0f) - { - case 0x0a: // letter T - segment = 0x301; - break; - case 0x0b: // letter E - segment = 0x79; - break; - case 0x0c: // letter L - segment = 0x38; - break; - case 0x0d: // letter U - segment = 0x3e; - break; - case 0x0e: // letter J - segment = 0x1e; - break; - default: - segment = 0x3f; //patterns[data & 0x0f]; - } + u16 segment = patterns[data & 15]; if (BIT(data, 4)) { m_digits[m_digit] = (blank) ? 0 : segment; @@ -176,45 +366,75 @@ void jeutel_state::ppi0a_w(uint8_t data) } } -void jeutel_state::ppi0b_w(uint8_t data) +void jeutel_state::ppi1b_w(u8 data) { m_digit = data & 0x0f; if (m_digit > 7) m_digit+=2; + + for (u8 i = 0; i < 8; i++) + m_io_outputs[8+(data>>4)*8+i] = BIT(m_lamp_data, i); } +void jeutel_state::ppi2a_w(u8 data) +{ + m_row = data; + if (!BIT(data, 6)) + m_audiocpu->reset(); + if (m_t_c > 0x10) + m_audiocpu->set_input_line(INPUT_LINE_NMI, BIT(data, 7) ? ASSERT_LINE : CLEAR_LINE); +} -void jeutel_state::machine_reset() +void jeutel_state::machine_start() { - m_timer_a = 0; - m_sndcmd = 0; - m_digit = 0; + genpin_class::machine_start(); + m_io_outputs.resolve(); + m_digits.resolve(); + + save_item(NAME(m_t_c)); + save_item(NAME(m_row)); + save_item(NAME(m_lamp_data)); + save_item(NAME(m_sndcmd)); + save_item(NAME(m_digit)); + save_item(NAME(m_tmbyte)); + save_item(NAME(m_tmbit)); + save_item(NAME(m_tmtemp)); } -TIMER_DEVICE_CALLBACK_MEMBER( jeutel_state::timer_a ) +void jeutel_state::machine_reset() { - m_timer_a ^= 1; - m_cpu2->set_input_line(0, (m_timer_a) ? ASSERT_LINE : CLEAR_LINE); - if (m_cpu2->state_int(Z80_HALT)) - m_cpu2->pulse_input_line(INPUT_LINE_NMI, attotime::zero); + genpin_class::machine_reset(); + for (u8 i = 0; i < m_io_outputs.size(); i++) + m_io_outputs[i] = 0; + + m_sndcmd = 0U; + m_digit = 0U; + m_t_c = 0U; + m_tmbyte = 0U; + m_tmbit = 0U; } -void jeutel_state::init_jeutel() +WRITE_LINE_MEMBER( jeutel_state::clock_w ) { + m_cpu2->set_input_line(0, (state) ? ASSERT_LINE : CLEAR_LINE); + if (m_cpu2->state_int(Z80_HALT)) + m_cpu2->pulse_input_line(INPUT_LINE_NMI, attotime::zero); + if (m_t_c < 0x20) + m_t_c++; } void jeutel_state::jeutel(machine_config &config) { /* basic machine hardware */ - Z80(config, m_maincpu, 3300000); - m_maincpu->set_addrmap(AS_PROGRAM, &jeutel_state::jeutel_map); + Z80(config, m_maincpu, 8_MHz_XTAL / 2); + m_maincpu->set_addrmap(AS_PROGRAM, &jeutel_state::main_map); - Z80(config, m_cpu2, 3300000); - m_cpu2->set_addrmap(AS_PROGRAM, &jeutel_state::jeutel_cpu2); + Z80(config, m_cpu2, 8_MHz_XTAL / 2); + m_cpu2->set_addrmap(AS_PROGRAM, &jeutel_state::cpu2_map); - z80_device &cpu3(Z80(config, "cpu3", 3300000)); - cpu3.set_addrmap(AS_PROGRAM, &jeutel_state::jeutel_cpu3); - cpu3.set_addrmap(AS_IO, &jeutel_state::jeutel_cpu3_io); + Z80(config, m_audiocpu, 8_MHz_XTAL / 2); + m_audiocpu->set_addrmap(AS_PROGRAM, &jeutel_state::audio_main_map); + m_audiocpu->set_addrmap(AS_IO, &jeutel_state::audio_io_map); /* Video */ config.set_default_layout(layout_jeutel); @@ -225,42 +445,45 @@ void jeutel_state::jeutel(machine_config &config) /* sound hardware */ SPEAKER(config, "mono").front_center(); - ay8910_device &aysnd(AY8910(config, "aysnd", 639450)); + ay8910_device &aysnd(AY8910(config, "aysnd", 8_MHz_XTAL / 4)); aysnd.port_a_write_callback().set(FUNC(jeutel_state::porta_w)); aysnd.port_b_read_callback().set(FUNC(jeutel_state::portb_r)); - aysnd.add_route(ALL_OUTPUTS, "mono", 0.40); + aysnd.add_route(ALL_OUTPUTS, "mono", 0.8); TMS5110A(config, m_tms, 640000); - //m_tms->m0().set("tmsprom", FUNC(tmsprom_device::m0_w)); - //m_tms->data().set("tmsprom", FUNC(tmsprom_device::data_r)); + m_tms->m0().set(FUNC(jeutel_state::tminc_w)); + m_tms->data().set(FUNC(jeutel_state::tmdata_r)); + //m_tms->irq().set_inputline(m_audiocpu, INPUT_LINE_IRQ0); // emulation doesn't support INT pin m_tms->add_route(ALL_OUTPUTS, "mono", 1.0); + MC1408(config, "dac", 0).add_route(ALL_OUTPUTS, "mono", 0.5); // NE5018 + /* Devices */ - i8255_device &ppi0(I8255A(config, "ppi8255_0")); - //ppi0.in_pa_callback().set_ioport("P1"); - ppi0.out_pa_callback().set(FUNC(jeutel_state::ppi0a_w)); - //ppi0.in_pb_callback().set_ioport("P2"); - ppi0.out_pb_callback().set(FUNC(jeutel_state::ppi0b_w)); - //ppi0.in_pc_callback().set_ioport("EXTRA"); - //ppi0.out_pc_callback().set(FUNC(jeutel_state::ppi0c_w)); - - I8255A(config, "ppi8255_1"); - //ppi1.in_pa_callback().set_ioport("P1"); - //ppi1.out_pa_callback().set(FUNC(jeutel_state::ppi1a_w)); - //ppi1.in_pb_callback().set_ioport("P2"); - //ppi1.out_pb_callback().set(FUNC(jeutel_state::ppi1b_w)); - //ppi1.in_pc_callback().set_ioport("EXTRA"); - //ppi1.out_pc_callback().set(FUNC(jeutel_state::ppi1c_w)); - - I8255A(config, "ppi8255_2"); - //ppi2.in_pa_callback().set_ioport("P1"); - //ppi2.out_pa_callback().set(FUNC(jeutel_state::ppi2a_w)); - //ppi2.in_pb_callback().set_ioport("P2"); - //ppi2.out_pb_callback().set(FUNC(jeutel_state::ppi2b_w)); - //ppi2.in_pc_callback().set_ioport("EXTRA"); - //ppi2.out_pc_callback().set(FUNC(jeutel_state::ppi2c_w)); - - TIMER(config, "timer_a").configure_periodic(FUNC(jeutel_state::timer_a), attotime::from_hz(120)); + I8255A(config, m_ppi[0]); // IC31 + //m_ppi[0]->in_pa_callback().set(FUNC(jeutel_state::ppi0a_r)); + m_ppi[0]->out_pa_callback().set(FUNC(jeutel_state::ppi0a_w)); + m_ppi[0]->in_pb_callback().set(FUNC(jeutel_state::ppi0b_r)); + //m_ppi[0]->out_pb_callback().set(FUNC(jeutel_state::ppi0b_w)); + //m_ppi[0]->in_pc_callback().set(FUNC(jeutel_state::ppi0c_r)); + //m_ppi[0]->out_pc_callback().set(FUNC(jeutel_state::ppi0c_w)); + + I8255A(config, m_ppi[1]); // IC32 + //m_ppi[1]->in_pa_callback().set(FUNC(jeutel_state::ppi1a_r)); + m_ppi[1]->out_pa_callback().set(FUNC(jeutel_state::ppi1a_w)); + //m_ppi[1]->in_pb_callback().set(FUNC(jeutel_state::ppi1b_r)); + m_ppi[1]->out_pb_callback().set(FUNC(jeutel_state::ppi1b_w)); + //m_ppi[1]->in_pc_callback().set(FUNC(jeutel_state::ppi1c_r)); + //m_ppi[1]->out_pc_callback().set(FUNC(jeutel_state::ppi1c_w)); + + I8255A(config, m_ppi[2]); // IC33 + //m_ppi[2]->in_pa_callback().set(FUNC(jeutel_state::ppi2a_r)); + m_ppi[2]->out_pa_callback().set(FUNC(jeutel_state::ppi2a_w)); + m_ppi[2]->in_pb_callback().set(FUNC(jeutel_state::ppi2b_r)); + //m_ppi[2]->out_pb_callback().set(FUNC(jeutel_state::ppi2b_w)); + //m_ppi[2]->in_pc_callback().set(FUNC(jeutel_state::ppi2c_r)); + m_ppi[2]->out_pc_callback().set(FUNC(jeutel_state::ppi2c_w)); + + CLOCK(config, "rclock", 2000).signal_handler().set(FUNC(jeutel_state::clock_w)); } } // Anonymous namespace @@ -293,5 +516,5 @@ ROM_START(olympic) ROM_END -GAME( 1983, leking, 0, jeutel, jeutel, jeutel_state, init_jeutel, ROT0, "Jeutel", "Le King", MACHINE_IS_SKELETON_MECHANICAL) -GAME( 1984, olympic, 0, jeutel, jeutel, jeutel_state, init_jeutel, ROT0, "Jeutel", "Olympic Games", MACHINE_IS_SKELETON_MECHANICAL) +GAME( 1983, leking, 0, jeutel, jeutel, jeutel_state, empty_init, ROT0, "Jeutel", "Le King", MACHINE_IS_SKELETON_MECHANICAL ) +GAME( 1984, olympic, 0, jeutel, jeutel, jeutel_state, empty_init, ROT0, "Jeutel", "Olympic Games", MACHINE_IS_SKELETON_MECHANICAL ) diff --git a/src/mame/drivers/pk8000.cpp b/src/mame/drivers/pk8000.cpp index 2c5f6ad2b28..fd131bf964e 100644 --- a/src/mame/drivers/pk8000.cpp +++ b/src/mame/drivers/pk8000.cpp @@ -2,10 +2,10 @@ // copyright-holders:Miodrag Milanovic, Robbbert /*************************************************************************** - PK-8000 +PK-8000 - 18/07/2009 Mostly working driver - 12/05/2009 Skeleton driver. +2009-05-12 Skeleton driver. +2009-07-18 Mostly working driver ****************************************************************************/ @@ -42,7 +42,7 @@ public: void pk8000(machine_config &config); private: - u8 m_keyboard_line; + u8 m_keyboard_line = 0U; u8 joy_1_r(); u8 joy_2_r(); diff --git a/src/mame/layout/jeutel.lay b/src/mame/layout/jeutel.lay index 050c7a34914..6cd1073b353 100644 --- a/src/mame/layout/jeutel.lay +++ b/src/mame/layout/jeutel.lay @@ -7,9 +7,9 @@ copyright-holders:Robbbert - + - + @@ -28,108 +28,108 @@ copyright-holders:Robbbert - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + -- cgit v1.2.3