From 829cf9afe41a59319f638e7a3c059ad42e9770f8 Mon Sep 17 00:00:00 2001 From: Olivier Galibert Date: Thu, 18 May 2023 22:31:19 +0200 Subject: ceres: hd image fixes --- src/mame/ceres/ceres.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/mame/ceres/ceres.cpp b/src/mame/ceres/ceres.cpp index 7341e9f0b8d..f965b7c54e5 100644 --- a/src/mame/ceres/ceres.cpp +++ b/src/mame/ceres/ceres.cpp @@ -100,7 +100,7 @@ protected: required_device m_fdc; optional_device_array m_fdd; - optional_device_array m_hdd; + required_device_array m_hdd; required_device m_screen; required_shared_ptr m_vram; @@ -191,6 +191,9 @@ void ceres1_state::wfc_command(u8 command) m_wfc_status &= ~WFC_S_ERR; m_wfc_error = 0; + if (((m_wfc_sdh >> 3) & 3) == 3) + return; + harddisk_image_device *hdf = m_hdd[(m_wfc_sdh >> 3) & 3]; switch (command >> 4) @@ -201,14 +204,14 @@ 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); - if (hdf) + if (hdf->exists()) hdf->read(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); - if (hdf) + if (hdf->exists()) hdf->write(get_lbasector(hdf), m_wfc_sram); m_wfc_offset = 0; break; -- cgit v1.2.3