From 7fdaf9d48cf5a5a7d0e0127d63d787e90fe77173 Mon Sep 17 00:00:00 2001 From: Miodrag Milanovic Date: Sat, 10 Feb 2024 14:12:06 +0100 Subject: galaxy: fix cassete writing and more reliable reading writing is now done as on real hardware, so output audio now matches. reading is more reliable from real cassette --- src/mame/sfrj/galaxy.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mame/sfrj/galaxy.cpp b/src/mame/sfrj/galaxy.cpp index d53c745e568..d88c9292439 100644 --- a/src/mame/sfrj/galaxy.cpp +++ b/src/mame/sfrj/galaxy.cpp @@ -103,7 +103,7 @@ uint8_t galaxy_state::keyboard_r(offs_t offset) if (offset == 0) { double level = m_cassette->input(); - return (level > 0) ? 0xfe : 0xff; + return (level > -0.1) ? 0xff : 0xfe; } else return m_io_keyboard[(offset>>3) & 0x07]->read() & (0x01<<(offset & 0x07)) ? 0xfe : 0xff; @@ -111,7 +111,7 @@ uint8_t galaxy_state::keyboard_r(offs_t offset) void galaxy_state::latch_w(uint8_t data) { - double val = (((data >>6) & 1 ) + ((data >> 2) & 1) - 1) * 32000; + double val = (BIT(data,6) ^ BIT(data,2)) ? 0 : BIT(data,6) ? -1.0f : +1.0f; m_latch_value = data; m_cassette->output(val); } -- cgit v1.2.3