2020-09-05 20:12:14 +02:00
|
|
|
#include "DRIVER2.H"
|
2020-03-27 21:47:29 +01:00
|
|
|
#include "PAUSE.H"
|
2020-04-11 23:02:26 +02:00
|
|
|
#include "SYSTEM.H"
|
|
|
|
#include "MISSION.H"
|
|
|
|
#include "OVERLAY.H"
|
|
|
|
#include "PRES.H"
|
|
|
|
#include "PAD.H"
|
|
|
|
#include "MAIN.H"
|
|
|
|
#include "GLAUNCH.H"
|
|
|
|
#include "SCORES.H"
|
2020-04-12 15:26:17 +02:00
|
|
|
#include "SOUND.H"
|
2020-04-12 23:30:03 +02:00
|
|
|
#include "CUTSCENE.H"
|
2020-05-27 18:02:16 +02:00
|
|
|
#include "REPLAYS.H"
|
2020-05-30 11:53:05 +02:00
|
|
|
#include "OVERMAP.H"
|
2020-08-22 08:46:41 +02:00
|
|
|
#include "HANDLING.H"
|
2020-08-28 21:42:42 +02:00
|
|
|
#include "../MEMCARD/MAIN.H"
|
|
|
|
|
|
|
|
#include "STRINGS.H"
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-04-26 12:17:24 +02:00
|
|
|
static int gScoreEntered = 0;
|
|
|
|
static char EnterNameText[32] = { 0 };
|
|
|
|
static int PauseReturnValue;
|
|
|
|
int pauseflag = 0;
|
|
|
|
int gShowMap = 0;
|
|
|
|
int gDrawPauseMenus = 0;
|
|
|
|
int gEnteringScore = 0;
|
|
|
|
static int gScorePosition = 0;
|
|
|
|
static int allownameentry = 0;
|
|
|
|
|
|
|
|
static MENU_ITEM* ActiveItem[3];
|
2020-10-31 01:11:58 +01:00
|
|
|
static MENU_HEADER* ActiveMenu;
|
2020-04-26 12:17:24 +02:00
|
|
|
static int ActiveMenuItem;
|
|
|
|
static int VisibleMenu;
|
|
|
|
static MENU_HEADER* VisibleMenus[3];
|
|
|
|
static char SfxVolumeText[8];
|
|
|
|
static char MusicVolumeText[8];
|
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
static char ScoreTime[5][16];
|
|
|
|
static char ScoreItems[5][16];
|
|
|
|
static char ScoreName[5][7];
|
|
|
|
|
|
|
|
static char validchars[] = " ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-+!";
|
|
|
|
|
2020-03-27 21:47:29 +01:00
|
|
|
void PauseMap(int direction);
|
|
|
|
void SfxVolume(int direction);
|
|
|
|
void MusicVolume(int direction);
|
|
|
|
void SaveReplay(int direction);
|
|
|
|
void SaveGame(int direction);
|
|
|
|
void EnterName();
|
|
|
|
|
|
|
|
char EnterScoreText[32] = { 0 };
|
|
|
|
|
2020-04-26 14:20:35 +02:00
|
|
|
#if defined(_DEBUG) || defined(DEBUG_OPTIONS)
|
2020-04-26 12:07:37 +02:00
|
|
|
|
2020-04-26 12:17:24 +02:00
|
|
|
void SetRightWayUp(int direction)
|
2020-04-26 12:07:37 +02:00
|
|
|
{
|
|
|
|
extern char gRightWayUp;
|
2020-04-26 12:17:24 +02:00
|
|
|
gRightWayUp = 1;
|
|
|
|
PauseReturnValue = MENU_QUIT_CONTINUE;
|
2020-04-26 12:07:37 +02:00
|
|
|
}
|
|
|
|
|
2020-11-07 19:49:16 +01:00
|
|
|
void SetDisplayPosition(int direction)
|
|
|
|
{
|
|
|
|
extern int gDisplayPosition;
|
|
|
|
gDisplayPosition ^= 1;
|
|
|
|
}
|
|
|
|
|
2020-09-26 18:37:50 +02:00
|
|
|
void ToggleInvincibility(int direction)
|
2020-04-26 12:07:37 +02:00
|
|
|
{
|
|
|
|
extern int gInvincibleCar;
|
2020-04-26 12:23:42 +02:00
|
|
|
gInvincibleCar ^= 1;
|
2020-04-26 12:07:37 +02:00
|
|
|
}
|
|
|
|
|
2020-09-26 18:37:50 +02:00
|
|
|
void ToggleImmunity(int direction)
|
2020-04-26 12:07:37 +02:00
|
|
|
{
|
|
|
|
extern int gPlayerImmune;
|
2020-04-26 12:23:42 +02:00
|
|
|
gPlayerImmune ^= 1;
|
2020-04-26 12:07:37 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
void TogglePlayerGhost(int direction)
|
|
|
|
{
|
|
|
|
extern int playerghost;
|
2020-04-26 12:23:42 +02:00
|
|
|
playerghost ^= 1;
|
2020-04-26 12:07:37 +02:00
|
|
|
}
|
|
|
|
|
2020-09-26 18:37:50 +02:00
|
|
|
void ToggleOverlays(int direction)
|
|
|
|
{
|
|
|
|
extern int gDoOverlays;
|
|
|
|
gDoOverlays ^= 1;
|
|
|
|
}
|
|
|
|
|
2020-08-22 09:29:17 +02:00
|
|
|
int lastCar = -1;
|
|
|
|
|
2020-08-22 08:46:41 +02:00
|
|
|
void ToggleSecretCarFun(int direction)
|
|
|
|
{
|
|
|
|
extern CAR_COSMETICS car_cosmetics[5];
|
2020-08-22 09:29:17 +02:00
|
|
|
extern int wantedCar[2];
|
|
|
|
|
|
|
|
int active = (ActiveCheats.cheat10 ^= 1);
|
|
|
|
|
|
|
|
if (active)
|
|
|
|
{
|
|
|
|
if (lastCar == -1)
|
|
|
|
lastCar = wantedCar[0];
|
|
|
|
|
|
|
|
// make our current car the secret car
|
|
|
|
wantedCar[0] = 12;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (lastCar != -1)
|
|
|
|
{
|
|
|
|
// restore our initial car
|
|
|
|
wantedCar[0] = lastCar;
|
|
|
|
lastCar = -1;
|
|
|
|
}
|
|
|
|
}
|
2020-08-22 08:46:41 +02:00
|
|
|
|
|
|
|
FixCarCos(&car_cosmetics[4], 12);
|
|
|
|
}
|
|
|
|
|
2020-10-05 20:42:38 +02:00
|
|
|
void ToggleMiniCars(int direction)
|
|
|
|
{
|
|
|
|
ActiveCheats.cheat13 ^= 1;
|
|
|
|
}
|
|
|
|
|
2020-09-04 21:08:51 +02:00
|
|
|
void ToggleJerichoMode(int direction)
|
|
|
|
{
|
|
|
|
ActiveCheats.cheat12 ^= 1;
|
|
|
|
}
|
|
|
|
|
2020-09-26 18:37:50 +02:00
|
|
|
void TogglePuppyDogCops(int direction)
|
|
|
|
{
|
|
|
|
gPuppyDogCop ^= 1;
|
|
|
|
}
|
|
|
|
|
2020-04-26 12:07:37 +02:00
|
|
|
extern void LoadSky(void);
|
|
|
|
|
|
|
|
void DebugTimeOfDayDay(int direction)
|
|
|
|
{
|
|
|
|
gTimeOfDay = 1;
|
2020-05-06 06:42:10 +02:00
|
|
|
gWantNight = 0;
|
2020-04-26 12:07:37 +02:00
|
|
|
LoadSky();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DebugTimeOfDayNight(int direction)
|
|
|
|
{
|
|
|
|
gTimeOfDay = 3;
|
2020-05-06 06:42:10 +02:00
|
|
|
gWantNight = 1;
|
2020-04-26 12:07:37 +02:00
|
|
|
LoadSky();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DebugTimeOfDayDusk(int direction)
|
|
|
|
{
|
|
|
|
gTimeOfDay = 0;
|
2020-05-06 06:42:10 +02:00
|
|
|
gWantNight = 0;
|
2020-04-26 12:07:37 +02:00
|
|
|
LoadSky();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DebugTimeOfDayDawn(int direction)
|
|
|
|
{
|
|
|
|
gTimeOfDay = 2;
|
2020-05-06 06:42:10 +02:00
|
|
|
gWantNight = 0;
|
2020-04-26 12:07:37 +02:00
|
|
|
LoadSky();
|
|
|
|
}
|
|
|
|
|
|
|
|
void DebugTimeOfDayRain(int direction)
|
|
|
|
{
|
|
|
|
//extern int weather;
|
|
|
|
//weather ^= weather;
|
2020-04-26 12:23:42 +02:00
|
|
|
gWeather ^= 1;
|
|
|
|
|
|
|
|
if (gWeather == 1)
|
|
|
|
wetness = 7000;
|
|
|
|
else
|
|
|
|
wetness = 0;
|
|
|
|
|
2020-04-26 12:07:37 +02:00
|
|
|
LoadSky();
|
|
|
|
}
|
|
|
|
|
|
|
|
MENU_ITEM DebugTimeOfDayItems[] =
|
|
|
|
{
|
|
|
|
{ "Day", 3, 2, DebugTimeOfDayDay, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Night", 3, 2, DebugTimeOfDayNight,MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Dusk", 3, 2, DebugTimeOfDayDusk, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Dawn", 3, 2, DebugTimeOfDayDawn, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Rain", 3, 2, DebugTimeOfDayRain, MENU_QUIT_NONE, NULL },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER DebugTimeOfDayHeader =
|
|
|
|
{ "Time Of Day", { 0, 0, 0, 0 }, 0u, DebugTimeOfDayItems };
|
|
|
|
|
2020-09-26 18:37:50 +02:00
|
|
|
MENU_ITEM DebugJustForFunItems[] =
|
|
|
|
{
|
|
|
|
{ "Secret Car Fun", 3, 2, ToggleSecretCarFun, MENU_QUIT_RESTART, NULL },
|
2020-10-07 11:11:58 +02:00
|
|
|
{ "Mini Cars", 3, 2, ToggleMiniCars, MENU_QUIT_NONE, NULL },
|
2020-09-26 18:37:50 +02:00
|
|
|
{ "Jericho Mode", 3, 2, ToggleJerichoMode, MENU_QUIT_NONE, NULL },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER DebugJustForFunHeader =
|
|
|
|
{ "Just for fun", { 0, 0, 0, 0 }, 0u, DebugJustForFunItems };
|
|
|
|
|
2020-10-04 20:19:53 +02:00
|
|
|
#ifdef CUTSCENE_RECORDER
|
|
|
|
extern void NextCutsceneRecorderPlayer(int dir);
|
|
|
|
extern char gCutsceneRecorderPauseText[64];
|
2020-10-09 22:13:49 +02:00
|
|
|
|
|
|
|
extern void NextChase(int dir);
|
|
|
|
extern char gCurrentChasePauseText[64];
|
2020-10-04 20:19:53 +02:00
|
|
|
#endif
|
|
|
|
|
2020-04-26 12:07:37 +02:00
|
|
|
MENU_ITEM DebugOptionsItems[] =
|
|
|
|
{
|
2020-10-09 22:13:49 +02:00
|
|
|
#ifdef CUTSCENE_RECORDER
|
|
|
|
//{ gCutsceneRecorderPauseText, 5u, 2u, (pauseFunc)&NextCutsceneRecorderPlayer, MENU_QUIT_NONE, NULL },
|
|
|
|
{ gCurrentChasePauseText, 5u, 2u, (pauseFunc)&NextChase, MENU_QUIT_NONE, NULL },
|
2020-10-04 20:19:53 +02:00
|
|
|
#endif
|
2020-11-07 19:49:16 +01:00
|
|
|
{ "Display position", 3, 2, SetDisplayPosition, MENU_QUIT_NONE, NULL},
|
2020-04-26 12:17:24 +02:00
|
|
|
{ "Back on Wheels", 3, 2, SetRightWayUp, MENU_QUIT_NONE, NULL},
|
2020-04-26 12:07:37 +02:00
|
|
|
{ "Time of Day", 65, 2, NULL, MENU_QUIT_NONE, &DebugTimeOfDayHeader },
|
2020-10-07 11:11:58 +02:00
|
|
|
{ "Fun Cheats", 65, 2, NULL, MENU_QUIT_NONE, &DebugJustForFunHeader },
|
2020-09-26 18:37:50 +02:00
|
|
|
{ "Invincibility", 3, 2, ToggleInvincibility,MENU_QUIT_NONE, NULL},
|
|
|
|
{ "Immunity", 3, 2, ToggleImmunity, MENU_QUIT_NONE, NULL},
|
|
|
|
{ "Puppy Dog Cops", 3, 2, TogglePuppyDogCops, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Toggle Overlay", 3, 2, ToggleOverlays, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Player Ghost", 3, 2, TogglePlayerGhost, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Next Mission", 1, 2, NULL, MENU_QUIT_NEXTMISSION, NULL },
|
2020-04-26 12:07:37 +02:00
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER DebugOptionsHeader =
|
|
|
|
{ "Debug Options", { 0, 0, 0, 0 }, 0u, DebugOptionsItems };
|
|
|
|
#endif
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
MENU_ITEM YesNoRestartItems[3] =
|
|
|
|
{
|
|
|
|
{ "NO", 1u, 2u, NULL, MENU_QUIT_BACKMENU, NULL },
|
|
|
|
{ "YES", 1u, 2u, NULL, MENU_QUIT_RESTART, NULL },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM YesNoQuitItems[3] =
|
|
|
|
{
|
|
|
|
{ "NO", 1u, 2u, NULL, MENU_QUIT_BACKMENU, NULL },
|
|
|
|
{ "YES", 1u, 2u, NULL, MENU_QUIT_QUIT, NULL },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER YesNoRestartHeader =
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Are You Sure?", { 0, 0, 0, 0 }, 0u, YesNoRestartItems };
|
2020-04-05 22:04:37 +02:00
|
|
|
|
|
|
|
MENU_HEADER YesNoQuitHeader =
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Are You Sure?", { 0, 0, 0, 0 }, 0u, YesNoQuitItems };
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-04-26 12:07:37 +02:00
|
|
|
MENU_ITEM MainPauseItems[] =
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-12 15:26:17 +02:00
|
|
|
{ "Continue", 1u, 2u, NULL, MENU_QUIT_CONTINUE, NULL },
|
2020-04-26 12:07:37 +02:00
|
|
|
{ "Show Map", 3u, 2u, (pauseFunc)&PauseMap, MENU_QUIT_NONE, NULL },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Restart", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Sfx Volume", 13u, 2u, (pauseFunc)&SfxVolume, MENU_QUIT_NONE, NULL },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Music Volume", 21u, 2u, (pauseFunc)&MusicVolume, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Film Director", 1u, 2u, NULL, MENU_QUIT_DIRECTOR, NULL},
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
2020-09-26 18:37:50 +02:00
|
|
|
#if defined(_DEBUG) || defined(DEBUG_OPTIONS)
|
|
|
|
{ "Debug Options", 65u, 2u, NULL, MENU_QUIT_NONE, &DebugOptionsHeader },
|
|
|
|
#endif
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM MultiplayerPauseItems[7] =
|
|
|
|
{
|
|
|
|
{ "Resume", 1u, 2u, NULL, MENU_QUIT_CONTINUE, NULL },
|
|
|
|
{ "Restart", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Sfx Volume", 13u, 2u, (pauseFunc)&SfxVolume, MENU_QUIT_NONE, NULL },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Music Volume", 21u, 2u, (pauseFunc)&MusicVolume, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
2020-09-26 20:20:22 +02:00
|
|
|
void SkipCutscene(int dir)
|
|
|
|
{
|
|
|
|
gSkipInGameCutscene = 1;
|
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-04-26 12:07:37 +02:00
|
|
|
MENU_ITEM CutscenePauseItems[] =
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
|
|
|
{ "Continue", 1u, 2u, NULL, MENU_QUIT_CONTINUE, NULL },
|
2020-09-26 20:20:22 +02:00
|
|
|
#if defined(_DEBUG) || defined(DEBUG_OPTIONS)
|
|
|
|
{ "Skip Cutscene", 3u, 2u, (pauseFunc)&SkipCutscene, MENU_QUIT_CONTINUE, NULL },
|
|
|
|
#endif
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Restart", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Effects Volume", 13u, 2u, (pauseFunc)&SfxVolume, MENU_QUIT_NONE, NULL },
|
|
|
|
{ "Music Volume", 21u, 2u, (pauseFunc)&MusicVolume, MENU_QUIT_NONE, NULL },
|
2020-09-26 18:37:50 +02:00
|
|
|
#if defined(_DEBUG) || defined(DEBUG_OPTIONS)
|
|
|
|
{ "Debug Options", 65u, 2u, NULL, MENU_QUIT_NONE, &DebugOptionsHeader },
|
|
|
|
#endif
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
2020-08-31 13:15:40 +02:00
|
|
|
MENU_ITEM MissionCompleteItems[] =
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-08-31 13:15:40 +02:00
|
|
|
#ifdef PSX
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Save Game", 3u, 2u, (pauseFunc)&SaveGame, MENU_QUIT_NONE, NULL },
|
2020-08-31 13:15:40 +02:00
|
|
|
#endif
|
2020-05-17 19:45:44 +02:00
|
|
|
{ "Continue", 1u, 2u, NULL, MENU_QUIT_NEXTMISSION, NULL },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Film Director",1u,2u,NULL,MENU_QUIT_DIRECTOR,NULL},
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
|
|
|
{ "Save Replay", 3u, 2u, (pauseFunc)&SaveReplay, MENU_QUIT_NONE, NULL },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Restart", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM MissionFailedItems[6] =
|
|
|
|
{
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Film Director",1u,2u,NULL,MENU_QUIT_DIRECTOR,NULL},
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
2020-04-05 22:04:37 +02:00
|
|
|
{ "Exit", 3u, 2u, (pauseFunc)&SaveReplay, MENU_QUIT_NONE, NULL },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Retry Mission",65u,2u,NULL,MENU_QUIT_NONE,&YesNoRestartHeader },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
2020-05-20 23:33:21 +02:00
|
|
|
MENU_ITEM TakeARideFinishedItems[] =
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
|
|
|
{ "Restart", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Film Director",1u,2u,NULL,MENU_QUIT_DIRECTOR,NULL},
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
|
|
|
{ "Save Replay", 3u, 2u, (pauseFunc)&SaveReplay, MENU_QUIT_NONE, NULL },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM DrivingGameFinishedItems[7] =
|
|
|
|
{
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Play Again", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-04-12 15:04:54 +02:00
|
|
|
{ EnterScoreText, 3u, 2u, (pauseFunc)&EnterName, MENU_QUIT_NONE, NULL },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Film Director",1u,2u,NULL,MENU_QUIT_DIRECTOR,NULL},
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
|
|
|
{ "Save Replay", 3u, 2u, (pauseFunc)&SaveReplay, MENU_QUIT_NONE, NULL },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM MultiplayerFinishedItems[5] =
|
|
|
|
{
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Play Again", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
|
|
|
{ "Save Replay", 3u, 2u, (pauseFunc)&SaveReplay, MENU_QUIT_NONE, NULL },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM ChaseGameFinishedItems[6] =
|
|
|
|
{
|
2020-08-31 13:15:40 +02:00
|
|
|
{ "Play Again", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoRestartHeader },
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Film Director",1u,2u,NULL,MENU_QUIT_DIRECTOR,NULL},
|
|
|
|
{ "Quick Replay",1u,2u,NULL,MENU_QUIT_QUICKREPLAY,NULL},
|
|
|
|
{ "Save Replay", 3u, 2u, (pauseFunc)&SaveReplay, MENU_QUIT_NONE, NULL },
|
2020-03-27 21:47:29 +01:00
|
|
|
{ "Exit", 65u, 2u, NULL, MENU_QUIT_NONE, &YesNoQuitHeader },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM NoPadItems[1] =
|
|
|
|
{
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM NoMultiPadItems[2] =
|
|
|
|
{
|
|
|
|
{ "Exit", 1u, 2u, NULL, MENU_QUIT_QUIT, NULL },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM InvalidPadItems[1] =
|
|
|
|
{
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL}
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_ITEM InvalidMultiPadItems[2] =
|
|
|
|
{
|
|
|
|
{ "Exit", 1u, 2u, NULL, MENU_QUIT_QUIT, NULL },
|
|
|
|
{ NULL, 128u, 0u, NULL, MENU_QUIT_NONE, NULL }
|
|
|
|
};
|
|
|
|
|
2020-04-26 12:07:37 +02:00
|
|
|
|
2020-03-27 21:47:29 +01:00
|
|
|
MENU_HEADER PauseMenuHeader =
|
2020-04-12 15:26:17 +02:00
|
|
|
{ "Paused", { 0, 0, 0, 0 }, 0u, MainPauseItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER MultiplayerPauseHeader =
|
2020-04-12 15:26:17 +02:00
|
|
|
{ "Paused", { 0, 0, 0, 0 }, 0u, MultiplayerPauseItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER CutscenePauseMenuHeader =
|
2020-04-12 15:26:17 +02:00
|
|
|
{ "Paused", { 0, 0, 0, 0 }, 0u, CutscenePauseItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER MissionCompleteHeader =
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Mission Successful", { 0, 0, 0, 0 }, 0u, MissionCompleteItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER MissionFailedHeader =
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Mission Failed", { 0, 0, 0, 0 }, 0u, MissionFailedItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER TakeARideFinishedHeader =
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Game Over", { 0, 0, 0, 0 }, 0u, TakeARideFinishedItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER DrivingGameFinishedHeader =
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Game Over", { 0, 0, 0, 0 }, 0u, DrivingGameFinishedItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER MultiplayerFinishedHeader =
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Game Over", { 0, 0, 0, 0 }, 0u, MultiplayerFinishedItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER ChaseGameFinishedHeader =
|
2020-04-11 23:24:54 +02:00
|
|
|
{ "Game Over", { 0, 0, 0, 0 }, 0u, ChaseGameFinishedItems };
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
MENU_HEADER NoPadHeader =
|
|
|
|
{
|
2020-10-07 11:11:58 +02:00
|
|
|
"Insert a Controller in port 1",
|
2020-03-27 21:47:29 +01:00
|
|
|
{ 0, 0, 0, 0 },
|
|
|
|
0u,
|
|
|
|
NoPadItems
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER NoMultiPadHeader =
|
|
|
|
{
|
2020-10-07 11:11:58 +02:00
|
|
|
"Insert a Controller in port 2",
|
2020-03-27 21:47:29 +01:00
|
|
|
{ 0, 0, 0, 0 },
|
|
|
|
0u,
|
|
|
|
NoMultiPadItems
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER InvalidPadHeader =
|
|
|
|
{
|
2020-10-07 11:11:58 +02:00
|
|
|
"Unsupported controller in port 1",
|
2020-03-27 21:47:29 +01:00
|
|
|
{ 0, 0, 0, 0 },
|
|
|
|
0u,
|
|
|
|
InvalidPadItems
|
|
|
|
};
|
|
|
|
|
|
|
|
MENU_HEADER InvalidMultiPadHeader =
|
|
|
|
{
|
2020-10-07 11:11:58 +02:00
|
|
|
"Unsupported controller in port 2",
|
2020-03-27 21:47:29 +01:00
|
|
|
{ 0, 0, 0, 0 },
|
|
|
|
0u,
|
|
|
|
InvalidMultiPadItems
|
|
|
|
};
|
|
|
|
|
|
|
|
int playerwithcontrol[3] = { 0 };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
2020-10-31 01:11:58 +01:00
|
|
|
// int /*$ra*/ ShowPauseMenu(PAUSEMODE mode /*$s0*/)
|
2020-03-27 21:47:29 +01:00
|
|
|
// line 1004, offset 0x0006bf50
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1005
|
|
|
|
// Start offset: 0x0006BF50
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// PAUSEMODE passed_mode; // $s2
|
2020-03-27 21:47:29 +01:00
|
|
|
|
|
|
|
/* begin block 1.1 */
|
|
|
|
// Start line: 1062
|
|
|
|
// Start offset: 0x0006C0C0
|
|
|
|
/* end block 1.1 */
|
|
|
|
// End offset: 0x0006C140
|
|
|
|
// End Line: 1085
|
|
|
|
|
|
|
|
/* begin block 1.2 */
|
|
|
|
// Start line: 1092
|
|
|
|
// Start offset: 0x0006C178
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// RECT rect; // stack offset -32
|
2020-03-27 21:47:29 +01:00
|
|
|
/* end block 1.2 */
|
|
|
|
// End offset: 0x0006C1FC
|
|
|
|
// End Line: 1101
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006C2AC
|
|
|
|
// End Line: 1137
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 2008
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 2009
|
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
int ShowPauseMenu(PAUSEMODE mode)
|
|
|
|
{
|
2020-05-12 06:00:32 +02:00
|
|
|
PAUSEMODE passed_mode;
|
2020-04-11 23:02:26 +02:00
|
|
|
RECT16 rect;
|
2020-04-05 22:04:37 +02:00
|
|
|
|
|
|
|
ReadControllers();
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
if (mode == PAUSEMODE_PAUSEP1)
|
|
|
|
{
|
|
|
|
playerwithcontrol[0] = 1;
|
2020-04-11 23:02:26 +02:00
|
|
|
playerwithcontrol[1] = 0;
|
|
|
|
playerwithcontrol[2] = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
else if (mode == PAUSEMODE_PAUSEP2)
|
|
|
|
{
|
|
|
|
playerwithcontrol[0] = 0;
|
|
|
|
playerwithcontrol[1] = 1;
|
|
|
|
playerwithcontrol[2] = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
playerwithcontrol[0] = 0;
|
|
|
|
playerwithcontrol[1] = 0;
|
|
|
|
playerwithcontrol[2] = 1;
|
|
|
|
}
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
SetDispMask(1);
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
SfxVolume(0);
|
|
|
|
MusicVolume(0);
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
StopPadVibration(0);
|
|
|
|
StopPadVibration(1);
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
InitaliseMenu(mode);
|
|
|
|
gDrawPauseMenus = 1;
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
if (NoPlayerControl == 0 && OnScoreTable(NULL) != -1 && allownameentry != 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
gScoreEntered = 0;
|
2020-08-31 13:15:40 +02:00
|
|
|
sprintf(EnterScoreText, "Enter Score");
|
|
|
|
sprintf(EnterNameText, "Enter Name:");
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
gScoreEntered = 1;
|
2020-08-31 13:15:40 +02:00
|
|
|
sprintf(EnterScoreText, "View Table");
|
|
|
|
sprintf(EnterNameText, "High Scores");
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
passed_mode = mode;
|
|
|
|
|
|
|
|
if (mode == PAUSEMODE_PADERROR)
|
|
|
|
mode = PAUSEMODE_PAUSE;
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
PauseReturnValue = 0;
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
do {
|
|
|
|
UpdatePadData();
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
if (passed_mode == PAUSEMODE_PADERROR)
|
|
|
|
{
|
|
|
|
if (pad_connected == 1)
|
|
|
|
{
|
|
|
|
InitaliseMenu(mode);
|
|
|
|
passed_mode = mode;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
InitaliseMenu(PAUSEMODE_PADERROR);
|
|
|
|
}
|
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (pad_connected != 1)
|
|
|
|
{
|
|
|
|
passed_mode = PAUSEMODE_PADERROR;
|
2020-04-05 22:04:37 +02:00
|
|
|
InitaliseMenu(PAUSEMODE_PADERROR);
|
|
|
|
}
|
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
if (pad_connected < 1)
|
2020-04-11 23:02:26 +02:00
|
|
|
playerwithcontrol[2] = 1;
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
ControlMenu();
|
|
|
|
DrawGame();
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
} while (PauseReturnValue == 0);
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
gDrawPauseMenus = 0;
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
if (1 < NumPlayers)
|
|
|
|
{
|
2020-04-11 23:02:26 +02:00
|
|
|
rect.x = 0;
|
2020-05-12 06:00:32 +02:00
|
|
|
rect.w = 320;
|
2020-04-11 23:02:26 +02:00
|
|
|
rect.h = 1;
|
2020-05-12 06:00:32 +02:00
|
|
|
rect.y = current->draw.clip.y + current->draw.clip.h;
|
|
|
|
ClearImage2(&rect, 0, 0, 0);
|
2020-04-05 22:04:37 +02:00
|
|
|
DrawGame();
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
rect.x = 0;
|
2020-05-12 06:00:32 +02:00
|
|
|
rect.w = 320;
|
2020-04-11 23:02:26 +02:00
|
|
|
rect.h = 1;
|
2020-05-12 06:00:32 +02:00
|
|
|
rect.y = current->draw.clip.y + current->draw.clip.h;
|
|
|
|
ClearImage2(&rect, 0, 0, 0);
|
2020-04-05 22:04:37 +02:00
|
|
|
DrawGame();
|
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
switch (PauseReturnValue)
|
|
|
|
{
|
2020-04-11 23:02:26 +02:00
|
|
|
case 1:
|
|
|
|
pauseflag = 0;
|
|
|
|
break;
|
|
|
|
case 2:
|
|
|
|
EndGame(GAMEMODE_QUIT);
|
|
|
|
break;
|
|
|
|
case 3:
|
|
|
|
EndGame(GAMEMODE_RESTART);
|
|
|
|
break;
|
|
|
|
case 4:
|
|
|
|
EndGame(GAMEMODE_DIRECTOR);
|
|
|
|
break;
|
|
|
|
case 5:
|
|
|
|
EndGame(GAMEMODE_REPLAY);
|
|
|
|
break;
|
|
|
|
case 7:
|
|
|
|
EndGame(GAMEMODE_NEXTMISSION);
|
2020-05-12 06:00:32 +02:00
|
|
|
break;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
return PauseReturnValue;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ DrawPauseMenus()
|
|
|
|
// line 1139, offset 0x0006dcd4
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 4357
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 4358
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 2278
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 2279
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 4358
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 4359
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
|
|
|
|
|
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void DrawPauseMenus(void)
|
|
|
|
{
|
2020-08-30 18:30:48 +02:00
|
|
|
#if !defined(PSX) && defined(DEBUG_OPTIONS)
|
|
|
|
extern int g_FreeCameraEnabled;
|
|
|
|
|
|
|
|
if (g_FreeCameraEnabled)
|
|
|
|
return;
|
|
|
|
#endif
|
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
if (gDrawPauseMenus != 0 && gShowMap == 0)
|
|
|
|
{
|
|
|
|
if (gEnteringScore == 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
DrawVisibleMenus();
|
2020-05-12 06:00:32 +02:00
|
|
|
else
|
2020-04-05 22:04:37 +02:00
|
|
|
DrawHighScoreMenu(gScorePosition);
|
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ SaveReplay(int direction /*$a0*/)
|
|
|
|
// line 1153, offset 0x0006d9b0
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 3753
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 3754
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 2306
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 2307
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 3754
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 3755
|
|
|
|
|
|
|
|
void SaveReplay(int direction)
|
|
|
|
{
|
2020-11-11 19:37:19 +01:00
|
|
|
char filename[64];
|
2020-05-27 18:02:16 +02:00
|
|
|
#ifdef PSX
|
2020-04-05 22:04:37 +02:00
|
|
|
CallMemoryCard(0x10, 1);
|
2020-05-27 18:02:16 +02:00
|
|
|
#else
|
2020-05-27 20:07:54 +02:00
|
|
|
int size = SaveReplayToBuffer(_other_buffer);
|
2020-11-11 19:37:19 +01:00
|
|
|
|
|
|
|
#ifdef CUTSCENE_RECORDER
|
|
|
|
extern int gCutsceneAsReplay;
|
|
|
|
if(gCutsceneAsReplay != 0)
|
2020-11-12 11:02:45 +01:00
|
|
|
{
|
|
|
|
FILE* temp;
|
|
|
|
int cnt;
|
|
|
|
cnt = 2;
|
|
|
|
|
|
|
|
while(cnt < 14)
|
|
|
|
{
|
|
|
|
sprintf(filename, "CUT%d_%d.D2RP", gCutsceneAsReplay, cnt);
|
|
|
|
|
|
|
|
temp = fopen(filename, "rb");
|
|
|
|
if (temp)
|
|
|
|
{
|
|
|
|
fclose(temp);
|
|
|
|
cnt++;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-11-11 19:37:19 +01:00
|
|
|
#else
|
|
|
|
sprintf(filename, "CHASE.D2RP", gCurrentMissionNumber);
|
|
|
|
#endif
|
|
|
|
FILE* fp = fopen(filename, "wb");
|
2020-05-27 18:02:16 +02:00
|
|
|
if (fp)
|
|
|
|
{
|
2020-10-04 20:19:53 +02:00
|
|
|
fwrite(_other_buffer, 1, size, fp);
|
2020-05-27 18:02:16 +02:00
|
|
|
fclose(fp);
|
|
|
|
}
|
|
|
|
#endif
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ SaveGame(int direction /*$a0*/)
|
|
|
|
// line 1158, offset 0x0006d9d4
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 3763
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 3764
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 3764
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 3765
|
|
|
|
|
|
|
|
void SaveGame(int direction)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
CallMemoryCard(0x20, 1);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ EnterName()
|
|
|
|
// line 1163, offset 0x0006d9f8
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 3773
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 3774
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 3774
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 3775
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
2020-06-13 18:25:19 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void EnterName(void)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
EnterScoreName();
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
2020-10-31 01:11:58 +01:00
|
|
|
// int /*$ra*/ MaxMenuStringLength(MENU_HEADER *pMenu /*$v0*/)
|
2020-03-27 21:47:29 +01:00
|
|
|
// line 1185, offset 0x0006da18
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1186
|
|
|
|
// Start offset: 0x0006DA18
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// MENU_ITEM *pItems; // $s1
|
2020-03-27 21:47:29 +01:00
|
|
|
// int max; // $s2
|
|
|
|
// int temp; // $s0
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006DAD0
|
|
|
|
// End Line: 1206
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 3817
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 3818
|
|
|
|
|
2020-04-11 23:57:32 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
int MaxMenuStringLength(MENU_HEADER *pMenu)
|
|
|
|
{
|
2020-05-12 06:00:32 +02:00
|
|
|
int max;
|
|
|
|
int temp;
|
|
|
|
MENU_ITEM *pItems;
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
pItems = pMenu->MenuItems;
|
|
|
|
max = StringWidth(pMenu->Title);
|
2020-04-11 23:57:32 +02:00
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
while ((pItems->Type & 0x80) == 0)
|
2020-04-11 23:57:32 +02:00
|
|
|
{
|
2020-05-12 06:00:32 +02:00
|
|
|
temp = StringWidth(pItems->Text);
|
2020-04-11 23:57:32 +02:00
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
if ((pItems->Type & 0x18) != 0)
|
|
|
|
temp = temp + StringWidth(" 100");
|
2020-04-11 23:57:32 +02:00
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
if (max < temp)
|
|
|
|
max = temp;
|
2020-04-11 23:57:32 +02:00
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
pItems++;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
return max;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
2020-10-31 01:11:58 +01:00
|
|
|
// void /*$ra*/ InitaliseMenu(PAUSEMODE mode /*$a2*/)
|
2020-03-27 21:47:29 +01:00
|
|
|
// line 1216, offset 0x0006c2ac
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1217
|
|
|
|
// Start offset: 0x0006C2AC
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// MENU_ITEM *pItem; // $a0
|
2020-03-27 21:47:29 +01:00
|
|
|
// int i; // $a1
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006C6B8
|
|
|
|
// End Line: 1388
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 2361
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 2362
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 2441
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 2442
|
|
|
|
|
2020-05-12 06:00:32 +02:00
|
|
|
// [D] [A] please get rid of inlined code
|
2020-03-27 21:47:29 +01:00
|
|
|
void InitaliseMenu(PAUSEMODE mode)
|
|
|
|
{
|
2020-04-11 23:02:26 +02:00
|
|
|
unsigned char uVar1;
|
|
|
|
unsigned char bVar2;
|
|
|
|
unsigned char bVar3;
|
2020-04-05 22:04:37 +02:00
|
|
|
MENU_ITEM *pMVar4;
|
|
|
|
MENU_HEADER *pMVar5;
|
|
|
|
MENU_HEADER **ppMVar6;
|
|
|
|
char *pcVar7;
|
|
|
|
MENU_ITEM **ppMVar8;
|
2020-04-11 23:02:26 +02:00
|
|
|
unsigned char uVar9;
|
2020-04-05 22:04:37 +02:00
|
|
|
int iVar10;
|
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
ppMVar8 = ActiveItem;
|
|
|
|
ppMVar6 = VisibleMenus;
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar10 = 2;
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
do {
|
2020-05-12 06:00:32 +02:00
|
|
|
*ppMVar8++ = NULL;
|
|
|
|
*ppMVar6++ = NULL;
|
|
|
|
|
|
|
|
iVar10--;
|
2020-04-05 22:04:37 +02:00
|
|
|
} while (-1 < iVar10);
|
2020-05-12 06:00:32 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
allownameentry = 0;
|
2020-05-12 06:00:32 +02:00
|
|
|
|
|
|
|
switch (mode)
|
|
|
|
{
|
2020-08-28 21:42:42 +02:00
|
|
|
case PAUSEMODE_PAUSE:
|
|
|
|
case PAUSEMODE_PAUSEP1:
|
|
|
|
case PAUSEMODE_PAUSEP2:
|
|
|
|
if (NumPlayers == 1 && gMultiplayerLevels == 0)
|
2020-05-12 06:00:32 +02:00
|
|
|
{
|
2020-08-28 21:42:42 +02:00
|
|
|
if (gInGameCutsceneActive == 0)
|
|
|
|
{
|
|
|
|
ActiveMenu = &PauseMenuHeader;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ActiveMenu = &CutscenePauseMenuHeader;
|
|
|
|
}
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-05-12 06:00:32 +02:00
|
|
|
else
|
|
|
|
{
|
2020-08-28 21:42:42 +02:00
|
|
|
ActiveMenu = &MultiplayerPauseHeader;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
break;
|
|
|
|
case PAUSEMODE_GAMEOVER:
|
2020-05-12 06:00:32 +02:00
|
|
|
switch (GameType)
|
|
|
|
{
|
2020-08-28 21:42:42 +02:00
|
|
|
case GAME_PURSUIT:
|
|
|
|
switchD_0006c3b4_caseD_3:
|
|
|
|
ActiveMenu = &ChaseGameFinishedHeader;
|
2020-05-12 06:00:32 +02:00
|
|
|
gMissionCompletionState = mode;
|
|
|
|
goto LAB_0006c5d0;
|
|
|
|
case GAME_GETAWAY:
|
|
|
|
case GAME_CHECKPOINT:
|
2020-08-28 21:42:42 +02:00
|
|
|
if (NumPlayers == 1)
|
|
|
|
{
|
|
|
|
ActiveMenu = &DrivingGameFinishedHeader;
|
|
|
|
allownameentry = 0;
|
|
|
|
gMissionCompletionState = mode;
|
|
|
|
goto LAB_0006c5d0;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case GAME_GATERACE:
|
2020-05-12 06:00:32 +02:00
|
|
|
case GAME_TRAILBLAZER:
|
|
|
|
case GAME_SURVIVAL:
|
2020-08-28 21:42:42 +02:00
|
|
|
if (NumPlayers == 1)
|
|
|
|
{
|
2020-05-12 06:00:32 +02:00
|
|
|
ActiveMenu = &DrivingGameFinishedHeader;
|
|
|
|
gMissionCompletionState = mode;
|
2020-08-28 21:42:42 +02:00
|
|
|
allownameentry = NumPlayers;
|
2020-05-12 06:00:32 +02:00
|
|
|
goto LAB_0006c5d0;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
if (NumPlayers == 1)
|
|
|
|
goto switchD_0006c460_caseD_1;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
LAB_0006c4c0:
|
|
|
|
ActiveMenu = &MultiplayerFinishedHeader;
|
|
|
|
gMissionCompletionState = mode;
|
|
|
|
break;
|
|
|
|
case PAUSEMODE_COMPLETE:
|
|
|
|
if (true)
|
|
|
|
{
|
|
|
|
switch (GameType)
|
|
|
|
{
|
|
|
|
case GAME_MISSION:
|
|
|
|
ActiveMenu = &MissionCompleteHeader;
|
|
|
|
gMissionCompletionState = mode;
|
|
|
|
goto LAB_0006c5d0;
|
|
|
|
case GAME_GETAWAY:
|
|
|
|
case GAME_GATERACE:
|
|
|
|
case GAME_CHECKPOINT:
|
|
|
|
case GAME_TRAILBLAZER:
|
|
|
|
case GAME_SURVIVAL:
|
|
|
|
case GAME_COPSANDROBBERS:
|
|
|
|
if (NumPlayers == 1) {
|
|
|
|
|
|
|
|
ActiveMenu = &DrivingGameFinishedHeader;
|
|
|
|
gMissionCompletionState = mode;
|
|
|
|
allownameentry = NumPlayers;
|
|
|
|
goto LAB_0006c5d0;
|
|
|
|
}
|
|
|
|
goto LAB_0006c4c0;
|
|
|
|
case GAME_PURSUIT:
|
|
|
|
goto switchD_0006c3b4_caseD_3;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
switchD_0006c460_caseD_1:
|
|
|
|
ActiveMenu = &TakeARideFinishedHeader;
|
|
|
|
gMissionCompletionState = mode;
|
|
|
|
break;
|
|
|
|
case PAUSEMODE_PADERROR:
|
|
|
|
if (pad_connected < 0)
|
|
|
|
{
|
|
|
|
if (NumPlayers == 1)
|
|
|
|
{
|
|
|
|
ActiveMenu = &InvalidPadHeader;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ActiveMenu = &InvalidMultiPadHeader;
|
|
|
|
if (Pads[0].type != 1)
|
|
|
|
{
|
|
|
|
pcVar7 = "Incorrect controller in Port 2";
|
|
|
|
goto LAB_0006c5cc;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pcVar7 = "Incorrect controller in Port 1";
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
if (NumPlayers == 1)
|
|
|
|
{
|
|
|
|
ActiveMenu = &NoPadHeader;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
ActiveMenu = &NoMultiPadHeader;
|
|
|
|
if (Pads[0].type != 0)
|
|
|
|
{
|
|
|
|
pcVar7 = "Please insert controller into port";
|
|
|
|
goto LAB_0006c5cc;
|
|
|
|
}
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
pcVar7 = "Please insert controller into port";
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
LAB_0006c5cc:
|
|
|
|
ActiveMenu->Title = pcVar7;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
LAB_0006c5d0:
|
2020-04-11 23:02:26 +02:00
|
|
|
ActiveItem[0] = ActiveMenu->MenuItems;
|
|
|
|
VisibleMenus[0] = ActiveMenu;
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
ActiveMenuItem = 0;
|
|
|
|
VisibleMenu = 0;
|
2020-04-11 23:02:26 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar1 = ActiveMenu->MenuItems->Type;
|
2020-04-11 23:02:26 +02:00
|
|
|
uVar9 = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
pMVar4 = ActiveMenu->MenuItems;
|
2020-04-11 23:02:26 +02:00
|
|
|
|
|
|
|
while (uVar1 != 0x80)
|
|
|
|
{
|
2020-04-11 23:57:32 +02:00
|
|
|
uVar1 = (pMVar4+1)->Type;
|
2020-04-11 23:02:26 +02:00
|
|
|
uVar9++;
|
|
|
|
pMVar4++;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
ActiveMenu->NumItems = uVar9;
|
|
|
|
iVar10 = MaxMenuStringLength(ActiveMenu);
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
bVar2 = ActiveMenu->NumItems;
|
|
|
|
bVar3 = ActiveMenu->NumItems;
|
|
|
|
(ActiveMenu->Bound).x = (short)((0x130 - iVar10) / 2) + -4;
|
2020-08-28 21:42:42 +02:00
|
|
|
(ActiveMenu->Bound).w = (short)iVar10 + 0x18;
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar10 = (int)(((uint)bVar2 + 1) * -0xf + 0x100) / 2;
|
2020-08-28 21:42:42 +02:00
|
|
|
(ActiveMenu->Bound).y = (short)iVar10;
|
|
|
|
(ActiveMenu->Bound).h = ((ushort)bVar3 + 1) * 0xf + 10;
|
|
|
|
|
|
|
|
if (iVar10 < 0x30)
|
|
|
|
(ActiveMenu->Bound).y = 0x30;
|
|
|
|
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
2020-10-31 01:11:58 +01:00
|
|
|
// void /*$ra*/ SetupMenu(MENU_HEADER *menu /*$a0*/, int back /*$a1*/)
|
2020-03-27 21:47:29 +01:00
|
|
|
// line 1401, offset 0x0006c6b8
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1402
|
|
|
|
// Start offset: 0x0006C6B8
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// MENU_ITEM *pItem; // $a2
|
2020-03-27 21:47:29 +01:00
|
|
|
// int count; // $a3
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006C7F4
|
|
|
|
// End Line: 1431
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 2819
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 2820
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 2833
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 2834
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 2840
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 2841
|
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
// [D]
|
2020-04-05 22:04:37 +02:00
|
|
|
void SetupMenu(MENU_HEADER *menu, int back)
|
2020-03-27 21:47:29 +01:00
|
|
|
{
|
2020-04-12 15:04:54 +02:00
|
|
|
unsigned char bVar1;
|
|
|
|
unsigned char bVar2;
|
2020-04-05 22:04:37 +02:00
|
|
|
MENU_ITEM *pMVar3;
|
|
|
|
MENU_HEADER *pMVar4;
|
2020-04-12 15:04:54 +02:00
|
|
|
int iVar5;
|
|
|
|
MENU_ITEM *pMVar6;
|
|
|
|
int count;
|
|
|
|
|
|
|
|
count = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
|
|
|
|
ActiveMenuItem = 0;
|
2020-04-12 15:04:54 +02:00
|
|
|
if (menu->MenuItems->Type != 0x80)
|
|
|
|
{
|
|
|
|
pMVar6 = menu->MenuItems;
|
2020-04-05 22:04:37 +02:00
|
|
|
do {
|
2020-04-12 15:04:54 +02:00
|
|
|
if ((back != 0) && (pMVar6 == ActiveItem[VisibleMenu]))
|
|
|
|
{
|
|
|
|
ActiveMenuItem = count;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
pMVar3 = pMVar6 + 1;
|
|
|
|
count = count + 1;
|
|
|
|
|
|
|
|
pMVar6 = pMVar6 + 1;
|
|
|
|
} while (pMVar3->Type != 0x80);
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
|
|
|
ActiveMenu = menu;
|
2020-04-12 15:04:54 +02:00
|
|
|
menu->NumItems = count;
|
|
|
|
iVar5 = MaxMenuStringLength(ActiveMenu);
|
2020-04-05 22:04:37 +02:00
|
|
|
pMVar4 = ActiveMenu;
|
|
|
|
bVar1 = ActiveMenu->NumItems;
|
|
|
|
bVar2 = ActiveMenu->NumItems;
|
2020-04-12 15:04:54 +02:00
|
|
|
(ActiveMenu->Bound).x = (short)((0x130 - iVar5) / 2) + -4;
|
|
|
|
(pMVar4->Bound).w = (short)iVar5 + 0x18;
|
|
|
|
iVar5 = (int)(((uint)bVar1 + 1) * -0xf + 0x100) / 2;
|
|
|
|
(pMVar4->Bound).y = (short)iVar5;
|
2020-04-05 22:04:37 +02:00
|
|
|
(pMVar4->Bound).h = ((ushort)bVar2 + 1) * 0xf + 10;
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if (iVar5 < 0x30)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
(pMVar4->Bound).y = 0x30;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
ActiveItem[VisibleMenu] = ActiveMenu->MenuItems + ActiveMenuItem;
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ DrawVisibleMenus()
|
|
|
|
// line 1443, offset 0x0006c7f4
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1445
|
|
|
|
// Start offset: 0x0006C7F4
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// MENU_HEADER *pActive; // $s5
|
|
|
|
// MENU_ITEM *pItem; // $s1
|
|
|
|
// POLY_FT3 *null; // $a0
|
2020-03-27 21:47:29 +01:00
|
|
|
// int i; // stack offset -48
|
|
|
|
// int ypos; // $s3
|
|
|
|
// int xpos; // $fp
|
|
|
|
// int width; // $s4
|
|
|
|
|
|
|
|
/* begin block 1.1 */
|
|
|
|
// Start line: 1473
|
|
|
|
// Start offset: 0x0006C8C0
|
|
|
|
// Variables:
|
|
|
|
// unsigned char r; // $s6
|
|
|
|
// unsigned char b; // $s7
|
|
|
|
// int x1; // $s0
|
|
|
|
// int x2; // $s2
|
|
|
|
/* end block 1.1 */
|
|
|
|
// End offset: 0x0006CA40
|
|
|
|
// End Line: 1509
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006CBE8
|
|
|
|
// End Line: 1528
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 2919
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 2920
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 2932
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 2933
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 2933
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 2934
|
|
|
|
|
|
|
|
/* begin block 5 */
|
|
|
|
// Start line: 2939
|
|
|
|
/* end block 5 */
|
|
|
|
// End Line: 2940
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void DrawVisibleMenus(void)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
short sVar1;
|
|
|
|
short sVar2;
|
|
|
|
short sVar3;
|
|
|
|
DB *pDVar4;
|
|
|
|
uint uVar5;
|
|
|
|
int iVar6;
|
|
|
|
int x;
|
|
|
|
char *pString;
|
2020-04-11 23:02:26 +02:00
|
|
|
POLY_FT3 *null;
|
|
|
|
POLY_F4 *poly;
|
2020-04-05 22:04:37 +02:00
|
|
|
short sVar8;
|
|
|
|
MENU_ITEM *pMVar9;
|
|
|
|
int y;
|
|
|
|
int y_00;
|
|
|
|
MENU_HEADER *pMVar10;
|
|
|
|
int r;
|
|
|
|
int b;
|
|
|
|
int x_00;
|
2020-04-11 23:02:26 +02:00
|
|
|
int i;
|
2020-04-05 22:04:37 +02:00
|
|
|
|
|
|
|
if (1 < NumPlayers) {
|
|
|
|
SetFullscreenDrawing();
|
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
pMVar10 = VisibleMenus[VisibleMenu];
|
2020-04-05 22:04:37 +02:00
|
|
|
y = (int)(pMVar10->Bound).y;
|
|
|
|
y_00 = y;
|
2020-04-11 23:02:26 +02:00
|
|
|
if (pMVar10->Title != NULL)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
y_00 = y + 0xf;
|
2020-05-30 22:28:11 +02:00
|
|
|
OutputString(pMVar10->Title, 2, (int)(pMVar10->Bound).x, y, (int)(pMVar10->Bound).w, 0x80, 0x20, 0x20);
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
i = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar5 = (uint)pMVar10->NumItems;
|
|
|
|
pMVar9 = pMVar10->MenuItems;
|
|
|
|
sVar1 = (pMVar10->Bound).x;
|
|
|
|
x_00 = (int)sVar1;
|
|
|
|
sVar2 = (pMVar10->Bound).w;
|
|
|
|
y = (int)sVar2;
|
|
|
|
if (pMVar10->NumItems != 0) {
|
|
|
|
do {
|
2020-04-11 23:02:26 +02:00
|
|
|
if (pMVar9->Text != NULL) {
|
2020-04-05 22:04:37 +02:00
|
|
|
r = 0x80;
|
2020-04-11 23:02:26 +02:00
|
|
|
if (pMVar9 == ActiveItem[VisibleMenu])
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
r = 0;
|
|
|
|
b = 0;
|
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
b = 0x80;
|
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
if ((pMVar9->Type & 8) == 0)
|
|
|
|
{
|
|
|
|
if ((pMVar9->Type & 0x10) != 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar6 = StringWidth(pMVar9->Text);
|
2020-04-11 23:02:26 +02:00
|
|
|
x = StringWidth(" 100");
|
2020-04-05 22:04:37 +02:00
|
|
|
x = x_00 + ((y - iVar6) - x >> 1);
|
|
|
|
iVar6 = StringWidth(pMVar9->Text);
|
|
|
|
iVar6 = x + iVar6;
|
|
|
|
OutputString(pMVar9->Text, 1, x, y_00, y, r, 0x80, b);
|
|
|
|
pString = MusicVolumeText;
|
|
|
|
goto LAB_0006c9ec;
|
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
OutputString(pMVar9->Text, (uint)pMVar9->Justify, x_00, y_00, y, r, 0x80, b);
|
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar6 = StringWidth(pMVar9->Text);
|
2020-04-11 23:02:26 +02:00
|
|
|
x = StringWidth(" 100");
|
2020-04-05 22:04:37 +02:00
|
|
|
x = x_00 + ((y - iVar6) - x >> 1);
|
|
|
|
iVar6 = StringWidth(pMVar9->Text);
|
|
|
|
iVar6 = x + iVar6;
|
|
|
|
OutputString(pMVar9->Text, 1, x, y_00, y, r, 0x80, b);
|
|
|
|
pString = SfxVolumeText;
|
|
|
|
LAB_0006c9ec:
|
|
|
|
OutputString(pString, 1, iVar6 + 10, y_00, y, r, 0x80, b);
|
|
|
|
}
|
2020-04-11 23:02:26 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
y_00 = y_00 + 0xf;
|
|
|
|
uVar5 = (uint)pMVar10->NumItems;
|
|
|
|
}
|
|
|
|
pMVar9 = pMVar9 + 1;
|
2020-04-11 23:02:26 +02:00
|
|
|
i = i + 1;
|
|
|
|
} while (i < (int)uVar5);
|
|
|
|
}
|
2020-04-11 23:24:54 +02:00
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
null = (POLY_FT3 *)current->primptr;
|
|
|
|
setPolyFT3(null);
|
|
|
|
null->x0 = -1;
|
|
|
|
null->y0 = -1;
|
|
|
|
null->x1 = -1;
|
|
|
|
null->y1 = -1;
|
|
|
|
null->x2 = -1;
|
|
|
|
null->y2 = -1;
|
|
|
|
null->tpage = 0;
|
|
|
|
|
|
|
|
addPrim(current->ot, null);
|
|
|
|
|
|
|
|
current->primptr += sizeof(POLY_FT3);
|
|
|
|
poly = (POLY_F4*)current->primptr;
|
2020-04-11 23:24:54 +02:00
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
setPolyF4(poly);
|
2020-04-11 23:57:32 +02:00
|
|
|
sVar8 = sVar1 + sVar2 + 5; // x + w
|
2020-04-11 23:02:26 +02:00
|
|
|
sVar3 = (pMVar10->Bound).y;
|
2020-04-11 23:57:32 +02:00
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
poly->x0 = sVar1 + -5;
|
|
|
|
poly->x1 = sVar8;
|
|
|
|
poly->y0 = sVar3 + -5;
|
|
|
|
poly->x2 = sVar1 + -5;
|
2020-04-11 23:57:32 +02:00
|
|
|
|
|
|
|
poly->y1 = sVar3 + -5;
|
|
|
|
poly->y2 = sVar3 + (pMVar10->Bound).h;
|
|
|
|
|
2020-04-11 23:02:26 +02:00
|
|
|
poly->x3 = sVar8;
|
2020-04-11 23:57:32 +02:00
|
|
|
poly->y3 = sVar3 + (pMVar10->Bound).h;
|
2020-04-11 23:02:26 +02:00
|
|
|
|
|
|
|
poly->r0 = '\x10';
|
|
|
|
poly->g0 = '\x10';
|
|
|
|
poly->b0 = '\x10';
|
|
|
|
|
|
|
|
setSemiTrans(poly, 1);
|
|
|
|
|
2020-04-11 23:24:54 +02:00
|
|
|
addPrim(current->ot, poly);
|
2020-04-11 23:02:26 +02:00
|
|
|
current->primptr += sizeof(POLY_F4);
|
|
|
|
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ ControlMenu()
|
|
|
|
// line 1543, offset 0x0006cbe8
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1545
|
|
|
|
// Start offset: 0x0006CBE8
|
|
|
|
// Variables:
|
|
|
|
// static int debounce; // offset 0x30
|
|
|
|
// unsigned short paddata; // $a2
|
|
|
|
// unsigned short paddirect; // $a3
|
|
|
|
|
|
|
|
/* begin block 1.1 */
|
|
|
|
// Start line: 1596
|
|
|
|
// Start offset: 0x0006CCD4
|
|
|
|
// Variables:
|
|
|
|
// int doit; // $v1
|
|
|
|
/* end block 1.1 */
|
|
|
|
// End offset: 0x0006CD78
|
|
|
|
// End Line: 1621
|
|
|
|
|
|
|
|
/* begin block 1.2 */
|
|
|
|
// Start line: 1675
|
|
|
|
// Start offset: 0x0006CF54
|
|
|
|
// Variables:
|
|
|
|
// int i; // $a0
|
|
|
|
/* end block 1.2 */
|
|
|
|
// End offset: 0x0006CFB8
|
|
|
|
// End Line: 1682
|
|
|
|
|
|
|
|
/* begin block 1.3 */
|
|
|
|
// Start line: 1692
|
|
|
|
// Start offset: 0x0006CFD8
|
|
|
|
// Variables:
|
|
|
|
// int i; // $a0
|
|
|
|
/* end block 1.3 */
|
|
|
|
// End offset: 0x0006D034
|
|
|
|
// End Line: 1703
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006D034
|
|
|
|
// End Line: 1705
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 3196
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 3197
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 3212
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 3213
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 3213
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 3214
|
|
|
|
|
|
|
|
/* begin block 5 */
|
|
|
|
// Start line: 3233
|
|
|
|
/* end block 5 */
|
|
|
|
// End Line: 3234
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void ControlMenu(void)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
EXIT_VALUE EVar1;
|
|
|
|
bool bVar2;
|
|
|
|
int iVar3;
|
|
|
|
MENU_ITEM *pMVar4;
|
|
|
|
ushort uVar5;
|
|
|
|
MENU_HEADER *menu;
|
|
|
|
ushort uVar6;
|
|
|
|
|
2020-07-05 18:32:12 +02:00
|
|
|
if (playerwithcontrol[2] == 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar5 = Pads[1].dirnew;
|
|
|
|
uVar6 = Pads[1].direct;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
|
|
|
if (playerwithcontrol[0] != 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar5 = Pads[0].dirnew;
|
|
|
|
uVar6 = Pads[0].direct;
|
|
|
|
}
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar5 = Pads[0].dirnew;
|
|
|
|
uVar6 = Pads[0].direct;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
|
|
|
if (NumPlayers == 2)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar5 = Pads[1].dirnew | Pads[0].dirnew;
|
|
|
|
uVar6 = Pads[1].direct | Pads[0].direct;
|
|
|
|
}
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
|
|
|
if (gShowMap != 0)
|
|
|
|
{
|
|
|
|
if ((uVar5 & 0x50) == 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
PauseMap(0);
|
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
static int controlmenu_debounce = 0;
|
|
|
|
|
|
|
|
if (((uVar6 & 0xa000) == 0) || ((ActiveItem[VisibleMenu]->Type & 4) == 0))
|
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-07-05 18:32:12 +02:00
|
|
|
if ((uVar5 & 0x1000) != 0)
|
|
|
|
{
|
|
|
|
ActiveMenuItem--;
|
|
|
|
|
|
|
|
if (ActiveMenuItem < 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
ActiveMenuItem = (uint)ActiveMenu->NumItems - 1;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
ActiveItem[VisibleMenu] = ActiveMenu->MenuItems + ActiveMenuItem;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if ((uVar5 & 0x4000) != 0)
|
|
|
|
{
|
2020-07-05 18:32:12 +02:00
|
|
|
ActiveMenuItem++;
|
|
|
|
|
|
|
|
if (((uint)ActiveMenu->NumItems - 1) < ActiveMenuItem)
|
2020-04-05 22:04:37 +02:00
|
|
|
ActiveMenuItem = 0;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
ActiveItem[VisibleMenu] = ActiveMenu->MenuItems + ActiveMenuItem;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
2020-07-05 18:32:12 +02:00
|
|
|
if ((uVar5 & 0x40) == 0)
|
|
|
|
{
|
2020-04-12 15:04:54 +02:00
|
|
|
if ((uVar5 & 0x10) == 0)
|
|
|
|
{
|
|
|
|
if ((uVar5 & 0x800) == 0)
|
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if (VisibleMenu != 0)
|
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar3 = 0;
|
2020-07-05 18:32:12 +02:00
|
|
|
if (ActiveMenu->NumItems == 0)
|
2020-04-12 15:04:54 +02:00
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
pMVar4 = ActiveMenu->MenuItems;
|
2020-04-12 15:04:54 +02:00
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
if (pMVar4->ExitValue == MENU_QUIT_CONTINUE)
|
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
PauseReturnValue = (uint)pMVar4->ExitValue;
|
|
|
|
return;
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
|
|
|
iVar3++;
|
|
|
|
if ((uint)ActiveMenu->NumItems <= iVar3)
|
2020-04-12 15:04:54 +02:00
|
|
|
break;
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
pMVar4 = ActiveMenu->MenuItems + iVar3;
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if (VisibleMenu < 1)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar3 = 0;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
|
|
|
if (ActiveMenu->NumItems == 0)
|
2020-04-12 15:04:54 +02:00
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
EVar1 = ActiveMenu->MenuItems->ExitValue;
|
2020-04-12 15:04:54 +02:00
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
if (EVar1 == MENU_QUIT_CONTINUE)
|
|
|
|
{
|
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
PauseReturnValue = (uint)EVar1;
|
|
|
|
return;
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
|
|
|
iVar3++;
|
|
|
|
|
|
|
|
if ((uint)ActiveMenu->NumItems <= iVar3)
|
|
|
|
break;
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
EVar1 = ActiveMenu->MenuItems[iVar3].ExitValue;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
controlmenu_debounce = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-12 15:04:54 +02:00
|
|
|
pMVar4 = ActiveItem[VisibleMenu];
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
if ((pMVar4->Type & 0x40) != 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
menu = pMVar4->SubMenu;
|
|
|
|
VisibleMenu = VisibleMenu + 1;
|
2020-04-12 15:04:54 +02:00
|
|
|
VisibleMenus[VisibleMenu] = menu;
|
2020-04-05 22:04:37 +02:00
|
|
|
SetupMenu(menu, 0);
|
|
|
|
return;
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
if ((pMVar4->Type & 2) != 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
(*pMVar4->func)(0);
|
|
|
|
}
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-04-12 15:04:54 +02:00
|
|
|
EVar1 = ActiveItem[VisibleMenu]->ExitValue;
|
|
|
|
|
|
|
|
if (EVar1 == MENU_QUIT_NONE)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if (EVar1 != MENU_QUIT_BACKMENU)
|
|
|
|
{
|
|
|
|
PauseReturnValue = (uint)ActiveItem[VisibleMenu]->ExitValue;
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
VisibleMenu = VisibleMenu + -1;
|
2020-04-12 15:04:54 +02:00
|
|
|
SetupMenu(VisibleMenus[VisibleMenu], 1);
|
2020-04-05 22:04:37 +02:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
bVar2 = false;
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if (controlmenu_debounce < 1)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar3 = 10;
|
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
controlmenu_debounce = controlmenu_debounce + -1;
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar3 = 2;
|
2020-07-05 18:32:12 +02:00
|
|
|
|
2020-05-20 23:33:21 +02:00
|
|
|
if (controlmenu_debounce != 0)
|
|
|
|
goto LAB_0006cd08;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
bVar2 = true;
|
2020-04-12 15:04:54 +02:00
|
|
|
controlmenu_debounce = iVar3;
|
2020-03-27 21:47:29 +01:00
|
|
|
LAB_0006cd08:
|
2020-04-12 15:04:54 +02:00
|
|
|
|
|
|
|
if (bVar2)
|
|
|
|
{
|
|
|
|
if ((uVar6 & 0x8000) == 0)
|
|
|
|
{
|
|
|
|
(*ActiveItem[VisibleMenu]->func)(1);
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-04-12 15:04:54 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
(*ActiveItem[VisibleMenu]->func)(-1);
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ PauseMap(int direction /*$a0*/)
|
|
|
|
// line 1710, offset 0x0006dad0
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 4364
|
|
|
|
/* end block 1 */
|
|
|
|
// End Line: 4365
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 4869
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 4870
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 4870
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 4871
|
|
|
|
|
2020-05-30 11:53:05 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void PauseMap(int direction)
|
|
|
|
{
|
2020-05-30 11:53:05 +02:00
|
|
|
gShowMap ^= 1;
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
ReadControllers();
|
2020-05-30 11:53:05 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
map_x_shift = 0;
|
|
|
|
map_z_shift = 0;
|
2020-05-30 11:53:05 +02:00
|
|
|
|
|
|
|
if (gShowMap == 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
InitOverheadMap();
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ SfxVolume(int direction /*$a0*/)
|
|
|
|
// line 1725, offset 0x0006db34
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1726
|
|
|
|
// Start offset: 0x0006DB34
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006DC04
|
|
|
|
// End Line: 1744
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 4902
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 4903
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 4905
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 4906
|
|
|
|
|
2020-04-12 15:26:17 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void SfxVolume(int direction)
|
|
|
|
{
|
2020-04-12 15:26:17 +02:00
|
|
|
if (direction < 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
gMasterVolume = gMasterVolume + -100;
|
2020-04-12 15:26:17 +02:00
|
|
|
else if (0 < direction)
|
|
|
|
gMasterVolume = gMasterVolume + 100;
|
|
|
|
|
|
|
|
if (gMasterVolume < -10000)
|
2020-04-05 22:04:37 +02:00
|
|
|
gMasterVolume = -10000;
|
2020-04-12 15:26:17 +02:00
|
|
|
|
|
|
|
if (0 < gMasterVolume)
|
2020-04-05 22:04:37 +02:00
|
|
|
gMasterVolume = 0;
|
2020-04-12 15:26:17 +02:00
|
|
|
|
|
|
|
sprintf(SfxVolumeText, "%d", (int)(10000 + gMasterVolume) / 100);
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
SetMasterVolume(gMasterVolume);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ MusicVolume(int direction /*$a0*/)
|
|
|
|
// line 1746, offset 0x0006dc04
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1747
|
|
|
|
// Start offset: 0x0006DC04
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006DCD4
|
|
|
|
// End Line: 1765
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 4942
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 4943
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 4945
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 4946
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 4948
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 4949
|
|
|
|
|
2020-04-12 15:26:17 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void MusicVolume(int direction)
|
|
|
|
{
|
2020-04-12 15:26:17 +02:00
|
|
|
if (direction < 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
gMusicVolume = gMusicVolume + -100;
|
2020-04-12 15:26:17 +02:00
|
|
|
else if (0 < direction)
|
|
|
|
gMusicVolume = gMusicVolume + 100;
|
|
|
|
|
|
|
|
if (gMusicVolume < -10000)
|
2020-04-05 22:04:37 +02:00
|
|
|
gMusicVolume = -10000;
|
2020-04-12 15:26:17 +02:00
|
|
|
|
|
|
|
if (0 < gMusicVolume)
|
2020-04-05 22:04:37 +02:00
|
|
|
gMusicVolume = 0;
|
2020-04-12 15:26:17 +02:00
|
|
|
|
|
|
|
sprintf(MusicVolumeText, "%d", (int)(10000 + gMusicVolume) / 100);
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
SetXMVolume(gMusicVolume);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ EnterScoreName()
|
|
|
|
// line 1787, offset 0x0006d044
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 1789
|
|
|
|
// Start offset: 0x0006D044
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// SCORE_ENTRY *table; // stack offset -40
|
2020-03-27 21:47:29 +01:00
|
|
|
// char *username; // $s3
|
|
|
|
// unsigned short npad; // $a1
|
|
|
|
// int so; // $s0
|
|
|
|
// int co; // $s1
|
|
|
|
// int delay; // $s2
|
|
|
|
// char c; // $a0
|
|
|
|
// char toggle; // $s6
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006D324
|
|
|
|
// End Line: 1941
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 3716
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 3717
|
|
|
|
|
|
|
|
/* begin block 3 */
|
|
|
|
// Start line: 3717
|
|
|
|
/* end block 3 */
|
|
|
|
// End Line: 3718
|
|
|
|
|
|
|
|
/* begin block 4 */
|
|
|
|
// Start line: 3718
|
|
|
|
/* end block 4 */
|
|
|
|
// End Line: 3719
|
|
|
|
|
|
|
|
/* WARNING: Unknown calling convention yet parameter storage is locked */
|
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void EnterScoreName(void)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
bool bVar1;
|
2020-08-28 21:42:42 +02:00
|
|
|
short uVar2;
|
|
|
|
int uVar3;
|
|
|
|
char* pcVar4;
|
2020-04-05 22:04:37 +02:00
|
|
|
char cVar5;
|
|
|
|
int iVar6;
|
2020-08-28 21:42:42 +02:00
|
|
|
int uVar7;
|
2020-04-05 22:04:37 +02:00
|
|
|
int iVar8;
|
2020-08-28 21:42:42 +02:00
|
|
|
char* username;
|
|
|
|
int uVar9;
|
|
|
|
SCORE_ENTRY* table;
|
2020-04-05 22:04:37 +02:00
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
username = NULL;
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar8 = 0;
|
|
|
|
gEnteringScore = 1;
|
|
|
|
uVar9 = 0;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if (gScoreEntered == 0)
|
|
|
|
{
|
|
|
|
gScorePosition = OnScoreTable(&table);
|
|
|
|
|
|
|
|
if (gScorePosition != -1)
|
|
|
|
username = ScoreName[gScorePosition];
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
OnScoreTable(&table);
|
2020-04-05 22:04:37 +02:00
|
|
|
gScorePosition = -1;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar7 = 1;
|
|
|
|
iVar6 = 0;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
CreateScoreNames(table, &gPlayerScore, gScorePosition);
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
do {
|
|
|
|
ReadControllers();
|
|
|
|
uVar2 = Pads[0].dirnew;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if (gScoreEntered == 0)
|
|
|
|
{
|
|
|
|
if ((Pads[0].dirnew & 0x10) != 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
gEnteringScore = 0;
|
|
|
|
return;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if ((Pads[0].direct & 0x20) == 0)
|
|
|
|
{
|
|
|
|
if ((Pads[0].direct & 0x8000) == 0)
|
|
|
|
{
|
|
|
|
if ((Pads[0].direct & 0x2000) == 0)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar8 = 0;
|
|
|
|
goto LAB_0006d1e8;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
bVar1 = iVar8 == 0;
|
|
|
|
iVar8 = iVar8 + -1;
|
2020-08-28 21:42:42 +02:00
|
|
|
if (bVar1)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar8 = 0x14;
|
|
|
|
LAB_0006d1c4:
|
|
|
|
uVar9 = 0;
|
|
|
|
uVar7 = uVar7 + 1;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else if (iVar8 < 1)
|
|
|
|
{
|
|
|
|
iVar8 = 2;
|
|
|
|
goto LAB_0006d1c4;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if (0x43 < uVar7)
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar7 = 0;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
bVar1 = iVar8 == 0;
|
|
|
|
iVar8 = iVar8 + -1;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if (bVar1)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar8 = 0x14;
|
|
|
|
LAB_0006d184:
|
|
|
|
uVar9 = 0;
|
|
|
|
uVar7 = uVar7 - 1;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else if (iVar8 < 1)
|
|
|
|
{
|
|
|
|
iVar8 = 2;
|
|
|
|
goto LAB_0006d184;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if ((int)uVar7 < 0)
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar7 = 0x43;
|
|
|
|
}
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
iVar8 = 1;
|
|
|
|
uVar9 = 0;
|
|
|
|
uVar7 = 0x43;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
LAB_0006d1e8:
|
2020-08-28 21:42:42 +02:00
|
|
|
cVar5 = validchars[uVar7];
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar3 = uVar9 + 1;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if (iVar6 == 5)
|
2020-04-05 22:04:37 +02:00
|
|
|
cVar5 = -2;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
uVar9 = uVar3 & 0xff;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if ((uVar3 & 4) == 0)
|
|
|
|
{
|
|
|
|
if (cVar5 == ' ')
|
|
|
|
username[iVar6] = '.';
|
|
|
|
else
|
|
|
|
username[iVar6] = cVar5;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else
|
|
|
|
{
|
|
|
|
username[iVar6] = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
pcVar4 = username + iVar6;
|
|
|
|
|
|
|
|
if ((uVar2 & 0x80) != 0)
|
|
|
|
{
|
|
|
|
if (0 < iVar6)
|
|
|
|
iVar6--;
|
|
|
|
|
|
|
|
pcVar4 = username + iVar6;
|
|
|
|
*pcVar4 = 0;
|
|
|
|
pcVar4[1] = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if ((uVar2 & 0x40) != 0)
|
|
|
|
{
|
|
|
|
if (cVar5 == -2)
|
|
|
|
{
|
|
|
|
*pcVar4 = 0;
|
|
|
|
strcpy(gPlayerScore.name, username);
|
|
|
|
AddScoreToTable(table, gScorePosition);
|
2020-08-31 13:15:40 +02:00
|
|
|
sprintf(EnterScoreText, "View Table");
|
|
|
|
sprintf(EnterNameText, "High Scores");
|
2020-04-05 22:04:37 +02:00
|
|
|
gEnteringScore = 0;
|
|
|
|
gScoreEntered = 1;
|
|
|
|
return;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
if (cVar5 == -1)
|
|
|
|
{
|
|
|
|
if (0 < iVar6)
|
|
|
|
iVar6--;
|
|
|
|
|
|
|
|
username[iVar6] = 0;
|
|
|
|
username[iVar6+1] = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else if (iVar6 < 5)
|
|
|
|
{
|
|
|
|
iVar6 = iVar6 + 1;
|
|
|
|
*pcVar4 = cVar5;
|
|
|
|
username[iVar6] = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else if((Pads[0].dirnew & 0x50) != 0)
|
|
|
|
{
|
|
|
|
gEnteringScore = 0;
|
|
|
|
return;
|
2020-04-05 22:04:37 +02:00
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
DrawGame();
|
|
|
|
} while (true);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// decompiled code
|
|
|
|
// original method signature:
|
|
|
|
// void /*$ra*/ DrawHighScoreMenu(int selection /*stack 0*/)
|
|
|
|
// line 2020, offset 0x0006d694
|
|
|
|
/* begin block 1 */
|
|
|
|
// Start line: 2021
|
|
|
|
// Start offset: 0x0006D694
|
|
|
|
// Variables:
|
2020-10-31 01:11:58 +01:00
|
|
|
// POLY_FT3 *null; // $a0
|
2020-03-27 21:47:29 +01:00
|
|
|
// char text[4]; // stack offset -48
|
|
|
|
// unsigned char r; // $s3
|
|
|
|
// unsigned char g; // $s5
|
|
|
|
// unsigned char b; // $s2
|
|
|
|
// int i; // $s0
|
|
|
|
// int ypos; // $s4
|
|
|
|
/* end block 1 */
|
|
|
|
// End offset: 0x0006D9B0
|
|
|
|
// End Line: 2075
|
|
|
|
|
|
|
|
/* begin block 2 */
|
|
|
|
// Start line: 4486
|
|
|
|
/* end block 2 */
|
|
|
|
// End Line: 4487
|
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
// [D]
|
2020-03-27 21:47:29 +01:00
|
|
|
void DrawHighScoreMenu(int selection)
|
|
|
|
{
|
2020-08-28 21:42:42 +02:00
|
|
|
POLY_FT3* null;
|
|
|
|
POLY_F4* prim;
|
|
|
|
int iVar1;
|
|
|
|
int iVar2;
|
2020-04-05 22:04:37 +02:00
|
|
|
int b;
|
|
|
|
int r;
|
|
|
|
int y;
|
2020-08-28 21:42:42 +02:00
|
|
|
int iVar3;
|
|
|
|
char text[8];
|
2020-04-05 22:04:37 +02:00
|
|
|
|
|
|
|
OutputString(EnterNameText, 2, 0xa0, 0x46, 0, 0x80, 0x20, 0x20);
|
2020-08-28 21:42:42 +02:00
|
|
|
OutputString("Name", 1, 0x28, 0x5a, 0, 0x80, 0x80, 0x20);
|
|
|
|
OutputString("Time", 4, 0x118, 0x5a, 0, 0x80, 0x80, 0x20);
|
2020-04-05 22:04:37 +02:00
|
|
|
y = 0x6e;
|
2020-08-28 21:42:42 +02:00
|
|
|
iVar3 = 0;
|
|
|
|
iVar1 = 0;
|
|
|
|
iVar2 = 0;
|
2020-04-05 22:04:37 +02:00
|
|
|
do {
|
|
|
|
r = 0x80;
|
2020-08-28 21:42:42 +02:00
|
|
|
if (iVar1 == selection)
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
r = 0;
|
|
|
|
b = 0;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
else
|
|
|
|
{
|
2020-04-05 22:04:37 +02:00
|
|
|
b = 0x80;
|
|
|
|
}
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
sprintf(text, "%d", iVar2);
|
|
|
|
|
|
|
|
OutputString(text, 1, 0x28, y, 0, r, 0x80, b);
|
|
|
|
OutputString(ScoreName[iVar2], 1, 0x3c, y, 0, r, 0x80, b);
|
|
|
|
OutputString(ScoreItems[iVar2], 4, 0xdc, y, 0, r, 0x80, b);
|
|
|
|
OutputString(ScoreTime[iVar2], 4, 0x118, y, 0, r, 0x80, b);
|
|
|
|
|
2020-04-05 22:04:37 +02:00
|
|
|
y = y + 0xf;
|
2020-08-28 21:42:42 +02:00
|
|
|
|
|
|
|
iVar2++;
|
|
|
|
} while (iVar2 < 5);
|
|
|
|
|
|
|
|
null = (POLY_FT3*)current->primptr;
|
|
|
|
|
|
|
|
setPolyFT3(null);
|
|
|
|
|
|
|
|
null->x0 = -1;
|
|
|
|
null->y0 = -1;
|
|
|
|
null->x1 = -1;
|
|
|
|
null->y1 = -1;
|
|
|
|
null->x2 = -1;
|
|
|
|
null->y2 = -1;
|
|
|
|
null->tpage = 0;
|
|
|
|
|
|
|
|
addPrim(current->ot, null);
|
|
|
|
|
|
|
|
current->primptr += sizeof(POLY_FT3);
|
|
|
|
|
|
|
|
prim = (POLY_F4*)current->primptr;
|
|
|
|
setPolyF4(prim);
|
|
|
|
setSemiTrans(prim, 1); // code is 43 '+';
|
|
|
|
|
|
|
|
prim->y0 = 0x41;
|
|
|
|
prim->y1 = 0x41;
|
|
|
|
prim->y2 = 0xc5;
|
|
|
|
prim->y3 = 0xc5;
|
|
|
|
prim->x0 = 0x1a;
|
|
|
|
prim->x1 = 0x126;
|
|
|
|
prim->x2 = 0x1a;
|
|
|
|
prim->x3 = 0x126;
|
|
|
|
prim->r0 = 16;
|
|
|
|
prim->g0 = 16;
|
|
|
|
prim->b0 = 16;
|
|
|
|
|
|
|
|
addPrim(current->ot, prim);
|
|
|
|
current->primptr += sizeof(POLY_F4);
|
2020-03-27 21:47:29 +01:00
|
|
|
}
|
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
//*Offset 0x6D324, from D : \driver2\game\C\PAUSE.C(lines 1943..2011)
|
|
|
|
//* Stack frame base $sp, size 80
|
|
|
|
//* Saved registers at offset - 4: s0 s1 s2 s3 s4 s5 s6 s7 fp ra
|
|
|
|
//* /
|
2020-10-31 01:11:58 +01:00
|
|
|
//void /*$ra*/ CreateScoreNames(SCORE_ENTRY* table /*$s0*/, PLAYER_SCORE* score /*stack 4*/, int position /*stack 8*/)
|
2020-08-28 21:42:42 +02:00
|
|
|
//{ // line 1, offset 0x6d324
|
|
|
|
// char* text; // $s1
|
|
|
|
// int min; // $t1
|
|
|
|
// int frac; // $v0
|
|
|
|
// int i; // $s5
|
|
|
|
//} // line 69, offset 0x6d664
|
|
|
|
|
|
|
|
// [D]
|
|
|
|
void CreateScoreNames(SCORE_ENTRY* table, PLAYER_SCORE* score, int position)
|
|
|
|
{
|
|
|
|
int time;
|
|
|
|
char* text;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
switch (GameType)
|
|
|
|
{
|
|
|
|
case GAME_PURSUIT:
|
|
|
|
case GAME_GETAWAY:
|
|
|
|
case GAME_CHECKPOINT:
|
|
|
|
case GAME_SURVIVAL:
|
|
|
|
text = NULL;
|
|
|
|
break;
|
|
|
|
case GAME_GATERACE:
|
|
|
|
text = "Gates";
|
|
|
|
break;
|
|
|
|
case GAME_TRAILBLAZER:
|
|
|
|
text = "Cones";
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return;
|
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
i = 0;
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
do {
|
|
|
|
if (i == position)
|
|
|
|
{
|
|
|
|
time = score->time;
|
|
|
|
if (time == -1)
|
|
|
|
sprintf(ScoreTime[i], "-:--.--");
|
|
|
|
else
|
|
|
|
sprintf(ScoreTime[i], "%d:%02d.%02d", time / 180000, time / 3000 + (time / 180000) * -0x3c, (time % 3000) / 0x1e);
|
|
|
|
|
|
|
|
ScoreItems[i][0] = '\0';
|
|
|
|
|
|
|
|
if ((text != NULL) && (score->items != -1))
|
|
|
|
sprintf(ScoreItems[i], "%d %s", score->items, text);
|
|
|
|
|
|
|
|
ClearMem(ScoreName[i], 7);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
time = table->time;
|
|
|
|
|
|
|
|
if (time == -1)
|
|
|
|
sprintf(ScoreTime[i], "-:--.--");
|
|
|
|
else
|
|
|
|
sprintf(ScoreTime[i], "%d:%02d.%02d", time / 180000, time / 3000 + (time / 180000) * -0x3c, (time % 3000) / 0x1e);
|
|
|
|
|
|
|
|
ScoreItems[i][0] = '\0';
|
|
|
|
|
|
|
|
if ((text != NULL) && (table->items != -1))
|
|
|
|
sprintf(ScoreItems[i], "%d %s", table->items, text);
|
|
|
|
|
|
|
|
sprintf(ScoreName[i], "%s", table->name);
|
|
|
|
table = table + 1;
|
|
|
|
}
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
i++;
|
|
|
|
} while (i < 5);
|
2020-03-27 21:47:29 +01:00
|
|
|
|
2020-08-28 21:42:42 +02:00
|
|
|
}
|