mirror of
https://github.com/holub/mame
synced 2025-07-04 17:38:08 +03:00
Cleanups again
This commit is contained in:
parent
272871986d
commit
486fbfa555
@ -89,7 +89,7 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "Unable to read source file '%s'\n", srcfile);
|
fprintf(stderr, "Unable to read source file '%s'\n", srcfile);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// rip through it to find all drivers
|
// rip through it to find all drivers
|
||||||
int drivcount = 0;
|
int drivcount = 0;
|
||||||
char *srcptr = (char *)buffer;
|
char *srcptr = (char *)buffer;
|
||||||
@ -99,7 +99,7 @@ int main(int argc, char *argv[])
|
|||||||
while (srcptr < endptr)
|
while (srcptr < endptr)
|
||||||
{
|
{
|
||||||
char c = *srcptr++;
|
char c = *srcptr++;
|
||||||
|
|
||||||
// count newlines
|
// count newlines
|
||||||
if (c == 13 || c == 10)
|
if (c == 13 || c == 10)
|
||||||
{
|
{
|
||||||
@ -108,11 +108,11 @@ int main(int argc, char *argv[])
|
|||||||
linenum++;
|
linenum++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip any spaces
|
// skip any spaces
|
||||||
if (isspace(c))
|
if (isspace(c))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// look for end of C comment
|
// look for end of C comment
|
||||||
if (in_comment && c == '*' && *srcptr == '/')
|
if (in_comment && c == '*' && *srcptr == '/')
|
||||||
{
|
{
|
||||||
@ -120,11 +120,11 @@ int main(int argc, char *argv[])
|
|||||||
in_comment = false;
|
in_comment = false;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// skip anything else inside a C comment
|
// skip anything else inside a C comment
|
||||||
if (in_comment)
|
if (in_comment)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// look for start of C comment
|
// look for start of C comment
|
||||||
if (c == '/' && *srcptr == '*')
|
if (c == '/' && *srcptr == '*')
|
||||||
{
|
{
|
||||||
@ -132,7 +132,7 @@ int main(int argc, char *argv[])
|
|||||||
in_comment = true;
|
in_comment = true;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we hit a C++ comment, scan to the end of line
|
// if we hit a C++ comment, scan to the end of line
|
||||||
if (c == '/' && *srcptr == '/')
|
if (c == '/' && *srcptr == '/')
|
||||||
{
|
{
|
||||||
@ -140,7 +140,7 @@ int main(int argc, char *argv[])
|
|||||||
srcptr++;
|
srcptr++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// extract the driver name
|
// extract the driver name
|
||||||
char drivname[32];
|
char drivname[32];
|
||||||
drivname[0] = 0;
|
drivname[0] = 0;
|
||||||
@ -150,7 +150,7 @@ int main(int argc, char *argv[])
|
|||||||
drivname[pos] = *srcptr++;
|
drivname[pos] = *srcptr++;
|
||||||
drivname[pos+1] = 0;
|
drivname[pos+1] = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// verify the name as valid
|
// verify the name as valid
|
||||||
for (char *drivch = drivname; *drivch != 0; drivch++)
|
for (char *drivch = drivname; *drivch != 0; drivch++)
|
||||||
{
|
{
|
||||||
@ -159,16 +159,16 @@ int main(int argc, char *argv[])
|
|||||||
fprintf(stderr, "%s:%d - Invalid character '%c' in driver \"%s\"\n", srcfile, linenum, *drivch, drivname);
|
fprintf(stderr, "%s:%d - Invalid character '%c' in driver \"%s\"\n", srcfile, linenum, *drivch, drivname);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add it to the list
|
// add it to the list
|
||||||
char *name = (char *)malloc(strlen(drivname) + 1);
|
char *name = (char *)malloc(strlen(drivname) + 1);
|
||||||
strcpy(name, drivname);
|
strcpy(name, drivname);
|
||||||
drivlist[drivcount++] = name;
|
drivlist[drivcount++] = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
// add a reference to the ___empty driver
|
// add a reference to the ___empty driver
|
||||||
drivlist[drivcount++] = "___empty";
|
drivlist[drivcount++] = "___empty";
|
||||||
|
|
||||||
// output a count
|
// output a count
|
||||||
if (drivcount == 0)
|
if (drivcount == 0)
|
||||||
{
|
{
|
||||||
@ -176,13 +176,13 @@ int main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
fprintf(stderr, "%d drivers found\n", drivcount);
|
fprintf(stderr, "%d drivers found\n", drivcount);
|
||||||
|
|
||||||
// sort the list
|
// sort the list
|
||||||
qsort(drivlist, drivcount, sizeof(*drivlist), sort_callback);
|
qsort(drivlist, drivcount, sizeof(*drivlist), sort_callback);
|
||||||
|
|
||||||
// start with a header
|
// start with a header
|
||||||
printf("#include \"emu.h\"\n\n");
|
printf("#include \"emu.h\"\n\n");
|
||||||
|
|
||||||
// output the list of externs first
|
// output the list of externs first
|
||||||
for (int index = 0; index < drivcount; index++)
|
for (int index = 0; index < drivcount; index++)
|
||||||
printf("GAME_EXTERN(%s);\n", drivlist[index]);
|
printf("GAME_EXTERN(%s);\n", drivlist[index]);
|
||||||
@ -195,7 +195,7 @@ int main(int argc, char *argv[])
|
|||||||
printf("\t&GAME_NAME(%s)%s\n", drivlist[index], (index == drivcount - 1) ? "" : ",");
|
printf("\t&GAME_NAME(%s)%s\n", drivlist[index], (index == drivcount - 1) ? "" : ",");
|
||||||
printf("};\n");
|
printf("};\n");
|
||||||
printf("\n");
|
printf("\n");
|
||||||
|
|
||||||
// also output a global count
|
// also output a global count
|
||||||
printf("int driver_list::s_driver_count = %d;\n", drivcount);
|
printf("int driver_list::s_driver_count = %d;\n", drivcount);
|
||||||
|
|
||||||
|
@ -88,11 +88,11 @@ const char *driverpath = m_enumerator.config().m_devicelist.find("root")->search
|
|||||||
|
|
||||||
// also determine if this is the driver's specific ROMs or not
|
// also determine if this is the driver's specific ROMs or not
|
||||||
bool source_is_gamedrv = (dynamic_cast<const driver_device_config_base *>(source) != NULL);
|
bool source_is_gamedrv = (dynamic_cast<const driver_device_config_base *>(source) != NULL);
|
||||||
|
|
||||||
// temporary hack: add the driver path
|
// temporary hack: add the driver path
|
||||||
astring combinedpath(m_searchpath, ";", driverpath);
|
astring combinedpath(m_searchpath, ";", driverpath);
|
||||||
m_searchpath = combinedpath;
|
m_searchpath = combinedpath;
|
||||||
|
|
||||||
// now iterate over regions and ROMs within
|
// now iterate over regions and ROMs within
|
||||||
for (const rom_entry *region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
|
for (const rom_entry *region = rom_first_region(*source); region != NULL; region = rom_next_region(region))
|
||||||
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
|
for (const rom_entry *rom = rom_first_file(region); rom; rom = rom_next_file(rom))
|
||||||
@ -102,7 +102,7 @@ m_searchpath = combinedpath;
|
|||||||
// if a dump exists, then at least one entry is required
|
// if a dump exists, then at least one entry is required
|
||||||
if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
|
if (!hashes.flag(hash_collection::FLAG_NO_DUMP))
|
||||||
anyrequired = true;
|
anyrequired = true;
|
||||||
|
|
||||||
// audit a file
|
// audit a file
|
||||||
audit_record *record = NULL;
|
audit_record *record = NULL;
|
||||||
if (ROMREGION_ISROMDATA(region))
|
if (ROMREGION_ISROMDATA(region))
|
||||||
@ -111,12 +111,12 @@ m_searchpath = combinedpath;
|
|||||||
// audit a disk
|
// audit a disk
|
||||||
else if (ROMREGION_ISDISKDATA(region))
|
else if (ROMREGION_ISDISKDATA(region))
|
||||||
record = audit_one_disk(rom);
|
record = audit_one_disk(rom);
|
||||||
|
|
||||||
// skip if no record
|
// skip if no record
|
||||||
if (record == NULL)
|
if (record == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// if we got a record back,
|
// if we got a record back,
|
||||||
if (record->status() != audit_record::STATUS_NOT_FOUND && source_is_gamedrv && also_used_by_parent(hashes) == -1)
|
if (record->status() != audit_record::STATUS_NOT_FOUND && source_is_gamedrv && also_used_by_parent(hashes) == -1)
|
||||||
anyfound = true;
|
anyfound = true;
|
||||||
}
|
}
|
||||||
@ -125,7 +125,7 @@ m_searchpath = combinedpath;
|
|||||||
// if we found nothing, we don't have the set at all
|
// if we found nothing, we don't have the set at all
|
||||||
if (!anyfound && anyrequired)
|
if (!anyfound && anyrequired)
|
||||||
m_record_list.reset();
|
m_record_list.reset();
|
||||||
|
|
||||||
// return a summary
|
// return a summary
|
||||||
return summarize();
|
return summarize();
|
||||||
}
|
}
|
||||||
@ -160,10 +160,10 @@ media_auditor::summary media_auditor::audit_samples()
|
|||||||
searchpath.cat(";").cat(&intf->samplenames[sampnum][1]);
|
searchpath.cat(";").cat(&intf->samplenames[sampnum][1]);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
// create a new record
|
// create a new record
|
||||||
audit_record &record = m_record_list.append(*global_alloc(audit_record(intf->samplenames[sampnum], audit_record::MEDIA_SAMPLE)));
|
audit_record &record = m_record_list.append(*global_alloc(audit_record(intf->samplenames[sampnum], audit_record::MEDIA_SAMPLE)));
|
||||||
|
|
||||||
// look for the files
|
// look for the files
|
||||||
emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
|
emu_file file(m_enumerator.options().sample_path(), OPEN_FLAG_READ | OPEN_FLAG_NO_PRELOAD);
|
||||||
path_iterator path(searchpath);
|
path_iterator path(searchpath);
|
||||||
@ -180,7 +180,7 @@ media_auditor::summary media_auditor::audit_samples()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// return a summary
|
// return a summary
|
||||||
return summarize();
|
return summarize();
|
||||||
}
|
}
|
||||||
@ -264,7 +264,7 @@ media_auditor::summary media_auditor::summarize(astring *string)
|
|||||||
case audit_record::SUBSTATUS_NOT_FOUND_BIOS:
|
case audit_record::SUBSTATUS_NOT_FOUND_BIOS:
|
||||||
if (string != NULL) string->catprintf("NOT FOUND (BIOS)\n");
|
if (string != NULL) string->catprintf("NOT FOUND (BIOS)\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
assert(false);
|
assert(false);
|
||||||
}
|
}
|
||||||
@ -301,7 +301,7 @@ audit_record *media_auditor::audit_one_rom(const rom_entry *rom)
|
|||||||
filerr = file.open(curpath, crc);
|
filerr = file.open(curpath, crc);
|
||||||
else
|
else
|
||||||
filerr = file.open(curpath);
|
filerr = file.open(curpath);
|
||||||
|
|
||||||
// if it worked, get the actual length and hashes, then stop
|
// if it worked, get the actual length and hashes, then stop
|
||||||
if (filerr == FILERR_NONE)
|
if (filerr == FILERR_NONE)
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ audit_record *media_auditor::audit_one_rom(const rom_entry *rom)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute the final status
|
// compute the final status
|
||||||
compute_status(record, rom, record.actual_length() != 0);
|
compute_status(record, rom, record.actual_length() != 0);
|
||||||
return &record;
|
return &record;
|
||||||
@ -329,7 +329,7 @@ audit_record *media_auditor::audit_one_disk(const rom_entry *rom)
|
|||||||
emu_file *source_file;
|
emu_file *source_file;
|
||||||
chd_file *source;
|
chd_file *source;
|
||||||
chd_error err = open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, &source_file, &source, NULL);
|
chd_error err = open_disk_image(m_enumerator.options(), &m_enumerator.driver(), rom, &source_file, &source, NULL);
|
||||||
|
|
||||||
// if we succeeded, get the hashes
|
// if we succeeded, get the hashes
|
||||||
if (err == CHDERR_NONE)
|
if (err == CHDERR_NONE)
|
||||||
{
|
{
|
||||||
@ -342,7 +342,7 @@ audit_record *media_auditor::audit_one_disk(const rom_entry *rom)
|
|||||||
hashes.add_from_buffer(hash_collection::HASH_MD5, header.md5, sizeof(header.md5));
|
hashes.add_from_buffer(hash_collection::HASH_MD5, header.md5, sizeof(header.md5));
|
||||||
if (memcmp(nullhash, header.sha1, sizeof(header.sha1)) != 0)
|
if (memcmp(nullhash, header.sha1, sizeof(header.sha1)) != 0)
|
||||||
hashes.add_from_buffer(hash_collection::HASH_SHA1, header.sha1, sizeof(header.sha1));
|
hashes.add_from_buffer(hash_collection::HASH_SHA1, header.sha1, sizeof(header.sha1));
|
||||||
|
|
||||||
// update the actual values
|
// update the actual values
|
||||||
record.set_actual(hashes);
|
record.set_actual(hashes);
|
||||||
|
|
||||||
@ -350,7 +350,7 @@ audit_record *media_auditor::audit_one_disk(const rom_entry *rom)
|
|||||||
chd_close(source);
|
chd_close(source);
|
||||||
global_free(source_file);
|
global_free(source_file);
|
||||||
}
|
}
|
||||||
|
|
||||||
// compute the final status
|
// compute the final status
|
||||||
compute_status(record, rom, err == CHDERR_NONE);
|
compute_status(record, rom, err == CHDERR_NONE);
|
||||||
return &record;
|
return &record;
|
||||||
@ -368,7 +368,7 @@ void media_auditor::compute_status(audit_record &record, const rom_entry *rom, b
|
|||||||
if (!found)
|
if (!found)
|
||||||
{
|
{
|
||||||
int parent;
|
int parent;
|
||||||
|
|
||||||
// no good dump
|
// no good dump
|
||||||
if (record.expected_hashes().flag(hash_collection::FLAG_NO_DUMP))
|
if (record.expected_hashes().flag(hash_collection::FLAG_NO_DUMP))
|
||||||
record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND_NODUMP);
|
record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND_NODUMP);
|
||||||
@ -390,7 +390,7 @@ void media_auditor::compute_status(audit_record &record, const rom_entry *rom, b
|
|||||||
else
|
else
|
||||||
record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND);
|
record.set_status(audit_record::STATUS_NOT_FOUND, audit_record::SUBSTATUS_NOT_FOUND);
|
||||||
}
|
}
|
||||||
|
|
||||||
// if found, provide more details
|
// if found, provide more details
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -105,7 +105,7 @@ public:
|
|||||||
// construction/destruction
|
// construction/destruction
|
||||||
audit_record(const rom_entry &media, media_type type);
|
audit_record(const rom_entry &media, media_type type);
|
||||||
audit_record(const char *name, media_type type);
|
audit_record(const char *name, media_type type);
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
audit_record *next() const { return m_next; }
|
audit_record *next() const { return m_next; }
|
||||||
media_type type() const { return m_type; }
|
media_type type() const { return m_type; }
|
||||||
@ -123,7 +123,7 @@ public:
|
|||||||
m_status = status;
|
m_status = status;
|
||||||
m_substatus = substatus;
|
m_substatus = substatus;
|
||||||
}
|
}
|
||||||
|
|
||||||
void set_actual(const hash_collection &hashes, UINT64 length = 0)
|
void set_actual(const hash_collection &hashes, UINT64 length = 0)
|
||||||
{
|
{
|
||||||
m_hashes = hashes;
|
m_hashes = hashes;
|
||||||
@ -139,7 +139,7 @@ private:
|
|||||||
const char * m_name; /* name of item */
|
const char * m_name; /* name of item */
|
||||||
UINT64 m_explength; /* expected length of item */
|
UINT64 m_explength; /* expected length of item */
|
||||||
UINT64 m_length; /* actual length of item */
|
UINT64 m_length; /* actual length of item */
|
||||||
hash_collection m_exphashes; /* expected hash data */
|
hash_collection m_exphashes; /* expected hash data */
|
||||||
hash_collection m_hashes; /* actual hash information */
|
hash_collection m_hashes; /* actual hash information */
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public:
|
|||||||
|
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
media_auditor(const driver_enumerator &enumerator);
|
media_auditor(const driver_enumerator &enumerator);
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
audit_record *first() const { return m_record_list.first(); }
|
audit_record *first() const { return m_record_list.first(); }
|
||||||
int count() const { return m_record_list.count(); }
|
int count() const { return m_record_list.count(); }
|
||||||
@ -171,7 +171,7 @@ public:
|
|||||||
summary audit_media(const char *validation = AUDIT_VALIDATE_FULL);
|
summary audit_media(const char *validation = AUDIT_VALIDATE_FULL);
|
||||||
summary audit_samples();
|
summary audit_samples();
|
||||||
summary summarize(astring *output = NULL);
|
summary summarize(astring *output = NULL);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// internal helpers
|
// internal helpers
|
||||||
audit_record *audit_one_rom(const rom_entry *rom);
|
audit_record *audit_one_rom(const rom_entry *rom);
|
||||||
|
@ -231,7 +231,7 @@ int cli_frontend::execute(int argc, char **argv)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listxml - output the XML data for one or more
|
// listxml - output the XML data for one or more
|
||||||
// games
|
// games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -249,10 +249,10 @@ void cli_frontend::listxml(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listfull - output the name and description of
|
// listfull - output the name and description of
|
||||||
// one or more games
|
// one or more games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
void cli_frontend::listfull(const char *gamename)
|
void cli_frontend::listfull(const char *gamename)
|
||||||
{
|
{
|
||||||
// determine which drivers to output; return an error if none found
|
// determine which drivers to output; return an error if none found
|
||||||
@ -271,7 +271,7 @@ void cli_frontend::listfull(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listsource - output the name and source
|
// listsource - output the name and source
|
||||||
// filename of one or more games
|
// filename of one or more games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -290,7 +290,7 @@ void cli_frontend::listsource(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listclones - output the name and parent of all
|
// listclones - output the name and parent of all
|
||||||
// clones matching the given pattern
|
// clones matching the given pattern
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -299,7 +299,7 @@ void cli_frontend::listclones(const char *gamename)
|
|||||||
// start with a filtered list of drivers
|
// start with a filtered list of drivers
|
||||||
driver_enumerator drivlist(m_options, gamename);
|
driver_enumerator drivlist(m_options, gamename);
|
||||||
int original_count = drivlist.count();
|
int original_count = drivlist.count();
|
||||||
|
|
||||||
// iterate through the remaining ones to see if their parent matches
|
// iterate through the remaining ones to see if their parent matches
|
||||||
while (drivlist.next_excluded())
|
while (drivlist.next_excluded())
|
||||||
{
|
{
|
||||||
@ -309,7 +309,7 @@ void cli_frontend::listclones(const char *gamename)
|
|||||||
if (drivlist.matches(gamename, drivlist.driver(clone_of).name))
|
if (drivlist.matches(gamename, drivlist.driver(clone_of).name))
|
||||||
drivlist.include();
|
drivlist.include();
|
||||||
}
|
}
|
||||||
|
|
||||||
// return an error if none found
|
// return an error if none found
|
||||||
if (drivlist.count() == 0)
|
if (drivlist.count() == 0)
|
||||||
{
|
{
|
||||||
@ -336,8 +336,8 @@ void cli_frontend::listclones(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listbrothers - for each matching game, output
|
// listbrothers - for each matching game, output
|
||||||
// the list of other games that share the same
|
// the list of other games that share the same
|
||||||
// source file
|
// source file
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -358,14 +358,14 @@ void cli_frontend::listbrothers(const char *gamename)
|
|||||||
// if we are already marked in the final list, we don't need to do anything
|
// if we are already marked in the final list, we don't need to do anything
|
||||||
if (drivlist.included(initial_drivlist.current()))
|
if (drivlist.included(initial_drivlist.current()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// otherwise, walk excluded items in the final list and mark any that match
|
// otherwise, walk excluded items in the final list and mark any that match
|
||||||
drivlist.reset();
|
drivlist.reset();
|
||||||
while (drivlist.next_excluded())
|
while (drivlist.next_excluded())
|
||||||
if (strcmp(drivlist.driver().source_file, initial_drivlist.driver().source_file) == 0)
|
if (strcmp(drivlist.driver().source_file, initial_drivlist.driver().source_file) == 0)
|
||||||
drivlist.include();
|
drivlist.include();
|
||||||
}
|
}
|
||||||
|
|
||||||
// print the header
|
// print the header
|
||||||
mame_printf_info("Source file: Name: Parent:\n");
|
mame_printf_info("Source file: Name: Parent:\n");
|
||||||
|
|
||||||
@ -381,7 +381,7 @@ void cli_frontend::listbrothers(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listcrc - output the CRC and name of all ROMs
|
// listcrc - output the CRC and name of all ROMs
|
||||||
// referenced by the emulator
|
// referenced by the emulator
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -407,7 +407,7 @@ void cli_frontend::listcrc(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listroms - output the list of ROMs referenced
|
// listroms - output the list of ROMs referenced
|
||||||
// by a given game or set of games
|
// by a given game or set of games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -469,7 +469,7 @@ void cli_frontend::listroms(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listsamples - output the list of samples
|
// listsamples - output the list of samples
|
||||||
// referenced by a given game or set of games
|
// referenced by a given game or set of games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -491,7 +491,7 @@ void cli_frontend::listsamples(const char *gamename)
|
|||||||
break;
|
break;
|
||||||
if (devconfig == NULL)
|
if (devconfig == NULL)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
// print a header
|
// print a header
|
||||||
if (!first)
|
if (!first)
|
||||||
mame_printf_info("\n");
|
mame_printf_info("\n");
|
||||||
@ -514,7 +514,7 @@ void cli_frontend::listsamples(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// listdevices - output the list of devices
|
// listdevices - output the list of devices
|
||||||
// referenced by a given game or set of games
|
// referenced by a given game or set of games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -575,7 +575,7 @@ void cli_frontend::listmedia(const char *gamename)
|
|||||||
// iterate over drivers
|
// iterate over drivers
|
||||||
while (drivlist.next())
|
while (drivlist.next())
|
||||||
{
|
{
|
||||||
// iterate
|
// iterate
|
||||||
const device_config_image_interface *imagedev = NULL;
|
const device_config_image_interface *imagedev = NULL;
|
||||||
bool first = true;
|
bool first = true;
|
||||||
for (bool gotone = drivlist.config().m_devicelist.first(imagedev); gotone; gotone = imagedev->next(imagedev))
|
for (bool gotone = drivlist.config().m_devicelist.first(imagedev); gotone; gotone = imagedev->next(imagedev))
|
||||||
@ -596,12 +596,12 @@ void cli_frontend::listmedia(const char *gamename)
|
|||||||
if (end == -1)
|
if (end == -1)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// end the line
|
// end the line
|
||||||
printf("\n");
|
printf("\n");
|
||||||
first = false;
|
first = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we didn't get any at all, just print a none line
|
// if we didn't get any at all, just print a none line
|
||||||
if (first)
|
if (first)
|
||||||
printf("%-13s(none)\n", drivlist.driver().name);
|
printf("%-13s(none)\n", drivlist.driver().name);
|
||||||
@ -610,7 +610,7 @@ void cli_frontend::listmedia(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// verifyroms - verify the ROM sets of one or
|
// verifyroms - verify the ROM sets of one or
|
||||||
// more games
|
// more games
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -636,7 +636,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(&summary_string);
|
auditor.summarize(&summary_string);
|
||||||
mame_printf_info("%s", summary_string.cstr());
|
mame_printf_info("%s", summary_string.cstr());
|
||||||
|
|
||||||
// if not found, count that and leave it at that
|
// if not found, count that and leave it at that
|
||||||
if (summary == media_auditor::NOTFOUND)
|
if (summary == media_auditor::NOTFOUND)
|
||||||
notfound++;
|
notfound++;
|
||||||
@ -667,7 +667,7 @@ void cli_frontend::verifyroms(const char *gamename)
|
|||||||
mame_printf_info("is best available\n");
|
mame_printf_info("is best available\n");
|
||||||
correct++;
|
correct++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -718,12 +718,12 @@ void cli_frontend::verifysamples(const char *gamename)
|
|||||||
{
|
{
|
||||||
// audit the samples in this set
|
// audit the samples in this set
|
||||||
media_auditor::summary summary = auditor.audit_samples();
|
media_auditor::summary summary = auditor.audit_samples();
|
||||||
|
|
||||||
// output the summary of the audit
|
// output the summary of the audit
|
||||||
astring summary_string;
|
astring summary_string;
|
||||||
auditor.summarize(&summary_string);
|
auditor.summarize(&summary_string);
|
||||||
mame_printf_info("%s", summary_string.cstr());
|
mame_printf_info("%s", summary_string.cstr());
|
||||||
|
|
||||||
// if not found, print a message and set the flag
|
// if not found, print a message and set the flag
|
||||||
if (summary == media_auditor::NOTFOUND)
|
if (summary == media_auditor::NOTFOUND)
|
||||||
{
|
{
|
||||||
@ -757,7 +757,7 @@ void cli_frontend::verifysamples(const char *gamename)
|
|||||||
mame_printf_info("is best available\n");
|
mame_printf_info("is best available\n");
|
||||||
correct++;
|
correct++;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -1073,7 +1073,7 @@ static void info_listsoftware(const char *gamename)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// romident - identify ROMs by looking for
|
// romident - identify ROMs by looking for
|
||||||
// matches in our internal database
|
// matches in our internal database
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
|
||||||
@ -1174,7 +1174,7 @@ void cli_frontend::execute_commands(const char *exename)
|
|||||||
{ CLICOMMAND_VERIFYROMS, &cli_frontend::verifyroms },
|
{ CLICOMMAND_VERIFYROMS, &cli_frontend::verifyroms },
|
||||||
{ CLICOMMAND_VERIFYSAMPLES, &cli_frontend::verifysamples },
|
{ CLICOMMAND_VERIFYSAMPLES, &cli_frontend::verifysamples },
|
||||||
{ CLICOMMAND_LISTMEDIA, &cli_frontend::listmedia },
|
{ CLICOMMAND_LISTMEDIA, &cli_frontend::listmedia },
|
||||||
// { CLICOMMAND_LISTSOFTWARE, &cli_frontend::listsoftware },
|
// { CLICOMMAND_LISTSOFTWARE, &cli_frontend::listsoftware },
|
||||||
{ CLICOMMAND_ROMIDENT, &cli_frontend::romident }
|
{ CLICOMMAND_ROMIDENT, &cli_frontend::romident }
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1201,7 +1201,7 @@ void cli_frontend::execute_commands(const char *exename)
|
|||||||
void cli_frontend::display_help()
|
void cli_frontend::display_help()
|
||||||
{
|
{
|
||||||
mame_printf_info(APPLONGNAME " v%s - " FULLLONGNAME "\n"
|
mame_printf_info(APPLONGNAME " v%s - " FULLLONGNAME "\n"
|
||||||
COPYRIGHT_INFO "\n\n", build_version);
|
COPYRIGHT_INFO "\n\n", build_version);
|
||||||
mame_printf_info("%s\n", DISCLAIMER);
|
mame_printf_info("%s\n", DISCLAIMER);
|
||||||
mame_printf_info(USAGE "\n\n"
|
mame_printf_info(USAGE "\n\n"
|
||||||
" " APPNAME " -showusage for a brief list of options\n"
|
" " APPNAME " -showusage for a brief list of options\n"
|
||||||
@ -1257,7 +1257,7 @@ void media_identifier::identify(const char *filename)
|
|||||||
astring curfile(filename, PATH_SEPARATOR, entry->name);
|
astring curfile(filename, PATH_SEPARATOR, entry->name);
|
||||||
identify_file(curfile);
|
identify_file(curfile);
|
||||||
}
|
}
|
||||||
|
|
||||||
// close the directory and be done
|
// close the directory and be done
|
||||||
osd_closedir(directory);
|
osd_closedir(directory);
|
||||||
}
|
}
|
||||||
@ -1333,7 +1333,7 @@ void media_identifier::identify_file(const char *name)
|
|||||||
mame_printf_info("is a writeable CHD\n");
|
mame_printf_info("is a writeable CHD\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// otherwise, get the hash collection for this CHD
|
// otherwise, get the hash collection for this CHD
|
||||||
static const UINT8 nullhash[20] = { 0 };
|
static const UINT8 nullhash[20] = { 0 };
|
||||||
hash_collection hashes;
|
hash_collection hashes;
|
||||||
@ -1350,7 +1350,7 @@ void media_identifier::identify_file(const char *name)
|
|||||||
else
|
else
|
||||||
m_matches++;
|
m_matches++;
|
||||||
}
|
}
|
||||||
|
|
||||||
// all other files have their hashes computed directly
|
// all other files have their hashes computed directly
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1483,6 +1483,6 @@ int media_identifier::find_by_hash(const hash_collection &hashes, int length)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return found;
|
return found;
|
||||||
}
|
}
|
||||||
|
@ -99,10 +99,10 @@ public:
|
|||||||
// construction/destruction
|
// construction/destruction
|
||||||
cli_frontend(cli_options &options, osd_interface &osd);
|
cli_frontend(cli_options &options, osd_interface &osd);
|
||||||
~cli_frontend();
|
~cli_frontend();
|
||||||
|
|
||||||
// execute based on the incoming argc/argv
|
// execute based on the incoming argc/argv
|
||||||
int execute(int argc, char **argv);
|
int execute(int argc, char **argv);
|
||||||
|
|
||||||
// direct access to the command operations
|
// direct access to the command operations
|
||||||
void listxml(const char *gamename = "*");
|
void listxml(const char *gamename = "*");
|
||||||
void listfull(const char *gamename = "*");
|
void listfull(const char *gamename = "*");
|
||||||
@ -145,7 +145,7 @@ public:
|
|||||||
int nonroms() const { return m_nonroms; }
|
int nonroms() const { return m_nonroms; }
|
||||||
|
|
||||||
// operations
|
// operations
|
||||||
void reset() { m_total = m_matches = m_nonroms = 0; }
|
void reset() { m_total = m_matches = m_nonroms = 0; }
|
||||||
void identify(const char *name);
|
void identify(const char *name);
|
||||||
void identify_file(const char *name);
|
void identify_file(const char *name);
|
||||||
void identify_data(const char *name, const UINT8 *data, int length);
|
void identify_data(const char *name, const UINT8 *data, int length);
|
||||||
|
@ -35,16 +35,16 @@ class upd96050_device;
|
|||||||
struct necdsp_interface
|
struct necdsp_interface
|
||||||
{
|
{
|
||||||
devcb_read_line m_in_int_func;
|
devcb_read_line m_in_int_func;
|
||||||
//devcb_read8 m_in_si_func;
|
//devcb_read8 m_in_si_func;
|
||||||
//devcb_read_line m_in_sck_func;
|
//devcb_read_line m_in_sck_func;
|
||||||
//devcb_read_line m_in_sien_func;
|
//devcb_read_line m_in_sien_func;
|
||||||
//devcb_read_line m_in_soen_func;
|
//devcb_read_line m_in_soen_func;
|
||||||
//devcb_read_line m_in_dack_func;
|
//devcb_read_line m_in_dack_func;
|
||||||
devcb_write_line m_out_p0_func;
|
devcb_write_line m_out_p0_func;
|
||||||
devcb_write_line m_out_p1_func;
|
devcb_write_line m_out_p1_func;
|
||||||
//devcb_write8 m_out_so_func;
|
//devcb_write8 m_out_so_func;
|
||||||
//devcb_write_line m_out_sorq_func;
|
//devcb_write_line m_out_sorq_func;
|
||||||
//devcb_write_line m_out_drq_func;
|
//devcb_write_line m_out_drq_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NECDSP_INTERFACE(name) \
|
#define NECDSP_INTERFACE(name) \
|
||||||
@ -222,16 +222,16 @@ private:
|
|||||||
protected:
|
protected:
|
||||||
// device callbacks
|
// device callbacks
|
||||||
devcb_resolved_read_line m_in_int_func;
|
devcb_resolved_read_line m_in_int_func;
|
||||||
//devcb_resolved_read8 m_in_si_func;
|
//devcb_resolved_read8 m_in_si_func;
|
||||||
//devcb_resolved_read_line m_in_sck_func;
|
//devcb_resolved_read_line m_in_sck_func;
|
||||||
//devcb_resolved_read_line m_in_sien_func;
|
//devcb_resolved_read_line m_in_sien_func;
|
||||||
//devcb_resolved_read_line m_in_soen_func;
|
//devcb_resolved_read_line m_in_soen_func;
|
||||||
//devcb_resolved_read_line m_in_dack_func;
|
//devcb_resolved_read_line m_in_dack_func;
|
||||||
devcb_resolved_write_line m_out_p0_func;
|
devcb_resolved_write_line m_out_p0_func;
|
||||||
devcb_resolved_write_line m_out_p1_func;
|
devcb_resolved_write_line m_out_p1_func;
|
||||||
//devcb_resolved_write8 m_out_so_func;
|
//devcb_resolved_write8 m_out_so_func;
|
||||||
//devcb_resolved_write_line m_out_sorq_func;
|
//devcb_resolved_write_line m_out_sorq_func;
|
||||||
//devcb_resolved_write_line m_out_drq_func;
|
//devcb_resolved_write_line m_out_drq_func;
|
||||||
|
|
||||||
const necdsp_device_config &m_config;
|
const necdsp_device_config &m_config;
|
||||||
};
|
};
|
||||||
|
@ -257,16 +257,16 @@ struct delegate_raw_mfp
|
|||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// comparison operator
|
// comparison operator
|
||||||
bool operator==(const delegate_raw_mfp &rhs) const
|
bool operator==(const delegate_raw_mfp &rhs) const
|
||||||
{
|
{
|
||||||
return (memcmp(&m_rawdata, &rhs.m_rawdata, sizeof(m_rawdata)) == 0);
|
return (memcmp(&m_rawdata, &rhs.m_rawdata, sizeof(m_rawdata)) == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// convert back to a member function pointer
|
// convert back to a member function pointer
|
||||||
template<class _FunctionType>
|
template<class _FunctionType>
|
||||||
_FunctionType &mfp() const { return *reinterpret_cast<_FunctionType *>(&m_rawdata); }
|
_FunctionType &mfp() const { return *reinterpret_cast<_FunctionType *>(&m_rawdata); }
|
||||||
|
|
||||||
// raw buffer to hold the copy of the function pointer
|
// raw buffer to hold the copy of the function pointer
|
||||||
mutable struct { UINT8 bytes[MAX_MFP_SIZE]; } m_rawdata;
|
mutable struct { UINT8 bytes[MAX_MFP_SIZE]; } m_rawdata;
|
||||||
};
|
};
|
||||||
@ -326,7 +326,7 @@ public:
|
|||||||
m_object(NULL),
|
m_object(NULL),
|
||||||
m_callobject(NULL),
|
m_callobject(NULL),
|
||||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
||||||
|
|
||||||
// construct from static reference function with object pointer
|
// construct from static reference function with object pointer
|
||||||
template<class _FunctionClass>
|
template<class _FunctionClass>
|
||||||
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
||||||
@ -335,7 +335,7 @@ public:
|
|||||||
m_object(NULL),
|
m_object(NULL),
|
||||||
m_callobject(NULL),
|
m_callobject(NULL),
|
||||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
||||||
|
|
||||||
// copy operator
|
// copy operator
|
||||||
delegate_base &operator=(const delegate_base &src)
|
delegate_base &operator=(const delegate_base &src)
|
||||||
{
|
{
|
||||||
@ -350,20 +350,20 @@ public:
|
|||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// comparison operator
|
// comparison operator
|
||||||
bool operator==(const delegate_base &rhs) const
|
bool operator==(const delegate_base &rhs) const
|
||||||
{
|
{
|
||||||
return (m_caster == rhs.m_caster && m_object == rhs.m_object &&
|
return (m_caster == rhs.m_caster && m_object == rhs.m_object &&
|
||||||
m_function == m_function && m_rawfunction == m_rawfunction);
|
m_function == m_function && m_rawfunction == m_rawfunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
bool isnull() const { return (m_caster == NULL); }
|
bool isnull() const { return (m_caster == NULL); }
|
||||||
bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); }
|
bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); }
|
||||||
bool has_object() const { return (m_object != NULL); }
|
bool has_object() const { return (m_object != NULL); }
|
||||||
const char *name() const { return m_name; }
|
const char *name() const { return m_name; }
|
||||||
|
|
||||||
// call the function
|
// call the function
|
||||||
_ReturnType operator()() const { return (*m_function)(m_callobject); }
|
_ReturnType operator()() const { return (*m_function)(m_callobject); }
|
||||||
_ReturnType operator()(_P1Type p1) const { return (*m_function)(m_callobject, p1); }
|
_ReturnType operator()(_P1Type p1) const { return (*m_function)(m_callobject, p1); }
|
||||||
@ -432,7 +432,7 @@ protected:
|
|||||||
deferred_cast_func m_caster; // pointer to helper function that does the cast
|
deferred_cast_func m_caster; // pointer to helper function that does the cast
|
||||||
const char * m_name; // name string
|
const char * m_name; // name string
|
||||||
generic_static_func m_function; // generic static function pointer
|
generic_static_func m_function; // generic static function pointer
|
||||||
delegate_raw_mfp m_rawfunction; // copy of raw MFP
|
delegate_raw_mfp m_rawfunction; // copy of raw MFP
|
||||||
delegate_generic_class * m_object; // pointer to the post-cast object
|
delegate_generic_class * m_object; // pointer to the post-cast object
|
||||||
delegate_generic_class * m_callobject; // pointer to the object used for calling
|
delegate_generic_class * m_callobject; // pointer to the object used for calling
|
||||||
};
|
};
|
||||||
@ -546,7 +546,7 @@ public:
|
|||||||
m_name(name),
|
m_name(name),
|
||||||
m_object(NULL),
|
m_object(NULL),
|
||||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
||||||
|
|
||||||
// construct from static reference function with object pointer
|
// construct from static reference function with object pointer
|
||||||
template<class _FunctionClass>
|
template<class _FunctionClass>
|
||||||
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
delegate_base(typename delegate_traits<_FunctionClass, _ReturnType, _P1Type, _P2Type, _P3Type, _P4Type>::static_ref_func_type funcptr, const char *name, _FunctionClass *object)
|
||||||
@ -554,7 +554,7 @@ public:
|
|||||||
m_name(name),
|
m_name(name),
|
||||||
m_object(NULL),
|
m_object(NULL),
|
||||||
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
m_function(reinterpret_cast<generic_static_func>(funcptr)) { bind(object); }
|
||||||
|
|
||||||
// copy operator
|
// copy operator
|
||||||
delegate_base &operator=(const delegate_base &src)
|
delegate_base &operator=(const delegate_base &src)
|
||||||
{
|
{
|
||||||
@ -568,20 +568,20 @@ public:
|
|||||||
}
|
}
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// comparison operator
|
// comparison operator
|
||||||
bool operator==(const delegate_base &rhs) const
|
bool operator==(const delegate_base &rhs) const
|
||||||
{
|
{
|
||||||
return (m_caster == rhs.m_caster && m_object == rhs.m_object &&
|
return (m_caster == rhs.m_caster && m_object == rhs.m_object &&
|
||||||
m_function == m_function && m_rawfunction == m_rawfunction);
|
m_function == m_function && m_rawfunction == m_rawfunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
bool isnull() const { return (m_caster == NULL); }
|
bool isnull() const { return (m_caster == NULL); }
|
||||||
bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); }
|
bool valid_target(bindable_object &object) const { return ((*m_caster)(object) != NULL); }
|
||||||
bool has_object() const { return (m_object != NULL); }
|
bool has_object() const { return (m_object != NULL); }
|
||||||
const char *name() const { return m_name; }
|
const char *name() const { return m_name; }
|
||||||
|
|
||||||
// call the function
|
// call the function
|
||||||
_ReturnType operator()() const { return (*m_function)(m_object); }
|
_ReturnType operator()() const { return (*m_function)(m_object); }
|
||||||
_ReturnType operator()(_P1Type p1) const { return (*m_function)(m_object, p1); }
|
_ReturnType operator()(_P1Type p1) const { return (*m_function)(m_object, p1); }
|
||||||
|
@ -69,7 +69,7 @@ int driver_list::find(const char *name)
|
|||||||
game_driver driver;
|
game_driver driver;
|
||||||
driver.name = name;
|
driver.name = name;
|
||||||
game_driver *driverptr = &driver;
|
game_driver *driverptr = &driver;
|
||||||
|
|
||||||
// binary search to find it
|
// binary search to find it
|
||||||
const game_driver **result = reinterpret_cast<const game_driver **>(bsearch(&driverptr, s_drivers_sorted, s_driver_count, sizeof(*s_drivers_sorted), driver_sort_callback));
|
const game_driver **result = reinterpret_cast<const game_driver **>(bsearch(&driverptr, s_drivers_sorted, s_driver_count, sizeof(*s_drivers_sorted), driver_sort_callback));
|
||||||
return (result == NULL) ? -1 : result - s_drivers_sorted;
|
return (result == NULL) ? -1 : result - s_drivers_sorted;
|
||||||
@ -227,7 +227,7 @@ int driver_enumerator::filter(const char *filterstring)
|
|||||||
{
|
{
|
||||||
// reset the count
|
// reset the count
|
||||||
exclude_all();
|
exclude_all();
|
||||||
|
|
||||||
// match name against each driver in the list
|
// match name against each driver in the list
|
||||||
for (int index = 0; index < s_driver_count; index++)
|
for (int index = 0; index < s_driver_count; index++)
|
||||||
if (matches(filterstring, s_drivers_sorted[index]->name))
|
if (matches(filterstring, s_drivers_sorted[index]->name))
|
||||||
@ -246,7 +246,7 @@ int driver_enumerator::filter(const game_driver &driver)
|
|||||||
{
|
{
|
||||||
// reset the count
|
// reset the count
|
||||||
exclude_all();
|
exclude_all();
|
||||||
|
|
||||||
// match name against each driver in the list
|
// match name against each driver in the list
|
||||||
for (int index = 0; index < s_driver_count; index++)
|
for (int index = 0; index < s_driver_count; index++)
|
||||||
if (s_drivers_sorted[index] == &driver)
|
if (s_drivers_sorted[index] == &driver)
|
||||||
@ -278,7 +278,7 @@ bool driver_enumerator::next()
|
|||||||
{
|
{
|
||||||
// always advance one
|
// always advance one
|
||||||
m_current++;
|
m_current++;
|
||||||
|
|
||||||
// if we have a filter, scan forward to the next match
|
// if we have a filter, scan forward to the next match
|
||||||
while (m_current < s_driver_count)
|
while (m_current < s_driver_count)
|
||||||
{
|
{
|
||||||
@ -301,7 +301,7 @@ bool driver_enumerator::next_excluded()
|
|||||||
{
|
{
|
||||||
// always advance one
|
// always advance one
|
||||||
m_current++;
|
m_current++;
|
||||||
|
|
||||||
// if we have a filter, scan forward to the next match
|
// if we have a filter, scan forward to the next match
|
||||||
while (m_current < s_driver_count)
|
while (m_current < s_driver_count)
|
||||||
{
|
{
|
||||||
|
@ -121,7 +121,7 @@ protected:
|
|||||||
public:
|
public:
|
||||||
// getters
|
// getters
|
||||||
static int total() { return s_driver_count; }
|
static int total() { return s_driver_count; }
|
||||||
|
|
||||||
// any item by index
|
// any item by index
|
||||||
static const game_driver &driver(int index) { assert(index >= 0 && index < s_driver_count); return *s_drivers_sorted[index]; }
|
static const game_driver &driver(int index) { assert(index >= 0 && index < s_driver_count); return *s_drivers_sorted[index]; }
|
||||||
static int clone(int index) { return find(driver(index).parent); }
|
static int clone(int index) { return find(driver(index).parent); }
|
||||||
@ -147,7 +147,7 @@ protected:
|
|||||||
|
|
||||||
// internal state
|
// internal state
|
||||||
static int s_driver_count;
|
static int s_driver_count;
|
||||||
static const game_driver * const s_drivers_sorted[];
|
static const game_driver * const s_drivers_sorted[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -162,12 +162,12 @@ public:
|
|||||||
driver_enumerator(emu_options &options, const char *filter);
|
driver_enumerator(emu_options &options, const char *filter);
|
||||||
driver_enumerator(emu_options &options, const game_driver &filter);
|
driver_enumerator(emu_options &options, const game_driver &filter);
|
||||||
~driver_enumerator();
|
~driver_enumerator();
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
int count() const { return m_filtered_count; }
|
int count() const { return m_filtered_count; }
|
||||||
int current() const { return m_current; }
|
int current() const { return m_current; }
|
||||||
emu_options &options() const { return m_options; }
|
emu_options &options() const { return m_options; }
|
||||||
|
|
||||||
// current item
|
// current item
|
||||||
const game_driver &driver() const { return driver_list::driver(m_current); }
|
const game_driver &driver() const { return driver_list::driver(m_current); }
|
||||||
machine_config &config() const { return config(m_current); }
|
machine_config &config() const { return config(m_current); }
|
||||||
|
@ -157,7 +157,7 @@ void *malloc_file_line(size_t size, const char *file, int line)
|
|||||||
|
|
||||||
|
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
// malloc_array_file_line - allocate memory with
|
// malloc_array_file_line - allocate memory with
|
||||||
// file and line number information, and a hint
|
// file and line number information, and a hint
|
||||||
// that this object is an array
|
// that this object is an array
|
||||||
//-------------------------------------------------
|
//-------------------------------------------------
|
||||||
|
@ -247,7 +247,7 @@ private:
|
|||||||
|
|
||||||
// ======================> simple_list_wrapper
|
// ======================> simple_list_wrapper
|
||||||
|
|
||||||
// a simple_list_wrapper wraps an existing object with a next pointer so it
|
// a simple_list_wrapper wraps an existing object with a next pointer so it
|
||||||
// can live in a simple_list without requiring the object to have a next
|
// can live in a simple_list without requiring the object to have a next
|
||||||
// pointer
|
// pointer
|
||||||
template<class T>
|
template<class T>
|
||||||
@ -258,13 +258,13 @@ public:
|
|||||||
simple_list_wrapper(T *object)
|
simple_list_wrapper(T *object)
|
||||||
: m_next(NULL),
|
: m_next(NULL),
|
||||||
m_object(object) { }
|
m_object(object) { }
|
||||||
|
|
||||||
// operators
|
// operators
|
||||||
operator T *() { return m_object; }
|
operator T *() { return m_object; }
|
||||||
operator T *() const { return m_object; }
|
operator T *() const { return m_object; }
|
||||||
T *operator *() { return m_object; }
|
T *operator *() { return m_object; }
|
||||||
T *operator *() const { return m_object; }
|
T *operator *() const { return m_object; }
|
||||||
|
|
||||||
// getters
|
// getters
|
||||||
simple_list_wrapper *next() const { return m_next; }
|
simple_list_wrapper *next() const { return m_next; }
|
||||||
T *object() const { return m_object; }
|
T *object() const { return m_object; }
|
||||||
|
@ -155,8 +155,8 @@ static int write_config(emu_options &options, const char *filename, const game_d
|
|||||||
|
|
||||||
static void image_options_extract(running_machine &machine)
|
static void image_options_extract(running_machine &machine)
|
||||||
{
|
{
|
||||||
/* only extract the device options if we've added them
|
/* only extract the device options if we've added them
|
||||||
no need to assert in case they are missing */
|
no need to assert in case they are missing */
|
||||||
{
|
{
|
||||||
int index = 0;
|
int index = 0;
|
||||||
device_image_interface *image = NULL;
|
device_image_interface *image = NULL;
|
||||||
|
@ -53,7 +53,7 @@ class info_xml_creator
|
|||||||
public:
|
public:
|
||||||
// construction/destruction
|
// construction/destruction
|
||||||
info_xml_creator(driver_enumerator &drivlist);
|
info_xml_creator(driver_enumerator &drivlist);
|
||||||
|
|
||||||
// output
|
// output
|
||||||
void output(FILE *out);
|
void output(FILE *out);
|
||||||
|
|
||||||
|
@ -944,12 +944,12 @@ driver_device_config_base::driver_device_config_base(const machine_config &mconf
|
|||||||
void driver_device_config_base::static_set_game(device_config *device, const game_driver *game)
|
void driver_device_config_base::static_set_game(device_config *device, const game_driver *game)
|
||||||
{
|
{
|
||||||
driver_device_config_base *base = downcast<driver_device_config_base *>(device);
|
driver_device_config_base *base = downcast<driver_device_config_base *>(device);
|
||||||
|
|
||||||
base->m_system = game;
|
base->m_system = game;
|
||||||
|
|
||||||
// set the short name to the game's name
|
// set the short name to the game's name
|
||||||
base->m_shortname = game->name;
|
base->m_shortname = game->name;
|
||||||
|
|
||||||
// and set the search path to include all parents
|
// and set the search path to include all parents
|
||||||
base->m_searchpath = game->name;
|
base->m_searchpath = game->name;
|
||||||
for (int parent = driver_list::clone(*game); parent != -1; parent = driver_list::clone(parent))
|
for (int parent = driver_list::clone(*game); parent != -1; parent = driver_list::clone(parent))
|
||||||
|
@ -116,7 +116,7 @@ protected:
|
|||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const device_timer_id TIMER_RX = 0;
|
static const device_timer_id TIMER_RX = 0;
|
||||||
static const device_timer_id TIMER_TX = 1;
|
static const device_timer_id TIMER_TX = 1;
|
||||||
@ -147,7 +147,7 @@ private:
|
|||||||
int m_dcd; // data carrier detect
|
int m_dcd; // data carrier detect
|
||||||
int m_sm_dtr; // sync match/data terminal ready
|
int m_sm_dtr; // sync match/data terminal ready
|
||||||
int m_tuf; // transmitter underflow
|
int m_tuf; // transmitter underflow
|
||||||
|
|
||||||
// timers
|
// timers
|
||||||
emu_timer *m_rx_timer;
|
emu_timer *m_rx_timer;
|
||||||
emu_timer *m_tx_timer;
|
emu_timer *m_tx_timer;
|
||||||
|
@ -41,7 +41,7 @@ struct pic8259_interface
|
|||||||
/* 1 - when master, 0 - when slave */
|
/* 1 - when master, 0 - when slave */
|
||||||
devcb_read_line sp_en_func;
|
devcb_read_line sp_en_func;
|
||||||
/* Called when on master slave irq is trigered*/
|
/* Called when on master slave irq is trigered*/
|
||||||
devcb_read8 read_slave_ack_func;
|
devcb_read8 read_slave_ack_func;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -145,7 +145,7 @@ protected:
|
|||||||
virtual void device_start();
|
virtual void device_start();
|
||||||
virtual void device_reset();
|
virtual void device_reset();
|
||||||
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
|
virtual void device_timer(emu_timer &timer, device_timer_id id, int m_param, void *ptr);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static const device_timer_id TIMER_RX_A = 0;
|
static const device_timer_id TIMER_RX_A = 0;
|
||||||
static const device_timer_id TIMER_TX_A = 1;
|
static const device_timer_id TIMER_TX_A = 1;
|
||||||
|
@ -64,7 +64,7 @@ enum
|
|||||||
"images is a violation of copyright law and should be promptly reported to the\n" \
|
"images is a violation of copyright law and should be promptly reported to the\n" \
|
||||||
"authors so that appropriate legal action can be taken.\n"
|
"authors so that appropriate legal action can be taken.\n"
|
||||||
#define USAGE "Usage: %s [%s] [options]"
|
#define USAGE "Usage: %s [%s] [options]"
|
||||||
#define XML_ROOT "mame"
|
#define XML_ROOT "mame"
|
||||||
#define XML_TOP "game"
|
#define XML_TOP "game"
|
||||||
#define STATE_MAGIC_NUM 'M', 'A', 'M', 'E', 'S', 'A', 'V', 'E'
|
#define STATE_MAGIC_NUM 'M', 'A', 'M', 'E', 'S', 'A', 'V', 'E'
|
||||||
#else
|
#else
|
||||||
@ -91,8 +91,8 @@ enum
|
|||||||
"with these files is a violation of copyright law and should be promptly\n" \
|
"with these files is a violation of copyright law and should be promptly\n" \
|
||||||
"reported to the authors so that appropriate legal action can be taken.\n"
|
"reported to the authors so that appropriate legal action can be taken.\n"
|
||||||
#define USAGE "Usage: %s [%s] [media] [software] [options]"
|
#define USAGE "Usage: %s [%s] [media] [software] [options]"
|
||||||
#define XML_ROOT "mess"
|
#define XML_ROOT "mess"
|
||||||
#define XML_TOP "machine"
|
#define XML_TOP "machine"
|
||||||
#define STATE_MAGIC_NUM 'M', 'E', 'S', 'S', 'S', 'A', 'V', 'E'
|
#define STATE_MAGIC_NUM 'M', 'E', 'S', 'S', 'S', 'A', 'V', 'E'
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -68,10 +68,10 @@ struct _parse_state
|
|||||||
{
|
{
|
||||||
XML_Parser parser;
|
XML_Parser parser;
|
||||||
int done;
|
int done;
|
||||||
|
|
||||||
void (*error_proc)(const char *message);
|
void (*error_proc)(const char *message);
|
||||||
void *param;
|
void *param;
|
||||||
|
|
||||||
enum softlist_parse_position pos;
|
enum softlist_parse_position pos;
|
||||||
char **text_dest;
|
char **text_dest;
|
||||||
};
|
};
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
uiswlist.c
|
uiswlist.c
|
||||||
|
|
||||||
Internal MAME user interface for software list.
|
Internal MAME user interface for software list.
|
||||||
|
|
||||||
Copyright Nicola Salmoria and the MAME Team.
|
Copyright Nicola Salmoria and the MAME Team.
|
||||||
Visit http://mamedev.org for licensing and usage restrictions.
|
Visit http://mamedev.org for licensing and usage restrictions.
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ typedef struct _software_entry_state software_entry_state;
|
|||||||
struct _software_entry_state
|
struct _software_entry_state
|
||||||
{
|
{
|
||||||
software_entry_state *next;
|
software_entry_state *next;
|
||||||
|
|
||||||
const char *short_name;
|
const char *short_name;
|
||||||
const char *long_name;
|
const char *long_name;
|
||||||
const char *interface;
|
const char *interface;
|
||||||
@ -64,11 +64,11 @@ struct _software_part_state
|
|||||||
static void ui_mess_menu_populate_software_parts(running_machine &machine, ui_menu *menu, const char *swlist, const char *swinfo, const char *interface)
|
static void ui_mess_menu_populate_software_parts(running_machine &machine, ui_menu *menu, const char *swlist, const char *swinfo, const char *interface)
|
||||||
{
|
{
|
||||||
software_list *list = software_list_open(machine.options(), swlist, FALSE, NULL);
|
software_list *list = software_list_open(machine.options(), swlist, FALSE, NULL);
|
||||||
|
|
||||||
if (list)
|
if (list)
|
||||||
{
|
{
|
||||||
software_info *info = software_list_find(list, swinfo, NULL);
|
software_info *info = software_list_find(list, swinfo, NULL);
|
||||||
|
|
||||||
if (info)
|
if (info)
|
||||||
{
|
{
|
||||||
for (software_part *swpart = software_find_part(info, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
|
for (software_part *swpart = software_find_part(info, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
|
||||||
@ -91,7 +91,7 @@ static void ui_mess_menu_populate_software_parts(running_machine &machine, ui_me
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
software_list_close(list);
|
software_list_close(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ void ui_mess_menu_software_parts(running_machine &machine, ui_menu *menu, void *
|
|||||||
const char *swlist = sw_state->list_name;
|
const char *swlist = sw_state->list_name;
|
||||||
const char *swinfo = sw_state->short_name;
|
const char *swinfo = sw_state->short_name;
|
||||||
const char *interface = sw_state->interface;
|
const char *interface = sw_state->interface;
|
||||||
|
|
||||||
// generate list of available parts
|
// generate list of available parts
|
||||||
if (!ui_menu_populated(menu))
|
if (!ui_menu_populated(menu))
|
||||||
{
|
{
|
||||||
@ -112,20 +112,20 @@ void ui_mess_menu_software_parts(running_machine &machine, ui_menu *menu, void *
|
|||||||
ui_mess_menu_populate_software_parts(machine, menu, swlist, swinfo, interface);
|
ui_mess_menu_populate_software_parts(machine, menu, swlist, swinfo, interface);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process the menu */
|
/* process the menu */
|
||||||
event = ui_menu_process(machine, menu, 0);
|
event = ui_menu_process(machine, menu, 0);
|
||||||
|
|
||||||
if (event != NULL && event->iptkey == IPT_UI_SELECT && event->itemref != NULL)
|
if (event != NULL && event->iptkey == IPT_UI_SELECT && event->itemref != NULL)
|
||||||
{
|
{
|
||||||
software_part_state *entry = (software_part_state *) event->itemref;
|
software_part_state *entry = (software_part_state *) event->itemref;
|
||||||
|
|
||||||
// build the name for the part to be loaded
|
// build the name for the part to be loaded
|
||||||
astring temp_name(sw_state->short_name);
|
astring temp_name(sw_state->short_name);
|
||||||
temp_name.cat(":");
|
temp_name.cat(":");
|
||||||
temp_name.cat(entry->part_name);
|
temp_name.cat(entry->part_name);
|
||||||
//printf("%s\n", temp_name.cstr());
|
//printf("%s\n", temp_name.cstr());
|
||||||
|
|
||||||
sw_state->image->load(temp_name.cstr());
|
sw_state->image->load(temp_name.cstr());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ static int compare_software_entries(const software_entry_state *e1, const softwa
|
|||||||
e1_basename = (e1->long_name != NULL) ? e1->long_name : "";
|
e1_basename = (e1->long_name != NULL) ? e1->long_name : "";
|
||||||
e2_basename = (e2->long_name != NULL) ? e2->long_name : "";
|
e2_basename = (e2->long_name != NULL) ? e2->long_name : "";
|
||||||
}
|
}
|
||||||
|
|
||||||
result = mame_stricmp(e1_basename, e2_basename);
|
result = mame_stricmp(e1_basename, e2_basename);
|
||||||
if (result == 0)
|
if (result == 0)
|
||||||
{
|
{
|
||||||
@ -159,7 +159,7 @@ static int compare_software_entries(const software_entry_state *e1, const softwa
|
|||||||
result = 1;
|
result = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ static software_entry_state *append_software_entry(ui_menu *menu, software_menu_
|
|||||||
software_entry_state *entry = NULL;
|
software_entry_state *entry = NULL;
|
||||||
software_entry_state **entryptr;
|
software_entry_state **entryptr;
|
||||||
const char *interface = image->image_config().image_interface();
|
const char *interface = image->image_config().image_interface();
|
||||||
|
|
||||||
// check if at least one of the parts has the correct interface and add a menu entry only in this case
|
// check if at least one of the parts has the correct interface and add a menu entry only in this case
|
||||||
for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
|
for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
|
||||||
{
|
{
|
||||||
@ -180,7 +180,7 @@ static software_entry_state *append_software_entry(ui_menu *menu, software_menu_
|
|||||||
// allocate a new entry
|
// allocate a new entry
|
||||||
entry = (software_entry_state *) ui_menu_pool_alloc(menu, sizeof(*entry));
|
entry = (software_entry_state *) ui_menu_pool_alloc(menu, sizeof(*entry));
|
||||||
memset(entry, 0, sizeof(*entry));
|
memset(entry, 0, sizeof(*entry));
|
||||||
|
|
||||||
entry->short_name = ui_menu_pool_strdup(menu, swinfo->shortname);
|
entry->short_name = ui_menu_pool_strdup(menu, swinfo->shortname);
|
||||||
entry->long_name = ui_menu_pool_strdup(menu, swinfo->longname);
|
entry->long_name = ui_menu_pool_strdup(menu, swinfo->longname);
|
||||||
entry->list_name = list_name;
|
entry->list_name = list_name;
|
||||||
@ -189,16 +189,16 @@ static software_entry_state *append_software_entry(ui_menu *menu, software_menu_
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// find the end of the list
|
// find the end of the list
|
||||||
entryptr = &menustate->entrylist;
|
entryptr = &menustate->entrylist;
|
||||||
while ((*entryptr != NULL) && (compare_software_entries(entry, *entryptr, menustate->ordered_by_shortname) >= 0))
|
while ((*entryptr != NULL) && (compare_software_entries(entry, *entryptr, menustate->ordered_by_shortname) >= 0))
|
||||||
entryptr = &(*entryptr)->next;
|
entryptr = &(*entryptr)->next;
|
||||||
|
|
||||||
// insert the entry
|
// insert the entry
|
||||||
entry->next = *entryptr;
|
entry->next = *entryptr;
|
||||||
*entryptr = entry;
|
*entryptr = entry;
|
||||||
|
|
||||||
return entry;
|
return entry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,16 +206,16 @@ static software_entry_state *append_software_entry(ui_menu *menu, software_menu_
|
|||||||
static void ui_mess_menu_populate_software_entries(running_machine &machine, ui_menu *menu, software_menu_state *menustate)
|
static void ui_mess_menu_populate_software_entries(running_machine &machine, ui_menu *menu, software_menu_state *menustate)
|
||||||
{
|
{
|
||||||
software_list *list = software_list_open(machine.options(), menustate->list_name, FALSE, NULL);
|
software_list *list = software_list_open(machine.options(), menustate->list_name, FALSE, NULL);
|
||||||
|
|
||||||
// build up the list of entries for the menu
|
// build up the list of entries for the menu
|
||||||
if (list)
|
if (list)
|
||||||
{
|
{
|
||||||
for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
|
for (software_info *swinfo = software_list_find(list, "*", NULL); swinfo != NULL; swinfo = software_list_find(list, "*", swinfo))
|
||||||
append_software_entry(menu, menustate, swinfo, menustate->list_name, menustate->image);
|
append_software_entry(menu, menustate, swinfo, menustate->list_name, menustate->image);
|
||||||
|
|
||||||
software_list_close(list);
|
software_list_close(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add an entry to change ordering
|
// add an entry to change ordering
|
||||||
ui_menu_item_append(menu, "Switch Item Ordering", NULL, 0, (void *)1);
|
ui_menu_item_append(menu, "Switch Item Ordering", NULL, 0, (void *)1);
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ static void ui_mess_menu_populate_software_entries(running_machine &machine, ui_
|
|||||||
bool swinfo_has_multiple_parts(software_info *swinfo, const char *interface)
|
bool swinfo_has_multiple_parts(software_info *swinfo, const char *interface)
|
||||||
{
|
{
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
|
for (software_part *swpart = software_find_part(swinfo, NULL, NULL); swpart != NULL; swpart = software_part_next(swpart))
|
||||||
{
|
{
|
||||||
if (strcmp(interface, swpart->interface_) == 0)
|
if (strcmp(interface, swpart->interface_) == 0)
|
||||||
@ -243,7 +243,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
const software_entry_state *entry;
|
const software_entry_state *entry;
|
||||||
const software_entry_state *selected_entry = NULL;
|
const software_entry_state *selected_entry = NULL;
|
||||||
int bestmatch = 0;
|
int bestmatch = 0;
|
||||||
|
|
||||||
if (!ui_menu_populated(menu) || sw_state->reorder)
|
if (!ui_menu_populated(menu) || sw_state->reorder)
|
||||||
{
|
{
|
||||||
sw_state->reorder = 0;
|
sw_state->reorder = 0;
|
||||||
@ -253,10 +253,10 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
ui_mess_menu_populate_software_entries(machine, menu, sw_state);
|
ui_mess_menu_populate_software_entries(machine, menu, sw_state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* process the menu */
|
/* process the menu */
|
||||||
event = ui_menu_process(machine, menu, 0);
|
event = ui_menu_process(machine, menu, 0);
|
||||||
|
|
||||||
if (event != NULL && event->itemref != NULL)
|
if (event != NULL && event->itemref != NULL)
|
||||||
{
|
{
|
||||||
if ((FPTR)event->itemref == 1 && event->iptkey == IPT_UI_SELECT)
|
if ((FPTR)event->itemref == 1 && event->iptkey == IPT_UI_SELECT)
|
||||||
@ -278,7 +278,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
software_entry_state *entry = (software_entry_state *) event->itemref;
|
software_entry_state *entry = (software_entry_state *) event->itemref;
|
||||||
software_list *tmp_list = software_list_open(machine.options(), sw_state->list_name, FALSE, NULL);
|
software_list *tmp_list = software_list_open(machine.options(), sw_state->list_name, FALSE, NULL);
|
||||||
software_info *tmp_info = software_list_find(tmp_list, entry->short_name, NULL);
|
software_info *tmp_info = software_list_find(tmp_list, entry->short_name, NULL);
|
||||||
|
|
||||||
// if the selected software has multiple parts that can be loaded, open the submenu
|
// if the selected software has multiple parts that can be loaded, open the submenu
|
||||||
if (swinfo_has_multiple_parts(tmp_info, image->image_config().image_interface()))
|
if (swinfo_has_multiple_parts(tmp_info, image->image_config().image_interface()))
|
||||||
{
|
{
|
||||||
@ -299,7 +299,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
popmessage("No matching device found for interface '%s'!", entry->interface);
|
popmessage("No matching device found for interface '%s'!", entry->interface);
|
||||||
}
|
}
|
||||||
software_list_close(tmp_list);
|
software_list_close(tmp_list);
|
||||||
|
|
||||||
// reset the char buffer when pressing IPT_UI_SELECT
|
// reset the char buffer when pressing IPT_UI_SELECT
|
||||||
if (sw_state->filename_buffer[0] != '\0')
|
if (sw_state->filename_buffer[0] != '\0')
|
||||||
memset(sw_state->filename_buffer, '\0', ARRAY_LENGTH(sw_state->filename_buffer));
|
memset(sw_state->filename_buffer, '\0', ARRAY_LENGTH(sw_state->filename_buffer));
|
||||||
@ -308,13 +308,13 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
{
|
{
|
||||||
int buflen = strlen(sw_state->filename_buffer);
|
int buflen = strlen(sw_state->filename_buffer);
|
||||||
bool update_selected = FALSE;
|
bool update_selected = FALSE;
|
||||||
|
|
||||||
/* if it's a backspace and we can handle it, do so */
|
/* if it's a backspace and we can handle it, do so */
|
||||||
if ((event->unichar == 8 || event->unichar == 0x7f) && buflen > 0)
|
if ((event->unichar == 8 || event->unichar == 0x7f) && buflen > 0)
|
||||||
{
|
{
|
||||||
*(char *)utf8_previous_char(&sw_state->filename_buffer[buflen]) = 0;
|
*(char *)utf8_previous_char(&sw_state->filename_buffer[buflen]) = 0;
|
||||||
update_selected = TRUE;
|
update_selected = TRUE;
|
||||||
|
|
||||||
if (ARRAY_LENGTH(sw_state->filename_buffer) > 0)
|
if (ARRAY_LENGTH(sw_state->filename_buffer) > 0)
|
||||||
ui_popup_time(ERROR_MESSAGE_TIME, "%s", sw_state->filename_buffer);
|
ui_popup_time(ERROR_MESSAGE_TIME, "%s", sw_state->filename_buffer);
|
||||||
}
|
}
|
||||||
@ -324,7 +324,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
buflen += utf8_from_uchar(&sw_state->filename_buffer[buflen], ARRAY_LENGTH(sw_state->filename_buffer) - buflen, event->unichar);
|
buflen += utf8_from_uchar(&sw_state->filename_buffer[buflen], ARRAY_LENGTH(sw_state->filename_buffer) - buflen, event->unichar);
|
||||||
sw_state->filename_buffer[buflen] = 0;
|
sw_state->filename_buffer[buflen] = 0;
|
||||||
update_selected = TRUE;
|
update_selected = TRUE;
|
||||||
|
|
||||||
if (ARRAY_LENGTH(sw_state->filename_buffer) > 0)
|
if (ARRAY_LENGTH(sw_state->filename_buffer) > 0)
|
||||||
ui_popup_time(ERROR_MESSAGE_TIME, "%s", sw_state->filename_buffer);
|
ui_popup_time(ERROR_MESSAGE_TIME, "%s", sw_state->filename_buffer);
|
||||||
}
|
}
|
||||||
@ -354,7 +354,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
if (mame_strnicmp(compare_name, sw_state->filename_buffer, i) == 0)
|
if (mame_strnicmp(compare_name, sw_state->filename_buffer, i) == 0)
|
||||||
match = i;
|
match = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match > bestmatch)
|
if (match > bestmatch)
|
||||||
{
|
{
|
||||||
bestmatch = match;
|
bestmatch = match;
|
||||||
@ -366,7 +366,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
for (entry = sw_state->entrylist; entry != cur_selected; entry = entry->next)
|
for (entry = sw_state->entrylist; entry != cur_selected; entry = entry->next)
|
||||||
{
|
{
|
||||||
const char *compare_name = sw_state->ordered_by_shortname ? entry->short_name : entry->long_name;
|
const char *compare_name = sw_state->ordered_by_shortname ? entry->short_name : entry->long_name;
|
||||||
|
|
||||||
if (compare_name != NULL && sw_state->filename_buffer != NULL)
|
if (compare_name != NULL && sw_state->filename_buffer != NULL)
|
||||||
{
|
{
|
||||||
int match = 0;
|
int match = 0;
|
||||||
@ -375,7 +375,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
if (mame_strnicmp(compare_name, sw_state->filename_buffer, i) == 0)
|
if (mame_strnicmp(compare_name, sw_state->filename_buffer, i) == 0)
|
||||||
match = i;
|
match = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (match > bestmatch)
|
if (match > bestmatch)
|
||||||
{
|
{
|
||||||
bestmatch = match;
|
bestmatch = match;
|
||||||
@ -383,7 +383,7 @@ void ui_mess_menu_software_list(running_machine &machine, ui_menu *menu, void *p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (selected_entry != NULL && selected_entry != cur_selected)
|
if (selected_entry != NULL && selected_entry != cur_selected)
|
||||||
ui_menu_set_selection(menu, (void *) selected_entry);
|
ui_menu_set_selection(menu, (void *) selected_entry);
|
||||||
}
|
}
|
||||||
@ -402,18 +402,18 @@ static void ui_mess_menu_populate_software_list(running_machine &machine, ui_men
|
|||||||
{
|
{
|
||||||
bool haveCompatible = FALSE;
|
bool haveCompatible = FALSE;
|
||||||
const char *interface = image->image_config().image_interface();
|
const char *interface = image->image_config().image_interface();
|
||||||
|
|
||||||
// Add original software lists for this system
|
// Add original software lists for this system
|
||||||
for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
|
for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
|
||||||
{
|
{
|
||||||
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
|
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
|
||||||
|
|
||||||
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
|
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
|
||||||
{
|
{
|
||||||
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM))
|
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_ORIGINAL_SYSTEM))
|
||||||
{
|
{
|
||||||
software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
|
software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
|
||||||
|
|
||||||
if (list)
|
if (list)
|
||||||
{
|
{
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
@ -427,24 +427,24 @@ static void ui_mess_menu_populate_software_list(running_machine &machine, ui_men
|
|||||||
if (found) {
|
if (found) {
|
||||||
ui_menu_item_append(menu, list->description, NULL, 0, swlist->list_name[i]);
|
ui_menu_item_append(menu, list->description, NULL, 0, swlist->list_name[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
software_list_close(list);
|
software_list_close(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add compatible software lists for this system
|
// Add compatible software lists for this system
|
||||||
for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
|
for (const device_config *dev = machine.config().m_devicelist.first(SOFTWARE_LIST); dev != NULL; dev = dev->typenext())
|
||||||
{
|
{
|
||||||
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
|
software_list_config *swlist = (software_list_config *)downcast<const legacy_device_config_base *>(dev)->inline_config();
|
||||||
|
|
||||||
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
|
for (int i = 0; i < DEVINFO_STR_SWLIST_MAX - DEVINFO_STR_SWLIST_0; i++)
|
||||||
{
|
{
|
||||||
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_COMPATIBLE_SYSTEM))
|
if (swlist->list_name[i] && (swlist->list_type == SOFTWARE_LIST_COMPATIBLE_SYSTEM))
|
||||||
{
|
{
|
||||||
software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
|
software_list *list = software_list_open(machine.options(), swlist->list_name[i], FALSE, NULL);
|
||||||
|
|
||||||
if (list)
|
if (list)
|
||||||
{
|
{
|
||||||
bool found = FALSE;
|
bool found = FALSE;
|
||||||
@ -461,14 +461,14 @@ static void ui_mess_menu_populate_software_list(running_machine &machine, ui_men
|
|||||||
}
|
}
|
||||||
ui_menu_item_append(menu, list->description, NULL, 0, swlist->list_name[i]);
|
ui_menu_item_append(menu, list->description, NULL, 0, swlist->list_name[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
haveCompatible = TRUE;
|
haveCompatible = TRUE;
|
||||||
software_list_close(list);
|
software_list_close(list);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *parameter, void *state)
|
void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *parameter, void *state)
|
||||||
@ -477,10 +477,10 @@ void ui_image_menu_software(running_machine &machine, ui_menu *menu, void *param
|
|||||||
device_image_interface* image = (device_image_interface*)parameter;
|
device_image_interface* image = (device_image_interface*)parameter;
|
||||||
if (!ui_menu_populated(menu))
|
if (!ui_menu_populated(menu))
|
||||||
ui_mess_menu_populate_software_list(machine, menu, image);
|
ui_mess_menu_populate_software_list(machine, menu, image);
|
||||||
|
|
||||||
/* process the menu */
|
/* process the menu */
|
||||||
event = ui_menu_process(machine, menu, 0);
|
event = ui_menu_process(machine, menu, 0);
|
||||||
|
|
||||||
if (event != NULL && event->iptkey == IPT_UI_SELECT)
|
if (event != NULL && event->iptkey == IPT_UI_SELECT)
|
||||||
{
|
{
|
||||||
ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_list, NULL);
|
ui_menu *child_menu = ui_menu_alloc(machine, &machine.render().ui_container(), ui_mess_menu_software_list, NULL);
|
||||||
|
@ -92,7 +92,7 @@ protected:
|
|||||||
inline UINT8 readbyte(offs_t address);
|
inline UINT8 readbyte(offs_t address);
|
||||||
inline void writebyte(offs_t address, UINT8 m_data);
|
inline void writebyte(offs_t address, UINT8 m_data);
|
||||||
inline void increment_csr();
|
inline void increment_csr();
|
||||||
|
|
||||||
void draw_text_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va);
|
void draw_text_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va);
|
||||||
void draw_graphics_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va);
|
void draw_graphics_scanline(bitmap_t *bitmap, const rectangle *cliprect, int y, UINT16 va);
|
||||||
void update_graphics(bitmap_t *bitmap, const rectangle *cliprect);
|
void update_graphics(bitmap_t *bitmap, const rectangle *cliprect);
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
MCFG_DEVICE_ADD(_tag, UPD3301, _clock) \
|
MCFG_DEVICE_ADD(_tag, UPD3301, _clock) \
|
||||||
MCFG_DEVICE_CONFIG(_intrf)
|
MCFG_DEVICE_CONFIG(_intrf)
|
||||||
|
|
||||||
|
|
||||||
#define UPD3301_INTERFACE(name) \
|
#define UPD3301_INTERFACE(name) \
|
||||||
const upd3301_interface (name) =
|
const upd3301_interface (name) =
|
||||||
|
|
||||||
@ -147,9 +147,9 @@ private:
|
|||||||
inline void update_hrtc_timer(int state);
|
inline void update_hrtc_timer(int state);
|
||||||
inline void update_vrtc_timer(int state);
|
inline void update_vrtc_timer(int state);
|
||||||
inline void recompute_parameters();
|
inline void recompute_parameters();
|
||||||
|
|
||||||
void draw_scanline();
|
void draw_scanline();
|
||||||
|
|
||||||
devcb_resolved_write_line m_out_int_func;
|
devcb_resolved_write_line m_out_int_func;
|
||||||
devcb_resolved_write_line m_out_drq_func;
|
devcb_resolved_write_line m_out_drq_func;
|
||||||
devcb_resolved_write_line m_out_hrtc_func;
|
devcb_resolved_write_line m_out_hrtc_func;
|
||||||
@ -191,9 +191,9 @@ private:
|
|||||||
int m_z; // horizontal blanking width
|
int m_z; // horizontal blanking width
|
||||||
|
|
||||||
// attributes
|
// attributes
|
||||||
int m_at1; //
|
int m_at1; //
|
||||||
int m_at0; //
|
int m_at0; //
|
||||||
int m_sc; //
|
int m_sc; //
|
||||||
int m_attr; // attributes per row
|
int m_attr; // attributes per row
|
||||||
int m_attr_blink; // attribute blink
|
int m_attr_blink; // attribute blink
|
||||||
int m_attr_frame; // attribute blink frame counter
|
int m_attr_frame; // attribute blink frame counter
|
||||||
|
@ -11,7 +11,7 @@ public:
|
|||||||
: driver_device(machine, config) { }
|
: driver_device(machine, config) { }
|
||||||
|
|
||||||
/* memory pointers */
|
/* memory pointers */
|
||||||
UINT8 m_videoram[0x1000];
|
UINT8 m_videoram[0x1000];
|
||||||
UINT8 m_workram[0x1000];
|
UINT8 m_workram[0x1000];
|
||||||
|
|
||||||
/* video-related */
|
/* video-related */
|
||||||
|
@ -48,7 +48,7 @@ public:
|
|||||||
|
|
||||||
UINT16 *m_videoram;
|
UINT16 *m_videoram;
|
||||||
UINT16 *m_spriteram;
|
UINT16 *m_spriteram;
|
||||||
// size_t m_spriteram_size;
|
// size_t m_spriteram_size;
|
||||||
UINT32 m_coin_word[2];
|
UINT32 m_coin_word[2];
|
||||||
UINT32 *m_f3_ram;
|
UINT32 *m_f3_ram;
|
||||||
int m_f3_game;
|
int m_f3_game;
|
||||||
|
@ -742,7 +742,7 @@ void *osd_malloc(size_t size);
|
|||||||
|
|
||||||
|
|
||||||
/*-----------------------------------------------------------------------------
|
/*-----------------------------------------------------------------------------
|
||||||
osd_malloc_array: allocate memory, hinting tha this memory contains an
|
osd_malloc_array: allocate memory, hinting tha this memory contains an
|
||||||
array
|
array
|
||||||
|
|
||||||
Parameters:
|
Parameters:
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
#ifndef APIENTRY
|
#ifndef APIENTRY
|
||||||
#define APIENTRY
|
#define APIENTRY
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "GL/gl.h"
|
#include "GL/gl.h"
|
||||||
#include "GL/glext.h"
|
#include "GL/glext.h"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user