summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Olivier Galibert <galibert@pobox.com>2017-07-03 22:22:05 +0200
committer Olivier Galibert <galibert@pobox.com>2017-07-03 22:22:22 +0200
commit92ef0f292cd338c01bac2517db779bc82c1bd4db (patch)
tree28c1a123c79583632bee2a923614b553484332df
parent435fee169a3e0bf13ccf10625fc795b26b3f243a (diff)
Initialization ordering fixes (nw)
-rw-r--r--src/emu/emumem.cpp14
-rw-r--r--src/emu/emumem.h1
-rw-r--r--src/emu/machine.cpp8
3 files changed, 20 insertions, 3 deletions
diff --git a/src/emu/emumem.cpp b/src/emu/emumem.cpp
index cdbda64f396..08e0bc3e02a 100644
--- a/src/emu/emumem.cpp
+++ b/src/emu/emumem.cpp
@@ -1559,7 +1559,6 @@ memory_manager::memory_manager(running_machine &machine)
void memory_manager::allocate(device_memory_interface &memory)
{
- memory.load_configs();
for (int spacenum = 0; spacenum < memory.max_space_count(); ++spacenum)
{
// if there is a configuration for this space, we need an address space
@@ -1570,6 +1569,19 @@ void memory_manager::allocate(device_memory_interface &memory)
}
//-------------------------------------------------
+// configure - configure the address spaces
+//-------------------------------------------------
+
+void memory_manager::configure()
+{
+ // loop over devices to configure the address spaces
+ memory_interface_iterator iter(machine().root_device());
+ for (device_memory_interface &memory : iter)
+ memory.load_configs();
+ m_machine.m_dummy_space.load_configs();
+}
+
+//-------------------------------------------------
// initialize - initialize the memory system
//-------------------------------------------------
diff --git a/src/emu/emumem.h b/src/emu/emumem.h
index dd6ff5df38e..8b28aab8cfe 100644
--- a/src/emu/emumem.h
+++ b/src/emu/emumem.h
@@ -643,6 +643,7 @@ class memory_manager
public:
// construction/destruction
memory_manager(running_machine &machine);
+ void configure();
void initialize();
// getters
diff --git a/src/emu/machine.cpp b/src/emu/machine.cpp
index 3906671587c..36e107e838d 100644
--- a/src/emu/machine.cpp
+++ b/src/emu/machine.cpp
@@ -233,8 +233,12 @@ void running_machine::start()
// initialize the streams engine before the sound devices start
m_sound = std::make_unique<sound_manager>(*this);
- // first load ROMs, then populate memory, and finally initialize CPUs
- // these operations must proceed in this order
+ // 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
+ // complete address spaces). These operations must proceed in this
+ // order
+ m_memory.configure();
m_rom_load = make_unique_clear<rom_load_manager>(*this);
m_memory.initialize();