From 6e9116564561abfbf83a8501b4f81d811730343a Mon Sep 17 00:00:00 2001 From: etabeta78 Date: Wed, 3 Dec 2014 12:01:10 +0100 Subject: (MESS) apollo: made possible to load cartridge tapes from softlist, by dealing with these images like it's done for cassettes and floppies. [Fabio Priuli] out of whatsnew: eventually, I hope to have some more spare time to clean up image handling because the different implementations for each media type cause a lot of unneeded headaches. --- src/emu/bus/isa/sc499.c | 21 +++++++++++---------- src/emu/bus/isa/sc499.h | 3 +-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/emu/bus/isa/sc499.c b/src/emu/bus/isa/sc499.c index 6e91c79510c..1ca3859d41c 100644 --- a/src/emu/bus/isa/sc499.c +++ b/src/emu/bus/isa/sc499.c @@ -16,6 +16,7 @@ */ #include "sc499.h" +#include "formats/ioprocs.h" #define VERBOSE 0 @@ -1307,16 +1308,16 @@ void sc499_ctape_image_device::write_block(int block_num, UINT8 *ptr) bool sc499_ctape_image_device::call_load() { - if (software_entry() == NULL) - { - m_ctape_data.resize(length()); - fread(m_ctape_data, length()); - } - else - { - m_ctape_data.resize(get_software_region_length("ctape")); - memcpy(m_ctape_data, get_software_region("ctape"), get_software_region_length("ctape")); - } + UINT32 size; + io_generic io; + io.file = (device_image_interface *)this; + io.procs = &image_ioprocs; + io.filler = 0xff; + + size = io_generic_size(&io); + m_ctape_data.resize(size); + + io_generic_read(&io, m_ctape_data, 0, size); return IMAGE_INIT_PASS; } diff --git a/src/emu/bus/isa/sc499.h b/src/emu/bus/isa/sc499.h index 825706f43a4..eeda9ad1a4a 100644 --- a/src/emu/bus/isa/sc499.h +++ b/src/emu/bus/isa/sc499.h @@ -31,8 +31,7 @@ public: // image-level overrides virtual bool call_load(); -// virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return load_software(swlist, swname, start_entry); } - virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { printf("%s\n", swname); return load_software(swlist, swname, start_entry); } + virtual bool call_softlist_load(software_list_device &swlist, const char *swname, const rom_entry *start_entry) { return load_software(swlist, swname, start_entry); } virtual void call_unload(); virtual iodevice_t image_type() const { return IO_MAGTAPE; } -- cgit v1.2.3