Fixes (nw)
This commit is contained in:
parent
3b421603ec
commit
5f215ff7d4
@ -51,7 +51,7 @@ void mcd_isa_device::device_start()
|
||||
cdrom_image_device::device_start();
|
||||
set_isa_device();
|
||||
m_isa->set_dma_channel(5, this, false);
|
||||
m_isa->install_device(0x0310, 0x0311, *this, &mcd_isa_device::map, 16);
|
||||
m_isa->install_device(0x0310, 0x0311, *this, &mcd_isa_device::map);
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
|
@ -264,6 +264,17 @@ public:
|
||||
/// valid until resolution time.
|
||||
void set_tag(char const *tag) { m_tag = tag; }
|
||||
|
||||
/// \brief Is the object to be resolved before memory maps?
|
||||
///
|
||||
/// Some objects must be resolved before memory maps are loaded
|
||||
/// (devices for instance), some after (memory shares for
|
||||
/// instance).
|
||||
///
|
||||
/// \return True if the target object has to be resolved before
|
||||
/// memory maps are loaded
|
||||
|
||||
virtual bool is_pre_map() const { return false; }
|
||||
|
||||
/// \brief Dummy tag always treated as not found
|
||||
constexpr static char DUMMY_TAG[17] = "finder_dummy_tag";
|
||||
|
||||
@ -460,6 +471,16 @@ public:
|
||||
/// remains valid until resolution time.
|
||||
device_finder(device_t &base, char const *tag) : object_finder_base<DeviceClass, Required>(base, tag) { }
|
||||
|
||||
/// \brief Is the object to be resolved before memory maps?
|
||||
///
|
||||
/// Some objects must be resolved before memory maps are loaded
|
||||
/// (devices for instance), some after (memory shares for
|
||||
/// instance).
|
||||
///
|
||||
/// \return True if the target object has to be resolved before
|
||||
/// memory maps are loaded
|
||||
virtual bool is_pre_map() const override { return true; }
|
||||
|
||||
private:
|
||||
/// \brief Find device
|
||||
///
|
||||
|
@ -422,52 +422,66 @@ void device_t::set_machine(running_machine &machine)
|
||||
// list and return status
|
||||
//-------------------------------------------------
|
||||
|
||||
bool device_t::findit(bool isvalidation) const
|
||||
bool device_t::findit(bool pre_map, bool isvalidation) const
|
||||
{
|
||||
bool allfound = true;
|
||||
for (finder_base *autodev = m_auto_finder_list; autodev != nullptr; autodev = autodev->next())
|
||||
{
|
||||
if (isvalidation)
|
||||
if (autodev->is_pre_map() == pre_map)
|
||||
{
|
||||
// sanity checking
|
||||
const char *tag = autodev->finder_tag();
|
||||
if (tag == nullptr)
|
||||
if (isvalidation)
|
||||
{
|
||||
osd_printf_error("Finder tag is null!\n");
|
||||
allfound = false;
|
||||
continue;
|
||||
}
|
||||
if (tag[0] == '^' && tag[1] == ':')
|
||||
{
|
||||
osd_printf_error("Malformed finder tag: %s\n", tag);
|
||||
allfound = false;
|
||||
continue;
|
||||
// sanity checking
|
||||
const char *tag = autodev->finder_tag();
|
||||
if (tag == nullptr)
|
||||
{
|
||||
osd_printf_error("Finder tag is null!\n");
|
||||
allfound = false;
|
||||
continue;
|
||||
}
|
||||
if (tag[0] == '^' && tag[1] == ':')
|
||||
{
|
||||
osd_printf_error("Malformed finder tag: %s\n", tag);
|
||||
allfound = false;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
allfound &= autodev->findit(isvalidation);
|
||||
}
|
||||
allfound &= autodev->findit(isvalidation);
|
||||
}
|
||||
return allfound;
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_objects - find objects referenced in
|
||||
// configuration
|
||||
// resolve_pre_map - find objects that may be used
|
||||
// in memory maps
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_t::resolve_objects()
|
||||
void device_t::resolve_pre_map()
|
||||
{
|
||||
// prepare the logerror buffer
|
||||
if (m_machine->allow_logging())
|
||||
m_string_buffer.reserve(1024);
|
||||
|
||||
// find all the registered devices
|
||||
if (!findit(false))
|
||||
// find all the registered pre-map objects
|
||||
if (!findit(true, false))
|
||||
throw emu_fatalerror("Missing some required devices, unable to proceed");
|
||||
}
|
||||
|
||||
//-------------------------------------------------
|
||||
// resolve_post_map - find objects that are created
|
||||
// in memory maps
|
||||
//-------------------------------------------------
|
||||
|
||||
void device_t::resolve_post_map()
|
||||
{
|
||||
// find all the registered post-map objects
|
||||
if (!findit(false, false))
|
||||
throw emu_fatalerror("Missing some required objects, unable to proceed");
|
||||
|
||||
// allow implementation to do additional setup
|
||||
device_resolve_objects();
|
||||
}
|
||||
|
||||
|
||||
//-------------------------------------------------
|
||||
// start - start a device
|
||||
//-------------------------------------------------
|
||||
|
@ -534,7 +534,7 @@ public:
|
||||
|
||||
void set_default_bios(u8 bios) { m_default_bios = bios; }
|
||||
void set_system_bios(u8 bios) { m_system_bios = bios; }
|
||||
bool findit(bool isvalidation = false) const;
|
||||
bool findit(bool pre_map, bool isvalidation) const;
|
||||
|
||||
// misc
|
||||
template <typename Format, typename... Params> void popmessage(Format &&fmt, Params &&... args) const;
|
||||
@ -543,7 +543,8 @@ public:
|
||||
protected:
|
||||
// miscellaneous helpers
|
||||
void set_machine(running_machine &machine);
|
||||
void resolve_objects();
|
||||
void resolve_pre_map();
|
||||
void resolve_post_map();
|
||||
void start();
|
||||
void stop();
|
||||
void debug_setup();
|
||||
|
@ -223,6 +223,10 @@ void running_machine::start()
|
||||
// initialize the streams engine before the sound devices start
|
||||
m_sound = std::make_unique<sound_manager>(*this);
|
||||
|
||||
// resolve objects that can be used by memory maps
|
||||
for (device_t &device : device_iterator(root_device()))
|
||||
device.resolve_pre_map();
|
||||
|
||||
// configure the address spaces, load ROMs (which needs
|
||||
// width/endianess of the spaces), then populate memory (which
|
||||
// needs rom bases), and finally initialize CPUs (which needs
|
||||
@ -251,6 +255,10 @@ void running_machine::start()
|
||||
|
||||
manager().create_custom(*this);
|
||||
|
||||
// resolve objects that are created by memory maps
|
||||
for (device_t &device : device_iterator(root_device()))
|
||||
device.resolve_post_map();
|
||||
|
||||
// register callbacks for the devices, then start them
|
||||
add_notifier(MACHINE_NOTIFY_RESET, machine_notify_delegate(&running_machine::reset_all_devices, this));
|
||||
add_notifier(MACHINE_NOTIFY_EXIT, machine_notify_delegate(&running_machine::stop_all_devices, this));
|
||||
@ -1007,10 +1015,6 @@ void running_machine::logfile_callback(const char *buffer)
|
||||
|
||||
void running_machine::start_all_devices()
|
||||
{
|
||||
// resolve objects first to avoid messy start order dependencies
|
||||
for (device_t &device : device_iterator(root_device()))
|
||||
device.resolve_objects();
|
||||
|
||||
m_dummy_space.start();
|
||||
|
||||
// iterate through the devices
|
||||
|
@ -1919,7 +1919,8 @@ void validity_checker::validate_devices()
|
||||
m_current_device = &device;
|
||||
|
||||
// validate auto-finders
|
||||
device.findit(true);
|
||||
device.findit(true, true);
|
||||
device.findit(false, true);
|
||||
|
||||
// validate the device tag
|
||||
validate_tag(device.basetag());
|
||||
@ -1979,7 +1980,8 @@ void validity_checker::validate_devices()
|
||||
for (device_t &card_dev : device_iterator(*card))
|
||||
{
|
||||
m_current_device = &card_dev;
|
||||
card_dev.findit(true);
|
||||
card_dev.findit(true, true);
|
||||
card_dev.findit(false, true);
|
||||
card_dev.validity_check(*this);
|
||||
m_current_device = nullptr;
|
||||
}
|
||||
|
@ -339,7 +339,8 @@ ADDRESS_MAP_START(astrocorp_state::showhanc_map)
|
||||
AM_RANGE( 0x08e000, 0x08e001 ) AM_READ_PORT("EEPROMIN")
|
||||
AM_RANGE( 0x090000, 0x093fff ) AM_RAM AM_SHARE("nvram") // battery
|
||||
AM_RANGE( 0x0a0000, 0x0a0001 ) AM_WRITE(astrocorp_screen_enable_w)
|
||||
AM_RANGE( 0x0e0000, 0x0e0001 ) AM_READ(astrocorp_unk_r) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00)
|
||||
AM_RANGE( 0x0e0000, 0x0e0001 ) AM_READ(astrocorp_unk_r)
|
||||
AM_RANGE( 0x0e0000, 0x0e0001 ) AM_DEVWRITE8("oki", okim6295_device, write, 0xff00)
|
||||
ADDRESS_MAP_END
|
||||
|
||||
ADDRESS_MAP_START(astrocorp_state::skilldrp_map)
|
||||
|
Loading…
Reference in New Issue
Block a user