summaryrefslogtreecommitdiffstatshomepage
path: root/src
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2008-01-11 06:38:33 +0000
committer Aaron Giles <aaron@aarongiles.com>2008-01-11 06:38:33 +0000
commitf8f4dad549c027d25d5e14fad00db48542ec60bf (patch)
treed5c985b104c13a1e148f074610b4554f5a22045e /src
parent0d47d3745800bb7e6e71e650a5c666619108a0d3 (diff)
(From Chad)
Allows 64 bit mame compiles to read 32 bit inps, and also make 64 bit mame compiles make 32 bit compatible inps.
Diffstat (limited to 'src')
-rw-r--r--src/emu/inptport.c13
-rw-r--r--src/tools/src2html.c31
2 files changed, 31 insertions, 13 deletions
diff --git a/src/emu/inptport.c b/src/emu/inptport.c
index 02462eaa16f..cddb7f43e3a 100644
--- a/src/emu/inptport.c
+++ b/src/emu/inptport.c
@@ -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;
diff --git a/src/tools/src2html.c b/src/tools/src2html.c
index ea23017bc1b..54dafe17eaf 100644
--- a/src/tools/src2html.c
+++ b/src/tools/src2html.c
@@ -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)