[heathzenith/h8.cpp] Update interrupt handling to not use set_input_line_and_vector (#13492)

* [heathzenith/h8.cpp] Update interrupt handling to not use set_input_line_and_vector

* Fix include guards for moved header file
This commit is contained in:
Mark Garlanger 2025-03-20 09:42:29 -05:00 committed by GitHub
parent 805b01e8f4
commit adcf81c34c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 38 additions and 18 deletions

View File

@ -5818,13 +5818,13 @@ end
---------------------------------------------------
--
--@src/devices/bus/heathzenith/h89/intr_cntrl.h,BUSES["HEATH_INTR_SOCKET"] = true
--@src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h,BUSES["HEATH_INTR_SOCKET"] = true
---------------------------------------------------
if (BUSES["HEATH_INTR_SOCKET"]~=null) then
files {
MAME_DIR .. "src/devices/bus/heathzenith/h89/intr_cntrl.cpp",
MAME_DIR .. "src/devices/bus/heathzenith/h89/intr_cntrl.h",
MAME_DIR .. "src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.cpp",
MAME_DIR .. "src/devices/bus/heathzenith/intr_cntrl/intr_cntrl.h",
}
end

View File

@ -16,7 +16,7 @@
#include "imagedev/floppy.h"
#include "machine/wd_fdc.h"
#include "bus/heathzenith/h89/intr_cntrl.h"
#include "bus/heathzenith/intr_cntrl/intr_cntrl.h"
class mms77316_fdc_device : public device_t, public device_h89bus_right_card_interface
{

View File

@ -13,7 +13,7 @@
#include "h89bus.h"
#include "bus/heathzenith/h89/intr_cntrl.h"
#include "bus/heathzenith/intr_cntrl/intr_cntrl.h"
class h89bus_z37_device : public device_t, public device_h89bus_right_card_interface
{

View File

@ -8,8 +8,8 @@
****************************************************************************/
#ifndef MAME_BUS_HEATHZENITH_H89_INTR_CNTRL_H
#define MAME_BUS_HEATHZENITH_H89_INTR_CNTRL_H
#ifndef MAME_BUS_HEATHZENITH_INTR_CNTRL_INTR_CNTRL_H
#define MAME_BUS_HEATHZENITH_INTR_CNTRL_INTR_CNTRL_H
#pragma once
@ -165,4 +165,4 @@ protected:
DECLARE_DEVICE_TYPE(HEATH_INTR_SOCKET, heath_intr_socket)
#endif // MAME_BUS_HEATHZENITH_H89_INTR_CNTRL_H
#endif // MAME_BUS_HEATHZENITH_INTR_CNTRL_INTR_CNTRL_H

View File

@ -57,6 +57,7 @@ Official test program from pages 4 to 8 of the operator's manual:
#include "sound/beep.h"
#include "speaker.h"
#include "bus/heathzenith/intr_cntrl/intr_cntrl.h"
#include "formats/h8_cas.h"
#include "h8.lh"
@ -68,6 +69,7 @@ public:
h8_state(const machine_config &mconfig, device_type type, const char *tag)
: driver_device(mconfig, type, tag)
, m_maincpu(*this, "maincpu")
, m_intr_socket(*this, "intr_socket")
, m_uart(*this, "uart")
, m_console(*this, "console")
, m_cass(*this, "cassette")
@ -116,6 +118,7 @@ private:
static constexpr XTAL H8_IRQ_PULSE = H8_BEEP_FRQ / 2;
required_device<i8080_cpu_device> m_maincpu;
required_device<heath_intr_socket> m_intr_socket;
required_device<i8251_device> m_uart;
required_device<i8251_device> m_console;
required_device<cassette_image_device> m_cass;
@ -142,7 +145,9 @@ DEVICE_INPUT_DEFAULTS_END
TIMER_DEVICE_CALLBACK_MEMBER(h8_state::h8_irq_pulse)
{
if (BIT(m_irq_ctl, 0))
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); // I8080
{
m_intr_socket->set_irq_level(1, ASSERT_LINE);
}
}
u8 h8_state::portf0_r()
@ -190,7 +195,8 @@ void h8_state::portf0_w(u8 data)
m_mon_led = !BIT(data, 5);
m_beep->set_state(!BIT(data, 7));
m_maincpu->set_input_line(INPUT_LINE_IRQ0, CLEAR_LINE);
m_intr_socket->set_irq_level(1, CLEAR_LINE);
m_irq_ctl &= 0xf0;
if (BIT(data, 6)) m_irq_ctl |= 1;
if (!BIT(data, 4)) m_irq_ctl |= 2;
@ -260,10 +266,13 @@ INPUT_CHANGED_MEMBER(h8_state::button_0)
{
u8 data = m_io_keyboard[1]->read() ^ 0xff;
if (BIT(data, 5))
{
m_maincpu->reset();
else
if (BIT(data, 6))
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xcf); // INT 10 // I8080
}
else if (BIT(data, 6))
{
m_intr_socket->set_irq_level(1, ASSERT_LINE);
}
}
}
@ -322,7 +331,9 @@ But, all of this can only occur if bit 4 of port F0 is low. */
c = !m_ff_b; // from /Q of 2nd flipflop
m_ff_b = a; // from Q of 1st flipflop
if (c)
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xd7); // I8080
{
m_intr_socket->set_irq_level(2, ASSERT_LINE);
}
}
}
else
@ -338,9 +349,7 @@ But, all of this can only occur if bit 4 of port F0 is low. */
void h8_state::h8_level3_irq_callback(int state)
{
if (state) {
m_maincpu->set_input_line_and_vector(INPUT_LINE_IRQ0, ASSERT_LINE, 0xdf); // RST3
}
m_intr_socket->set_irq_level(3, state);
}
TIMER_DEVICE_CALLBACK_MEMBER(h8_state::kansas_w)
@ -373,6 +382,11 @@ TIMER_DEVICE_CALLBACK_MEMBER(h8_state::kansas_r)
}
}
static void intr_ctrl_options(device_slot_interface &device)
{
device.option_add("original", HEATH_INTR_CNTRL);
}
void h8_state::h8(machine_config &config)
{
/* basic machine hardware */
@ -381,10 +395,16 @@ void h8_state::h8(machine_config &config)
m_maincpu->set_addrmap(AS_IO, &h8_state::io_map);
m_maincpu->out_status_func().set(FUNC(h8_state::h8_status_callback));
m_maincpu->out_inte_func().set(FUNC(h8_state::h8_inte_callback));
m_maincpu->set_irq_acknowledge_callback("intr_socket", FUNC(heath_intr_socket::irq_callback));
/* video hardware */
config.set_default_layout(layout_h8);
HEATH_INTR_SOCKET(config, m_intr_socket, intr_ctrl_options, nullptr);
m_intr_socket->irq_line_cb().set_inputline(m_maincpu, INPUT_LINE_IRQ0);
m_intr_socket->set_default_option("original");
m_intr_socket->set_fixed(true);
/* sound hardware */
SPEAKER(config, "mono").front_center();
BEEP(config, m_beep, H8_BEEP_FRQ).add_route(ALL_OUTPUTS, "mono", 1.00);

View File

@ -45,7 +45,6 @@
#include "bus/heathzenith/h19/tlb.h"
#include "bus/heathzenith/h89/h89bus.h"
#include "bus/heathzenith/h89/intr_cntrl.h"
#include "bus/heathzenith/h89/cdr_fdc_880h.h"
#include "bus/heathzenith/h89/h_88_3.h"
#include "bus/heathzenith/h89/h_88_5.h"
@ -55,6 +54,7 @@
#include "bus/heathzenith/h89/we_pullup.h"
#include "bus/heathzenith/h89/z_89_11.h"
#include "bus/heathzenith/h89/z37_fdc.h"
#include "bus/heathzenith/intr_cntrl/intr_cntrl.h"
#include "cpu/z80/z80.h"
#include "machine/ins8250.h"