- removed need for *_dev.lst files [Miodrag Milanovic]

- enforced short names for slot card devices
- updated validation, romverify and listxml output accordingly
- slotoptions now also contain shortnames so it's possible to link
  slot option and device
This commit is contained in:
Miodrag Milanovic 2012-02-23 14:19:37 +00:00
parent dc0fc0e01f
commit 97c3d0cb39
16 changed files with 173 additions and 667 deletions

4
.gitattributes vendored
View File

@ -25,7 +25,6 @@ hlsl/yiq_encode.fx svneol=native#text/plain
src/build/build.mak svneol=native#text/plain
src/build/file2str.c svneol=native#text/plain
src/build/makedep.c svneol=native#text/plain
src/build/makedev.c svneol=native#text/plain
src/build/makelist.c svneol=native#text/plain
src/build/png2bdc.c svneol=native#text/plain
src/build/verinfo.c svneol=native#text/plain
@ -1400,7 +1399,6 @@ src/ldplayer/layout/pr8210.lay svneol=native#text/plain
src/ldplayer/ldplayer.c svneol=native#text/plain
src/ldplayer/ldplayer.lst svneol=native#text/plain
src/ldplayer/ldplayer.mak svneol=native#text/plain
src/ldplayer/ldplayer_dev.lst svneol=native#text/plain
src/lib/cothread/amd64.c svneol=native#text/plain
src/lib/cothread/doc/amd64.asm svneol=native#text/plain
src/lib/cothread/doc/style.css svneol=native#text/plain
@ -4366,10 +4364,8 @@ src/mame/machine/zs01.h svneol=native#text/plain
src/mame/mame.c svneol=native#text/plain
src/mame/mame.lst svneol=native#text/plain
src/mame/mame.mak svneol=native#text/plain
src/mame/mame_dev.lst svneol=native#text/plain
src/mame/tiny.lst svneol=native#text/plain
src/mame/tiny.mak svneol=native#text/plain
src/mame/tiny_dev.lst svneol=native#text/plain
src/mame/video/1942.c svneol=native#text/plain
src/mame/video/1943.c svneol=native#text/plain
src/mame/video/20pacgal.c svneol=native#text/plain

View File

