summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-02-27 22:16:07 +1100
committer Vas Crabb <vas@vastheman.com>2017-02-27 22:57:14 +1100
commit6c23897483a0201dd0b65b450253fd9bf8fb8723 (patch)
tree62a083b4801f63b09bed57ae0c9e8f646aaa3200 /src/frontend
parentb07c572f709e95dcd1e2e4b9d4c696e122f67655 (diff)
Self-registering devices prep:
* Make device_creator a variable template and get rid of the ampersands * Remove screen.h and speaker.h from emu.h and add where necessary * Centralise instantiations of screen and speaker finder templates * Add/standardise #include guards in many hearers * Remove many redundant #includes * Order #includesr to help catch headers that can't be #included alone (nw) This changes #include order to be prefix, unit header if applicable then other stuff roughly in order from most dependent to least dependent library. This helps catch headers that don't #include things that they use.
Diffstat (limited to 'src/frontend')
-rw-r--r--src/frontend/mame/clifront.cpp8
-rw-r--r--src/frontend/mame/info.cpp11
-rw-r--r--src/frontend/mame/info.h7
-rw-r--r--src/frontend/mame/mameopts.cpp3
-rw-r--r--src/frontend/mame/ui/devctrl.h2
5 files changed, 21 insertions, 10 deletions
diff --git a/src/frontend/mame/clifront.cpp b/src/frontend/mame/clifront.cpp
index 7904c106353..9f281c46296 100644
--- a/src/frontend/mame/clifront.cpp
+++ b/src/frontend/mame/clifront.cpp
@@ -702,14 +702,12 @@ void cli_frontend::listslots(const char *gamename)
{
if (option.second->selectable())
{
- device_t *dev = (*option.second->devtype())(*drivlist.config(), "dummy", &drivlist.config()->root_device(), 0);
+ std::unique_ptr<device_t> dev = option.second->devtype()(*drivlist.config(), "dummy", &drivlist.config()->root_device(), 0);
dev->config_complete();
- if (first_option) {
+ if (first_option)
printf("%-16s %s\n", option.second->name(),dev->name());
- } else {
+ else
printf("%-34s%-16s %s\n", "", option.second->name(),dev->name());
- }
- global_free(dev);
first_option = false;
}
diff --git a/src/frontend/mame/info.cpp b/src/frontend/mame/info.cpp
index 7c964de669c..2576edf878e 100644
--- a/src/frontend/mame/info.cpp
+++ b/src/frontend/mame/info.cpp
@@ -9,17 +9,24 @@
***************************************************************************/
#include "emu.h"
+
+#include "info.h"
#include "mameopts.h"
+
#include "machine/ram.h"
#include "sound/samples.h"
-#include "info.h"
-#include "xmlfile.h"
+
#include "config.h"
#include "drivenum.h"
+#include "screen.h"
#include "softlist_dev.h"
+#include "speaker.h"
+
+#include "xmlfile.h"
#include <ctype.h>
+
#define XML_ROOT "mame"
#define XML_TOP "machine"
diff --git a/src/frontend/mame/info.h b/src/frontend/mame/info.h
index 29f931b5c4a..6ffce39e496 100644
--- a/src/frontend/mame/info.h
+++ b/src/frontend/mame/info.h
@@ -8,11 +8,14 @@
***************************************************************************/
-#pragma once
-
#ifndef __INFO_H__
#define __INFO_H__
+#pragma once
+
+#include "emuopts.h"
+
+
class driver_enumerator;
diff --git a/src/frontend/mame/mameopts.cpp b/src/frontend/mame/mameopts.cpp
index be3ceb89845..13233122d2b 100644
--- a/src/frontend/mame/mameopts.cpp
+++ b/src/frontend/mame/mameopts.cpp
@@ -10,12 +10,15 @@
#include "emu.h"
#include "mameopts.h"
+
#include "drivenum.h"
+#include "screen.h"
#include "softlist_dev.h"
#include <ctype.h>
#include <stack>
+
int mame_options::m_slot_options = 0;
int mame_options::m_device_options = 0;
diff --git a/src/frontend/mame/ui/devctrl.h b/src/frontend/mame/ui/devctrl.h
index e0b757cccca..96cd6237e7b 100644
--- a/src/frontend/mame/ui/devctrl.h
+++ b/src/frontend/mame/ui/devctrl.h
@@ -44,7 +44,7 @@ protected:
private:
// device iterator
- typedef device_type_iterator<&device_creator<DeviceType>, DeviceType> iterator;
+ typedef device_type_iterator<device_creator<DeviceType>, DeviceType> iterator;
DeviceType * m_device;
int m_count;