From 2d352e7e9d0754d14c519a9046c2b3e80df5134a Mon Sep 17 00:00:00 2001 From: smf- Date: Sat, 15 Jun 2013 17:44:56 +0000 Subject: [PATCH] fixed crash when reading from non existent hard drive (nw) --- src/emu/machine/idehd.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/emu/machine/idehd.h b/src/emu/machine/idehd.h index 4e6b9e90016..7d5e003f815 100644 --- a/src/emu/machine/idehd.h +++ b/src/emu/machine/idehd.h @@ -166,8 +166,8 @@ public: ide_hdd_device(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock); ide_hdd_device(const machine_config &mconfig, device_type type, const char *name, const char *tag, device_t *owner, UINT32 clock, const char *shortname, const char *source); - virtual int read_sector(UINT32 lba, void *buffer) { return hard_disk_read(m_disk, lba, buffer); } - virtual int write_sector(UINT32 lba, const void *buffer) { return hard_disk_write(m_disk, lba, buffer); } + virtual int read_sector(UINT32 lba, void *buffer) { if (m_disk == NULL) return 0; return hard_disk_read(m_disk, lba, buffer); } + virtual int write_sector(UINT32 lba, const void *buffer) { if (m_disk == NULL) return 0; return hard_disk_write(m_disk, lba, buffer); } protected: // device-level overrides