cleanup (nw)

This commit is contained in:
Miodrag Milanovic 2016-07-31 20:19:50 +02:00
parent 22c7a00d57
commit 91fcff1b6d
4 changed files with 7 additions and 7 deletions

View File

@ -1017,7 +1017,7 @@ bool device_image_interface::load_internal(const std::string &path, bool is_crea
m_create_args = create_args; m_create_args = create_args;
if (m_init_phase==false) { if (m_init_phase==false) {
m_err = (image_error_t)finish_load(); m_err = (finish_load()==IMAGE_INIT_PASS) ? IMAGE_ERROR_SUCCESS : IMAGE_ERROR_INTERNAL;
if (m_err) if (m_err)
goto done; goto done;
} }
@ -1103,7 +1103,7 @@ bool device_image_interface::finish_load()
if (m_created) if (m_created)
{ {
err = call_create(m_create_format, m_create_args); err = call_create(m_create_format, m_create_args);
if (err) if (err == IMAGE_INIT_FAIL)
{ {
if (!m_err) if (!m_err)
m_err = IMAGE_ERROR_UNSPECIFIED; m_err = IMAGE_ERROR_UNSPECIFIED;
@ -1113,7 +1113,7 @@ bool device_image_interface::finish_load()
{ {
// using device load // using device load
err = call_load(); err = call_load();
if (err) if (err == IMAGE_INIT_FAIL)
{ {
if (!m_err) if (!m_err)
m_err = IMAGE_ERROR_UNSPECIFIED; m_err = IMAGE_ERROR_UNSPECIFIED;

View File

@ -147,8 +147,8 @@ public:
virtual void device_compute_hash(util::hash_collection &hashes, const void *data, size_t length, const char *types) const; virtual void device_compute_hash(util::hash_collection &hashes, const void *data, size_t length, const char *types) const;
virtual bool call_load() { return false; } virtual bool call_load() { return IMAGE_INIT_PASS; }
virtual bool call_create(int format_type, util::option_resolution *format_options) { return false; } virtual bool call_create(int format_type, util::option_resolution *format_options) { return IMAGE_INIT_PASS; }
virtual void call_unload() { } virtual void call_unload() { }
virtual std::string call_display() { return std::string(); } virtual std::string call_display() { return std::string(); }
virtual device_image_partialhash_func get_partial_hash() const { return nullptr; } virtual device_image_partialhash_func get_partial_hash() const { return nullptr; }

View File

@ -8,7 +8,7 @@
memory memory
-------------------------------------------------*/ -------------------------------------------------*/
int z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ) bool z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr )
{ {
int ch; int ch;
UINT16 args[3]; UINT16 args[3];

View File

@ -13,6 +13,6 @@
#ifndef __Z80_BIN__ #ifndef __Z80_BIN__
#define __Z80_BIN__ #define __Z80_BIN__
int z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr ); bool z80bin_load_file(device_image_interface *image, address_space &space, const char *file_type, UINT16 *exec_addr, UINT16 *start_addr, UINT16 *end_addr );
#endif #endif