(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.
This commit is contained in:
etabeta78 2014-12-03 12:01:10 +01:00
parent 01c95e71cc
commit 6e91165645
2 changed files with 12 additions and 12 deletions

View File

@ -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;
}

View File

@ -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; }