(From Chad)

Allows 64 bit mame compiles to read 32 bit inps, and also make 64 
bit mame compiles make 32 bit compatible inps.
This commit is contained in:
Aaron Giles 2008-01-11 06:38:33 +00:00
parent 0d47d37458
commit f8f4dad549
2 changed files with 31 additions and 13 deletions

View File

@ -231,7 +231,7 @@ struct ext_header
char header[7]; // must be "XINP" followed by NULLs
char shortname[9]; // game shortname
char version[32]; // MAME version string
long starttime; // approximate INP start time
UINT32 starttime; // approximate INP start time
char dummy[32]; // for possible future expansion
};
@ -1157,7 +1157,7 @@ static void setup_playback(running_machine *machine)
const char *filename = options_get_string(mame_options(), OPTION_PLAYBACK);
inp_header inpheader;
file_error filerr;
time_t started_time;
struct ext_header xheader;
char check[7];
@ -1204,7 +1204,8 @@ static void setup_playback(running_machine *machine)
// output info to console
mame_printf_info("Version string: %s\n",xheader.version);
mame_printf_info("Start time: %s\n", ctime((const time_t *)&xheader.starttime));
started_time = (time_t)xheader.starttime;
mame_printf_info("Start time: %s\n", ctime(&started_time));
// verify header against current game
if (strcmp(machine->gamedrv->name, xheader.shortname) != 0)
@ -3009,9 +3010,9 @@ profiler_mark(PROFILER_INPUT);
/* store speed read from INP file, if extended INP */
if (Machine->playback_file != NULL && !no_extended_inp)
{
long dummy;
mame_fread(Machine->playback_file,&rec_speed,sizeof(double));
mame_fread(Machine->playback_file,&dummy,sizeof(long));
UINT32 dummy;
mame_fread(Machine->playback_file, &rec_speed, sizeof(rec_speed));
mame_fread(Machine->playback_file, &dummy, sizeof(dummy));
framecount++;
rec_speed *= 100;
totalspeed += rec_speed;

View File

@ -302,6 +302,9 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
list_entry *curlist;
osd_directory *dir;
int found = 0;
int colheight;
int colcount;
int colnum;
/* open the directory and iterate through it */
dir = osd_opendir(astring_c(srcdir));
@ -337,6 +340,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
/* sort the list */
qsort(listarray, found, sizeof(listarray[0]), compare_list_entries);
colheight = (found + 3) / 4;
/* rebuild the list */
list = NULL;
@ -346,15 +350,16 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
list = listarray[found];
}
/* add a header */
if (list != NULL)
core_fprintf(indexfile, "\t<h2>%s</h2>\n\t<div align=\"center\"><table border=\"0\" width=\"90%%\"><tr><td width=\"25%%\">\n", (entry_type == ENTTYPE_DIR) ? "Directories" : "Files");
/* iterate through each file */
colcount = colnum = 0;
for (curlist = list; curlist != NULL && result == 0; curlist = curlist->next)
{
astring *srcfile, *dstfile;
/* add a header */
if (curlist == list)
core_fprintf(indexfile, "\t<h2>%s</h2>\n\t<ul>\n", (entry_type == ENTTYPE_DIR) ? "Directories" : "Files");
/* build the source filename */
srcfile = astring_alloc();
astring_printf(srcfile, "%s%c%s", astring_c(srcdir), PATH_SEPARATOR[0], astring_c(curlist->name));
@ -379,7 +384,7 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
{
astring_printf(dstfile, "%s%c%s.html", astring_c(dstdir), PATH_SEPARATOR[0], astring_c(curlist->name));
if (indexfile != NULL)
core_fprintf(indexfile, "\t<li><a href=\"%s.html\">%s</a></li>\n", astring_c(curlist->name), astring_c(curlist->name));
core_fprintf(indexfile, "\t\t<a href=\"%s.html\">%s</a><br />\n", astring_c(curlist->name), astring_c(curlist->name));
result = output_file(type, srcrootlen, dstrootlen, srcfile, dstfile);
}
}
@ -389,9 +394,17 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
{
astring_printf(dstfile, "%s%c%s", astring_c(dstdir), PATH_SEPARATOR[0], astring_c(curlist->name));
if (indexfile != NULL)
core_fprintf(indexfile, "\t<li><a href=\"%s/index.html\">%s/</a></li>\n", astring_c(curlist->name), astring_c(curlist->name));
core_fprintf(indexfile, "\t\t<a href=\"%s/index.html\">%s/</a><br />\n", astring_c(curlist->name), astring_c(curlist->name));
result = recurse_dir(srcrootlen, dstrootlen, srcfile, dstfile);
}
/* move to the next column if we got them all */
if (++colcount >= colheight)
{
core_fprintf(indexfile, "\t</td><td width=\"25%%\">\n");
colcount = 0;
colnum++;
}
/* free memory for the names */
astring_free(srcfile);
@ -400,7 +413,11 @@ static int recurse_dir(int srcrootlen, int dstrootlen, const astring *srcdir, co
/* close the list if we found some stuff */
if (list != NULL)
core_fprintf(indexfile, "\t</ul>\n");
{
while (colnum++ < 3)
core_fprintf(indexfile, "\t</td><td width=\"25%%\">\n");
core_fprintf(indexfile, "\t</td></tr></table></div>\n");
}
/* free all the allocated entries */
while (list != NULL)