From e81c0d609a5df9021729ed3f07e2e9933db6ee1a Mon Sep 17 00:00:00 2001 From: arbee Date: Fri, 1 Sep 2023 22:53:08 -0400 Subject: [PATCH] machine/intelfsh.cpp: Support reading the busy/ready pin for Flash chips that have one. [R. Belmont] --- src/devices/machine/intelfsh.cpp | 10 ++++++++++ src/devices/machine/intelfsh.h | 2 ++ 2 files changed, 12 insertions(+) diff --git a/src/devices/machine/intelfsh.cpp b/src/devices/machine/intelfsh.cpp index 5ae298c83fc..4ec5315b47b 100644 --- a/src/devices/machine/intelfsh.cpp +++ b/src/devices/machine/intelfsh.cpp @@ -317,6 +317,15 @@ void intelfsh_device::device_start() save_pointer( &m_data[0], "m_data", m_size); } +//------------------------------------------------- +// is_ready - emulates the *Busy/Ready pin on some +// flash devices. +//------------------------------------------------- + +bool intelfsh_device::is_ready() +{ + return (m_status & 0x80) ? true : false; +} //------------------------------------------------- // delay_tick - handle delayed commands/events @@ -332,6 +341,7 @@ TIMER_CALLBACK_MEMBER(intelfsh_device::delay_tick) case FM_ERASEAMD4: m_flash_mode = FM_NORMAL; + m_status = 0x80; break; } } diff --git a/src/devices/machine/intelfsh.h b/src/devices/machine/intelfsh.h index e3fc991324b..711523bebe4 100644 --- a/src/devices/machine/intelfsh.h +++ b/src/devices/machine/intelfsh.h @@ -15,6 +15,8 @@ class intelfsh_device : public device_t, public: uint8_t *base() { return &m_data[0]; } + bool is_ready(); + protected: // construction/destruction intelfsh_device(const machine_config &mconfig, device_type type, const char *tag, device_t *owner, uint32_t clock, uint8_t bits, uint32_t size, uint8_t maker_id, uint16_t device_id);