mirror of
https://github.com/holub/mame
synced 2025-04-23 17:00:53 +03:00
BIM 68153: fixed release irq line bug and updated LOGs
This commit is contained in:
parent
140d8c7558
commit
c2d117b559
@ -27,27 +27,22 @@
|
||||
#include "68153bim.h"
|
||||
#include "cpu/m68000/m68000.h"
|
||||
|
||||
#define LOG_GENERAL 0x01
|
||||
#define LOG_SETUP 0x02
|
||||
#define LOG_PRINTF 0x04
|
||||
#define LOG_INT 0x08
|
||||
#define LOG_READ 0x10
|
||||
#define LOG_IACK 0x20
|
||||
//#define LOG_GENERAL (1U << 0)
|
||||
#define LOG_SETUP (1U << 1)
|
||||
#define LOG_INT (1U << 2)
|
||||
#define LOG_READ (1U << 3)
|
||||
#define LOG_IACK (1U << 4)
|
||||
|
||||
#define VERBOSE 0 // (LOG_PRINTF | LOG_SETUP | LOG_INT | LOG_IACK) //LOG_GENERAL | LOG_READ)
|
||||
//#define VERBOSE ( LOG_SETUP | LOG_INT | LOG_IACK | LOG_GENERAL | LOG_READ)
|
||||
//#define LOG_OUTPUT_FUNC printf
|
||||
|
||||
#define LOGMASK(mask, ...) do { if (VERBOSE & mask) logerror(__VA_ARGS__); } while (0)
|
||||
#define LOGLEVEL(mask, level, ...) do { if ((VERBOSE & mask) >= level) logerror(__VA_ARGS__); } while (0)
|
||||
#include "logmacro.h"
|
||||
|
||||
#define LOG(...) LOGMASK(LOG_GENERAL, __VA_ARGS__)
|
||||
#define LOGSETUP(...) LOGMASK(LOG_SETUP, __VA_ARGS__)
|
||||
#define LOGINT(...) LOGMASK(LOG_INT, __VA_ARGS__)
|
||||
#define LOGR(...) LOGMASK(LOG_READ, __VA_ARGS__)
|
||||
#define LOGIACK(...) LOGMASK(LOG_IACK, __VA_ARGS__)
|
||||
|
||||
#if VERBOSE & LOG_PRINTF
|
||||
#define logerror printf
|
||||
#endif
|
||||
//#define LOG(...) LOGMASKED(LOG_GENERAL, __VA_ARGS__)
|
||||
#define LOGSETUP(...) LOGMASKED(LOG_SETUP, __VA_ARGS__)
|
||||
#define LOGINT(...) LOGMASKED(LOG_INT, __VA_ARGS__)
|
||||
#define LOGR(...) LOGMASKED(LOG_READ, __VA_ARGS__)
|
||||
#define LOGIACK(...) LOGMASKED(LOG_IACK, __VA_ARGS__)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define FUNCNAME __func__
|
||||
@ -195,6 +190,7 @@ IRQ_CALLBACK_MEMBER(bim68153_device::iack)
|
||||
* IACK cycle. The cycle will end, the IACK is negated, and no additional action is required. */
|
||||
if (m_iackin == CLEAR_LINE)
|
||||
{
|
||||
LOGIACK(" - IRQ cleared due to IACKIN\n");
|
||||
m_out_iackout_cb(CLEAR_LINE);
|
||||
m_out_int_cb(CLEAR_LINE); // should really be tristated
|
||||
return MAX_VECTOR + 1; // This is a 68K emulation specific response and will terminate the iack cycle
|
||||
@ -207,8 +203,8 @@ IRQ_CALLBACK_MEMBER(bim68153_device::iack)
|
||||
if ((elem->m_control & bim68153_channel::REG_CNTRL_INT_LVL_MSK) == irqline)
|
||||
{ // then remember it
|
||||
ch = get_channel_index(elem);
|
||||
found = 1;
|
||||
}
|
||||
found = 1;
|
||||
}
|
||||
}
|
||||
/* 2. Pass on the interrupt daisy chain — For this case, IACKIN input is asserted by the preceding daisy chain interrupter,
|
||||
@ -306,7 +302,7 @@ READ8_MEMBER( bim68153_device::read )
|
||||
int vc = offset & REG_VECTOR;
|
||||
int ch = offset & CHN_MSK;
|
||||
|
||||
LOGR(" * %s %d Reg %s -> %02x \n", m_owner->tag(), ch, vc ? "vector" : "control",
|
||||
LOGR(" * %s %d Reg %s -> %02x \n", tag(), ch, vc ? "vector" : "control",
|
||||
vc ? m_chn[ch]->do_bimreg_vector_r() : m_chn[ch]->do_bimreg_control_r());
|
||||
|
||||
return vc ? m_chn[ch]->do_bimreg_vector_r() : m_chn[ch]->do_bimreg_control_r();
|
||||
@ -320,7 +316,7 @@ WRITE8_MEMBER( bim68153_device::write )
|
||||
int vc = offset & REG_VECTOR;
|
||||
int ch = offset & CHN_MSK;
|
||||
|
||||
LOGSETUP(" * %s %d Reg %s <- %02x \n", m_owner->tag(), ch, vc ? "vector" : "control", data);
|
||||
LOGSETUP(" * %s %d Reg %s <- %02x \n", tag(), ch, vc ? "vector" : "control", data);
|
||||
|
||||
if (vc)
|
||||
m_chn[ch]->do_bimreg_vector_w(data);
|
||||
@ -380,7 +376,7 @@ void bim68153_channel::device_reset()
|
||||
/* Trigger an interrupt */
|
||||
WRITE_LINE_MEMBER( bim68153_channel::int_w )
|
||||
{
|
||||
LOGINT("%s Ch %d: %d\n",FUNCNAME, m_index, state);
|
||||
LOGINT("%s Ch %d: %s\n",FUNCNAME, m_index, state == CLEAR_LINE ? "Cleared" : "Asserted");
|
||||
if (state == ASSERT_LINE)
|
||||
{
|
||||
m_bim->trigger_interrupt(m_index);
|
||||
|
Loading…
Reference in New Issue
Block a user