From 13caa1ec64e690792b34a46aa1fe5467059a9922 Mon Sep 17 00:00:00 2001 From: Michael Zapf Date: Fri, 28 Jun 2024 22:55:10 +0200 Subject: ti99/geneve: Replace fatal error with no action when accessing a MFM hard disk without image file. --- src/devices/imagedev/mfmhd.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/devices/imagedev/mfmhd.cpp b/src/devices/imagedev/mfmhd.cpp index 635aef90605..ecb886676a0 100644 --- a/src/devices/imagedev/mfmhd.cpp +++ b/src/devices/imagedev/mfmhd.cpp @@ -832,7 +832,9 @@ bool mfm_harddisk_device::read(attotime &from_when, const attotime &limit, uint1 if (track==nullptr) { // What shall we do in this case? - throw emu_fatalerror("Cannot read CHD image"); + // throw emu_fatalerror("Cannot read CHD image"); // a bit too harsh, just return a constant 0 + cdata = 0; + return false; } // Get a copy for later debug output @@ -871,7 +873,8 @@ bool mfm_harddisk_device::write(attotime &from_when, const attotime &limit, uint if (track==nullptr) { // What shall we do in this case? - throw emu_fatalerror("Cannot read CHD image"); + // throw emu_fatalerror("Cannot read CHD image"); // a bit too harsh, just return without doing anything + return false; } int bytepos = 0; @@ -1152,6 +1155,11 @@ uint16_t* mfmhd_trackimage_cache::get_trackimage(int cylinder, int head) // Then look it up again, which will move it to the front // previous points to the second to last element + + // If still null, the cache was never initialized, which means there is no drive image + if (previous == nullptr) + return nullptr; + current = previous->next; if (TRACE_CACHE) m_machine.logerror("[%s:cache] evict line (c=%d,h=%d)\n", m_mfmhd->tag(), current->cylinder, current->head); -- cgit v1.2.3