summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2022-04-23 13:13:20 -0400
committer AJR <ajrhacker@users.noreply.github.com>2022-04-23 13:13:20 -0400
commit51a2b03c9abdfe1137879e5f6d7242bc88f628bf (patch)
tree1186d1c0c19c507d2f7056f9315b7ef0374f433e
parent7b4350dc1d6b7d9765efefacb9e853fb2762d463 (diff)
dc: Fix crash with no GD-ROM loaded
-rw-r--r--src/mame/machine/gdrom.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/mame/machine/gdrom.cpp b/src/mame/machine/gdrom.cpp
index db01fc5ebea..59a7d154d56 100644
--- a/src/mame/machine/gdrom.cpp
+++ b/src/mame/machine/gdrom.cpp
@@ -246,6 +246,14 @@ void gdrom_device::ExecCommand()
// READ TOC (GD-ROM ver.)
case 0x14:
{
+ if (m_cdrom == nullptr)
+ {
+ m_phase = SCSI_PHASE_STATUS;
+ m_status_code = SCSI_STATUS_CODE_CHECK_CONDITION;
+ m_transfer_length = 0;
+ break;
+ }
+
// TODO: is this correct?
int start_trk = command[2];
int end_trk = m_cdrom->get_last_track();