From 08588682d4ee09cae30e8f7dbd827211e9312fe7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20St=C3=B6neberg?= Date: Fri, 12 Jan 2018 18:11:58 +0100 Subject: [PATCH] atarifdc.cpp: fixed drive lookup (nw) (#3051) --- src/mame/machine/atarifdc.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/mame/machine/atarifdc.cpp b/src/mame/machine/atarifdc.cpp index 207d9ad5ab1..512ea43137c 100644 --- a/src/mame/machine/atarifdc.cpp +++ b/src/mame/machine/atarifdc.cpp @@ -109,10 +109,23 @@ static void _atari_load_proc(device_image_interface &image, bool is_created) atarifdc->atari_load_proc(image, is_created); } +static int atari_fdc_get_drive(device_t *image) +{ + int drive = -1; + if (strcmp(image->tag(), ":fdc:" FLOPPY_0) == 0) drive = 0; + if (strcmp(image->tag(), ":fdc:" FLOPPY_1) == 0) drive = 1; + if (strcmp(image->tag(), ":fdc:" FLOPPY_2) == 0) drive = 2; + if (strcmp(image->tag(), ":fdc:" FLOPPY_3) == 0) drive = 3; + return drive; +} + void atari_fdc_device::atari_load_proc(device_image_interface &image, bool is_created) { - int id = floppy_get_drive(&image.device()); + int id = atari_fdc_get_drive(&image.device()); int size, i; + + if (id == -1) + return; m_drv[id].image = std::make_unique(MAXSIZE); if (!m_drv[id].image)