summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/info.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2010-06-28 06:40:44 +0000
committer Aaron Giles <aaron@aarongiles.com>2010-06-28 06:40:44 +0000
commit41b9dbb9ace490ee8ab0bd87d35a50e9b693d538 (patch)
tree945b176affb6ad7958b2016777241736ff6f294d /src/emu/info.c
parentf9a3aaf5c82bae95ba12b517beaf3fe5d4d1a93a (diff)
Made the machine_config a proper object. Added detokenize method to
this object which can be called multiple times to append new devices after the initial machine configuration is set up. Updated member variables to match new naming convention. Changed the running_machine to take a constructed machine_config object in the constructor, instead of creating one itself, for consistency. Also added machine->total_colors() as a shortcut to machine->config->m_total_colors.
Diffstat (limited to 'src/emu/info.c')
-rw-r--r--src/emu/info.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/emu/info.c b/src/emu/info.c
index a9587984d4d..2cda98b9312 100644
--- a/src/emu/info.c
+++ b/src/emu/info.c
@@ -433,7 +433,7 @@ static void print_game_rom(FILE *out, const game_driver *game, const machine_con
{
const game_driver *clone_of = driver_get_clone(game);
int rom_type;
- machine_config *pconfig = (clone_of != NULL) ? machine_config_alloc(clone_of->machine_config) : NULL;
+ machine_config *pconfig = (clone_of != NULL) ? global_alloc(machine_config(clone_of->machine_config)) : NULL;
/* iterate over 3 different ROM "types": BIOS, ROMs, DISKs */
for (rom_type = 0; rom_type < 3; rom_type++)
@@ -550,8 +550,7 @@ static void print_game_rom(FILE *out, const game_driver *game, const machine_con
}
}
- if (pconfig != NULL)
- machine_config_free(pconfig);
+ global_free(pconfig);
}
@@ -564,7 +563,7 @@ static void print_game_sampleof(FILE *out, const game_driver *game, const machin
{
const device_config_sound_interface *sound = NULL;
- for (bool gotone = config->devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = config->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->devconfig().type() == SOUND_SAMPLES)
{
const char *const *samplenames = ((const samples_interface *)sound->devconfig().static_config())->samplenames;
@@ -596,7 +595,7 @@ static void print_game_sample(FILE *out, const game_driver *game, const machine_
const device_config_sound_interface *sound = NULL;
/* iterate over sound chips looking for samples */
- for (bool gotone = config->devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = config->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
if (sound->devconfig().type() == SOUND_SAMPLES)
{
const char *const *samplenames = ((const samples_interface *)sound->devconfig().static_config())->samplenames;
@@ -651,7 +650,7 @@ static void print_game_chips(FILE *out, const game_driver *game, const machine_c
/* iterate over sound chips */
const device_config_sound_interface *sound = NULL;
- for (bool gotone = config->devicelist.first(sound); gotone; gotone = sound->next(sound))
+ for (bool gotone = config->m_devicelist.first(sound); gotone; gotone = sound->next(sound))
{
fprintf(out, "\t\t<chip");
fprintf(out, " type=\"audio\"");
@@ -759,7 +758,7 @@ static void print_game_sound(FILE *out, const game_driver *game, const machine_c
/* if we have no sound, zero out the speaker count */
const device_config_sound_interface *sound = NULL;
- if (!config->devicelist.first(sound))
+ if (!config->m_devicelist.first(sound))
speakers = 0;
fprintf(out, "\t\t<sound channels=\"%d\"/>\n", speakers);
@@ -824,7 +823,7 @@ static void print_game_driver(FILE *out, const game_driver *game, const machine_
else
fprintf(out, " savestate=\"unsupported\"");
- fprintf(out, " palettesize=\"%d\"", config->total_colors);
+ fprintf(out, " palettesize=\"%d\"", config->m_total_colors);
fprintf(out, "/>\n");
}
@@ -874,7 +873,7 @@ static void print_game_images(FILE *out, const game_driver *game, const machine_
const char *name;
const char *shortname;
- for (bool gotone = config->devicelist.first(dev); gotone; gotone = dev->next(dev))
+ for (bool gotone = config->m_devicelist.first(dev); gotone; gotone = dev->next(dev))
{
/* print out device type */
fprintf(out, "\t\t<device type=\"%s\"", xml_normalize_string(dev->image_type_name()));
@@ -923,7 +922,7 @@ static void print_game_images(FILE *out, const game_driver *game, const machine_
static void print_game_software_list(FILE *out, const game_driver *game, const machine_config *config)
{
- for (const device_config *dev = config->devicelist.first(); dev != NULL; dev = dev->next())
+ for (const device_config *dev = config->m_devicelist.first(); dev != NULL; dev = dev->next())
{
if ( ! strcmp( dev->tag(), __SOFTWARE_LIST_TAG ) )
{
@@ -957,7 +956,7 @@ static void print_game_info(FILE *out, const game_driver *game)
return;
/* start tracking resources and allocate the machine and input configs */
- config = machine_config_alloc(game->machine_config);
+ config = global_alloc(machine_config(game->machine_config));
input_port_list_init(portlist, game->ipt, NULL, 0, FALSE);
/* print the header and the game name */
@@ -1023,7 +1022,7 @@ static void print_game_info(FILE *out, const game_driver *game)
/* close the topmost tag */
fprintf(out, "\t</" XML_TOP ">\n");
- machine_config_free(config);
+ global_free(config);
}