diff options
Diffstat (limited to '3rdparty/ymfm/src/ymfm_opq.cpp')
-rw-r--r-- | 3rdparty/ymfm/src/ymfm_opq.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/3rdparty/ymfm/src/ymfm_opq.cpp b/3rdparty/ymfm/src/ymfm_opq.cpp index e886722876b..02d8c35a5a8 100644 --- a/3rdparty/ymfm/src/ymfm_opq.cpp +++ b/3rdparty/ymfm/src/ymfm_opq.cpp @@ -31,6 +31,8 @@ #include "ymfm_opq.h" #include "ymfm_fm.ipp" +#define TEMPORARY_DEBUG_PRINTS (1) + // // OPQ (aka YM3806/YM3533) // @@ -126,9 +128,11 @@ bool opq_registers::write(uint16_t index, uint8_t data, uint32_t &channel, uint3 // detune/multiple share a register based on the MSB of what is written // remap the multiple values to 100-11F - if ((index & 0xe0) == 0x40 && bitfield(data, 7)) + if ((index & 0xe0) == 0x40 && bitfield(data, 7) != 0) index += 0xc0; + m_regdata[index] = data; + // handle writes to the key on index if (index == 0x05) { @@ -425,16 +429,17 @@ uint8_t ym3806::read_status() uint8_t ym3806::read(uint32_t offset) { uint8_t result = 0xff; - switch (offset & 1) + switch (offset) { - case 0: // data port (unused) - debug::log_unexpected_read_write("Unexpected read from YM3806 offset %d\n", offset & 3); + case 0: // status port + result = read_status(); break; - case 1: // status port, YM2203 compatible - result = read_status(); + default: // unknown + debug::log_unexpected_read_write("Unexpected read from YM3806 offset %02X\n", offset); break; } +if (TEMPORARY_DEBUG_PRINTS && offset != 0) printf("Read %02X = %02X\n", offset, result); return result; } @@ -446,6 +451,7 @@ uint8_t ym3806::read(uint32_t offset) void ym3806::write(uint32_t offset, uint8_t data) { +if (TEMPORARY_DEBUG_PRINTS && (offset != 3 || data != 0x71)) printf("Write %02X = %02X\n", offset, data); // write the FM register m_fm.write(offset, data); } |