@ -591,8 +591,6 @@ VERSIONOBJ = $(OBJ)/version.o
EMUINFOOBJ = $(OBJ)/$(TARGET)/$(TARGET).o
DRIVLISTSRC = $(OBJ)/$(TARGET)/$(SUBTARGET)/drivlist.c
DRIVLISTOBJ = $(OBJ)/$(TARGET)/$(SUBTARGET)/drivlist.o
DEVLISTSRC = $(OBJ)/$(TARGET)/$(SUBTARGET)/devlist.c
DEVLISTOBJ = $(OBJ)/$(TARGET)/$(SUBTARGET)/devlist.o
@ -733,7 +731,7 @@ $(sort $(OBJDIRS)):
ifndef EXECUTABLE_DEFINED
$(EMULATOR): $(VERSIONOBJ) $(EMUINFOOBJ) $(DRIVLISTOBJ) $(DEVLISTOBJ) $(DRVLIBS) $(LIBOSD) $(LIBCPU) $(LIBEMU) $(LIBDASM) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(SOFTFLOAT) $(JPEG_LIB) $(FLAC_LIB) $(7Z_LIB) $(FORMATS_LIB) $(ZLIB) $(LIBOCORE) $(RESFILE)
$(EMULATOR): $(VERSIONOBJ) $(EMUINFOOBJ) $(DRIVLISTOBJ) $(DRVLIBS) $(LIBOSD) $(LIBCPU) $(LIBEMU) $(LIBDASM) $(LIBSOUND) $(LIBUTIL) $(EXPAT) $(SOFTFLOAT) $(JPEG_LIB) $(FLAC_LIB) $(7Z_LIB) $(FORMATS_LIB) $(ZLIB) $(LIBOCORE) $(RESFILE)
$(CC) $(CDEFS) $(CFLAGS) -c $(SRC)/version.c -o $(VERSIONOBJ)
@echo Linking $@...
$(LD) $(LDFLAGS) $(LDFLAGSEMULATOR) $^ $(LIBS) -o $@
@ -776,18 +774,10 @@ $(DRIVLISTOBJ): $(DRIVLISTSRC)
@echo Compiling $<...
$(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
$(DEVLISTOBJ): $(DEVLISTSRC)
@echo Compiling $<...
$(CC) $(CDEFS) $(CFLAGS) -c $< -o $@
$(DRIVLISTSRC): $(SRC)/$(TARGET)/$(SUBTARGET).lst $(MAKELIST_TARGET)
@echo Building driver list $<...
@$(MAKELIST) $< >$@
$(DEVLISTSRC): $(SRC)/$(TARGET)/$(SUBTARGET)_dev.lst $(MAKEDEV_TARGET)
@echo Building device list $<...
@$(MAKEDEV) $< >$@
$(OBJ)/%.a:
@echo Archiving $@...
$(RM) $@

View File

@ -21,7 +21,6 @@ OBJDIRS += \
FILE2STR_TARGET = $(BUILDOUT)/file2str$(BUILD_EXE)
MAKEDEP_TARGET = $(BUILDOUT)/makedep$(BUILD_EXE)
MAKELIST_TARGET = $(BUILDOUT)/makelist$(BUILD_EXE)
MAKEDEV_TARGET = $(BUILDOUT)/makedev$(BUILD_EXE)
PNG2BDC_TARGET = $(BUILDOUT)/png2bdc$(BUILD_EXE)
VERINFO_TARGET = $(BUILDOUT)/verinfo$(BUILD_EXE)
@ -29,14 +28,12 @@ ifeq ($(TARGETOS),win32)
FILE2STR = $(subst /,\,$(FILE2STR_TARGET))
MAKEDEP = $(subst /,\,$(MAKEDEP_TARGET))
MAKELIST = $(subst /,\,$(MAKELIST_TARGET))
MAKEDEV = $(subst /,\,$(MAKEDEV_TARGET))
PNG2BDC = $(subst /,\,$(PNG2BDC_TARGET))
VERINFO = $(subst /,\,$(VERINFO_TARGET))
else
FILE2STR = $(FILE2STR_TARGET)
MAKEDEP = $(MAKEDEP_TARGET)
MAKELIST = $(MAKELIST_TARGET)
MAKEDEV = $(MAKEDEV_TARGET)
PNG2BDC = $(PNG2BDC_TARGET)
VERINFO = $(VERINFO_TARGET)
endif
@ -46,7 +43,6 @@ BUILD += \
$(FILE2STR_TARGET) \
$(MAKEDEP_TARGET) \
$(MAKELIST_TARGET) \
$(MAKEDEV_TARGET) \
$(PNG2BDC_TARGET) \
$(VERINFO_TARGET) \
@ -91,19 +87,6 @@ $(MAKELIST_TARGET): $(MAKELISTOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB)
#-------------------------------------------------
# makedev
#-------------------------------------------------
MAKEDEVOBJS = \
$(BUILDOBJ)/makedev.o \
$(MAKEDEV_TARGET): $(MAKEDEVOBJS) $(LIBUTIL) $(LIBOCORE) $(ZLIB)
@echo Linking $@...
$(LD) $(LDFLAGS) $^ $(LIBS) -o $@
#-------------------------------------------------
# png2bdc
#-------------------------------------------------

View File

@ -1,268 +0,0 @@
/***************************************************************************
makedev.c
Create and sort the driver list.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
***************************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include "corefile.h"
#define MAX_DEVICES 65536
#define MAX_IGNORE 512
static const char *devlist[MAX_DEVICES];
static int devcount;
static const char *ignorelst[MAX_IGNORE];
static int ignorecount;
//-------------------------------------------------
// driver_sort_callback - compare two items in
// a string array
//-------------------------------------------------
int sort_callback(const void *elem1, const void *elem2)
{
const char **item1 = (const char **)elem1;
const char **item2 = (const char **)elem2;
return strcmp(*item1, *item2);
}
//-------------------------------------------------
// isignored - return info if item is in ignore
// list or not
//-------------------------------------------------
bool isignored(const char *drivname)
{
if (ignorecount>0) {
for(int i=0;i<ignorecount;i++) {
if (strcmp(ignorelst[i],drivname)==0) return true;
}
}
return false;
}
//-------------------------------------------------
// parse_file - parse a single file, may be
// called recursively
//-------------------------------------------------
int parse_file(const char *srcfile)
{
// read source file
void *buffer;
UINT32 length;
file_error filerr = core_fload(srcfile, &buffer, &length);
if (filerr != FILERR_NONE)
{
fprintf(stderr, "Unable to read source file '%s'\n", srcfile);
return 1;
}
// rip through it to find all drivers
char *srcptr = (char *)buffer;
char *endptr = srcptr + length;
int linenum = 1;
bool in_comment = false;
while (srcptr < endptr)
{
char c = *srcptr++;
// count newlines
if (c == 13 || c == 10)
{
if (c == 13 && *srcptr == 10)
srcptr++;
linenum++;
continue;
}
// skip any spaces
if (isspace(c))
continue;
// look for end of C comment
if (in_comment && c == '*' && *srcptr == '/')
{
srcptr++;
in_comment = false;
continue;
}
// skip anything else inside a C comment
if (in_comment)
continue;
// look for start of C comment
if (c == '/' && *srcptr == '*')
{
srcptr++;
in_comment = true;
continue;
}
// if we hit a C++ comment, scan to the end of line
if (c == '/' && *srcptr == '/')
{
while (srcptr < endptr && *srcptr != 13 && *srcptr != 10)
srcptr++;
continue;
}
// look for an import directive
if (c == '#')
{
char filename[256];
filename[0] = 0;
for (int pos = 0; srcptr < endptr && pos < ARRAY_LENGTH(filename) - 1 && !isspace(*srcptr); pos++)
{
filename[pos] = *srcptr++;
filename[pos+1] = 0;
}
fprintf(stderr, "Importing devices from '%s'\n", filename);
parse_file(filename);
continue;
}
if (c == '!')
{
char drivname[256];
drivname[0] = 0;
for (int pos = 0; srcptr < endptr && pos < ARRAY_LENGTH(drivname) - 1 && !isspace(*srcptr); pos++)
{
drivname[pos] = *srcptr++;
drivname[pos+1] = 0;
}
fprintf(stderr, "Place device '%s' to ignore list\n", drivname);
char *name = (char *)malloc(strlen(drivname) + 1);
strcpy(name, drivname);
ignorelst[ignorecount++] = name;
continue;
}
// otherwise treat as a device name
char drivname[32];
drivname[0] = 0;
srcptr--;
for (int pos = 0; srcptr < endptr && pos < ARRAY_LENGTH(drivname) - 1 && !isspace(*srcptr); pos++)
{
drivname[pos] = *srcptr++;
drivname[pos+1] = 0;
}
// verify the name as valid
for (char *drivch = drivname; *drivch != 0; drivch++)
{
if ((*drivch >= 'A' && *drivch <= 'Z') || (*drivch >= '0' && *drivch <= '9') || *drivch == '_')
continue;
fprintf(stderr, "%s:%d - Invalid character '%c' in device type \"%s\"\n", srcfile, linenum, *drivch, drivname);
return 1;
}
// add it to the list
if(!isignored(drivname))
{
char *name = (char *)malloc(strlen(drivname) + 1);
strcpy(name, drivname);
devlist[devcount++] = name;
}
}
osd_free(buffer);
return 0;
}
//-------------------------------------------------
// main - primary entry point
//-------------------------------------------------
int main(int argc, char *argv[])
{
// needs at least 1 argument
if (argc < 2)
{
fprintf(stderr,
"Usage:\n"
" makedev <source.lst>\n"
);
return 0;
}
// extract arguments
const char *srcfile = argv[1];
// parse the root file, exit early upon failure
devcount = 0;
if (parse_file(srcfile))
return 1;
// output a count
if (devcount == 0)
{
fprintf(stderr, "No devices found\n");
} else {
fprintf(stderr, "%d devices found\n", devcount);
}
// sort the list
qsort(devlist, devcount, sizeof(*devlist), sort_callback);
// start with a header
printf("#include \"emu.h\"\n\n");
// output the list of externs first
for (int index = 0; index < devcount; index++)
printf("extern const device_type %s;\n", devlist[index]);
printf("\n");
// then output the array
printf("const device_type * s_devices_sorted[] =\n");
printf("{\n");
for (int index = 0; index < devcount; index++)
printf("\t&%s%s\n", devlist[index], (index == devcount - 1) ? "" : ",");
printf("};\n");
printf("\n");
// also output a global count
printf("int m_device_count = %d;\n", devcount);
return 0;
}

View File

@ -732,9 +732,6 @@ void cli_frontend::listmedia(const char *gamename)
// verifyroms - verify the ROM sets of one or
// more games
//-------------------------------------------------
extern int m_device_count;
extern const device_type *s_devices_sorted[];
void cli_frontend::verifyroms(const char *gamename)
{
// determine which drivers to output;
@ -797,63 +794,131 @@ void cli_frontend::verifyroms(const char *gamename)
}
driver_enumerator dummy_drivlist(m_options);
dummy_drivlist.next();
machine_config &config = dummy_drivlist.config();
device_t *owner = &config.root_device();
// check if all are listed, note that empty one is included
for (int i = 0; i < m_device_count; i++)
typedef tagmap_t<FPTR> int_map;
int_map device_map;
while (dummy_drivlist.next())
{
device_type type = *s_devices_sorted[i];
device_t *dev = (*type)(config, "dummy", owner, 0);
dev->config_complete();
if (mame_strwildcmp(gamename, dev->shortname()) == 0)
machine_config &config = dummy_drivlist.config();
device_iterator iter(config.root_device());
for (device_t *dev = iter.first(); dev != NULL; dev = iter.next())
{
matched++;
// audit the ROMs in this set
media_auditor::summary summary = auditor.audit_device(dev, AUDIT_VALIDATE_FAST);
// if not found, count that and leave it at that
if (summary == media_auditor::NOTFOUND)
notfound++;
// else display information about what we discovered
else
{
// output the summary of the audit
astring summary_string;
auditor.summarize(dev->shortname(),&summary_string);
mame_printf_info("%s", summary_string.cstr());
// display information about what we discovered
mame_printf_info("romset %s ", dev->shortname());
// switch off of the result
switch (summary)
if ((strlen(dev->shortname())>0) && dev->rom_region() != NULL && (device_map.add(dev->shortname(), 0, false) != TMERR_DUPLICATE)) {
if (mame_strwildcmp(gamename, dev->shortname()) == 0)
{
case media_auditor::INCORRECT:
mame_printf_info("is bad\n");
incorrect++;
break;
matched++;
case media_auditor::CORRECT:
mame_printf_info("is good\n");
correct++;
break;
// audit the ROMs in this set
media_auditor::summary summary = auditor.audit_device(dev, AUDIT_VALIDATE_FAST);
case media_auditor::BEST_AVAILABLE:
mame_printf_info("is best available\n");
correct++;
break;
// if not found, count that and leave it at that
if (summary == media_auditor::NOTFOUND) {
notfound++;
}
// else display information about what we discovered
else
{
// output the summary of the audit
astring summary_string;
auditor.summarize(dev->shortname(),&summary_string);
mame_printf_info("%s", summary_string.cstr());
default:
break;
// display information about what we discovered
mame_printf_info("romset %s ", dev->shortname());
// switch off of the result
switch (summary)
{
case media_auditor::INCORRECT:
mame_printf_info("is bad\n");
incorrect++;
break;
case media_auditor::CORRECT:
mame_printf_info("is good\n");
correct++;
break;
case media_auditor::BEST_AVAILABLE:
mame_printf_info("is best available\n");
correct++;
break;
default:
break;
}
}
}
}
}
global_free(dev);
slot_interface_iterator slotiter(config.root_device());
for (const device_slot_interface *slot = slotiter.first(); slot != NULL; slot = slotiter.next())
{
const slot_interface* intf = slot->get_slot_interfaces();
for (int i = 0; intf && intf[i].name != NULL; i++)
{
astring temptag("_");
temptag.cat(intf[i].name);
device_t *dev = const_cast<machine_config &>(config).device_add(&config.root_device(), temptag.cstr(), intf[i].devtype, 0);
// notify this device and all its subdevices that they are now configured
device_iterator subiter(*dev);
for (device_t *device = subiter.first(); device != NULL; device = subiter.next())
if (!device->configured())
device->config_complete();
if (dev->rom_region() != NULL && device_map.add(dev->shortname(), 0, false) != TMERR_DUPLICATE) {
if (mame_strwildcmp(gamename, dev->shortname()) == 0)
{
matched++;
// audit the ROMs in this set
media_auditor::summary summary = auditor.audit_device(dev, AUDIT_VALIDATE_FAST);
// if not found, count that and leave it at that
if (summary == media_auditor::NOTFOUND)
notfound++;
// else display information about what we discovered
else
{
// output the summary of the audit
astring summary_string;
auditor.summarize(dev->shortname(),&summary_string);
mame_printf_info("%s", summary_string.cstr());
// display information about what we discovered
mame_printf_info("romset %s ", dev->shortname());
// switch off of the result
switch (summary)
{
case media_auditor::INCORRECT:
mame_printf_info("is bad\n");
incorrect++;
break;
case media_auditor::CORRECT:
mame_printf_info("is good\n");
correct++;
break;
case media_auditor::BEST_AVAILABLE:
mame_printf_info("is best available\n");
correct++;
break;
default:
break;
}
}
}
}
const_cast<machine_config &>(config).device_remove(&config.root_device(), temptag.cstr());
global_free(dev);
}
}
}
// clear out any cached files

View File

@ -165,7 +165,7 @@ public:
floppy_35_dd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~floppy_35_dd();
virtual void handled_variants(UINT32 *variants, int &var_count) const;
virtual void device_config_complete() { m_shortname = "floppy_35_dd"; }
protected:
virtual void setup_characteristics();
};
@ -175,7 +175,7 @@ public:
floppy_35_dd_nosd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~floppy_35_dd_nosd();
virtual void handled_variants(UINT32 *variants, int &var_count) const;
virtual void device_config_complete() { m_shortname = "floppy_35_dd_nosd"; }
protected:
virtual void setup_characteristics();
};
@ -185,7 +185,7 @@ public:
floppy_35_hd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~floppy_35_hd();
virtual void handled_variants(UINT32 *variants, int &var_count) const;
virtual void device_config_complete() { m_shortname = "floppy_35_hd"; }
protected:
virtual void setup_characteristics();
};
@ -195,7 +195,7 @@ public:
floppy_35_ed(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~floppy_35_ed();
virtual void handled_variants(UINT32 *variants, int &var_count) const;
virtual void device_config_complete() { m_shortname = "floppy_35_ed"; }
protected:
virtual void setup_characteristics();
};
@ -205,7 +205,7 @@ public:
floppy_525_dd(const machine_config &mconfig, const char *tag, device_t *owner, UINT32 clock);
virtual ~floppy_525_dd();
virtual void handled_variants(UINT32 *variants, int &var_count) const;
virtual void device_config_complete() { m_shortname = "floppy_525_dd"; }
protected:
virtual void setup_characteristics();
};

View File

@ -180,6 +180,7 @@ const char info_xml_creator::s_dtd_string[] =
"\t\t\t<!ELEMENT slotoption EMPTY>\n"
"\t\t\t\t<!ATTLIST slotoption name CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST slotoption description CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST slotoption shortname CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST slotoption default (yes|no) \"no\">\n"
"\t\t<!ELEMENT softwarelist EMPTY>\n"
"\t\t\t<!ATTLIST softwarelist name CDATA #REQUIRED>\n"
@ -187,92 +188,6 @@ const char info_xml_creator::s_dtd_string[] =
"\t\t\t<!ATTLIST softwarelist filter CDATA #IMPLIED>\n"
"\t\t<!ELEMENT ramoption (#PCDATA)>\n"
"\t\t\t<!ATTLIST ramoption default CDATA #IMPLIED>\n"
"\t<!ELEMENT device (description, rom*, chip*, display*, sound?, input?, dipswitch*, configuration*, adjuster*, device*, slot*)>\n"
"\t\t<!ATTLIST device name CDATA #IMPLIED>\n"
"\t\t<!ELEMENT description (#PCDATA)>\n"
"\t\t<!ELEMENT rom EMPTY>\n"
"\t\t\t<!ATTLIST rom name CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST rom bios CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST rom size CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST rom crc CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST rom sha1 CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST rom merge CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST rom region CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST rom offset CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST rom status (baddump|nodump|good) \"good\">\n"
"\t\t\t<!ATTLIST rom optional (yes|no) \"no\">\n"
"\t\t<!ELEMENT chip EMPTY>\n"
"\t\t\t<!ATTLIST chip name CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST chip tag CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST chip type (cpu|audio) #REQUIRED>\n"
"\t\t\t<!ATTLIST chip clock CDATA #IMPLIED>\n"
"\t\t<!ELEMENT display EMPTY>\n"
"\t\t\t<!ATTLIST display type (raster|vector|lcd|unknown) #REQUIRED>\n"
"\t\t\t<!ATTLIST display rotate (0|90|180|270) #REQUIRED>\n"
"\t\t\t<!ATTLIST display flipx (yes|no) \"no\">\n"
"\t\t\t<!ATTLIST display width CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display height CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display refresh CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST display pixclock CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display htotal CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display hbend CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display hbstart CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display vtotal CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display vbend CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST display vbstart CDATA #IMPLIED>\n"
"\t\t<!ELEMENT sound EMPTY>\n"
"\t\t\t<!ATTLIST sound channels CDATA #REQUIRED>\n"
"\t\t<!ELEMENT input (control*)>\n"
"\t\t\t<!ATTLIST input service (yes|no) \"no\">\n"
"\t\t\t<!ATTLIST input tilt (yes|no) \"no\">\n"
"\t\t\t<!ATTLIST input players CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST input buttons CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST input coins CDATA #IMPLIED>\n"
"\t\t\t<!ELEMENT control EMPTY>\n"
"\t\t\t\t<!ATTLIST control type CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST control minimum CDATA #IMPLIED>\n"
"\t\t\t\t<!ATTLIST control maximum CDATA #IMPLIED>\n"
"\t\t\t\t<!ATTLIST control sensitivity CDATA #IMPLIED>\n"
"\t\t\t\t<!ATTLIST control keydelta CDATA #IMPLIED>\n"
"\t\t\t\t<!ATTLIST control reverse (yes|no) \"no\">\n"
"\t\t\t\t<!ATTLIST control ways CDATA #IMPLIED>\n"
"\t\t\t\t<!ATTLIST control ways2 CDATA #IMPLIED>\n"
"\t\t\t\t<!ATTLIST control ways3 CDATA #IMPLIED>\n"
"\t\t<!ELEMENT dipswitch (dipvalue*)>\n"
"\t\t\t<!ATTLIST dipswitch name CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST dipswitch tag CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST dipswitch mask CDATA #REQUIRED>\n"
"\t\t\t<!ELEMENT dipvalue EMPTY>\n"
"\t\t\t\t<!ATTLIST dipvalue name CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST dipvalue value CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST dipvalue default (yes|no) \"no\">\n"
"\t\t<!ELEMENT configuration (confsetting*)>\n"
"\t\t\t<!ATTLIST configuration name CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST configuration tag CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST configuration mask CDATA #REQUIRED>\n"
"\t\t\t<!ELEMENT confsetting EMPTY>\n"
"\t\t\t\t<!ATTLIST confsetting name CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST confsetting value CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST confsetting default (yes|no) \"no\">\n"
"\t\t<!ELEMENT adjuster EMPTY>\n"
"\t\t\t<!ATTLIST adjuster name CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST adjuster default CDATA #REQUIRED>\n"
"\t\t<!ELEMENT device (instance*, extension*)>\n"
"\t\t\t<!ATTLIST device type CDATA #REQUIRED>\n"
"\t\t\t<!ATTLIST device tag CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST device mandatory CDATA #IMPLIED>\n"
"\t\t\t<!ATTLIST device interface CDATA #IMPLIED>\n"
"\t\t\t<!ELEMENT instance EMPTY>\n"
"\t\t\t\t<!ATTLIST instance name CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST instance briefname CDATA #REQUIRED>\n"
"\t\t\t<!ELEMENT extension EMPTY>\n"
"\t\t\t\t<!ATTLIST extension name CDATA #REQUIRED>\n"
"\t\t<!ELEMENT slot (slotoption*)>\n"
"\t\t\t<!ATTLIST slot name CDATA #REQUIRED>\n"
"\t\t\t<!ELEMENT slotoption EMPTY>\n"
"\t\t\t\t<!ATTLIST slotoption name CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST slotoption description CDATA #REQUIRED>\n"
"\t\t\t\t<!ATTLIST slotoption default (yes|no) \"no\">\n"
"]>";
@ -498,43 +413,39 @@ void info_xml_creator::output_devices()
slot_map desc;
const game_driver &driver = m_drivlist.driver();
bool display_all = (driver_list::total() == m_drivlist.count() + 1);
// first, run through slot devices
while (m_drivlist.next())
{
device_iterator deviter(m_drivlist.config().root_device());
deviter.first();
for (device_t *device = deviter.next(); device != NULL; device = deviter.next())
for (device_t *device = deviter.next(); device != NULL; device = deviter.next()) {
if (device->rom_region() != NULL && device->shortname()!= NULL)
{
if (desc.add(device->name(), &driver, FALSE) != TMERR_DUPLICATE)
output_one_device(*device, device->tag(), emulator_info::get_xml_top());
}
if (display_all)
}
slot_interface_iterator iter(m_drivlist.config().root_device());
for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next())
{
slot_interface_iterator iter(m_drivlist.config().root_device());
for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next())
const slot_interface* intf = slot->get_slot_interfaces();
for (int i = 0; intf && intf[i].name != NULL; i++)
{
const slot_interface* intf = slot->get_slot_interfaces();
for (int i = 0; intf && intf[i].name != NULL; i++)
{
astring temptag("_");
temptag.cat(intf[i].name);
device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), intf[i].devtype, 0);
astring temptag("_");
temptag.cat(intf[i].name);
device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), temptag.cstr(), intf[i].devtype, 0);
// notify this device and all its subdevices that they are now configured
device_iterator subiter(*dev);
for (device_t *device = subiter.first(); device != NULL; device = subiter.next())
if (!device->configured())
device->config_complete();
// notify this device and all its subdevices that they are now configured
device_iterator subiter(*dev);
for (device_t *device = subiter.first(); device != NULL; device = subiter.next())
if (!device->configured())
device->config_complete();
if (desc.add(dev->name(), &driver, FALSE) != TMERR_DUPLICATE)
output_one_device(*dev, temptag.cstr(), "device");
if (desc.add(dev->name(), &driver, FALSE) != TMERR_DUPLICATE)
output_one_device(*dev, temptag.cstr(), emulator_info::get_xml_top());
const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.cstr());
global_free(dev);
}
const_cast<machine_config &>(m_drivlist.config()).device_remove(&m_drivlist.config().root_device(), temptag.cstr());
global_free(dev);
}
}
}
@ -1372,9 +1283,13 @@ void info_xml_creator::output_slots(device_t &device, const char *root_tag)
for (int i = 0; intf && intf[i].name != NULL; i++)
{
device_t *dev = const_cast<machine_config &>(m_drivlist.config()).device_add(&m_drivlist.config().root_device(), "dummy", intf[i].devtype, 0);
if (!dev->configured())
dev->config_complete();
fprintf(m_output, "\t\t\t<slotoption");
fprintf(m_output, " name=\"%s\"", xml_normalize_string(intf[i].name));
fprintf(m_output, " description=\"%s\"", xml_normalize_string(dev->name()));
fprintf(m_output, " shortname=\"%s\"", xml_normalize_string(dev->shortname()));
if (slot->get_default_card(m_drivlist.config(), m_drivlist.options()))
{
if (slot->get_default_card(m_drivlist.config(), m_drivlist.options()) == intf[i].name)

View File

@ -132,6 +132,7 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_config_complete() { m_shortname = "centronics_printer"; }
private:
printer_image_device *m_printer;
centronics_device *m_owner;

View File

@ -96,6 +96,7 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_config_complete() { m_shortname = "hdd"; }
void ide_build_features();
virtual bool is_ready() { return (m_disk != NULL); }
@ -117,6 +118,7 @@ protected:
// device-level overrides
virtual void device_start();
virtual void device_reset();
virtual void device_config_complete() { m_shortname = "hdd_image"; }
// optional information overrides
virtual machine_config_constructor device_mconfig_additions() const;
};

View File

@ -18,6 +18,7 @@ public:
protected:
virtual void device_start();
virtual void device_reset();
virtual void device_config_complete() { m_shortname = "scsi_cdrom"; }
virtual void scsi_command();
virtual UINT8 scsi_get_data(int id, int pos);

View File

@ -18,6 +18,7 @@ public:
protected:
virtual void device_start();
virtual void device_reset();
virtual void device_config_complete() { m_shortname = "scsi_harddisk"; }
virtual void scsi_command();
virtual UINT8 scsi_get_data(int id, int pos);

View File

@ -60,11 +60,6 @@ UINT8 your_ptr64_flag_is_wrong[(int)(5 - sizeof(void *))];
// TYPE DEFINITIONS
//**************************************************************************
extern const device_type *s_devices_sorted[];
extern int m_device_count;
//**************************************************************************
// INLINE FUNCTIONS
//**************************************************************************
@ -302,7 +297,6 @@ void validity_checker::validate_one(const game_driver &driver)
validate_display();
validate_gfx();
validate_devices();
validate_slots();
}
catch (emu_fatalerror &err)
{
@ -706,22 +700,6 @@ void validity_checker::validate_roms()
if (items_since_region == 0)
mame_printf_warning("Empty ROM region '%s' (warning)\n", last_region_name);
// make sure each device is listed in the device list if it loads ROMs
if (m_current_device != NULL && total_files > 0)
{
// scan the list of devices for this device type
bool found = false;
for (int i = 0; i < m_device_count; i++)
if (m_current_device->type() == *s_devices_sorted[i])
{
found = true;
break;
}
// if not found, report an error
if (!found)
mame_printf_error("Device %s is not listed in device list (mame_dev.lst / mess_dev.lst)\n", m_current_device->shortname());
}
// reset the current device
m_current_device = NULL;
@ -1116,7 +1094,7 @@ void validity_checker::validate_devices()
// if we have a ROM region, we must have a shortname
if (device->rom_region() != NULL && strcmp(device->shortname(), "") == 0)
mame_printf_error("Device %s has ROM definition but does not have short name defined\n", device->name());
mame_printf_error("Device has ROM definition but does not have short name defined\n");
// check for device-specific validity check
device->validity_check(*this);
@ -1124,58 +1102,35 @@ void validity_checker::validate_devices()
// done with this device
m_current_device = NULL;
}
}
//-------------------------------------------------
// validate_slots - run per-slot validity
// checks
//-------------------------------------------------
void validity_checker::validate_slots()
{
// iterate over slots
slot_interface_iterator iter(m_current_config->root_device());
for (const device_slot_interface *slot = iter.first(); slot != NULL; slot = iter.next())
// if device is slot cart device, we must have a shortname
int_map slot_device_map;
slot_interface_iterator slotiter(m_current_config->root_device());
for (const device_slot_interface *slot = slotiter.first(); slot != NULL; slot = slotiter.next())
{
// iterate over interfaces
const slot_interface *intf = slot->get_slot_interfaces();
for (int j = 0; intf && intf[j].name != NULL; j++)
const slot_interface* intf = slot->get_slot_interfaces();
for (int i = 0; intf && intf[i].name != NULL; i++)
{
// instantiate the device
device_t *dev = (*intf[j].devtype)(*m_current_config, "dummy", &m_current_config->root_device(), 0);
dev->config_complete();
astring temptag("_");
temptag.cat(intf[i].name);
device_t *dev = const_cast<machine_config &>(*m_current_config).device_add(&m_current_config->root_device(), temptag.cstr(), intf[i].devtype, 0);
// if a ROM region is present
if (dev->rom_region() != NULL)
{
bool has_romfiles = false;
for (const rom_entry *romp = rom_first_region(*dev); !ROMENTRY_ISEND(romp); romp++)
if (ROMENTRY_ISFILE(romp))
{
has_romfiles = true;
break;
}
// notify this device and all its subdevices that they are now configured
device_iterator subiter(*dev);
for (device_t *device = subiter.first(); device != NULL; device = subiter.next())
if (!device->configured())
device->config_complete();
if (has_romfiles)
{
// scan the list of devices for this device type
bool found = false;
for (int i = 0; i < m_device_count; i++)
if (dev->type() == *s_devices_sorted[i])
{
found = true;
break;
}
// if not found, report an error
if (!found)
mame_printf_error("Device %s in slot %s is not listed in device list (mame_dev.lst / mess_dev.lst)\n", dev->shortname(), intf[j].name);
}
if (strcmp(dev->shortname(), "") == 0) {
if (slot_device_map.add(dev->name(), 0, false) != TMERR_DUPLICATE)
mame_printf_error("Device '%s' is slot cart device but does not have short name defined\n",dev->name());
}
const_cast<machine_config &>(*m_current_config).device_remove(&m_current_config->root_device(), temptag.cstr());
global_free(dev);
}
}
}

View File

@ -97,7 +97,6 @@ private:
void validate_condition(input_condition &condition, device_t &device, int_map &port_map);
void validate_inputs();
void validate_devices();
void validate_slots();
// output helpers
void build_output_prefix(astring &string);

View File

@ -1,42 +0,0 @@
/******************************************************************************
ldplayer_dev.lst
List of all enabled devices in the system. This file is parsed by
makedev.exe, sorted, and output as C code describing the devices.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
PIONEER_LDV1000
PIONEER_PR8210

View File

@ -1,53 +0,0 @@
/******************************************************************************
mame_dev.lst
List of all enabled devices in the system. This file is parsed by
makedev.exe, sorted, and output as C code describing the devices.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/
BSMT2000
H63484
NAMCO_50XX
NAMCO_51XX
NAMCO_52XX
NAMCO_53XX
NAMCO_54XX
NAMCO_62XX
MIE
PHILLIPS_22VP931
PIONEER_LDV1000
PIONEER_PR8210
SIMUTREK_SPECIAL

View File

@ -1,39 +0,0 @@
/******************************************************************************
tiny_dev.lst
List of all enabled devices in the system. This file is parsed by
makedev.exe, sorted, and output as C code describing the devices.
****************************************************************************
Copyright Aaron Giles
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name 'MAME' nor the names of its contributors may be
used to endorse or promote products derived from this software
without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY AARON GILES ''AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL AARON GILES BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
******************************************************************************/