From 6cc988f9ecbf87c342ca43ce335a1b420a75d820 Mon Sep 17 00:00:00 2001 From: hap Date: Fri, 26 Jan 2024 20:27:15 +0100 Subject: hd6301x: add irq pins to p5 read, acesp: hook up irq2 --- src/devices/cpu/m6800/m6801.cpp | 20 +++++++++++++++++--- src/mame/misc/acesp.cpp | 8 ++------ src/mame/saitek/ecbackg.cpp | 17 +++++++++-------- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/src/devices/cpu/m6800/m6801.cpp b/src/devices/cpu/m6800/m6801.cpp index 6230ebb2c1e..2cdc9386e10 100644 --- a/src/devices/cpu/m6800/m6801.cpp +++ b/src/devices/cpu/m6800/m6801.cpp @@ -1942,8 +1942,15 @@ void hd6301y_cpu_device::p5_ddr_w(uint8_t data) uint8_t hd6301x_cpu_device::p5_data_r() { - // read-only - return m_in_portx_func[0](); + uint8_t data = m_in_portx_func[0](); + + if (m_irq_state[HD6301_IRQ1_LINE]) + data &= 0xfe; + if (m_irq_state[HD6301_IRQ2_LINE]) + data &= 0xfd; + + // no DDR, read-only + return data; } uint8_t hd6301y_cpu_device::p5_data_r() @@ -1951,7 +1958,14 @@ uint8_t hd6301y_cpu_device::p5_data_r() if (m_portx_ddr[0] == 0xff) return m_portx_data[0]; else - return ((m_in_portx_func[0]() | ((m_irq_state[M6801_IS3_LINE]) ? 0x10 : 0)) & (m_portx_ddr[0] ^ 0xff)) | (m_portx_data[0] & m_portx_ddr[0]); + { + uint8_t data = hd6301x_cpu_device::p5_data_r(); + + if (m_irq_state[M6801_IS3_LINE]) + data |= 0x10; + + return (data & (m_portx_ddr[0] ^ 0xff)) | (m_portx_data[0] & m_portx_ddr[0]); + } } void hd6301y_cpu_device::p5_data_w(uint8_t data) diff --git a/src/mame/misc/acesp.cpp b/src/mame/misc/acesp.cpp index 5fb8ab5d1ef..8b0141f5aba 100644 --- a/src/mame/misc/acesp.cpp +++ b/src/mame/misc/acesp.cpp @@ -155,11 +155,7 @@ TIMER_DEVICE_CALLBACK_MEMBER(ace_sp_state::gen_fixfreq) // 6303Y must take vector 0xffea periodically, as amongst other things it clears a counter // in RAM which is increased in one of the other interrupts, with a time-out check which // will cause the game to jump back to the reset vector if it fails - // - // adding code to the core to generate it at the moment then causes a stack overflow issue - // instead, which again the code checks for, and resets if the stack grows too large - - //m_maincpu->force_irq2(); + m_maincpu->set_input_line(HD6301_IRQ2_LINE, HOLD_LINE); } void ace_sp_state::ace_sp(machine_config &config) @@ -170,7 +166,7 @@ void ace_sp_state::ace_sp(machine_config &config) PIA6821(config, "pia0"); // unknown frequency - TIMER(config, "fixedfreq").configure_periodic(FUNC(ace_sp_state::gen_fixfreq), attotime::from_hz(50)); + TIMER(config, "fixedfreq").configure_periodic(FUNC(ace_sp_state::gen_fixfreq), attotime::from_hz(10)); ACE_SP_REELCTRL(config, m_reelctrl, 2000000); // unknown clock diff --git a/src/mame/saitek/ecbackg.cpp b/src/mame/saitek/ecbackg.cpp index 4077c2b7afd..f86625768a8 100644 --- a/src/mame/saitek/ecbackg.cpp +++ b/src/mame/saitek/ecbackg.cpp @@ -12,9 +12,9 @@ This program got 3rd place in the first Computer Olympiad in 1989 (backgammon category). It also includes several game variations like Jacquet or Trictrac. MAME's sensorboard interface is a bit different compared to chess. Pieces can be -stacked up to 3. Pressing the Bear Off key (Del / Backspace) will also remove the -currently held piece. Capturing pieces is disabled, except when hitting a blot, -in which case the captured piece is held. +stacked up to 3. Pressing the Bear Off button (Del / Backspace) will also remove +the currently held piece. Capturing pieces is disabled, except when hitting a +blot, in which case the captured piece is held. Hardware notes: - PCB label: GT4-PE-009 @@ -203,20 +203,21 @@ void ecbackg_state::board_init_cb(int state) init_backgammon(); } +u8 ecbackg_state::board_spawn_cb(offs_t offset) +{ + return (offset == 1) ? 1 : 4; +} + INPUT_CHANGED_MEMBER(ecbackg_state::bear_off) { if (newval) { + // remove piece when Bear Off button is pressed board_remove_cb(); m_board->refresh(); } } -u8 ecbackg_state::board_spawn_cb(offs_t offset) -{ - return (offset == 1) ? 1 : 4; -} - u8 ecbackg_state::board_remove_cb() { int handpos = m_board->get_handpos(); -- cgit v1.2.3