// ----------------------------------------------------------------------------
// main.c
// ============================================================================
// ----------------------------------------------------------------------------
// main.c
// ============================================================================
short Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short Last[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
int TimeFrames, TimePlayed, TimeLeft, TapeTime;
int TimeFrames, TimePlayed, TimeLeft, TapeTime;
struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
struct HiScore highscore[MAX_SCORE_ENTRIES];
struct TapeInfo tape;
struct PlayerInfo stored_player[MAX_PLAYERS], *local_player = NULL;
struct HiScore highscore[MAX_SCORE_ENTRIES];
struct TapeInfo tape;
// --------------------------------------------------------------------------
// "real" (and therefore drawable) runtime elements
// --------------------------------------------------------------------------
// "real" (and therefore drawable) runtime elements
{ ".TOONS", GFX_SPECIAL_ARG_TOONS, },
{ ".SCORESOLD", GFX_SPECIAL_ARG_SCORESOLD, },
{ ".SCORESNEW", GFX_SPECIAL_ARG_SCORESNEW, },
{ ".TOONS", GFX_SPECIAL_ARG_TOONS, },
{ ".SCORESOLD", GFX_SPECIAL_ARG_SCORESOLD, },
{ ".SCORESNEW", GFX_SPECIAL_ARG_SCORESNEW, },
{ ".FADING", GFX_SPECIAL_ARG_FADING, },
{ ".QUIT", GFX_SPECIAL_ARG_QUIT, },
{ ".FADING", GFX_SPECIAL_ARG_FADING, },
{ ".QUIT", GFX_SPECIAL_ARG_QUIT, },
// ----------------------------------------------------------------------------
// music token prefix definitions
// ----------------------------------------------------------------------------
// music token prefix definitions
" --serveronly only start network server\n"
" -v, --verbose verbose mode\n"
" -V, --version show program version\n"
" --serveronly only start network server\n"
" -v, --verbose verbose mode\n"
" -V, --version show program version\n"
" -e, --execute COMMAND execute batch COMMAND\n"
"\n"
"Valid commands for '--execute' option:\n"
" -e, --execute COMMAND execute batch COMMAND\n"
"\n"
"Valid commands for '--execute' option:\n"
" \"print helptext.conf\" print default helptext config\n"
" \"dump level FILE\" dump level data from FILE\n"
" \"dump tape FILE\" dump tape data from FILE\n"
" \"print helptext.conf\" print default helptext config\n"
" \"dump level FILE\" dump level data from FILE\n"
" \"dump tape FILE\" dump tape data from FILE\n"
" \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
" \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n"
" \"autowarp LEVELDIR [NR ...]\" warp level tapes for LEVELDIR\n"
" \"autoplay LEVELDIR [NR ...]\" play level tapes for LEVELDIR\n"
" \"autoffwd LEVELDIR [NR ...]\" ffwd level tapes for LEVELDIR\n"
" \"autowarp LEVELDIR [NR ...]\" warp level tapes for LEVELDIR\n"
" \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
" \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
" \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
" \"convert LEVELDIR [NR]\" convert levels in LEVELDIR\n"
" \"create images DIRECTORY\" write BMP images to DIRECTORY\n"
" \"create CE image DIRECTORY\" write BMP image to DIRECTORY\n"
char *config_filename = getProgramConfigFilename(command_filename);
char *userdata_basename = getBaseNameNoSuffix(command_filename);
char *userdata_subdir;
char *config_filename = getProgramConfigFilename(command_filename);
char *userdata_basename = getBaseNameNoSuffix(command_filename);
char *userdata_subdir;
// read default program config, if existing
if (fileExists(config_filename))
// read default program config, if existing
if (fileExists(config_filename))
// set user data directory for Linux/Unix (but not Mac OS X)
userdata_subdir_unix = getStringCat2(".", userdata_basename);
// set user data directory for Linux/Unix (but not Mac OS X)
userdata_subdir_unix = getStringCat2(".", userdata_basename);
// set program title from potentially redefined program title
if (setup.internal.program_title != NULL &&
// set program title from potentially redefined program title
if (setup.internal.program_title != NULL &&