Esempio n. 1
0
void debug_view_memory::enumerate_sources()
{
	// start with an empty list
	m_source_list.reset();
	astring name;

	// first add all the devices' address spaces
	memory_interface_iterator iter(machine().root_device());
	for (device_memory_interface *memintf = iter.first(); memintf != NULL; memintf = iter.next())
		for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
		{
			address_space *space = memintf->space(spacenum);
			if (space != NULL)
			{
				name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space->name());
				m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *space)));
			}
		}

	// then add all the memory regions
	for (memory_region *region = machine().memory().first_region(); region != NULL; region = region->next())
	{
		name.printf("Region '%s'", region->name());
		m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, *region)));
	}

	// finally add all global array symbols
	for (int itemnum = 0; itemnum < 10000; itemnum++)
	{
		// stop when we run out of items
		UINT32 valsize, valcount;
		void *base;
		const char *itemname = machine().save().indexed_item(itemnum, base, valsize, valcount);
		if (itemname == NULL)
			break;

		// if this is a single-entry global, add it
        if (strstr(itemname, "state->"))
		{
			name.cpy(strrchr(itemname, '/') + 1);
			m_source_list.append(*auto_alloc(machine(), debug_view_memory_source(name, base, valsize, valcount)));
		}
	}

	// reset the source to a known good entry
	set_source(*m_source_list.head());
}
Esempio n. 2
0
void debug_view_memory::enumerate_sources()
{
	// start with an empty list
	m_source_list.reset();
	astring name;

	// first add all the devices' address spaces
	memory_interface_iterator iter(machine().root_device());
	for (device_memory_interface *memintf = iter.first(); memintf != NULL; memintf = iter.next())
		if (&memintf->device() != &machine().root_device())
			for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; spacenum++)
				if (memintf->has_space(spacenum))
				{
					address_space &space = memintf->space(spacenum);
					name.printf("%s '%s' %s space memory", memintf->device().name(), memintf->device().tag(), space.name());
					m_source_list.append(*global_alloc(debug_view_memory_source(name, space)));
				}

	// then add all the memory regions
	for (memory_region *region = machine().memory().first_region(); region != NULL; region = region->next())
	{
		name.printf("Region '%s'", region->name());
		m_source_list.append(*global_alloc(debug_view_memory_source(name, *region)));
	}

	// finally add all global array symbols
	for (int itemnum = 0; itemnum < 10000; itemnum++)
	{
		// stop when we run out of items
		UINT32 valsize, valcount;
		void *base;
		const char *itemname = machine().save().indexed_item(itemnum, base, valsize, valcount);
		if (itemname == NULL)
			break;

		// add pretty much anything that's not a timer (we may wish to cull other items later)
		// also, don't trim the front of the name, it's important to know which VIA6522 we're looking at, e.g.
		if (strncmp(itemname, "timer/", 6))
		{
			name.cpy(itemname);
			m_source_list.append(*global_alloc(debug_view_memory_source(name, base, valsize, valcount)));
		}
	}

	// reset the source to a known good entry
	set_source(*m_source_list.first());
}
Esempio n. 3
0
void debug_view_memory::enumerate_sources()
{
	// start with an empty list
	m_source_list.reset();
	std::string name;

	// first add all the devices' address spaces
	for (device_memory_interface &memintf : memory_interface_iterator(machine().root_device()))
		for (int spacenum = 0; spacenum < memintf.max_space_count(); ++spacenum)
			if (memintf.has_space(spacenum))
			{
				address_space &space = memintf.space(spacenum);
				name = string_format("%s '%s' %s space memory", memintf.device().name(), memintf.device().tag(), space.name());
				m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), space)));
			}

	// then add all the memory regions
	for (auto &region : machine().memory().regions())
	{
		name = string_format("Region '%s'", region.second->name());
		m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), *region.second.get())));
	}

	// finally add all global array symbols in alphabetical order
	std::vector<std::tuple<std::string, void *, u32, u32> > itemnames;
	itemnames.reserve(machine().save().registration_count());

	for (int itemnum = 0; itemnum < machine().save().registration_count(); itemnum++)
	{
		u32 valsize, valcount;
		void *base;
		std::string name_string(machine().save().indexed_item(itemnum, base, valsize, valcount));

		// add pretty much anything that's not a timer (we may wish to cull other items later)
		// also, don't trim the front of the name, it's important to know which VIA6522 we're looking at, e.g.
		if (strncmp(name_string.c_str(), "timer/", 6))
			itemnames.emplace_back(std::move(name_string), base, valsize, valcount);
	}

	std::sort(itemnames.begin(), itemnames.end(), [] (auto const &x, auto const &y) { return std::get<0>(x) < std::get<0>(y); });

	for (auto const &item : itemnames)
		m_source_list.append(*global_alloc(debug_view_memory_source(std::get<0>(item).c_str(), std::get<1>(item), std::get<2>(item), std::get<3>(item))));

	// reset the source to a known good entry
	set_source(*m_source_list.first());
}
Esempio n. 4
0
void debug_view_memory::enumerate_sources()
{
	// start with an empty list
	m_source_list.reset();
	std::string name;

	// first add all the devices' address spaces
	for (device_memory_interface &memintf : memory_interface_iterator(machine().root_device()))
		for (address_spacenum spacenum = AS_0; spacenum < ADDRESS_SPACES; ++spacenum)
			if (memintf.has_space(spacenum))
			{
				address_space &space = memintf.space(spacenum);
				name = string_format("%s '%s' %s space memory", memintf.device().name(), memintf.device().tag(), space.name());
				m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), space)));
			}

	// then add all the memory regions
	for (auto &region : machine().memory().regions())
	{
		name = string_format("Region '%s'", region.second->name());
		m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), *region.second.get())));
	}

	// finally add all global array symbols
	for (int itemnum = 0; itemnum < 10000; itemnum++)
	{
		// stop when we run out of items
		u32 valsize, valcount;
		void *base;
		const char *itemname = machine().save().indexed_item(itemnum, base, valsize, valcount);
		if (itemname == nullptr)
			break;

		// add pretty much anything that's not a timer (we may wish to cull other items later)
		// also, don't trim the front of the name, it's important to know which VIA6522 we're looking at, e.g.
		if (strncmp(itemname, "timer/", 6))
		{
			name.assign(itemname);
			m_source_list.append(*global_alloc(debug_view_memory_source(name.c_str(), base, valsize, valcount)));
		}
	}

	// reset the source to a known good entry
	set_source(*m_source_list.first());
}