This is the original code from mame2003 function looking at this code it could be our vector issues as well the game kick isint drawing properly either. Im going to wait till youve finished what you are doing then we can start some work on this and hopefully get the vectors working again. As you can see form looking at the code we need to update the avinfo
int cli_frontend_init (int argc, char **argv)
{
struct InternalMachineDriver drv;
char buffer[128];
char *cmd_name;
int game_index;
int i;
gamename = NULL;
game_index = -1;
/* clear all core options */
memset(&options,0,sizeof(options));
/* create the rc object */
rc = cli_rc_create();
if (!rc)
{
fprintf (stderr, "error on rc creation\n");
exit(1);
}
/* parse the commandline */
if (rc_parse_commandline(rc, argc, argv, 2, config_handle_arg))
{
fprintf (stderr, "error while parsing cmdline\n");
exit(1);
}
/* determine global configfile name */
cmd_name = win_strip_extension(win_basename(argv[0]));
if (!cmd_name)
{
fprintf (stderr, "who am I? cannot determine the name I was called with\n");
exit(1);
}
sprintf (buffer, "%s.ini", cmd_name);
/* parse mame.ini/mess.ini even if called with another name */
#ifdef MESS
if (strcmp(cmd_name, "mess") != 0)
{
if (parse_config ("mess.ini", NULL))
exit(1);
}
#else
if (strcmp(cmd_name, "mame") != 0)
{
if (parse_config ("mame.ini", NULL))
exit(1);
}
#endif
/* parse cmd_name.ini */
if (parse_config (buffer, NULL))
exit(1);
#ifdef MAME_DEBUG
if (parse_config( "debug.ini", NULL))
exit(1);
#endif
/* if requested, write out cmd_name.ini (normally "mame.ini") */
if (createconfig)
{
rc_save(rc, buffer, 0);
exit(0);
}
if (showconfig)
{
sprintf (buffer, " %s running parameters", cmd_name);
rc_write(rc, stdout, buffer);
exit(0);
}
if (showusage)
{
fprintf(stdout, "Usage: %s [" GAMENOUN "] [options]\n" "Options:\n", cmd_name);
/* actual help message */
rc_print_help(rc, stdout);
exit(0);
}
/* no longer needed */
free(cmd_name);
/* handle playback */
if (playbackname != NULL)
{
options.playback = mame_fopen(playbackname,0,FILETYPE_INPUTLOG,0);
if (!options.playback)
{
fprintf(stderr, "failed to open %s for playback\n", playbackname);
exit(1);
}
}
/* check for game name embedded in .inp header */
if (options.playback)
{
INP_HEADER inp_header;
/* read playback header */
mame_fread(options.playback, &inp_header, sizeof(INP_HEADER));
if (!isalnum(inp_header.name[0])) /* If first byte is not alpha-numeric */
mame_fseek(options.playback, 0, SEEK_SET); /* old .inp file - no header */
else
{
for (i = 0; (drivers[i] != 0); i++) /* find game and play it */
{
if (strcmp(drivers[i]->name, inp_header.name) == 0)
{
game_index = i;
gamename = (char *)drivers[i]->name;
printf("Playing back previously recorded " GAMENOUN " %s (%s) [press return]\n",
drivers[game_index]->name,drivers[game_index]->description);
getchar();
break;
}
}
}
}
/* check for frontend options, horrible 1234 hack */
if (frontend_help(gamename) != 1234)
exit(0);
gamename = win_basename(gamename);
gamename = win_strip_extension(gamename);
/* if not given by .inp file yet */
if (game_index == -1)
{
/* do we have a driver for this? */
for (i = 0; drivers[i]; i++)
if (stricmp(gamename,drivers[i]->name) == 0)
{
game_index = i;
break;
}
}
#ifdef MAME_DEBUG
if (game_index == -1)
{
/* pick a random game */
if (strcmp(gamename,"random") == 0)
{
i = 0;
while (drivers[i]) i++; /* count available drivers */
srand(time(0));
/* call rand() once to get away from the seed */
rand();
game_index = rand() % i;
fprintf(stderr, "running %s (%s) [press return]",drivers[game_index]->name,drivers[game_index]->description);
getchar();
}
}
#endif
/* we give up. print a few approximate matches */
if (game_index == -1)
{
fprintf(stderr, "\n\"%s\" approximately matches the following\n"
"supported " GAMESNOUN " (best match first):\n\n", gamename);
show_approx_matches();
exit(1);
}
/* ok, got a gamename */
/* if this is a vector game, parse vector.ini first */
expand_machine_driver(drivers[game_index]->drv, &drv);
if (drv.video_attributes & VIDEO_TYPE_VECTOR)
if (parse_config ("vector.ini", NULL))
exit(1);
/* nice hack: load source_file.ini (omit if referenced later any) */
{
const struct GameDriver *tmp_gd;
sprintf(buffer, "%s", drivers[game_index]->source_file+12);
buffer[strlen(buffer) - 2] = 0;
tmp_gd = drivers[game_index];
while (tmp_gd != NULL)
{
if (strcmp(tmp_gd->name, buffer) == 0) break;
tmp_gd = tmp_gd->clone_of;
}
if (tmp_gd == NULL)
/* not referenced later, so load it here */
{
strcat(buffer, ".ini");
if (parse_config (buffer, NULL))
exit(1);
}
}
/* now load gamename.ini */
/* this possibly checks for clonename.ini recursively! */
if (parse_config (NULL, drivers[game_index]))
exit(1);
/* handle record option */
if (recordname)
{
options.record = mame_fopen(recordname,0,FILETYPE_INPUTLOG,1);
if (!options.record)
{
fprintf(stderr, "failed to open %s for recording\n", recordname);
exit(1);
}
}
if (options.record)
{
INP_HEADER inp_header;
memset(&inp_header, '\0', sizeof(INP_HEADER));
strcpy(inp_header.name, drivers[game_index]->name);
/* MAME32 stores the MAME version numbers at bytes 9 - 11
* MAME DOS keeps this information in a string, the
* Windows code defines them in the Makefile.
*/
/*
inp_header.version[0] = 0;
inp_header.version[1] = VERSION;
inp_header.version[2] = BETA_VERSION;
*/
mame_fwrite(options.record, &inp_header, sizeof(INP_HEADER));
}
/* need a decent default for debug width/height */
if (options.debug_width == 0)
options.debug_width = 640;
if (options.debug_height == 0)
options.debug_height = 480;
options.debug_depth = 8;
/* no sound is indicated by a 0 samplerate */
if (!enable_sound)
options.samplerate = 0;
/* set the artwork options */
options.use_artwork = ARTWORK_USE_ALL;
if (use_backdrops == 0)
options.use_artwork &= ~ARTWORK_USE_BACKDROPS;
if (use_overlays == 0)
options.use_artwork &= ~ARTWORK_USE_OVERLAYS;
if (use_bezels == 0)
options.use_artwork &= ~ARTWORK_USE_BEZELS;
if (!use_artwork)
options.use_artwork = ARTWORK_USE_NONE;
{
/* first start with the game's built in orientation */
int orientation = drivers[game_index]->flags & ORIENTATION_MASK;
options.ui_orientation = orientation;
if (options.ui_orientation & ORIENTATION_SWAP_XY)
{
/* if only one of the components is inverted, switch them */
if ((options.ui_orientation & ROT180) == ORIENTATION_FLIP_X ||
(options.ui_orientation & ROT180) == ORIENTATION_FLIP_Y)
options.ui_orientation ^= ROT180;
}
/* override if no rotation requested */
if (video_norotate)
orientation = options.ui_orientation = ROT0;
/* rotate right */
if (video_ror)
{
/* if only one of the components is inverted, switch them */
if ((orientation & ROT180) == ORIENTATION_FLIP_X ||
(orientation & ROT180) == ORIENTATION_FLIP_Y)
orientation ^= ROT180;
orientation ^= ROT90;
}
/* rotate left */
if (video_rol)
{
/* if only one of the components is inverted, switch them */
if ((orientation & ROT180) == ORIENTATION_FLIP_X ||
(orientation & ROT180) == ORIENTATION_FLIP_Y)
orientation ^= ROT180;
orientation ^= ROT270;
}
/* auto-rotate right (e.g. for rotating lcds), based on original orientation */
if (video_autoror && (drivers[game_index]->flags & ORIENTATION_SWAP_XY) )
{
/* if only one of the components is inverted, switch them */
if ((orientation & ROT180) == ORIENTATION_FLIP_X ||
(orientation & ROT180) == ORIENTATION_FLIP_Y)
orientation ^= ROT180;
orientation ^= ROT90;
}
/* auto-rotate left (e.g. for rotating lcds), based on original orientation */
if (video_autorol && (drivers[game_index]->flags & ORIENTATION_SWAP_XY) )
{
/* if only one of the components is inverted, switch them */
if ((orientation & ROT180) == ORIENTATION_FLIP_X ||
(orientation & ROT180) == ORIENTATION_FLIP_Y)
orientation ^= ROT180;
orientation ^= ROT270;
}
/* flip X/Y */
if (video_flipx)
orientation ^= ORIENTATION_FLIP_X;
if (video_flipy)
orientation ^= ORIENTATION_FLIP_Y;
blit_flipx = ((orientation & ORIENTATION_FLIP_X) != 0);
blit_flipy = ((orientation & ORIENTATION_FLIP_Y) != 0);
blit_swapxy = ((orientation & ORIENTATION_SWAP_XY) != 0);
if( options.vector_width == 0 && options.vector_height == 0 )
{
options.vector_width = 640;
options.vector_height = 480;
}
if( blit_swapxy )
{
int temp;
temp = options.vector_width;
options.vector_width = options.vector_height;
options.vector_height = temp;
}
}
return game_index;
}