summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorGravatarGravatar Patrick Mackinlay <pmackinlay@hotmail.com>2020-11-24 08:31:36 +0700
committerGravatarGravatar Patrick Mackinlay <pmackinlay@hotmail.com>2020-11-24 08:31:36 +0700
commitf30e34652334acb322dec742714c2e136aab5819 (patch)
tree2a4a9718d10faba3bbf2f9a14c398e0b23cf833d
parent129b5b3382a8b1b1f0e7d75d0dcb15f1252b9a1c (diff)
ceres: avoid crash when missing hard disk
-rw-r--r--src/mame/drivers/ceres.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/mame/drivers/ceres.cpp b/src/mame/drivers/ceres.cpp
index 5a0174cbf14..f323b4c869d 100644
--- a/src/mame/drivers/ceres.cpp
+++ b/src/mame/drivers/ceres.cpp
@@ -200,13 +200,15 @@ void ceres1_state::wfc_command(u8 command)
case 2:
LOG("read sector drive %d chs %d,%d,%d count %d\n",
(m_wfc_sdh >> 3) & 3, m_wfc_cylinder & 0x3ff, (m_wfc_sdh >> 0) & 7, m_wfc_sector, m_wfc_count);
- hard_disk_read(hdf, get_lbasector(hdf), m_wfc_sram);
+ if (hdf)
+ hard_disk_read(hdf, get_lbasector(hdf), m_wfc_sram);
m_wfc_offset = 0;
break;
case 3:
LOG("write sector drive %d chs %d,%d,%d count %d\n",
(m_wfc_sdh >> 3) & 3, m_wfc_cylinder & 0x3ff, (m_wfc_sdh >> 0) & 7, m_wfc_sector, m_wfc_count);
- hard_disk_write(hdf, get_lbasector(hdf), m_wfc_sram);
+ if (hdf)
+ hard_disk_write(hdf, get_lbasector(hdf), m_wfc_sram);
m_wfc_offset = 0;
break;
case 4: