diff options
author | Michaël Banaan Ananas <happppp@users.noreply.github.com> | 2014-01-06 23:16:16 +0000 |
---|---|---|
committer | Michaël Banaan Ananas <happppp@users.noreply.github.com> | 2014-01-06 23:16:16 +0000 |
commit | 38bf8209ee556af403c2d1eefd3a92b1e0a40019 (patch) | |
tree | 43841386842f658143ff72afe21f2dc1c7a33bde /src | |
parent | 339ecb0f2cb2259e96067963878308239bd1d451 (diff) |
don't clutter error.log by default
Diffstat (limited to 'src')
-rw-r--r-- | src/mame/machine/docastle.c | 30 |
1 files changed, 19 insertions, 11 deletions
diff --git a/src/mame/machine/docastle.c b/src/mame/machine/docastle.c index d09f0d6d1e5..e50d088eb73 100644 --- a/src/mame/machine/docastle.c +++ b/src/mame/machine/docastle.c @@ -11,7 +11,11 @@ #include "cpu/z80/z80.h" #include "includes/docastle.h" +#define LOG 0 + /* +THIS IS A GIANT HACK! It can be accurately emulated once our Z80 core supports WAIT. + Communication between the two CPUs happens through a single bidirectional latch. Whenever CPU 0 reads or writes it, its WAIT input is asserted. It is implicitly cleared by CPU 1, when it accesses the latch. This enforces synchronization @@ -29,29 +33,34 @@ if it was a small shared buffer. The order of operations is: */ READ8_MEMBER(docastle_state::docastle_shared0_r) { - if (offset == 8) logerror("CPU #0 shared0r clock = %d\n", (UINT32)m_maincpu->total_cycles()); + if (offset == 8 && LOG) + logerror("CPU #0 shared0r clock = %d\n", (UINT32)m_maincpu->total_cycles()); + return m_buffer0[offset]; } READ8_MEMBER(docastle_state::docastle_shared1_r) { - if (offset == 8) logerror("CPU #1 shared1r clock = %d\n", (UINT32)m_slave->total_cycles()); + if (offset == 8 && LOG) + logerror("CPU #1 shared1r clock = %d\n", (UINT32)m_slave->total_cycles()); + return m_buffer1[offset]; } WRITE8_MEMBER(docastle_state::docastle_shared0_w) { - if (offset == 8) logerror("CPU #1 shared0w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n", + if (offset == 8 && LOG) + logerror("CPU #1 shared0w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n", m_buffer0[0], m_buffer0[1], m_buffer0[2], m_buffer0[3], m_buffer0[4], m_buffer0[5], m_buffer0[6], m_buffer0[7], data, (UINT32)m_slave->total_cycles()); m_buffer0[offset] = data; + /* awake the master CPU */ if (offset == 8) - /* awake the master CPU */ machine().scheduler().trigger(500); } @@ -60,16 +69,15 @@ WRITE8_MEMBER(docastle_state::docastle_shared1_w) { m_buffer1[offset] = data; - if (offset == 8) - { + if (offset == 8 && LOG) logerror("CPU #0 shared1w %02x %02x %02x %02x %02x %02x %02x %02x %02x clock = %d\n", - m_buffer1[0], m_buffer1[1], m_buffer1[2], m_buffer1[3], - m_buffer1[4], m_buffer1[5], m_buffer1[6], m_buffer1[7], - data, (UINT32)m_maincpu->total_cycles()); + m_buffer1[0], m_buffer1[1], m_buffer1[2], m_buffer1[3], + m_buffer1[4], m_buffer1[5], m_buffer1[6], m_buffer1[7], + data, (UINT32)m_maincpu->total_cycles()); - /* freeze execution of the master CPU until the slave has used the shared memory */ + /* freeze execution of the master CPU until the slave has used the shared memory */ + if (offset == 8) space.device().execute().spin_until_trigger(500); - } } |