2020-03-27 21:47:29 +01:00
# include "THISDUST.H"
# include "FEMAIN.H"
2020-04-10 13:56:11 +02:00
# include "../C/CD_ICON.H"
2020-03-28 16:43:40 +01:00
# include <string.h>
2020-03-27 21:47:29 +01:00
# include "LIBGPU.H"
# include "LIBETC.H"
# include "../C/SYSTEM.H"
# include "../C/GLAUNCH.H"
2020-04-05 00:53:41 +02:00
# include "../C/MISSION.H"
2020-03-28 16:43:40 +01:00
# include "../C/LOADVIEW.H"
# include "../C/PAD.H"
2020-03-29 01:56:49 +01:00
# include "../C/TIME.H"
# include "../C/PRES.H"
2020-03-29 14:13:32 +02:00
# include "../C/SOUND.H"
2020-04-05 18:44:41 +02:00
# include "../C/DEBRIS.H"
# include "../C/FMVPLAY.H"
2020-03-28 16:43:40 +01:00
2020-03-29 19:03:53 +02:00
# include "../MEMCARD/MAIN.H"
2020-03-28 16:43:40 +01:00
typedef int ( * screenFunc ) ( int bSetup ) ;
screenFunc fpUserFunctions [ ] = {
CentreScreen ,
CarSelectScreen ,
CopDiffLevelScreen ,
VibroOnOffScreen ,
MissionSelectScreen ,
MissionCityScreen ,
CutSceneCitySelectScreen ,
CutSceneSelectScreen ,
SetVolumeScreen ,
ScoreScreen ,
SubtitlesOnOffScreen ,
CityCutOffScreen ,
ControllerScreen ,
MainScreen ,
CheatScreen ,
ImmunityOnOffScreen ,
InvincibleOnOffScreen ,
GamePlayScreen ,
GameNameScreen ,
CheatNumlayerSelect ,
} ;
2020-03-29 18:10:37 +02:00
char * gfxNames [ 4 ] = {
" DATA \\ CARS \\ CCARS.RAW " ,
" DATA \\ CARS \\ HCARS.RAW " ,
" DATA \\ CARS \\ VCARS.RAW " ,
" DATA \\ CARS \\ RCARS.RAW " ,
} ;
char * cutGfxNames [ 4 ] = {
" DATA \\ CUTS \\ CCUTS.RAW " ,
" DATA \\ CUTS \\ HCUTS.RAW " ,
" DATA \\ CUTS \\ VCUTS.RAW " ,
" DATA \\ CUTS \\ RCUTS.RAW " ,
} ;
2020-03-29 22:33:32 +02:00
int CutAmounts [ 5 ] = {
0 , 8 , 7 , 5 , 8
} ;
int CutAmountsTotal [ 5 ] = {
0 , 8 , 15 , 20 , 40
} ;
char * CutSceneNames [ 28 ] =
{
" Il fiume rosso " ,
" L'obitorio " ,
" Il testimone " ,
" L'appartamento di Lenny " ,
" La setta cubana " ,
" L'intruso " ,
" L'incontro con Caine " ,
" Partenza dalla citt " ,
" In cerca di indizi " ,
" Partenza " ,
" Osservando l'autocarro " ,
" L'indizio nella Rosanna Soto " ,
" Il cantiere navale " ,
" Il colpo " ,
" L'arresto di Jericho " ,
" Vasquez in Las Vegas " ,
" Lo scambio di Jericho " ,
" Rapina nella banca " ,
" La sala da biliardo " ,
" Il sentiero di guerra di Caine " ,
" Caine a Rio " ,
" Avviso a Jones " ,
" La sparatoria " ,
" La fuga di Lenny " ,
" Lenny takedown " ,
" Back to chicago " ,
" Vasquez and Caine " ,
" Credits "
} ;
2020-04-05 18:44:41 +02:00
int CarAvailability [ 4 ] [ 10 ] = {
{ 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 } ,
{ 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 } ,
{ 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 } ,
{ 1 , 1 , 1 , 1 , 0 , 0 , 0 , 0 , 0 , 0 } ,
} ;
char carNumLookup [ 4 ] [ 10 ] = {
{ 0x1 , 0x2 , 0x3 , 0x4 , 0x0 , 0x8 , 0x9 , 0xA , 0xB , 0xC } ,
{ 0x1 , 0x2 , 0x3 , 0x4 , 0x0 , 0x8 , 0x9 , 0xA , 0xB , 0xC } ,
{ 0x1 , 0x2 , 0x3 , 0x4 , 0x0 , 0x8 , 0x9 , 0xA , 0xB , 0xC } ,
{ 0x1 , 0x2 , 0x3 , 0x4 , 0x0 , 0x8 , 0x9 , 0xA , 0xB , 0xC } ,
} ;
2020-03-29 22:33:32 +02:00
char ScreenTitle [ 128 ] ;
char ScoreName [ 128 ] ;
2020-04-05 18:44:41 +02:00
2020-03-29 22:33:32 +02:00
int bDoingScores = 0 ;
int bInCutSelect = 0 ;
int cutSelection = 0 ;
int currCity = 0 ;
2020-03-29 18:10:37 +02:00
2020-03-28 16:43:40 +01:00
int bRedrawFrontend = 0 ;
2020-03-29 14:33:48 +02:00
int bReturnToMain = 0 ;
2020-03-28 16:43:40 +01:00
int idle_timer = 0 ;
2020-03-29 18:10:37 +02:00
int currPlayer = 1 ;
2020-03-28 16:43:40 +01:00
int fePad = 0 ;
int ScreenDepth = 0 ;
int gIdleReplay = 0 ;
2020-04-05 18:44:41 +02:00
int padsConnected [ 2 ] = { 1 , 0 } ;
int feVariableSave [ 4 ] = { - 1 } ;
int bCdIconSetup = 0 ;
int bMissionSelect = 0 ;
int bDoingCarSelect = 0 ;
int bDoingCutSelect = 0 ;
int bDrawExtra = 0 ;
int mainScreenLoaded = 1 ;
int bDoneAllready = 0 ;
int allowVibration = 1 ;
int carSelection = 0 ;
int currSelIndex = 0 ;
int lastCutCity = - 1 ;
int lastCity = - 1 ;
char * ScreenNames [ 12 ] = { 0 } ;
char loaded [ 3 ] = { - 1 , 255 , 0 } ;
2020-03-28 16:43:40 +01:00
PSXSCREEN * pCurrScreen = NULL ;
PSXSCREEN * pNewScreen = NULL ;
2020-03-28 21:29:37 +01:00
PSXBUTTON * pNewButton = NULL ;
2020-03-28 16:43:40 +01:00
PSXBUTTON * pCurrButton = NULL ;
PSXSCREEN PsxScreens [ 42 ] = { 0 } ;
2020-04-05 18:44:41 +02:00
PSXSCREEN * pScreenStack [ 10 ] = { 0 } ;
PSXBUTTON * pButtonStack [ 10 ] = { 0 } ;
2020-03-27 21:47:29 +01:00
2020-03-28 21:29:37 +01:00
POLY_FT4 BackgroundPolys [ 6 ] ;
2020-03-29 01:56:49 +01:00
FE_FONT feFont ;
2020-04-01 13:31:43 +02:00
RECT16 extraRect = { 896 , 256 , 64 , 219 } ;
2020-04-05 18:44:41 +02:00
POLY_FT4 cd_sprite ;
2020-03-27 21:47:29 +01:00
2020-04-05 18:44:41 +02:00
SPRT extraSprt ;
POLY_FT3 extraDummy ;
2020-03-29 19:03:53 +02:00
// [D]
2020-03-29 14:13:32 +02:00
void SetVariable ( int var )
2020-03-27 21:47:29 +01:00
{
2020-04-11 00:12:50 +02:00
int code = ( var > > 8 ) ;
int value = ( var & 0xff ) ;
2020-03-27 21:47:29 +01:00
switch ( var > > 8 ) {
case 1 :
2020-04-11 00:12:50 +02:00
GameLevel = value ;
2020-03-27 21:47:29 +01:00
break ;
case 2 :
2020-04-11 00:12:50 +02:00
GameType = ( GAMETYPE ) value ;
if ( value ! = GAME_COPSANDROBBERS )
gWantNight = 0 ;
break ;
2020-03-27 21:47:29 +01:00
case 3 :
2020-04-11 00:12:50 +02:00
NumPlayers = ( value + 1 ) ;
2020-03-27 21:47:29 +01:00
break ;
case 4 :
2020-04-11 00:12:50 +02:00
if ( value ! = 0 )
2020-03-27 21:47:29 +01:00
gWantNight = 1 ;
break ;
case 5 :
gCurrentMissionNumber = 1 ;
GameType = GAME_MISSION ;
break ;
case 6 :
2020-03-29 19:03:53 +02:00
pScreenStack [ ScreenDepth ] = pCurrScreen ;
2020-04-11 00:12:50 +02:00
pButtonStack [ ScreenDepth ] = pCurrButton ;
if ( value = = 1 ) {
if ( CallMemoryCard ( 0x11 , 0 ) = = 0 ) {
ReInitFrontend ( ) ;
}
else {
StoredGameType = GameType ;
GameType = GAME_LOADEDREPLAY ;
GameStart ( ) ;
}
}
else {
2020-03-27 21:47:29 +01:00
CallMemoryCard ( 0x81 , 0 ) ;
ReInitFrontend ( ) ;
SetMasterVolume ( gMasterVolume ) ;
SetXMVolume ( gMusicVolume ) ;
}
2020-04-11 00:12:50 +02:00
break ;
2020-03-27 21:47:29 +01:00
case 7 :
2020-03-29 19:03:53 +02:00
pScreenStack [ ScreenDepth ] = pCurrScreen ;
2020-04-11 00:12:50 +02:00
pButtonStack [ ScreenDepth ] = pCurrButton ;
if ( value = = 0 ) {
2020-03-27 21:47:29 +01:00
CallMemoryCard ( 0x80 , 0 ) ;
2020-04-11 00:12:50 +02:00
ReInitFrontend ( ) ;
2020-03-27 21:47:29 +01:00
}
else {
2020-04-11 00:12:50 +02:00
if ( CallMemoryCard ( 0x21 , 0 ) = = 0 ) {
ReInitFrontend ( ) ;
} else {
2020-03-27 21:47:29 +01:00
GameType = GAME_CONTINUEMISSION ;
GameStart ( ) ;
}
}
2020-04-11 00:12:50 +02:00
2020-03-27 21:47:29 +01:00
break ;
case 8 :
2020-04-11 00:12:50 +02:00
gSubGameNumber = value ;
2020-03-27 21:47:29 +01:00
break ;
case 9 :
2020-04-11 00:12:50 +02:00
gSubtitles = ( value = = 0 ) ? 0 : 1 ;
2020-03-27 21:47:29 +01:00
break ;
case 10 :
2020-04-11 00:12:50 +02:00
gInvincibleCar = value ;
ActiveCheats . cheat3 = value ;
break ;
case 11 :
gPlayerImmune = value ;
ActiveCheats . cheat4 = value ;
2020-03-27 21:47:29 +01:00
break ;
2020-04-11 00:12:50 +02:00
case 12 :
2020-03-27 21:47:29 +01:00
GameLevel = 3 ;
2020-04-11 00:12:50 +02:00
gSubGameNumber = ( value = = 0 ) ? 2 : 0 ;
2020-03-27 21:47:29 +01:00
break ;
2020-04-11 00:12:50 +02:00
case 13 :
2020-03-27 21:47:29 +01:00
GameType = GAME_IDLEDEMO ;
2020-04-11 00:12:50 +02:00
gCurrentMissionNumber = ( value + 400 ) ;
break ;
2020-03-27 21:47:29 +01:00
}
}
// decompiled code
// original method signature:
// void /*$ra*/ LoadFrontendScreens()
// line 1371, offset 0x001c0c1c
/* begin block 1 */
2020-03-28 21:29:37 +01:00
// Start line: 1373
// Start offset: 0x001C0C1C
// Variables:
2020-03-27 21:47:29 +01:00
// int iTpage; // $s0
// int iNumScreens; // $t6
// int i; // $t0
// int j; // $a3
// struct RECT rect; // stack offset -40
// char *ptr; // $a2
/* end block 1 */
// End offset: 0x001C0F24
// End Line: 1454
/* begin block 2 */
// Start line: 2740
/* end block 2 */
// End Line: 2741
/* begin block 3 */
// Start line: 2750
/* end block 3 */
// End Line: 2751
/* begin block 4 */
// Start line: 2751
/* end block 4 */
// End Line: 2752
/* begin block 5 */
// Start line: 2761
/* end block 5 */
// End Line: 2762
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-28 16:43:40 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void LoadFrontendScreens ( void )
{
2020-03-28 16:43:40 +01:00
unsigned char uVar1 ;
2020-03-27 21:47:29 +01:00
int iVar2 ;
2020-03-28 16:43:40 +01:00
int * local_v1_356 ;
int * piVar3 ;
char * ptr ;
int iVar4 ;
2020-03-27 21:47:29 +01:00
int offset ;
2020-03-28 16:43:40 +01:00
int iVar5 ;
2020-03-28 21:29:37 +01:00
int iNumScreens ;
2020-03-28 16:43:40 +01:00
int iVar6 ;
int iVar7 ;
2020-03-27 21:47:29 +01:00
int iVar8 ;
2020-03-28 16:43:40 +01:00
short sVar9 ;
RECT16 rect ;
ShowLoadingScreen ( " GFX \\ FELOAD.TIM " , 1 , 0xc ) ;
2020-03-27 21:47:29 +01:00
ShowLoading ( ) ;
2020-03-28 16:43:40 +01:00
Loadfile ( " DATA \\ SCRS.BIN " , _frontend_buffer ) ;
2020-03-28 21:29:37 +01:00
ptr = _frontend_buffer + 20 ; // skip header and number of screens
iNumScreens = ( int ) _frontend_buffer [ 16 ] ;
if ( iNumScreens )
{
for ( int i = 0 ; i < iNumScreens ; i + + )
{
PsxScreens [ i ] . numButtons = * ptr + + ;
PsxScreens [ i ] . userFunctionNum = * ptr + + ;
if ( PsxScreens [ i ] . numButtons )
{
for ( int j = 0 ; j < PsxScreens [ i ] . numButtons ; j + + )
{
memcpy ( & PsxScreens [ i ] . buttons [ j ] , ptr , sizeof ( PSXBUTTON ) ) ;
ptr + = sizeof ( PSXBUTTON ) ;
}
2020-03-27 21:47:29 +01:00
}
2020-03-28 21:29:37 +01:00
}
2020-03-27 21:47:29 +01:00
}
2020-03-28 21:29:37 +01:00
rect . w = 64 ;
rect . h = 256 ;
2020-03-27 21:47:29 +01:00
ShowLoading ( ) ;
2020-03-28 16:43:40 +01:00
LoadBackgroundFile ( " DATA \\ GFX.RAW " ) ;
2020-03-28 21:29:37 +01:00
sVar9 = 640 ;
2020-03-27 21:47:29 +01:00
offset = 0x30000 ;
2020-03-28 16:43:40 +01:00
iVar7 = 1 ;
2020-03-29 14:13:32 +02:00
2020-03-27 21:47:29 +01:00
do {
2020-03-28 16:43:40 +01:00
iVar7 = iVar7 + - 1 ;
2020-03-27 21:47:29 +01:00
ShowLoading ( ) ;
2020-03-28 16:43:40 +01:00
LoadfileSeg ( " DATA \\ GFX.RAW " , _frontend_buffer , offset , 0x8000 ) ;
rect . y = 0x100 ;
rect . x = sVar9 ;
LoadImage ( & rect , ( u_long * ) _frontend_buffer ) ;
2020-03-27 21:47:29 +01:00
DrawSync ( 0 ) ;
2020-03-28 21:29:37 +01:00
sVar9 = sVar9 + 64 ;
2020-03-27 21:47:29 +01:00
offset = offset + 0x8000 ;
2020-03-28 16:43:40 +01:00
} while ( - 1 < iVar7 ) ;
2020-03-27 21:47:29 +01:00
ShowLoading ( ) ;
2020-03-29 14:13:32 +02:00
2020-03-28 16:43:40 +01:00
LoadfileSeg ( " DATA \\ GFX.RAW " , _frontend_buffer , 0x58000 , 0x8000 ) ;
2020-03-28 21:29:37 +01:00
rect . x = 960 ;
rect . y = 256 ;
2020-03-28 16:43:40 +01:00
LoadImage ( & rect , ( u_long * ) _frontend_buffer ) ;
2020-03-27 21:47:29 +01:00
DrawSync ( 0 ) ;
2020-03-28 21:29:37 +01:00
2020-03-29 18:10:37 +02:00
Loadfile ( " DATA \\ FEFONT.BNK " , ( char * ) & feFont ) ;
2020-03-29 14:33:48 +02:00
//PadChecks(); // [A] there is a bug too
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ LoadBackgroundFile(char *name /*$s4*/)
// line 1461, offset 0x001c0f24
/* begin block 1 */
// Start line: 1462
// Start offset: 0x001C0F24
// Variables:
// int iTpage; // $s2
// struct RECT rect; // stack offset -72
// int p; // $s0
// int pages[7]; // stack offset -64
/* end block 1 */
// End offset: 0x001C10F4
// End Line: 1509
/* begin block 2 */
// Start line: 2951
/* end block 2 */
// End Line: 2952
/* begin block 3 */
// Start line: 2959
/* end block 3 */
// End Line: 2960
2020-03-29 18:10:37 +02:00
// [D]
2020-03-27 21:47:29 +01:00
void LoadBackgroundFile ( char * name )
{
int iVar1 ;
int iVar2 ;
2020-04-01 13:31:43 +02:00
int p ;
2020-03-28 16:43:40 +01:00
int * piVar4 ;
RECT16 rect ;
2020-04-01 13:31:43 +02:00
int pages [ 6 ] ;
iVar1 = 11 ;
pages [ 0 ] = 0 ;
pages [ 1 ] = 1 ;
pages [ 2 ] = 2 ;
pages [ 3 ] = 3 ;
pages [ 4 ] = 4 ;
pages [ 5 ] = 5 ;
2020-03-28 16:43:40 +01:00
iVar2 = strcmp ( name , " DATA \\ GFX.RAW " ) ;
mainScreenLoaded = ( iVar2 = = 0 ) ;
2020-04-01 13:31:43 +02:00
piVar4 = pages ;
2020-03-28 16:43:40 +01:00
iVar2 = 5 ;
rect . w = 0x40 ;
rect . h = 0x100 ;
2020-03-27 21:47:29 +01:00
do {
FEDrawCDicon ( ) ;
2020-04-01 13:31:43 +02:00
p = * piVar4 ;
LoadfileSeg ( name , _overlay_buffer , p * 0x8000 , 0x8000 ) ;
2020-03-28 16:43:40 +01:00
piVar4 = piVar4 + 1 ;
2020-03-27 21:47:29 +01:00
FEDrawCDicon ( ) ;
2020-03-28 16:43:40 +01:00
iVar2 = iVar2 + - 1 ;
2020-04-01 13:31:43 +02:00
rect . y = ( short ) ( p / 6 ) ;
rect . x = ( ( short ) p + rect . y * - 6 ) * 64 + 640 ;
rect . y = rect . y * 256 ;
2020-04-01 01:27:09 +02:00
LoadImage ( & rect , ( u_long * ) _overlay_buffer ) ;
2020-03-27 21:47:29 +01:00
FEDrawCDicon ( ) ;
2020-03-28 16:43:40 +01:00
} while ( - 1 < iVar2 ) ;
2020-04-01 13:31:43 +02:00
LoadfileSeg ( name , _overlay_buffer , iVar1 * 0x8000 , 0x800 ) ;
2020-03-27 21:47:29 +01:00
FEDrawCDicon ( ) ;
2020-03-28 16:43:40 +01:00
rect . h = 1 ;
rect . y = ( short ) ( iVar1 / 6 ) ;
2020-04-01 13:31:43 +02:00
rect . x = ( ( short ) iVar1 + rect . y * - 6 ) * 64 + 640 ;
rect . y = rect . y * 256 ;
2020-04-01 01:27:09 +02:00
LoadImage ( & rect , ( u_long * ) _overlay_buffer ) ;
2020-03-27 21:47:29 +01:00
DrawSync ( 0 ) ;
SetupBackgroundPolys ( ) ;
2020-03-28 16:43:40 +01:00
return ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ SetupBackgroundPolys()
// line 1516, offset 0x001c10f4
/* begin block 1 */
// Start line: 1518
// Start offset: 0x001C10F4
// Variables:
// int i; // $v1
// int tpage; // $t3
/* end block 1 */
// End offset: 0x001C132C
// End Line: 1580
/* begin block 2 */
// Start line: 3110
/* end block 2 */
// End Line: 3111
/* begin block 3 */
// Start line: 3118
/* end block 3 */
// End Line: 3119
/* begin block 4 */
// Start line: 3119
/* end block 4 */
// End Line: 3120
/* begin block 5 */
// Start line: 3122
/* end block 5 */
// End Line: 3123
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-28 21:29:37 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void SetupBackgroundPolys ( void )
{
2020-03-28 21:29:37 +01:00
POLY_FT4 * poly ;
int i ;
2020-03-27 21:47:29 +01:00
2020-03-28 21:29:37 +01:00
poly = BackgroundPolys ;
i = 5 ;
2020-03-27 21:47:29 +01:00
do {
2020-03-28 21:29:37 +01:00
setPolyFT4 ( poly ) ;
setRGB0 ( poly , 128 , 128 , 128 ) ;
i - - ;
poly + + ;
} while ( - 1 < i ) ;
BackgroundPolys [ 0 ] . x0 = 0 ;
BackgroundPolys [ 0 ] . y0 = 0 ;
BackgroundPolys [ 0 ] . u0 = ' \0 ' ;
BackgroundPolys [ 0 ] . v0 = ' \x01 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 0 ] . clut = getClut ( 960 , 256 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 0 ] . x1 = 0x100 ;
BackgroundPolys [ 0 ] . y1 = 0 ;
BackgroundPolys [ 0 ] . u1 = - 1 ;
BackgroundPolys [ 0 ] . v1 = ' \x01 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 0 ] . tpage = getTPage ( 0 , 0 , 640 , 0 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 0 ] . x2 = 0 ;
BackgroundPolys [ 0 ] . y2 = 0x100 ;
BackgroundPolys [ 0 ] . u2 = ' \0 ' ;
BackgroundPolys [ 0 ] . v2 = - 1 ;
BackgroundPolys [ 0 ] . x3 = 0x100 ;
BackgroundPolys [ 0 ] . y3 = 0x100 ;
BackgroundPolys [ 0 ] . u3 = - 1 ;
BackgroundPolys [ 0 ] . v3 = - 1 ;
BackgroundPolys [ 1 ] . x0 = 0x100 ;
BackgroundPolys [ 1 ] . y0 = 0 ;
BackgroundPolys [ 1 ] . u0 = ' \0 ' ;
BackgroundPolys [ 1 ] . v0 = ' \x01 ' ;
BackgroundPolys [ 1 ] . clut = getClut ( 960 , 256 ) ;
BackgroundPolys [ 1 ] . x1 = 0x200 ;
BackgroundPolys [ 1 ] . y1 = 0 ;
BackgroundPolys [ 1 ] . u1 = - 1 ;
BackgroundPolys [ 1 ] . v1 = ' \x01 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 1 ] . tpage = getTPage ( 0 , 0 , 704 , 0 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 1 ] . x2 = 0x100 ;
BackgroundPolys [ 1 ] . y2 = 0x100 ;
BackgroundPolys [ 1 ] . u2 = ' \0 ' ;
BackgroundPolys [ 1 ] . v2 = - 1 ;
BackgroundPolys [ 1 ] . x3 = 0x200 ;
BackgroundPolys [ 1 ] . y3 = 0x100 ;
BackgroundPolys [ 1 ] . u3 = - 1 ;
BackgroundPolys [ 1 ] . v3 = - 1 ;
BackgroundPolys [ 2 ] . x0 = 0x200 ;
BackgroundPolys [ 2 ] . y0 = 0 ;
BackgroundPolys [ 2 ] . u0 = ' \0 ' ;
BackgroundPolys [ 2 ] . v0 = ' \x01 ' ;
BackgroundPolys [ 2 ] . clut = getClut ( 960 , 256 ) ;
BackgroundPolys [ 2 ] . x1 = 0x280 ;
BackgroundPolys [ 2 ] . y1 = 0 ;
BackgroundPolys [ 2 ] . u1 = - 0x80 ;
BackgroundPolys [ 2 ] . v1 = ' \x01 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 2 ] . tpage = getTPage ( 0 , 0 , 768 , 0 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 2 ] . x2 = 0x200 ;
BackgroundPolys [ 2 ] . y2 = 0x100 ;
BackgroundPolys [ 2 ] . u2 = ' \0 ' ;
BackgroundPolys [ 2 ] . v2 = - 1 ;
BackgroundPolys [ 2 ] . x3 = 0x280 ;
BackgroundPolys [ 2 ] . y3 = 0x100 ;
BackgroundPolys [ 2 ] . u3 = - 0x80 ;
BackgroundPolys [ 2 ] . v3 = - 1 ;
BackgroundPolys [ 3 ] . x0 = 0 ;
BackgroundPolys [ 3 ] . y0 = 0x100 ;
BackgroundPolys [ 3 ] . u0 = ' \0 ' ;
BackgroundPolys [ 3 ] . v0 = ' \0 ' ;
BackgroundPolys [ 3 ] . clut = getClut ( 960 , 256 ) ;
BackgroundPolys [ 3 ] . x1 = 0x100 ;
BackgroundPolys [ 3 ] . y1 = 0x100 ;
BackgroundPolys [ 3 ] . u1 = - 1 ;
BackgroundPolys [ 3 ] . v1 = ' \0 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 3 ] . tpage = getTPage ( 0 , 0 , 832 , 0 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 3 ] . x2 = 0 ;
BackgroundPolys [ 3 ] . y2 = 0x200 ;
BackgroundPolys [ 3 ] . u2 = ' \0 ' ;
BackgroundPolys [ 3 ] . v2 = - 1 ;
BackgroundPolys [ 3 ] . x3 = 0x100 ;
BackgroundPolys [ 3 ] . y3 = 0x200 ;
BackgroundPolys [ 3 ] . u3 = - 1 ;
BackgroundPolys [ 3 ] . v3 = - 1 ;
BackgroundPolys [ 4 ] . x0 = 0x100 ;
BackgroundPolys [ 4 ] . y0 = 0x100 ;
BackgroundPolys [ 4 ] . u0 = ' \0 ' ;
BackgroundPolys [ 4 ] . v0 = ' \0 ' ;
BackgroundPolys [ 4 ] . clut = getClut ( 960 , 256 ) ;
BackgroundPolys [ 4 ] . x1 = 0x200 ;
BackgroundPolys [ 4 ] . y1 = 0x100 ;
BackgroundPolys [ 4 ] . u1 = - 1 ;
BackgroundPolys [ 4 ] . v1 = ' \0 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 4 ] . tpage = getTPage ( 0 , 0 , 896 , 0 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 4 ] . x2 = 0x100 ;
BackgroundPolys [ 4 ] . y2 = 0x200 ;
BackgroundPolys [ 4 ] . u2 = ' \0 ' ;
BackgroundPolys [ 4 ] . v2 = - 1 ;
BackgroundPolys [ 4 ] . x3 = 0x200 ;
BackgroundPolys [ 4 ] . y3 = 0x200 ;
BackgroundPolys [ 4 ] . u3 = - 1 ;
BackgroundPolys [ 4 ] . v3 = - 1 ;
BackgroundPolys [ 5 ] . x0 = 0x200 ;
BackgroundPolys [ 5 ] . y0 = 0x100 ;
BackgroundPolys [ 5 ] . u0 = ' \0 ' ;
BackgroundPolys [ 5 ] . v0 = ' \0 ' ;
BackgroundPolys [ 5 ] . clut = getClut ( 960 , 256 ) ;
BackgroundPolys [ 5 ] . x1 = 0x280 ;
BackgroundPolys [ 5 ] . y1 = 0x100 ;
BackgroundPolys [ 5 ] . u1 = - 0x80 ;
BackgroundPolys [ 5 ] . v1 = ' \0 ' ;
2020-03-29 14:13:32 +02:00
BackgroundPolys [ 5 ] . tpage = getTPage ( 0 , 0 , 960 , 0 ) ;
2020-03-28 21:29:37 +01:00
BackgroundPolys [ 5 ] . x2 = 0x200 ;
BackgroundPolys [ 5 ] . y2 = 0x200 ;
BackgroundPolys [ 5 ] . u2 = ' \0 ' ;
BackgroundPolys [ 5 ] . v2 = - 1 ;
BackgroundPolys [ 5 ] . x3 = 0x280 ;
BackgroundPolys [ 5 ] . y3 = 0x200 ;
BackgroundPolys [ 5 ] . u3 = - 0x80 ;
BackgroundPolys [ 5 ] . v3 = - 1 ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ SetupScreenSprts(struct PSXSCREEN *pScr /*$a0*/)
// line 1588, offset 0x001c132c
/* begin block 1 */
// Start line: 1589
// Start offset: 0x001C132C
// Variables:
// int tpage; // $a1
// struct POLY_FT3 *null; // $v0
/* end block 1 */
// End offset: 0x001C147C
// End Line: 1650
/* begin block 2 */
// Start line: 3344
/* end block 2 */
// End Line: 3345
/* begin block 3 */
// Start line: 3353
/* end block 3 */
// End Line: 3354
/* begin block 4 */
// Start line: 3363
/* end block 4 */
// End Line: 3364
2020-03-28 21:29:37 +01:00
SPRT HighlightSprt ;
POLY_FT4 HighlightDummy ;
// [D]
2020-03-27 21:47:29 +01:00
void SetupScreenSprts ( PSXSCREEN * pScr )
{
2020-03-28 21:29:37 +01:00
int result ;
setSprt ( & HighlightSprt ) ;
setRGB0 ( & HighlightSprt , 128 , 128 , 128 ) ;
HighlightSprt . x0 = 0x16c ;
HighlightSprt . y0 = 0xc6 ;
HighlightSprt . w = 0x100 ;
HighlightSprt . u0 = ' \0 ' ;
HighlightSprt . v0 = ' \0 ' ;
HighlightSprt . h = 0x24 ;
setClut ( & HighlightSprt , 960 , 258 ) ;
setPolyFT4 ( & HighlightDummy ) ;
2020-03-29 14:13:32 +02:00
//HighlightDummy.code = '$';
2020-03-28 21:29:37 +01:00
HighlightDummy . x0 = - 1 ;
HighlightDummy . y0 = - 1 ;
HighlightDummy . x1 = - 1 ;
HighlightDummy . y1 = - 1 ;
HighlightDummy . x2 = - 1 ;
HighlightDummy . y2 = - 1 ;
//setTPage(&HighlightDummy, 0,0, 1728, 256); // feels wrong
HighlightDummy . tpage = 0x1b ;
pNewScreen = NULL ;
2020-03-27 21:47:29 +01:00
pCurrScreen = pScr ;
2020-03-28 21:29:37 +01:00
2020-03-27 21:47:29 +01:00
if ( pScr - > userFunctionNum = = 0 ) {
2020-03-28 21:29:37 +01:00
if ( pNewButton = = NULL ) {
2020-03-27 21:47:29 +01:00
pCurrButton = pScr - > buttons ;
}
else {
2020-03-28 21:29:37 +01:00
pCurrButton = pNewButton ;
pNewButton = NULL ;
2020-03-27 21:47:29 +01:00
}
}
else {
2020-03-28 21:29:37 +01:00
result = ( fpUserFunctions [ pScr - > userFunctionNum - 1 ] ) ( 1 ) ;
if ( result = = 0 ) {
if ( pNewButton = = NULL ) {
2020-03-27 21:47:29 +01:00
pCurrButton = pCurrScreen - > buttons ;
}
else {
2020-03-28 21:29:37 +01:00
pCurrButton = pNewButton ;
pNewButton = NULL ;
2020-03-27 21:47:29 +01:00
}
}
}
return ;
}
// decompiled code
// original method signature:
// void /*$ra*/ DrawScreen(struct PSXSCREEN *pScr /*stack 0*/)
// line 1658, offset 0x001c147c
/* begin block 1 */
// Start line: 1659
// Start offset: 0x001C147C
// Variables:
// int i; // $s1
// char version_info[32]; // stack offset -88
// int numBtnsToDraw; // stack offset -56
/* end block 1 */
// End offset: 0x001C18B4
// End Line: 1760
/* begin block 2 */
// Start line: 3516
/* end block 2 */
// End Line: 3517
/* begin block 3 */
// Start line: 3525
/* end block 3 */
// End Line: 3526
2020-03-29 01:56:49 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void DrawScreen ( PSXSCREEN * pScr )
{
short sVar1 ;
DB * pDVar2 ;
2020-03-29 14:13:32 +02:00
u_long * puVar3 ;
2020-03-27 21:47:29 +01:00
uint uVar4 ;
int local_68 ;
char * string ;
2020-03-29 01:56:49 +01:00
POLY_FT4 * pPVar5 ;
2020-03-27 21:47:29 +01:00
PSXSCREEN * pPVar6 ;
int iVar7 ;
PSXBUTTON * pPVar8 ;
char * pcVar9 ;
char * pcVar10 ;
char * string_00 ;
char * pcVar11 ;
int local_64 ;
int local_60 ;
2020-03-29 01:56:49 +01:00
char version_info [ 32 ] ;
int numBtnsToDraw ;
2020-03-27 21:47:29 +01:00
int local_34 ;
char * local_30 ;
pDVar2 = current ;
2020-03-29 01:56:49 +01:00
pPVar5 = BackgroundPolys ;
2020-03-27 21:47:29 +01:00
iVar7 = 5 ;
do {
2020-03-29 14:13:32 +02:00
addPrim ( & pDVar2 - > ot [ 0xb ] , pPVar5 ) ;
2020-04-06 13:59:27 +02:00
2020-03-29 01:56:49 +01:00
iVar7 = iVar7 + - 1 ;
pPVar5 = pPVar5 + 1 ;
2020-03-27 21:47:29 +01:00
} while ( - 1 < iVar7 ) ;
2020-03-29 14:13:32 +02:00
2020-03-29 01:56:49 +01:00
if ( pScr = = NULL ) {
2020-03-27 21:47:29 +01:00
EndFrame ( ) ;
}
else {
2020-03-29 01:56:49 +01:00
GetTimeStamp ( version_info ) ;
2020-04-05 22:04:37 +02:00
2020-03-29 01:56:49 +01:00
if ( ( bDoingCutSelect = = 0 ) | | ( 0x27 < gFurthestMission ) ) {
uVar4 = ( uint ) pScr - > numButtons ;
2020-03-27 21:47:29 +01:00
}
else {
2020-03-29 01:56:49 +01:00
uVar4 = ( uint ) pScr - > numButtons - 1 ;
2020-03-27 21:47:29 +01:00
}
iVar7 = 0 ;
2020-03-29 01:56:49 +01:00
if ( 0 < ( int ) uVar4 ) {
2020-03-27 21:47:29 +01:00
local_34 = 0 ;
pcVar9 = pScr - > buttons [ 0 ] . Name ;
pPVar8 = pScr - > buttons ;
pPVar6 = pScr ;
pcVar10 = pcVar9 ;
string_00 = pcVar9 ;
pcVar11 = pcVar9 ;
local_30 = pcVar9 ;
do {
local_68 = * ( int * ) ( ( int ) & pScr - > buttons [ 0 ] . action + local_34 ) > > 8 ;
if ( local_68 ! = 5 ) {
if ( pPVar8 = = pCurrButton ) {
string = pcVar10 ;
if ( local_68 = = 3 ) {
LAB_FRNT__001c16a8 :
sVar1 = pPVar6 - > buttons [ 0 ] . x ;
local_68 = 0x20 ;
local_64 = 0x20 ;
local_60 = 0x20 ;
}
else {
string = pcVar11 ;
2020-03-29 01:56:49 +01:00
if ( ( ( ( bMissionSelect ! = 0 ) & & ( ( iVar7 = = 0 | | ( iVar7 = = 5 ) ) ) ) | |
( ( bDoingCarSelect ! = 0 & & ( ( iVar7 = = 0 | | ( iVar7 = = 2 ) ) ) ) ) ) | |
2020-03-29 22:33:32 +02:00
( ( bInCutSelect ! = 0 & & ( ( iVar7 = = 0 | | ( iVar7 = = 2 ) ) ) ) ) ) {
2020-03-27 21:47:29 +01:00
LAB_FRNT__001c174c :
2020-03-29 01:56:49 +01:00
FEPrintString ( string , ( int ) pPVar6 - > buttons [ 0 ] . x * 2 +
( int ) pPVar6 - > buttons [ 0 ] . w ,
2020-03-27 21:47:29 +01:00
( int ) pPVar6 - > buttons [ 0 ] . y , 4 , 0x7c , 0x6c , 0x28 ) ;
goto LAB_FRNT__001c17ac ;
}
sVar1 = pPVar6 - > buttons [ 0 ] . x ;
local_68 = 0x80 ;
local_64 = 0x80 ;
local_60 = 0x80 ;
string = pcVar9 ;
}
FEPrintString ( string , ( int ) sVar1 * 2 + ( int ) pPVar6 - > buttons [ 0 ] . w ,
( int ) pPVar6 - > buttons [ 0 ] . y , 4 , local_68 , local_64 , local_60 ) ;
}
else {
if ( local_68 = = 3 ) {
string = pPVar8 - > Name ;
goto LAB_FRNT__001c16a8 ;
}
string = local_30 ;
2020-03-29 01:56:49 +01:00
if ( ( ( ( bMissionSelect ! = 0 ) & & ( ( iVar7 = = 0 | | ( iVar7 = = 5 ) ) ) ) | |
( ( bDoingCarSelect ! = 0 & & ( ( iVar7 = = 0 | | ( iVar7 = = 2 ) ) ) ) ) ) | |
2020-03-29 22:33:32 +02:00
( ( bInCutSelect ! = 0 & & ( ( iVar7 = = 0 | | ( iVar7 = = 2 ) ) ) ) ) )
2020-03-27 21:47:29 +01:00
goto LAB_FRNT__001c174c ;
2020-03-29 01:56:49 +01:00
FEPrintString ( string_00 ,
( int ) pPVar6 - > buttons [ 0 ] . x * 2 + ( int ) pPVar6 - > buttons [ 0 ] . w ,
2020-03-27 21:47:29 +01:00
( int ) pPVar6 - > buttons [ 0 ] . y , 4 , 0x80 , 0x80 , 0x80 ) ;
}
}
LAB_FRNT__001c17ac :
pPVar6 = ( PSXSCREEN * ) ( pPVar6 - > buttons [ 0 ] . Name + 0x1c ) ;
string_00 = string_00 + 0x3c ;
pcVar9 = pcVar9 + 0x3c ;
pcVar11 = pcVar11 + 0x3c ;
pcVar10 = pcVar10 + 0x3c ;
pPVar8 = pPVar8 + 1 ;
iVar7 = iVar7 + 1 ;
local_34 = local_34 + 0x3c ;
local_30 = local_30 + 0x3c ;
2020-03-29 01:56:49 +01:00
} while ( iVar7 < ( int ) uVar4 ) ;
2020-04-05 22:04:37 +02:00
# ifdef _DEBUG
FEPrintString ( version_info , 40 , 16 , 0 , 128 , 128 , 0 ) ;
FEPrintString ( " --- " GAME_VERSION " --- " , 320 , 16 , 0 , 128 , 128 , 0 ) ;
# endif
2020-03-27 21:47:29 +01:00
}
SetTextColour ( - 0x80 , ' \0 ' , ' \0 ' ) ;
2020-04-05 22:04:37 +02:00
2020-03-27 21:47:29 +01:00
DisplayOnScreenText ( ) ;
pDVar2 = current ;
2020-03-29 18:10:37 +02:00
2020-03-29 01:56:49 +01:00
if ( bDrawExtra ! = 0 ) {
2020-03-29 18:10:37 +02:00
addPrim ( current - > ot + 2 , & extraSprt ) ;
addPrim ( current - > ot + 3 , & extraDummy ) ;
2020-03-27 21:47:29 +01:00
}
}
}
// decompiled code
// original method signature:
// void /*$ra*/ DisplayOnScreenText()
// line 1769, offset 0x001c18e4
/* begin block 1 */
// Start line: 1771
// Start offset: 0x001C18E4
// Variables:
// int i; // $s0
// char text[32]; // stack offset -64
/* begin block 1.1 */
// Start line: 1795
// Start offset: 0x001C19DC
/* begin block 1.1.1 */
// Start line: 1797
// Start offset: 0x001C19E4
/* end block 1.1.1 */
// End offset: 0x001C19EC
// End Line: 1798
/* end block 1.1 */
// End offset: 0x001C19EC
// End Line: 1799
/* begin block 1.2 */
// Start line: 1807
// Start offset: 0x001C1A4C
// Variables:
// int extraVal; // $t1
/* end block 1.2 */
// End offset: 0x001C1AAC
// End Line: 1810
/* end block 1 */
// End offset: 0x001C1AD0
// End Line: 1847
/* begin block 2 */
// Start line: 3804
/* end block 2 */
// End Line: 3805
/* begin block 3 */
// Start line: 3805
/* end block 3 */
// End Line: 3806
/* begin block 4 */
// Start line: 3809
/* end block 4 */
// End Line: 3810
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-29 22:33:32 +02:00
char cutUnlock [ ] = {
0x02 , 0x02 , 0x02 , 0x04 , 0x05 ,
0x06 , 0x07 , 0x07 , 0x07 , 0x09 ,
0x0b , 0x0b , 0x0b , 0x0b , 0x0c ,
0x0c , 0x0d , 0x0d , 0x0e , 0x0f ,
0x11 , 0x11 , 0x11 , 0x11 , 0x12 ,
0x12 , 0x13 , 0x13 , 0x13 , 0x13 ,
0x15 , 0x15 , 0x15 , 0x15 , 0x16 ,
0x16 , 0x16 , 0x17 , 0x17 , 0x17 ,
0x1c } ;
char * NullStr = " \0 " ;
// [D]
2020-03-27 21:47:29 +01:00
void DisplayOnScreenText ( void )
{
uint transparent ;
char * __src ;
int iVar1 ;
char * * ppcVar2 ;
2020-03-29 22:33:32 +02:00
sprintf ( ScreenTitle , NullStr ) ;
if ( padsConnected [ 0 ] = = 0 ) {
2020-03-27 21:47:29 +01:00
transparent = ( uint ) Pads [ 0 ] . type ;
if ( Pads [ 0 ] . type = = ' \0 ' ) {
2020-03-29 22:33:32 +02:00
__src = " Please insert controller into Port 1 " ;
transparent = 1 ;
2020-03-27 21:47:29 +01:00
}
else {
if ( Pads [ 0 ] . type ! = ' \x01 ' ) {
return ;
}
2020-03-29 22:33:32 +02:00
__src = " Incompatible controller in Port 1 " ;
2020-03-27 21:47:29 +01:00
}
FEPrintStringSized ( __src , 0x28 , 400 , 0xc00 , transparent , 0x40 , 0x40 , 0x40 ) ;
}
else {
2020-03-29 22:33:32 +02:00
if ( ( bDoingScores = = 0 ) & & ( iVar1 = 0 , bDoingCarSelect = = 0 ) ) {
2020-03-27 21:47:29 +01:00
if ( 0 < ScreenDepth ) {
2020-03-29 22:33:32 +02:00
ppcVar2 = ScreenNames ;
2020-03-27 21:47:29 +01:00
do {
if ( 0 < iVar1 ) {
2020-03-29 22:33:32 +02:00
strcat ( ScreenTitle , ( char * ) " - " ) ;
2020-03-27 21:47:29 +01:00
}
__src = * ppcVar2 ;
ppcVar2 = ppcVar2 + 1 ;
2020-03-29 22:33:32 +02:00
strcat ( ScreenTitle , __src ) ;
2020-03-27 21:47:29 +01:00
iVar1 = iVar1 + 1 ;
} while ( iVar1 < ScreenDepth ) ;
}
2020-03-29 22:33:32 +02:00
FEPrintStringSized ( ScreenTitle , 0x28 , 400 , 0xc00 , 1 , 0x40 , 0x40 , 0x40 ) ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 22:33:32 +02:00
if ( bInCutSelect ! = 0 ) {
FEPrintStringSized ( CutSceneNames [ cutSelection + CutAmountsTotal [ currCity ] ] , 100 , 0xe2 ,
0xc00 , 1 , 0x60 , 0x60 , 0x60 ) ;
2020-03-27 21:47:29 +01:00
}
}
}
// decompiled code
// original method signature:
// void /*$ra*/ SetupExtraPoly(char *fileName /*$s5*/, int offset /*$s1*/, int offset2 /*$s0*/)
// line 1855, offset 0x001c1ad0
/* begin block 1 */
// Start line: 1856
// Start offset: 0x001C1AD0
// Variables:
// int i; // $s0
// int tpage; // $v1
// struct RECT rect; // stack offset -40
/* end block 1 */
// End offset: 0x001C1CF4
// End Line: 1916
/* begin block 2 */
// Start line: 3983
/* end block 2 */
// End Line: 3984
/* begin block 3 */
// Start line: 3992
/* end block 3 */
// End Line: 3993
/* begin block 4 */
// Start line: 3996
/* end block 4 */
// End Line: 3997
2020-03-29 18:10:37 +02:00
// [D]
2020-03-27 21:47:29 +01:00
void SetupExtraPoly ( char * fileName , int offset , int offset2 )
{
int iVar1 ;
int iVar2 ;
2020-03-29 18:10:37 +02:00
char * * ppuVar3 ;
RECT16 rect ;
2020-03-27 21:47:29 +01:00
2020-03-29 18:10:37 +02:00
rect = extraRect ;
2020-03-27 21:47:29 +01:00
FEDrawCDicon ( ) ;
2020-03-29 18:10:37 +02:00
Loadfile ( fileName , _frontend_buffer + offset2 ) ;
setSprt ( & extraSprt ) ;
//extraSprt.tag._3_1_ = 4;
//extraSprt.code = 'd';
extraSprt . x0 = 100 ;
2020-04-01 13:31:43 +02:00
extraSprt . w = 255 ;
extraSprt . y0 = 226 ;
extraSprt . r0 = 128 ;
extraSprt . g0 = 128 ;
extraSprt . b0 = 128 ;
2020-03-29 18:10:37 +02:00
extraSprt . u0 = ' \0 ' ;
extraSprt . v0 = ' \0 ' ;
extraSprt . h = 219 ;
extraSprt . clut = 0x403c ;
rect . x = 896 ;
rect . y = 256 ;
rect . w = 64 ;
rect . h = 219 ;
LoadImage ( & rect , ( u_long * ) ( _frontend_buffer + offset2 + offset * 0x8000 ) ) ;
2020-03-27 21:47:29 +01:00
DrawSync ( 0 ) ;
VSync ( 0 ) ;
2020-03-29 18:10:37 +02:00
setPolyFT3 ( & extraDummy ) ;
extraDummy . x0 = - 1 ;
extraDummy . y0 = - 1 ;
extraDummy . x1 = - 1 ;
extraDummy . y1 = - 1 ;
extraDummy . x2 = - 1 ;
extraDummy . y2 = - 1 ;
extraDummy . tpage = 0x1e ;
bDrawExtra = 1 ;
iVar1 = strcmp ( fileName , " DATA \\ CITY.RAW " ) ;
2020-03-27 21:47:29 +01:00
if ( iVar1 = = 0 ) {
2020-03-29 18:10:37 +02:00
loaded [ 0 ] = 1 ;
2020-03-29 22:33:32 +02:00
loaded [ 1 ] = - 1 ;
2020-03-27 21:47:29 +01:00
}
iVar1 = 0 ;
2020-03-29 18:10:37 +02:00
ppuVar3 = gfxNames ;
2020-03-27 21:47:29 +01:00
do {
iVar2 = strcmp ( fileName , * ppuVar3 ) ;
if ( iVar2 = = 0 ) {
2020-03-29 18:10:37 +02:00
loaded [ 0 ] = - 1 ;
loaded [ 1 ] = ( char ) iVar1 ;
loaded [ 2 ] = - 1 ;
2020-03-27 21:47:29 +01:00
}
iVar1 = iVar1 + 1 ;
ppuVar3 = ppuVar3 + 1 ;
} while ( iVar1 < 4 ) ;
iVar1 = 0 ;
2020-03-29 18:10:37 +02:00
ppuVar3 = cutGfxNames ;
2020-03-27 21:47:29 +01:00
do {
iVar2 = strcmp ( fileName , * ppuVar3 ) ;
if ( iVar2 = = 0 ) {
2020-03-29 18:10:37 +02:00
loaded [ 1 ] = - 1 ;
loaded [ 2 ] = ( char ) iVar1 ;
2020-03-27 21:47:29 +01:00
}
iVar1 = iVar1 + 1 ;
ppuVar3 = ppuVar3 + 1 ;
} while ( iVar1 < 4 ) ;
}
// decompiled code
// original method signature:
// void /*$ra*/ ReInitScreens()
// line 1941, offset 0x001c1cf4
/* begin block 1 */
// Start line: 4221
/* end block 1 */
// End Line: 4222
/* begin block 2 */
// Start line: 4247
/* end block 2 */
// End Line: 4248
/* begin block 3 */
// Start line: 4248
/* end block 3 */
// End Line: 4249
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-04-05 18:44:41 +02:00
// [D]
2020-03-27 21:47:29 +01:00
void ReInitScreens ( void )
{
2020-04-05 18:44:41 +02:00
# ifndef PSX
bCdIconSetup = 0 ;
bDoingScores = 0 ;
bInCutSelect = 0 ;
cutSelection = 0 ;
currCity = 0 ;
bRedrawFrontend = 0 ;
bReturnToMain = 0 ;
idle_timer = 0 ;
currPlayer = 1 ;
fePad = 0 ;
ScreenDepth = 0 ;
gIdleReplay = 0 ;
padsConnected [ 0 ] = 1 ;
padsConnected [ 1 ] = 0 ;
bCdIconSetup = 0 ;
bMissionSelect = 0 ;
bDoingCarSelect = 0 ;
bDoingCutSelect = 0 ;
bDrawExtra = 0 ;
mainScreenLoaded = 1 ;
bDoneAllready = 0 ;
allowVibration = 1 ;
ScreenNames [ 0 ] = 0 ;
gInFrontend = 1 ;
# endif // !PSX
if ( bCdIconSetup = = 0 ) {
2020-03-27 21:47:29 +01:00
FEInitCdIcon ( ) ;
}
if ( bReturnToMain = = 0 ) {
bReturnToMain = 1 ;
}
else {
ScreenDepth = 0 ;
NumPlayers = 1 ;
gWantNight = 0 ;
gNight = 0 ;
gTimeOfDay = 1 ;
gSubGameNumber = 0 ;
2020-04-05 18:44:41 +02:00
feVariableSave [ 3 ] = - 1 ;
feVariableSave [ 2 ] = - 1 ;
feVariableSave [ 1 ] = - 1 ;
feVariableSave [ 0 ] = - 1 ;
if ( mainScreenLoaded = = 0 )
{
bDrawExtra = 0 ;
LoadBackgroundFile ( " DATA \\ GFX.RAW " ) ;
2020-03-27 21:47:29 +01:00
}
}
2020-04-05 18:44:41 +02:00
pCurrScreen = pScreenStack [ ScreenDepth ] ;
pNewButton = pButtonStack [ ScreenDepth ] ;
2020-03-27 21:47:29 +01:00
SetupScreenSprts ( pCurrScreen ) ;
SetupBackgroundPolys ( ) ;
2020-04-05 18:44:41 +02:00
idle_timer = VSync ( 0xffffffff ) ;
return ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ NewSelection(short dir /*$s3*/)
// line 1991, offset 0x001c1e18
/* begin block 1 */
// Start line: 1992
// Start offset: 0x001C1E18
// Variables:
// struct RECT rect; // stack offset -48
// struct PSXBUTTON *pNewB; // $s2
/* end block 1 */
// End offset: 0x001C227C
// End Line: 2085
/* begin block 2 */
// Start line: 4367
/* end block 2 */
// End Line: 4368
/* begin block 3 */
// Start line: 4369
/* end block 3 */
// End Line: 4370
2020-03-29 14:13:32 +02:00
DR_MOVE In ;
DR_MOVE Out ;
RECT16 storeRect = { 768 , 475 , 255 , 36 } ;
2020-03-29 14:33:48 +02:00
// [D]
2020-03-27 21:47:29 +01:00
void NewSelection ( short dir )
{
DB * pDVar1 ;
PSXBUTTON * pPVar2 ;
PSXBUTTON * pPVar3 ;
uint uVar4 ;
2020-03-29 14:13:32 +02:00
RECT16 rect ;
2020-03-27 21:47:29 +01:00
pPVar2 = pCurrButton ;
2020-03-29 16:08:55 +02:00
uVar4 = dir ; // >> 10; //SEXT24(dir);
2020-03-27 21:47:29 +01:00
if ( pCurrScreen - > numButtons = = ' \0 ' ) {
return ;
}
if ( uVar4 ! = 0 ) {
2020-03-29 14:13:32 +02:00
SetDrawMove ( & In , & storeRect , ( int ) pCurrButton - > s_x , ( int ) pCurrButton - > s_y ) ;
addPrim ( current - > ot + 9 , & In ) ;
//In.tag = In.tag & 0xff000000 | *(uint *)current->ot[9] & 0xffffff;
//*(uint *)current->ot[9] = *(uint *)current->ot[9] & 0xff000000 | 0x1cc550;
2020-03-27 21:47:29 +01:00
}
pPVar3 = pPVar2 ;
if ( ( uVar4 & 0x1000 ) = = 0 ) {
if ( ( uVar4 & 0x4000 ) = = 0 ) {
if ( ( uVar4 & 0x8000 ) = = 0 ) {
pPVar3 = pCurrButton ;
if ( ( ( uVar4 & 0x2000 ) = = 0 ) | | ( pPVar3 = pPVar2 , pCurrButton - > r = = ' \0 ' ) )
goto LAB_FRNT__001c1ff4 ;
FESound ( 3 ) ;
uVar4 = ( uint ) pCurrButton - > r ;
}
else {
if ( pCurrButton - > l = = ' \0 ' ) goto LAB_FRNT__001c1ff4 ;
FESound ( 3 ) ;
uVar4 = ( uint ) pCurrButton - > l ;
}
}
else {
if ( pCurrButton - > d = = ' \0 ' ) goto LAB_FRNT__001c1ff4 ;
FESound ( 3 ) ;
uVar4 = ( uint ) pCurrButton - > d ;
}
}
else {
if ( pCurrButton - > u = = ' \0 ' ) goto LAB_FRNT__001c1ff4 ;
FESound ( 3 ) ;
uVar4 = ( uint ) pCurrButton - > u ;
}
pPVar3 = ( PSXBUTTON * ) & pCurrScreen [ - 1 ] . buttons [ uVar4 + 7 ] . w ;
LAB_FRNT__001c1ff4 :
2020-03-29 14:13:32 +02:00
rect . x = pPVar3 - > s_x ;
rect . y = pPVar3 - > s_y ;
rect . w = 0xff ;
rect . h = 0x24 ;
SetDrawMove ( & Out , & rect , ( int ) storeRect . x , ( int ) storeRect . y ) ;
2020-03-27 21:47:29 +01:00
pDVar1 = current ;
2020-03-29 14:13:32 +02:00
addPrim ( current - > ot + 8 , & Out ) ;
//Out.tag = Out.tag & 0xff000000 | *(uint *)current->ot[8] & 0xffffff;
//*(uint *)current->ot[8] = *(uint *)current->ot[8] & 0xff000000 | 0x1cc570;
HighlightSprt . x0 = pPVar3 - > s_x ;
HighlightSprt . y0 = pPVar3 - > s_y ;
addPrim ( pDVar1 - > ot + 6 , & HighlightSprt ) ;
//HighlightSprt.tag = HighlightSprt.tag & 0xff000000 | *(uint *)pDVar1->ot[6] & 0xffffff;
2020-03-27 21:47:29 +01:00
pCurrButton = pPVar3 ;
2020-03-29 14:13:32 +02:00
addPrim ( pDVar1 - > ot + 7 , & HighlightDummy ) ;
2020-04-08 20:46:50 +02:00
2020-03-27 21:47:29 +01:00
if ( pPVar3 - > action > > 8 = = 3 ) {
2020-03-29 14:13:32 +02:00
FEPrintString ( pPVar3 - > Name , ( int ) pPVar3 - > x * 2 + ( int ) pPVar3 - > w , ( int ) pPVar3 - > y , 4 , 0x20 , 0x20 ,
0x20 ) ;
2020-03-27 21:47:29 +01:00
}
else {
2020-03-29 14:13:32 +02:00
if ( ( ( ( bDoingCarSelect = = 0 ) | |
2020-03-27 21:47:29 +01:00
( ( pPVar3 ! = pCurrScreen - > buttons & & ( pPVar3 ! = pCurrScreen - > buttons + 2 ) ) ) ) & &
2020-03-29 14:13:32 +02:00
( ( bMissionSelect = = 0 | |
2020-03-27 21:47:29 +01:00
( ( pPVar3 ! = pCurrScreen - > buttons & & ( pPVar3 ! = pCurrScreen - > buttons + 5 ) ) ) ) ) ) & &
2020-03-29 22:33:32 +02:00
( ( bInCutSelect = = 0 | |
2020-04-08 20:46:50 +02:00
( ( pPVar3 ! = pCurrScreen - > buttons & & ( pPVar3 ! = pCurrScreen - > buttons + 2 ) ) ) ) ) )
{
2020-03-27 21:47:29 +01:00
FEPrintString ( pCurrButton - > Name , ( int ) pCurrButton - > x * 2 + ( int ) pCurrButton - > w ,
( int ) pCurrButton - > y , 4 , 0x80 , 0x80 , 0x80 ) ;
}
else {
FEPrintString ( pCurrButton - > Name , ( int ) pCurrButton - > x * 2 + ( int ) pCurrButton - > w ,
( int ) pCurrButton - > y , 4 , 0x7c , 0x6c , 0x28 ) ;
}
}
EndFrame ( ) ;
}
// decompiled code
// original method signature:
// int /*$ra*/ HandleKeyPress()
// line 2093, offset 0x001c22a8
/* begin block 1 */
// Start line: 2095
// Start offset: 0x001C22A8
/* begin block 1.1 */
// Start line: 2112
// Start offset: 0x001C2340
// Variables:
// int action; // $s0
/* begin block 1.1.1 */
// Start line: 2141
// Start offset: 0x001C244C
/* end block 1.1.1 */
// End offset: 0x001C2510
// End Line: 2166
/* end block 1.1 */
// End offset: 0x001C2564
// End Line: 2186
/* end block 1 */
// End offset: 0x001C2668
// End Line: 2232
/* begin block 2 */
// Start line: 4610
/* end block 2 */
// End Line: 4611
/* begin block 3 */
// Start line: 4611
/* end block 3 */
// End Line: 4612
/* begin block 4 */
// Start line: 4613
/* end block 4 */
// End Line: 4614
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-29 14:33:48 +02:00
// [D]
2020-03-27 21:47:29 +01:00
int HandleKeyPress ( void )
{
2020-04-11 00:12:50 +02:00
if ( ( pCurrScreen = = NULL ) | | ( pCurrButton = = NULL ) )
return 0 ;
2020-03-27 21:47:29 +01:00
2020-04-11 00:12:50 +02:00
if ( pCurrScreen - > userFunctionNum ! = 0 ) {
if ( ( fpUserFunctions [ pCurrScreen - > userFunctionNum - 1 ] ) ( 0 ) ! = 0 )
2020-03-29 14:33:48 +02:00
fePad = 0 ;
2020-04-11 00:12:50 +02:00
}
if ( ( fePad & 0x40U ) = = 0 ) {
if ( ( fePad & 0x10U ) = = 0 ) {
if ( ( ( ( fePad & 0x5000U ) = = 0 ) & & ( ( fePad & 0x8000U ) = = 0 ) ) & &
( ( fePad & 0x2000U ) = = 0 ) ) {
return 1 ;
}
NewSelection ( fePad ) ;
2020-03-27 21:47:29 +01:00
}
2020-04-11 00:12:50 +02:00
else {
if ( 0 < ScreenDepth ) {
if ( bDoneAllready = = 0 ) {
FESound ( 0 ) ;
2020-03-27 21:47:29 +01:00
}
2020-04-11 00:12:50 +02:00
else {
bDoneAllready = 0 ;
}
ScreenDepth = ScreenDepth + - 1 ;
if ( ScreenDepth = = 0 ) {
gWantNight = 0 ;
gSubGameNumber = 0 ;
NumPlayers = 1 ;
2020-03-27 21:47:29 +01:00
}
2020-04-11 00:12:50 +02:00
pNewScreen = pScreenStack [ ScreenDepth ] ;
pNewButton = pButtonStack [ ScreenDepth ] ;
2020-03-27 21:47:29 +01:00
}
}
2020-04-11 00:12:50 +02:00
}
else {
int action = pCurrButton - > action > > 8 ;
if ( action ! = 3 ) {
FESound ( 2 ) ;
if ( pCurrButton - > var ! = - 1 )
SetVariable ( pCurrButton - > var ) ;
switch ( action )
{
case 1 :
pScreenStack [ ScreenDepth ] = pCurrScreen ;
pButtonStack [ ScreenDepth ] = pCurrButton ;
ScreenNames [ ScreenDepth ] = pCurrButton - > Name ;
action = ( ScreenDepth < 11 ) ? ScreenDepth + 1 : 10 ;
pNewScreen = & PsxScreens [ pCurrButton - > action & 0xFF ] ;
ScreenDepth = action ;
break ;
case 2 :
if ( ( ( NumPlayers = = 2 ) & & ( bDoingCarSelect ! = 0 ) ) & & ( currPlayer = = 2 ) ) {
( fpUserFunctions [ pCurrScreen - > userFunctionNum - 1 ] ) ( 1 ) ;
bRedrawFrontend = 1 ;
2020-03-27 21:47:29 +01:00
}
else {
2020-04-11 00:12:50 +02:00
pScreenStack [ ScreenDepth ] = pCurrScreen ;
pButtonStack [ ScreenDepth ] = pCurrButton ;
ScreenNames [ ScreenDepth ] = pCurrButton - > Name ;
GameStart ( ) ;
2020-03-27 21:47:29 +01:00
}
2020-04-11 00:12:50 +02:00
break ;
case 4 :
if ( ScreenDepth > 0 )
{
action = ScreenDepth - 1 ;
if ( action = = 0 )
NumPlayers = 1 ;
pNewScreen = pScreenStack [ action ] ;
pNewButton = pButtonStack [ action ] ;
ScreenDepth = action ;
}
break ;
2020-03-27 21:47:29 +01:00
}
}
}
2020-04-11 00:12:50 +02:00
idle_timer = VSync ( - 1 ) ;
return 1 ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ PadChecks()
// line 2300, offset 0x001c2668
/* begin block 1 */
// Start line: 2302
// Start offset: 0x001C2668
// Variables:
// int i; // $a2
// int oldnum; // $s2
/* end block 1 */
// End offset: 0x001C296C
// End Line: 2417
/* begin block 2 */
// Start line: 4977
/* end block 2 */
// End Line: 4978
/* begin block 3 */
// Start line: 5046
/* end block 3 */
// End Line: 5047
/* begin block 4 */
// Start line: 5047
/* end block 4 */
// End Line: 5048
/* begin block 5 */
// Start line: 5048
/* end block 5 */
// End Line: 5049
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-29 14:33:48 +02:00
// [D]
2020-03-27 21:47:29 +01:00
void PadChecks ( void )
{
2020-03-29 14:33:48 +02:00
int iVar2 ;
2020-03-28 16:43:40 +01:00
2020-03-29 14:33:48 +02:00
// TODO: null check for pCurrScreen
2020-03-27 21:47:29 +01:00
2020-04-11 00:12:50 +02:00
int oldnum = numPadsConnected ;
2020-03-27 21:47:29 +01:00
ReadControllers ( ) ;
2020-04-11 00:12:50 +02:00
2020-03-29 14:33:48 +02:00
iVar2 = 1 ;
numPadsConnected = 0 ;
fePad = Pads [ 0 ] . mapnew ;
2020-04-11 00:12:50 +02:00
for ( int i = 0 ; i < 2 ; i + + ) {
if ( Pads [ i ] . type < 2 ) {
padsConnected [ i ] = 0 ;
2020-03-27 21:47:29 +01:00
}
else {
2020-04-11 00:12:50 +02:00
padsConnected [ i ] = 1 ;
numPadsConnected + + ;
2020-03-27 21:47:29 +01:00
}
2020-04-11 00:12:50 +02:00
}
if ( ( oldnum ! = numPadsConnected ) & &
( ( ( oldnum = = 2 | | ( numPadsConnected = = 2 ) ) & & ( ScreenDepth = = 0 ) ) ) ) {
2020-03-29 14:33:48 +02:00
bRedrawFrontend = 1 ;
2020-03-27 21:47:29 +01:00
MainScreen ( 1 ) ;
}
2020-04-11 00:12:50 +02:00
if ( ( ( Pads [ 0 ] . dualshock = = 0 ) | | ( padsConnected [ 0 ] = = 0 ) ) & &
( ( Pads [ 1 ] . dualshock = = 0 | | ( padsConnected [ 1 ] = = 0 ) ) ) ) {
2020-03-29 14:33:48 +02:00
if ( ( allowVibration = = 1 ) & & ( allowVibration = 0 , pCurrScreen - > userFunctionNum = = 18 ) ) {
2020-04-11 00:12:50 +02:00
bRedrawFrontend = 1 ;
2020-03-27 21:47:29 +01:00
GamePlayScreen ( 1 ) ;
}
}
else {
2020-03-29 14:33:48 +02:00
if ( ( allowVibration = = 0 ) & & ( allowVibration = 1 , pCurrScreen - > userFunctionNum = = 18 ) ) {
bRedrawFrontend = 1 ;
2020-03-27 21:47:29 +01:00
GamePlayScreen ( 1 ) ;
}
}
2020-04-11 00:12:50 +02:00
if ( ( oldnum ! = numPadsConnected ) & &
( ( ( ( NumPlayers = = 2 & & ( numPadsConnected ! = NumPlayers ) ) | | ( numPadsConnected = = 0 ) ) | |
2020-03-29 14:33:48 +02:00
( padsConnected [ 0 ] = = 0 ) ) ) ) {
2020-03-27 21:47:29 +01:00
bReturnToMain = 1 ;
2020-03-29 14:33:48 +02:00
bRedrawFrontend = 1 ;
fePad = 0x10 ;
2020-04-11 00:12:50 +02:00
if ( pCurrScreen - > userFunctionNum ! = 0 ) {
2020-03-29 14:33:48 +02:00
( fpUserFunctions [ pCurrScreen - > userFunctionNum - 1 ] ) ( 0 ) ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 14:33:48 +02:00
fePad = 0 ;
2020-03-27 21:47:29 +01:00
if ( ScreenDepth ! = 0 ) {
ReInitScreens ( ) ;
}
}
2020-04-11 00:12:50 +02:00
if ( ( ( bRedrawFrontend = = 0 ) & & ( numPadsConnected ! = oldnum ) ) & &
( ( gInFrontend ! = 0 & & ( ( pCurrScreen ! = NULL & & ( pCurrScreen - > userFunctionNum ! = 0 ) ) ) ) ) ) {
2020-03-29 14:33:48 +02:00
( fpUserFunctions [ pCurrScreen - > userFunctionNum - 1 ] ) ( 1 ) ;
bRedrawFrontend = 1 ;
2020-03-27 21:47:29 +01:00
}
}
// decompiled code
// original method signature:
// void /*$ra*/ DoFrontEnd()
// line 2423, offset 0x001c296c
/* begin block 1 */
// Start line: 2425
// Start offset: 0x001C296C
// Variables:
// static unsigned char result[8]; // offset 0x0
/* end block 1 */
// End offset: 0x001C2C2C
// End Line: 2588
/* begin block 2 */
// Start line: 5332
/* end block 2 */
// End Line: 5333
/* begin block 3 */
// Start line: 5339
/* end block 3 */
// End Line: 5340
/* begin block 4 */
// Start line: 5340
/* end block 4 */
// End Line: 5341
/* begin block 5 */
// Start line: 5346
/* end block 5 */
// End Line: 5347
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-29 18:10:37 +02:00
// [D]
2020-03-27 21:47:29 +01:00
void DoFrontEnd ( void )
{
UNIMPLEMENTED ( ) ;
int iVar1 ;
ResetGraph ( 1 ) ;
SetDispMask ( 0 ) ;
2020-03-29 14:33:48 +02:00
//PadChecks(); // [A] there is a BUG
2020-03-27 21:47:29 +01:00
bRedrawFrontend = 0 ;
gInFrontend = 1 ;
idle_timer = VSync ( 0xffffffff ) ;
LoadFrontendScreens ( ) ;
pCurrScreen = PsxScreens ;
pCurrButton = PsxScreens [ 0 ] . buttons ;
SetupBackgroundPolys ( ) ;
SetupScreenSprts ( pCurrScreen ) ;
SetDispMask ( 0 ) ;
ResetGraph ( 0 ) ;
SetFEDrawMode ( ) ;
2020-03-28 21:29:37 +01:00
SetVideoMode ( video_mode ) ;
2020-03-27 21:47:29 +01:00
EnableDisplay ( ) ;
DrawScreen ( pCurrScreen ) ;
EndFrame ( ) ;
NewSelection ( 0 ) ;
EndFrame ( ) ;
EndFrame ( ) ;
EndFrame ( ) ;
EndFrame ( ) ;
EndFrame ( ) ;
EndFrame ( ) ;
SetDispMask ( 1 ) ;
FEInitCdIcon ( ) ;
do {
PadChecks ( ) ;
if ( currPlayer = = 2 ) {
if ( Pads [ 1 ] . type < 2 ) {
if ( ( fePad & 0x10U ) = = 0 ) {
fePad = 0 ;
}
else {
fePad = 0x10 ;
}
}
else {
fePad = Pads [ 1 ] . mapnew ;
}
}
iVar1 = HandleKeyPress ( ) ;
if ( ( iVar1 ! = 0 ) & & ( pNewScreen ! = NULL ) ) {
SetupScreenSprts ( pNewScreen ) ;
DrawScreen ( pCurrScreen ) ;
EndFrame ( ) ;
NewSelection ( 0 ) ;
}
if ( bRedrawFrontend ! = 0 ) {
DrawScreen ( pCurrScreen ) ;
EndFrame ( ) ;
NewSelection ( 0 ) ;
bRedrawFrontend = 0 ;
}
2020-04-08 20:46:50 +02:00
2020-03-27 21:47:29 +01:00
iVar1 = VSync ( 0xffffffff ) ;
if ( 0x708 < iVar1 - idle_timer ) {
if ( ScreenDepth = = 0 ) {
GameType = GAME_IDLEDEMO ;
gCurrentMissionNumber = gIdleReplay + 400 ;
gIdleReplay = gIdleReplay + 1 ;
if ( gIdleReplay = = 4 ) {
gIdleReplay = 0 ;
}
pScreenStack [ 0 ] = pCurrScreen ;
pButtonStack [ 0 ] = pCurrButton ;
ScreenNames [ 0 ] = pCurrButton - > Name ;
GameStart ( ) ;
pCurrScreen = pScreenStack [ ScreenDepth ] ;
bRedrawFrontend = 1 ;
ScreenDepth = 0 ;
}
idle_timer = VSync ( 0xffffffff ) ;
}
2020-04-08 20:46:50 +02:00
# ifndef PSX
// [A] Always redraw frontend
DrawScreen ( pCurrScreen ) ;
NewSelection ( 0 ) ;
# endif
2020-03-27 21:47:29 +01:00
} while ( true ) ;
}
// decompiled code
// original method signature:
// void /*$ra*/ SetFEDrawMode()
// line 2630, offset 0x001c2c2c
/* begin block 1 */
// Start line: 2632
// Start offset: 0x001C2C2C
// Variables:
// struct DRAW_MODE *dm; // $s3
/* end block 1 */
// End offset: 0x001C2D90
// End Line: 2687
/* begin block 2 */
// Start line: 5839
/* end block 2 */
// End Line: 5840
/* begin block 3 */
// Start line: 5882
/* end block 3 */
// End Line: 5883
/* begin block 4 */
// Start line: 5883
/* end block 4 */
// End Line: 5884
/* begin block 5 */
// Start line: 5893
/* end block 5 */
// End Line: 5894
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-28 21:29:37 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void SetFEDrawMode ( void )
{
2020-03-28 21:29:37 +01:00
SetVideoMode ( video_mode ) ;
2020-04-20 10:19:24 +02:00
2020-03-28 21:29:37 +01:00
SetDefDrawEnv ( & MPBuff [ 0 ] [ 0 ] . draw , ( int ) draw_mode . x1 , ( int ) draw_mode . y1 , 0x280 , 0x200 ) ;
SetDefDispEnv ( & MPBuff [ 0 ] [ 0 ] . disp , ( int ) draw_mode . x1 , ( int ) draw_mode . y1 , 0x280 , 0x200 ) ;
SetDefDrawEnv ( & MPBuff [ 0 ] [ 1 ] . draw , ( int ) draw_mode . x1 , ( int ) draw_mode . y1 , 0x280 , 0x200 ) ;
SetDefDispEnv ( & MPBuff [ 0 ] [ 1 ] . disp , ( int ) draw_mode . x1 , ( int ) draw_mode . y1 , 0x280 , 0x200 ) ;
2020-04-20 10:19:24 +02:00
2020-03-28 21:29:37 +01:00
MPBuff [ 0 ] [ 0 ] . draw . isbg = ' \0 ' ;
MPBuff [ 0 ] [ 0 ] . disp . isinter = ' \x01 ' ;
MPBuff [ 0 ] [ 0 ] . draw . dfe = ' \x01 ' ;
MPBuff [ 0 ] [ 0 ] . disp . screen . h = 256 ;
MPBuff [ 0 ] [ 0 ] . primtab = _tempPrimTab1 ;
MPBuff [ 0 ] [ 0 ] . primptr = _tempPrimTab1 ;
2020-03-31 19:09:22 +02:00
MPBuff [ 0 ] [ 0 ] . ot = _tempOT1 ;
2020-03-28 21:29:37 +01:00
MPBuff [ 0 ] [ 1 ] . draw . isbg = ' \0 ' ;
MPBuff [ 0 ] [ 1 ] . disp . isinter = ' \x01 ' ;
MPBuff [ 0 ] [ 1 ] . draw . dfe = ' \x01 ' ;
MPBuff [ 0 ] [ 1 ] . disp . screen . h = 256 ;
MPBuff [ 0 ] [ 1 ] . primtab = _tempPrimTab2 ;
MPBuff [ 0 ] [ 1 ] . primptr = _tempPrimTab2 ;
2020-03-31 19:09:22 +02:00
MPBuff [ 0 ] [ 1 ] . ot = _tempOT2 ;
2020-03-28 21:29:37 +01:00
last = & MPBuff [ 0 ] [ 1 ] ;
current = & MPBuff [ 0 ] [ 0 ] ;
MPBuff [ 0 ] [ 0 ] . disp . screen . x = draw_mode . framex < < 1 ;
MPBuff [ 0 ] [ 0 ] . disp . screen . y = draw_mode . framey ;
MPBuff [ 0 ] [ 1 ] . disp . screen . y = draw_mode . framey ;
MPBuff [ 0 ] [ 1 ] . disp . screen . x = MPBuff [ 0 ] [ 0 ] . disp . screen . x ;
PutDispEnv ( & MPBuff [ 0 ] [ 0 ] . disp ) ;
2020-03-27 21:47:29 +01:00
PutDrawEnv ( & current - > draw ) ;
2020-03-28 21:29:37 +01:00
return ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ EndFrame()
// line 2695, offset 0x001c6378
/* begin block 1 */
// Start line: 2697
// Start offset: 0x001C6378
// Variables:
// struct DB *db_hold; // $a1
/* end block 1 */
// End offset: 0x001C6404
// End Line: 2716
/* begin block 2 */
// Start line: 8781
/* end block 2 */
// End Line: 8782
/* begin block 3 */
// Start line: 5390
/* end block 3 */
// End Line: 5391
/* begin block 4 */
// Start line: 8782
/* end block 4 */
// End Line: 8783
/* begin block 5 */
// Start line: 8784
/* end block 5 */
// End Line: 8785
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-29 01:56:49 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void EndFrame ( void )
{
char * * ppcVar1 ;
DB * pDVar2 ;
DB * pDVar3 ;
DrawSync ( 0 ) ;
VSync ( 0 ) ;
PutDispEnv ( & current - > disp ) ;
PutDrawEnv ( & current - > draw ) ;
2020-03-29 14:13:32 +02:00
2020-03-27 21:47:29 +01:00
pDVar3 = last ;
pDVar2 = current ;
ppcVar1 = & last - > primtab ;
current = last ;
last = pDVar2 ;
pDVar3 - > primptr = * ppcVar1 ;
2020-03-29 14:13:32 +02:00
2020-03-31 19:09:22 +02:00
DrawOTag ( ( u_long * ) ( pDVar2 - > ot + 0x10 ) ) ;
ClearOTagR ( ( u_long * ) ( current - > ot ) , 0x10 ) ;
2020-03-27 21:47:29 +01:00
VSync ( 0 ) ;
}
// decompiled code
// original method signature:
// int /*$ra*/ FEPrintString(char *string /*$t1*/, int x /*$t2*/, int y /*$s4*/, int justification /*$a3*/, int r /*stack 16*/, int g /*stack 20*/, int b /*stack 24*/)
// line 2745, offset 0x001c2d90
/* begin block 1 */
// Start line: 2746
// Start offset: 0x001C2D90
// Variables:
// struct FE_CHARDATA *pFontInfo; // $a0
// struct SPRT *font; // $t0
// unsigned char let; // $a0
// int counter; // $t4
/* begin block 1.1 */
// Start line: 2746
// Start offset: 0x001C2DEC
// Variables:
// char *pString; // $a1
/* begin block 1.1.1 */
// Start line: 2746
// Start offset: 0x001C2DEC
// Variables:
// char let; // $v1
// int w; // $a2
/* end block 1.1.1 */
// End offset: 0x001C2E38
// End Line: 2746
/* end block 1.1 */
// End offset: 0x001C2E38
// End Line: 2746
/* begin block 1.2 */
// Start line: 2792
// Start offset: 0x001C2F28
// Variables:
// int tpage; // $v1
/* end block 1.2 */
// End offset: 0x001C2F28
// End Line: 2792
/* end block 1 */
// End offset: 0x001C2FD8
// End Line: 2809
/* begin block 2 */
// Start line: 6177
/* end block 2 */
// End Line: 6178
/* begin block 3 */
// Start line: 6236
/* end block 3 */
// End Line: 6237
2020-03-29 01:56:49 +01:00
// [D]
2020-03-27 21:47:29 +01:00
int FEPrintString ( char * string , int x , int y , int justification , int r , int g , int b )
{
2020-03-29 01:56:49 +01:00
char bVar1 ;
char bVar2 ;
unsigned char uVar3 ;
2020-03-27 21:47:29 +01:00
DB * pDVar4 ;
int iVar5 ;
uint uVar6 ;
uint uVar7 ;
2020-03-29 01:56:49 +01:00
ulong * puVar8 ;
char * pbVar9 ;
SPRT * font ;
char * pbVar10 ;
int iVar11 ;
2020-03-27 21:47:29 +01:00
2020-03-29 01:56:49 +01:00
iVar11 = 0 ;
2020-03-27 21:47:29 +01:00
iVar5 = - 1 ;
2020-03-29 01:56:49 +01:00
if ( current ! = NULL ) {
font = ( SPRT * ) current - > primptr ;
2020-03-27 21:47:29 +01:00
bVar1 = * string ;
uVar7 = ( uint ) bVar1 ;
2020-03-29 01:56:49 +01:00
pbVar10 = ( char * ) ( string + 1 ) ;
2020-03-27 21:47:29 +01:00
iVar5 = x ;
if ( ( justification & 4U ) ! = 0 ) {
iVar5 = 0 ;
uVar6 = uVar7 ;
2020-03-29 01:56:49 +01:00
pbVar9 = pbVar10 ;
2020-03-27 21:47:29 +01:00
bVar2 = bVar1 ;
while ( bVar2 ! = 0 ) {
if ( uVar6 = = 0x20 ) {
iVar5 = iVar5 + 4 ;
}
else {
2020-03-29 18:10:37 +02:00
iVar5 = iVar5 + ( uint ) feFont . CharInfo [ uVar6 ] . w ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 01:56:49 +01:00
bVar2 = * pbVar9 ;
2020-03-27 21:47:29 +01:00
uVar6 = ( uint ) bVar2 ;
2020-03-29 01:56:49 +01:00
pbVar9 = pbVar9 + 1 ;
2020-03-27 21:47:29 +01:00
}
iVar5 = x - iVar5 ;
}
2020-03-29 01:56:49 +01:00
if ( ( bVar1 ! = 0 ) & & ( true ) ) {
2020-03-27 21:47:29 +01:00
do {
if ( uVar7 = = 0x20 ) {
iVar5 = iVar5 + 4 ;
}
else {
2020-03-29 18:10:37 +02:00
bVar1 = feFont . CharInfo [ uVar7 ] . w ;
2020-03-29 01:56:49 +01:00
setSprt ( font ) ;
2020-03-31 19:09:22 +02:00
//font->code = 'f';
2020-03-29 14:13:32 +02:00
setSemiTrans ( font , 1 ) ;
2020-03-29 22:33:32 +02:00
//font->tpage = 0x1a; // [A]
2020-03-29 01:56:49 +01:00
font - > r0 = ( unsigned char ) r ;
font - > g0 = ( unsigned char ) g ;
font - > b0 = ( unsigned char ) b ;
font - > x0 = ( short ) iVar5 ;
font - > y0 = ( short ) y ;
2020-03-29 18:10:37 +02:00
font - > u0 = feFont . CharInfo [ uVar7 ] . u ;
uVar3 = feFont . CharInfo [ uVar7 ] . v ;
2020-03-29 01:56:49 +01:00
font - > w = ( ushort ) bVar1 ;
font - > v0 = uVar3 ;
2020-03-27 21:47:29 +01:00
pDVar4 = current ;
2020-03-29 18:10:37 +02:00
bVar2 = feFont . CharInfo [ uVar7 ] . h ;
2020-03-27 21:47:29 +01:00
iVar5 = iVar5 + ( uint ) bVar1 ;
2020-03-29 01:56:49 +01:00
font - > clut = 0x407c ;
font - > h = ( ushort ) bVar2 ;
addPrim ( pDVar4 - > ot + 1 , font ) ;
2020-03-29 18:10:37 +02:00
font + + ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 01:56:49 +01:00
iVar11 = iVar11 + 1 ;
bVar1 = * pbVar10 ;
2020-03-27 21:47:29 +01:00
uVar7 = ( uint ) bVar1 ;
2020-03-29 01:56:49 +01:00
pbVar10 = pbVar10 + 1 ;
} while ( ( bVar1 ! = 0 ) & & ( iVar11 < 0x20 ) ) ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 18:10:37 +02:00
current - > primptr = ( char * ) font ;
2020-03-29 22:33:32 +02:00
/*
// this is not SPRT
font - > code = ' & ' ;
2020-03-27 21:47:29 +01:00
pDVar4 = current ;
2020-03-29 01:56:49 +01:00
font - > x0 = - 1 ;
font - > y0 = - 1 ;
font - > w = - 1 ;
font - > h = - 1 ;
2020-03-29 22:33:32 +02:00
* ( undefined2 * ) & font [ 1 ] . r0 = 0xffff ;
* ( undefined2 * ) & font [ 1 ] . b0 = 0xffff ;
* ( undefined2 * ) ( ( int ) & font [ 1 ] . tag + 2 ) = 0x1a ;
*/
2020-03-29 18:10:37 +02:00
2020-03-29 22:33:32 +02:00
// [A] - don't use odd poly_ft prims
DR_TPAGE * tp = ( DR_TPAGE * ) pDVar4 - > primptr ;
2020-03-29 18:10:37 +02:00
2020-03-29 22:33:32 +02:00
setDrawTPage ( tp , 0 , 0 , 0x1a ) ;
addPrim ( pDVar4 - > ot + 1 , tp ) ;
2020-03-29 18:10:37 +02:00
pDVar4 - > primptr + = sizeof ( DR_TPAGE ) ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 01:56:49 +01:00
return iVar5 ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// int /*$ra*/ FEPrintStringSized(char *string /*$t2*/, int x /*$t1*/, int y /*$t7*/, int scale /*$a3*/, int transparent /*stack 16*/, int r /*stack 20*/, int g /*stack 24*/, int b /*stack 28*/)
// line 2817, offset 0x001c2fd8
/* begin block 1 */
// Start line: 2818
// Start offset: 0x001C2FD8
// Variables:
// struct POLY_FT4 *font; // $t0
// struct FE_CHARDATA *pFontInfo; // $a2
// char let; // $v1
// int tpage; // $v0
// int w; // $t3
// int h; // $t4
/* end block 1 */
// End offset: 0x001C31FC
// End Line: 2880
/* begin block 2 */
// Start line: 6457
/* end block 2 */
// End Line: 6458
/* begin block 3 */
// Start line: 6466
/* end block 3 */
// End Line: 6467
2020-03-29 22:33:32 +02:00
// [D]
2020-03-27 21:47:29 +01:00
int FEPrintStringSized ( char * string , int x , int y , int scale , int transparent , int r , int g , int b )
{
2020-03-29 22:33:32 +02:00
char bVar1 ;
char bVar2 ;
unsigned char uVar3 ;
2020-03-27 21:47:29 +01:00
short sVar4 ;
DB * pDVar5 ;
2020-03-29 22:33:32 +02:00
unsigned char uVar6 ;
2020-03-27 21:47:29 +01:00
int iVar7 ;
2020-03-29 01:56:49 +01:00
short sVar8 ;
uint uVar9 ;
FE_CHARDATA * pFontInfo ;
POLY_FT4 * font ;
int iVar10 ;
2020-03-27 21:47:29 +01:00
iVar7 = - 1 ;
2020-03-29 01:56:49 +01:00
if ( current ! = NULL ) {
2020-03-27 21:47:29 +01:00
bVar1 = * string ;
2020-03-29 01:56:49 +01:00
font = ( POLY_FT4 * ) current - > primptr ;
2020-03-27 21:47:29 +01:00
iVar7 = x ;
while ( bVar1 ! = 0 ) {
bVar1 = * string ;
2020-03-29 01:56:49 +01:00
uVar9 = ( uint ) bVar1 ;
2020-03-29 22:33:32 +02:00
string = ( char * ) ( string + 1 ) ;
2020-03-29 01:56:49 +01:00
iVar10 = iVar7 ;
2020-03-27 21:47:29 +01:00
if ( bVar1 ! = 10 ) {
if ( bVar1 = = 0x20 ) {
2020-03-29 01:56:49 +01:00
iVar10 = iVar7 + 4 ;
2020-03-27 21:47:29 +01:00
}
else {
2020-03-29 22:33:32 +02:00
pFontInfo = feFont . CharInfo + uVar9 ;
bVar1 = feFont . CharInfo [ uVar9 ] . w ;
bVar2 = feFont . CharInfo [ uVar9 ] . h ;
setPolyFT4 ( font ) ;
//*(undefined *)((int)&font->tag + 3) = 9;
//font->code = ',';
setSemiTrans ( font , transparent ) ;
2020-03-31 19:09:22 +02:00
font - > tpage = 0x1a ;
2020-03-29 22:33:32 +02:00
font - > r0 = 128 ;
font - > g0 = 128 ;
font - > b0 = 128 ;
2020-03-29 01:56:49 +01:00
font - > u0 = pFontInfo - > u ;
2020-03-29 22:33:32 +02:00
font - > v0 = feFont . CharInfo [ uVar9 ] . v ;
font - > u1 = feFont . CharInfo [ uVar9 ] . w + pFontInfo - > u + - 1 ;
font - > v1 = feFont . CharInfo [ uVar9 ] . v ;
2020-03-29 01:56:49 +01:00
font - > u2 = pFontInfo - > u ;
2020-03-29 22:33:32 +02:00
font - > v2 = feFont . CharInfo [ uVar9 ] . h + feFont . CharInfo [ uVar9 ] . v + - 1 ;
font - > u3 = feFont . CharInfo [ uVar9 ] . w + pFontInfo - > u + - 1 ;
uVar6 = feFont . CharInfo [ uVar9 ] . v ;
uVar3 = feFont . CharInfo [ uVar9 ] . h ;
2020-03-29 01:56:49 +01:00
iVar10 = iVar7 + ( ( int ) ( ( uint ) bVar1 * scale ) > > 0xc ) ;
2020-03-27 21:47:29 +01:00
sVar4 = ( short ) y ;
2020-03-29 01:56:49 +01:00
sVar8 = sVar4 + ( short ) ( ( int ) ( ( uint ) bVar2 * scale ) > > 0xc ) ;
font - > x0 = ( short ) iVar7 ;
font - > y0 = sVar4 ;
font - > x1 = ( short ) iVar10 ;
font - > y1 = sVar4 ;
font - > x2 = ( short ) iVar7 ;
font - > y2 = sVar8 ;
font - > x3 = ( short ) iVar10 ;
font - > y3 = sVar8 ;
font - > clut = 0x407c ;
2020-03-29 22:33:32 +02:00
font - > r0 = ( unsigned char ) r ;
2020-03-29 01:56:49 +01:00
font - > v3 = uVar3 + uVar6 + - 1 ;
2020-03-29 22:33:32 +02:00
font - > g0 = ( unsigned char ) g ;
font - > b0 = ( unsigned char ) b ;
2020-03-27 21:47:29 +01:00
pDVar5 = current ;
2020-03-29 22:33:32 +02:00
addPrim ( current - > ot + 1 , font ) ;
//font->tag = font->tag & 0xff000000 | current->ot[1] & 0xffffff;
//uVar9 = (uint)font & 0xffffff;
font + + ;
///pDVar5->ot[1] = pDVar5->ot[1] & 0xff000000 | uVar9;
2020-03-27 21:47:29 +01:00
}
}
bVar1 = * string ;
2020-03-29 01:56:49 +01:00
iVar7 = iVar10 ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 01:56:49 +01:00
* ( POLY_FT4 * * ) & current - > primptr = font ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 22:33:32 +02:00
return iVar7 ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// int /*$ra*/ CentreScreen(int bSetup /*$a0*/)
// line 2894, offset 0x001c31fc
/* begin block 1 */
// Start line: 6662
/* end block 1 */
// End Line: 6663
/* begin block 2 */
// Start line: 6677
/* end block 2 */
// End Line: 6678
/* begin block 3 */
// Start line: 6678
/* end block 3 */
// End Line: 6679
int CentreScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
DB * pDVar1 ;
DB * pDVar2 ;
short sVar3 ;
pDVar2 = last ;
pDVar1 = current ;
if ( bSetup ! = 0 ) {
return 0 ;
}
if ( DAT_FRNT__001c6a94 = = 0 ) {
DAT_FRNT__001c6a94 = 1 ;
}
if ( ( uRam001cc5dc & 0x2000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x8000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x1000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x4000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x40 ) ! = 0 ) {
draw_mode_pal . framex = ( current - > disp ) . screen . x > > 1 ;
draw_mode_pal . framey = ( current - > disp ) . screen . y ;
draw_mode_ntsc . framex = ( current - > disp ) . screen . x > > 1 ;
draw_mode_ntsc . framey = ( current - > disp ) . screen . y ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x10 ) = = 0 ) {
return 0 ;
}
( current - > disp ) . screen . x = draw_mode_pal . framex < < 1 ;
( pDVar1 - > disp ) . screen . y = draw_mode_pal . framey ;
pDVar1 = last ;
( last - > disp ) . screen . x = draw_mode_pal . framex < < 1 ;
( pDVar1 - > disp ) . screen . y = draw_mode_pal . framey ;
return 0 ;
}
if ( ( current - > disp ) . screen . y < DAT_FRNT__001c6992 ) {
( current - > disp ) . screen . y = ( current - > disp ) . screen . y + 1 ;
sVar3 = ( pDVar2 - > disp ) . screen . y + 1 ;
goto LAB_FRNT__001c3360 ;
}
}
else {
if ( DAT_FRNT__001c698e < ( current - > disp ) . screen . y ) {
( current - > disp ) . screen . y = ( current - > disp ) . screen . y + - 1 ;
sVar3 = ( pDVar2 - > disp ) . screen . y + - 1 ;
LAB_FRNT__001c3360 :
( pDVar2 - > disp ) . screen . y = sVar3 ;
FESound ( 3 ) ;
return 0 ;
}
}
}
else {
if ( DAT_FRNT__001c698c < ( current - > disp ) . screen . x ) {
( current - > disp ) . screen . x = ( current - > disp ) . screen . x + - 1 ;
sVar3 = ( pDVar2 - > disp ) . screen . x + - 1 ;
goto LAB_FRNT__001c32c0 ;
}
}
}
else {
if ( ( current - > disp ) . screen . x < DAT_FRNT__001c6990 ) {
( current - > disp ) . screen . x = ( current - > disp ) . screen . x + 1 ;
sVar3 = ( pDVar2 - > disp ) . screen . x + 1 ;
LAB_FRNT__001c32c0 :
( pDVar2 - > disp ) . screen . x = sVar3 ;
FESound ( 3 ) ;
return 0 ;
}
}
FESound ( 1 ) ;
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ CarSelectScreen(int bSetup /*$a0*/)
// line 3029, offset 0x001c3430
/* begin block 1 */
// Start line: 3031
// Start offset: 0x001C3430
// Variables:
// int i; // $a0
// struct RECT rect; // stack offset -32
/* begin block 1.1 */
// Start line: 3145
// Start offset: 0x001C373C
// Variables:
// int lastVal; // $a3
/* begin block 1.1.1 */
// Start line: 3030
// Start offset: 0x001C37BC
/* begin block 1.1.1.1 */
// Start line: 3030
// Start offset: 0x001C37BC
// Variables:
// struct RECT rect; // stack offset -24
/* end block 1.1.1.1 */
// End offset: 0x001C37BC
// End Line: 3030
/* end block 1.1.1 */
// End offset: 0x001C37BC
// End Line: 3030
/* end block 1.1 */
// End offset: 0x001C37BC
// End Line: 3030
/* begin block 1.2 */
// Start line: 3164
// Start offset: 0x001C37D0
// Variables:
// int lastVal; // $a3
/* begin block 1.2.1 */
// Start line: 3030
// Start offset: 0x001C3858
/* begin block 1.2.1.1 */
// Start line: 3030
// Start offset: 0x001C3858
// Variables:
// struct RECT rect; // stack offset -24
/* end block 1.2.1.1 */
// End offset: 0x001C3858
// End Line: 3030
/* end block 1.2.1 */
// End offset: 0x001C3858
// End Line: 3030
/* end block 1.2 */
// End offset: 0x001C3858
// End Line: 3030
/* end block 1 */
// End offset: 0x001C3A60
// End Line: 3212
/* begin block 2 */
// Start line: 6955
/* end block 2 */
// End Line: 6956
/* begin block 3 */
// Start line: 6956
/* end block 3 */
// End Line: 6957
/* begin block 4 */
// Start line: 6957
/* end block 4 */
// End Line: 6958
2020-03-29 18:10:37 +02:00
// [D]
2020-03-27 21:47:29 +01:00
int CarSelectScreen ( int bSetup )
{
2020-03-29 18:10:37 +02:00
char bVar1 ;
2020-03-27 21:47:29 +01:00
DB * pDVar2 ;
2020-03-29 18:10:37 +02:00
int * piVar3 ;
2020-03-27 21:47:29 +01:00
int iVar4 ;
int iVar5 ;
uint * puVar6 ;
2020-03-29 18:10:37 +02:00
RECT16 rect ;
2020-03-27 21:47:29 +01:00
2020-03-29 18:10:37 +02:00
iVar5 = carSelection ;
rect = extraRect ;
2020-03-27 21:47:29 +01:00
if ( bSetup = = 0 ) {
2020-03-29 18:10:37 +02:00
if ( ( fePad & 0x10U ) = = 0 ) {
if ( ( fePad & 0x40U ) ! = 0 ) {
if ( currSelIndex = = 0 ) {
2020-03-27 21:47:29 +01:00
iVar4 = 9 ;
2020-03-29 18:10:37 +02:00
if ( carSelection ! = 0 ) {
iVar4 = carSelection + - 1 ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 18:10:37 +02:00
while ( ( carSelection = iVar4 ,
2020-04-05 00:53:41 +02:00
CarAvailability [ GameLevel ] [ carSelection ] = = 0 & &
2020-03-29 18:10:37 +02:00
( carSelection ! = iVar5 ) ) ) {
iVar4 = carSelection + - 1 ;
if ( carSelection + - 1 = = - 1 ) {
carSelection = 9 ;
iVar4 = carSelection ;
2020-03-27 21:47:29 +01:00
}
}
}
else {
2020-03-29 18:10:37 +02:00
if ( currSelIndex ! = 2 ) {
if ( currPlayer = = 1 ) {
feVariableSave [ 0 ] = carSelection ;
2020-04-05 00:53:41 +02:00
wantedCar [ 0 ] = carNumLookup [ GameLevel ] [ carSelection ] ;
2020-03-27 21:47:29 +01:00
}
else {
2020-04-05 00:53:41 +02:00
wantedCar [ 1 ] = carNumLookup [ GameLevel ] [ carSelection ] ;
2020-03-27 21:47:29 +01:00
}
if ( NumPlayers = = 2 ) {
2020-03-29 18:10:37 +02:00
currPlayer = currPlayer + 1 ;
2020-03-27 21:47:29 +01:00
return 0 ;
}
return 0 ;
}
2020-03-29 18:10:37 +02:00
if ( carSelection = = 9 ) {
carSelection = 0 ;
2020-03-27 21:47:29 +01:00
}
else {
2020-03-29 18:10:37 +02:00
carSelection = carSelection + 1 ;
2020-03-27 21:47:29 +01:00
}
2020-04-05 00:53:41 +02:00
while ( ( CarAvailability [ GameLevel ] [ carSelection ] = = 0 & &
2020-03-29 18:10:37 +02:00
( iVar4 = carSelection + 1 , carSelection ! = iVar5 ) ) ) {
carSelection = iVar4 ;
2020-03-27 21:47:29 +01:00
if ( iVar4 = = 10 ) {
2020-03-29 18:10:37 +02:00
carSelection = 0 ;
2020-03-27 21:47:29 +01:00
}
}
}
2020-04-01 13:31:43 +02:00
rect = extraRect ;
2020-04-01 01:27:09 +02:00
LoadImage ( & rect , ( u_long * ) ( _frontend_buffer + carSelection * 0x8000 ) ) ;
2020-03-27 21:47:29 +01:00
DrawSync ( 0 ) ;
DisplayOnScreenText ( ) ;
2020-03-29 18:10:37 +02:00
2020-03-27 21:47:29 +01:00
pDVar2 = current ;
2020-03-29 18:10:37 +02:00
addPrim ( current - > ot + 2 , & extraSprt ) ;
addPrim ( current - > ot + 3 , & extraDummy ) ;
2020-03-27 21:47:29 +01:00
EndFrame ( ) ;
return 0 ;
}
2020-03-29 18:10:37 +02:00
if ( ( fePad & 0x1000U ) = = 0 ) {
if ( ( fePad & 0x4000U ) = = 0 ) {
2020-03-27 21:47:29 +01:00
return 0 ;
}
bVar1 = pCurrButton - > d ;
}
else {
bVar1 = pCurrButton - > u ;
}
2020-03-29 18:10:37 +02:00
currSelIndex = ( uint ) bVar1 - 1 ;
2020-03-27 21:47:29 +01:00
}
else {
FESound ( 0 ) ;
2020-03-29 18:10:37 +02:00
bDoneAllready = 1 ;
LoadBackgroundFile ( " DATA \\ GFX.RAW " ) ;
currPlayer = 1 ;
bDrawExtra = 0 ;
bDoingCarSelect = 0 ;
2020-03-27 21:47:29 +01:00
}
return 0 ;
}
2020-03-29 18:10:37 +02:00
bDoingCarSelect = 1 ;
2020-03-27 21:47:29 +01:00
if ( NumPlayers = = 1 ) {
2020-03-29 18:10:37 +02:00
CarAvailability [ 0 ] [ 9 ] = 0 ; //(uint)((byte)AvailableCheats >> 4) & 1; // [A]
CarAvailability [ 1 ] [ 9 ] = 0 ; //(uint)((byte)AvailableCheats >> 6) & 1; // [A]
CarAvailability [ 2 ] [ 9 ] = 0 ; ///(uint)AvailableCheats._1_1_ & 1; // [A]
CarAvailability [ 3 ] [ 9 ] = 0 ; //(uint)(AvailableCheats._1_1_ >> 1) & 1; // [A]
2020-03-27 21:47:29 +01:00
}
if ( ( gFurthestMission = = 0x28 ) & & ( NumPlayers = = 1 ) ) {
iVar5 = 4 ;
2020-03-29 18:10:37 +02:00
piVar3 = ( int * ) CarAvailability + 4 ;
2020-03-27 21:47:29 +01:00
do {
if ( iVar5 ! = 8 ) {
2020-03-29 18:10:37 +02:00
* piVar3 = 1 ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 18:10:37 +02:00
piVar3 [ 10 ] = 1 ;
piVar3 [ 0x14 ] = 1 ;
piVar3 [ 0x1e ] = 1 ;
2020-03-27 21:47:29 +01:00
iVar5 = iVar5 + 1 ;
2020-03-29 18:10:37 +02:00
piVar3 = piVar3 + 1 ;
2020-03-27 21:47:29 +01:00
} while ( iVar5 < 9 ) ;
}
else {
2020-03-29 18:10:37 +02:00
piVar3 = ( int * ) CarAvailability + 4 ;
2020-03-27 21:47:29 +01:00
iVar5 = 4 ;
do {
2020-03-29 18:10:37 +02:00
* piVar3 = 0 ;
piVar3 [ 10 ] = 0 ;
piVar3 [ 0x14 ] = 0 ;
piVar3 [ 0x1e ] = 0 ;
2020-03-27 21:47:29 +01:00
iVar5 = iVar5 + - 1 ;
2020-03-29 18:10:37 +02:00
piVar3 = piVar3 + 1 ;
2020-03-27 21:47:29 +01:00
} while ( - 1 < iVar5 ) ;
}
2020-03-29 18:10:37 +02:00
if ( currPlayer ! = 1 ) {
2020-03-27 21:47:29 +01:00
if ( NumPlayers = = 2 ) {
2020-03-29 18:10:37 +02:00
FEPrintStringSized ( " Player 2 " , 400 , 0x104 , 0xc00 , 0 ,
0x80 , 0x80 , 0x80 ) ;
2020-03-27 21:47:29 +01:00
return 0 ;
}
return 0 ;
}
if ( feVariableSave [ 0 ] = = - 1 ) {
2020-03-29 18:10:37 +02:00
carSelection = 0 ;
2020-04-01 01:27:09 +02:00
if ( loaded [ 1 ] = = GameLevel ) {
2020-03-29 18:10:37 +02:00
bDrawExtra = currPlayer ;
LoadImage ( & rect , ( u_long * ) _frontend_buffer ) ;
2020-03-27 21:47:29 +01:00
}
else {
2020-03-29 18:10:37 +02:00
SetupExtraPoly ( gfxNames [ GameLevel ] , 0 , 0 ) ;
2020-04-01 01:27:09 +02:00
lastCity = GameLevel ;
2020-03-27 21:47:29 +01:00
}
}
else {
2020-03-29 18:10:37 +02:00
carSelection = feVariableSave [ 0 ] ;
SetupExtraPoly ( gfxNames [ GameLevel ] , feVariableSave [ 0 ] , 0 ) ;
2020-03-27 21:47:29 +01:00
}
2020-03-29 18:10:37 +02:00
LoadBackgroundFile ( " DATA \\ CARS \\ CARBACK.RAW " ) ;
2020-04-01 01:27:09 +02:00
feVariableSave [ 0 ] = - 1 ;
feVariableSave [ 1 ] = - 1 ;
feVariableSave [ 2 ] = - 1 ;
feVariableSave [ 3 ] = - 1 ;
lastCutCity = - 1 ;
2020-03-29 18:10:37 +02:00
currSelIndex = 1 ;
2020-03-27 21:47:29 +01:00
pCurrButton = pCurrScreen - > buttons + 1 ;
2020-03-29 18:10:37 +02:00
return 1 ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// int /*$ra*/ CopDiffLevelScreen(int bSetup /*$a0*/)
// line 3220, offset 0x001c6404
/* begin block 1 */
// Start line: 5153
/* end block 1 */
// End Line: 5154
/* begin block 2 */
// Start line: 10615
/* end block 2 */
// End Line: 10616
/* begin block 3 */
// Start line: 10616
/* end block 3 */
// End Line: 10617
/* WARNING: Control flow encountered bad instruction data */
int CopDiffLevelScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/* WARNING: Bad instruction - Truncating control flow here */
//halt_baddata();
}
// decompiled code
// original method signature:
// int /*$ra*/ VibroOnOffScreen(int bSetup /*$a0*/)
// line 3256, offset 0x001c3a60
/* begin block 1 */
// Start line: 7415
/* end block 1 */
// End Line: 7416
/* begin block 2 */
// Start line: 7460
/* end block 2 */
// End Line: 7461
/* begin block 3 */
// Start line: 7461
/* end block 3 */
// End Line: 7462
/* WARNING: Control flow encountered bad instruction data */
int VibroOnOffScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
/* WARNING: Bad instruction - Truncating control flow here */
//halt_baddata();
}
// decompiled code
// original method signature:
// int /*$ra*/ MissionSelectScreen(int bSetup /*$a0*/)
// line 3394, offset 0x001c3b1c
/* begin block 1 */
// Start line: 3396
// Start offset: 0x001C3B1C
// Variables:
// int i; // $a1
/* begin block 1.1 */
// Start line: 3423
// Start offset: 0x001C3BDC
// Variables:
// int usedB; // $s2
// int done; // $t0
// int bP; // $a3
// int bN; // $s5
// int shift; // $a3
/* end block 1.1 */
// End offset: 0x001C40D8
// End Line: 3552
/* end block 1 */
// End offset: 0x001C4338
// End Line: 3625
/* begin block 2 */
// Start line: 7783
/* end block 2 */
// End Line: 7784
/* begin block 3 */
// Start line: 7784
/* end block 3 */
// End Line: 7785
/* begin block 4 */
// Start line: 7791
/* end block 4 */
// End Line: 7792
int MissionSelectScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
byte bVar1 ;
bool bVar2 ;
bool bVar3 ;
uchar uVar4 ;
PSXSCREEN * pPVar5 ;
int * piVar6 ;
int iVar7 ;
int iVar8 ;
if ( bSetup = = 0 ) {
if ( ( uRam001cc5dc & 0x40 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x10 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x1000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x4000 ) = = 0 ) {
return 0 ;
}
bVar1 = pCurrButton - > d ;
}
else {
bVar1 = pCurrButton - > u ;
}
DAT_FRNT__001c6a8c = ( uint ) bVar1 - 1 ;
}
else {
DAT_FRNT__001c6a74 = 0 ;
DAT_FRNT__001c6ab0 = 0 ;
}
}
else {
if ( DAT_FRNT__001c6a8c = = 5 ) {
iVar7 = DAT_FRNT__001cc54c + 4 ;
if ( ( iVar7 < * ( int * ) ( DAT_FRNT__001c6a70 * 8 + 0x1c6b9c ) ) & & ( iVar7 < gFurthestMission ) ) {
LAB_FRNT__001c41fc :
DAT_FRNT__001cc54c = iVar7 ;
FESound ( 3 ) ;
( * ( code * ) ( & PTR_CentreScreen_FRNT__001c6a20 ) [ ( uint ) ( byte ) pCurrScreen - > userFunctionNum - 1 ]
) ( 1 ) ;
DAT_FRNT__001c6aa0 = 1 ;
return 1 ;
}
}
else {
if ( DAT_FRNT__001c6a8c = = 0 ) {
if ( * ( int * ) ( & DAT_FRNT__001c6b98 + DAT_FRNT__001c6a70 * 8 ) < DAT_FRNT__001cc54c ) {
iVar7 = DAT_FRNT__001cc54c + - 4 ;
goto LAB_FRNT__001c41fc ;
}
}
else {
bReturnToMain = 0 ;
GameType = GAME_REPLAYMISSION ;
feVariableSave [ 1 ] = DAT_FRNT__001c6a8c ;
feVariableSave [ 0 ] = DAT_FRNT__001cc54c ;
feVariableSave [ 2 ] = DAT_FRNT__001c6a70 ;
gCurrentMissionNumber =
( & DAT_FRNT__001c6bb8 ) [ ( DAT_FRNT__001cc54c + DAT_FRNT__001c6a8c + - 1 ) * 2 ] ;
}
}
}
return 0 ;
}
DAT_FRNT__001c6ab0 = 1 ;
if ( DAT_FRNT__001c6a74 = = 0 ) {
DAT_FRNT__001cc54c = * ( int * ) ( & DAT_FRNT__001c6b98 + DAT_FRNT__001c6a70 * 8 ) ;
DAT_FRNT__001c6a8c = 0 ;
if ( GameType = = GAME_REPLAYMISSION ) {
LoadBackgroundFile ( s_DATA_CITYBACK_RAW_FRNT__001c08b4 ) ;
}
}
pPVar5 = pCurrScreen ;
if ( feVariableSave [ 0 ] ! = - 1 ) {
DAT_FRNT__001cc54c = feVariableSave [ 0 ] ;
DAT_FRNT__001c6a8c = feVariableSave [ 1 ] ;
DAT_FRNT__001c6a70 = feVariableSave [ 2 ] ;
}
iVar8 = 0 ;
bVar2 = false ;
bVar3 = false ;
iVar7 = 0 ;
piVar6 = & DAT_FRNT__001c6bb8 + DAT_FRNT__001cc54c * 2 ;
do {
if ( ( ( gFurthestMission < * piVar6 ) | |
( * ( int * ) ( DAT_FRNT__001c6a70 * 8 + 0x1c6b9c ) < iVar7 + DAT_FRNT__001cc54c ) ) | |
( 0x24 < iVar7 + DAT_FRNT__001cc54c ) ) {
bVar2 = true ;
}
else {
iVar8 = iVar8 + 1 ;
}
iVar7 = iVar7 + 1 ;
piVar6 = piVar6 + 2 ;
} while ( ( iVar7 < 4 ) & & ( ! bVar2 ) ) ;
uVar4 = ( uchar ) iVar8 ;
if ( iVar8 = = 1 ) {
pCurrScreen - > buttons [ 1 ] . d = ' \x02 ' ;
pPVar5 - > buttons [ 1 ] . u = ' \x02 ' ;
sprintf ( pCurrScreen - > buttons [ 1 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 ) [ DAT_FRNT__001cc54c ] ) ;
sprintf ( pCurrScreen - > buttons [ 2 ] . Name , & DAT_FRNT__001c0830 ) ;
sprintf ( pCurrScreen - > buttons [ 3 ] . Name , & DAT_FRNT__001c0830 ) ;
LAB_FRNT__001c3e3c :
sprintf ( pCurrScreen - > buttons [ 4 ] . Name , & DAT_FRNT__001c0830 ) ;
}
else {
if ( iVar8 = = 2 ) {
pCurrScreen - > buttons [ 1 ] . u = ' \x03 ' ;
pCurrScreen - > buttons [ 1 ] . d = ' \x03 ' ;
pCurrScreen - > buttons [ 2 ] . u = uVar4 ;
pCurrScreen - > buttons [ 2 ] . d = uVar4 ;
sprintf ( pCurrScreen - > buttons [ 1 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 ) [ DAT_FRNT__001cc54c ] ) ;
sprintf ( pCurrScreen - > buttons [ 2 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 )
[ DAT_FRNT__001cc54c + 1 ] ) ;
sprintf ( pCurrScreen - > buttons [ 3 ] . Name , & DAT_FRNT__001c0830 ) ;
goto LAB_FRNT__001c3e3c ;
}
if ( iVar8 = = 3 ) {
pCurrScreen - > buttons [ 1 ] . u = ' \x04 ' ;
pCurrScreen - > buttons [ 1 ] . d = uVar4 ;
pCurrScreen - > buttons [ 2 ] . u = ' \x02 ' ;
pCurrScreen - > buttons [ 2 ] . d = ' \x04 ' ;
pCurrScreen - > buttons [ 3 ] . u = uVar4 ;
pCurrScreen - > buttons [ 3 ] . d = ' \x02 ' ;
sprintf ( pCurrScreen - > buttons [ 1 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 ) [ DAT_FRNT__001cc54c ] ) ;
sprintf ( pCurrScreen - > buttons [ 2 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 )
[ DAT_FRNT__001cc54c + 1 ] ) ;
sprintf ( pCurrScreen - > buttons [ 3 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 )
[ DAT_FRNT__001cc54c + 2 ] ) ;
goto LAB_FRNT__001c3e3c ;
}
if ( iVar8 = = 4 ) {
pCurrScreen - > buttons [ 1 ] . u = ' \x05 ' ;
pCurrScreen - > buttons [ 1 ] . d = ' \x03 ' ;
pCurrScreen - > buttons [ 2 ] . u = ' \x02 ' ;
pCurrScreen - > buttons [ 2 ] . d = uVar4 ;
pCurrScreen - > buttons [ 3 ] . u = ' \x03 ' ;
pCurrScreen - > buttons [ 3 ] . d = ' \x05 ' ;
pCurrScreen - > buttons [ 4 ] . u = uVar4 ;
pCurrScreen - > buttons [ 4 ] . d = ' \x02 ' ;
sprintf ( pCurrScreen - > buttons [ 1 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 ) [ DAT_FRNT__001cc54c ] ) ;
sprintf ( pCurrScreen - > buttons [ 2 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 )
[ DAT_FRNT__001cc54c + 1 ] ) ;
sprintf ( pCurrScreen - > buttons [ 3 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 )
[ DAT_FRNT__001cc54c + 2 ] ) ;
sprintf ( pCurrScreen - > buttons [ 4 ] . Name ,
( & PTR_s_Informazioni_sorveglianza_FRNT__001c06e4_FRNT__001c68f8 )
[ DAT_FRNT__001cc54c + 3 ] ) ;
}
}
pPVar5 = pCurrScreen ;
if ( ( ( iVar8 = = 4 ) & &
( ( int ) ( & DAT_FRNT__001c6bb8 ) [ ( DAT_FRNT__001cc54c + 4 ) * 2 ] < = gFurthestMission ) ) & &
( DAT_FRNT__001cc54c + 4 ! = * ( int * ) ( DAT_FRNT__001c6a70 * 8 + 0x1c6b9c ) ) ) {
bVar3 = true ;
}
if ( bVar3 ) {
if ( DAT_FRNT__001cc54c = = * ( int * ) ( & DAT_FRNT__001c6b98 + DAT_FRNT__001c6a70 * 8 ) ) {
LAB_FRNT__001c406c :
if ( bVar3 ) {
pCurrScreen - > buttons [ 1 ] . u = ' \x06 ' ;
pCurrScreen - > buttons [ 4 ] . d = ' \x06 ' ;
pCurrScreen - > buttons [ 5 ] . u = ' \x05 ' ;
pCurrScreen - > buttons [ 5 ] . d = ' \x02 ' ;
pPVar5 = pCurrScreen ;
pCurrScreen - > buttons [ 5 ] . action = 0 ;
pPVar5 - > buttons [ 0 ] . action = 0x500 ;
}
else {
pCurrScreen - > buttons [ 0 ] . action = 0x500 ;
pPVar5 - > buttons [ 5 ] . action = 0x500 ;
}
pCurrButton = pPVar5 - > buttons + 1 ;
DAT_FRNT__001c6a8c = 1 ;
goto LAB_FRNT__001c40d8 ;
}
pCurrScreen - > buttons [ 0 ] . u = ' \x06 ' ;
pCurrScreen - > buttons [ 0 ] . d = ' \x02 ' ;
pCurrScreen - > buttons [ 5 ] . u = ' \x05 ' ;
pCurrScreen - > buttons [ 5 ] . d = ' \x01 ' ;
pCurrScreen - > buttons [ 1 ] . u = ' \x01 ' ;
pCurrScreen - > buttons [ 4 ] . d = ' \x06 ' ;
pPVar5 = pCurrScreen ;
pCurrScreen - > buttons [ 0 ] . action = 0 ;
pPVar5 - > buttons [ 5 ] . action = 0 ;
}
else {
if ( DAT_FRNT__001cc54c = = * ( int * ) ( & DAT_FRNT__001c6b98 + DAT_FRNT__001c6a70 * 8 ) )
goto LAB_FRNT__001c406c ;
pCurrScreen - > buttons [ 0 ] . u = uVar4 + ' \x01 ' ;
pCurrScreen - > buttons [ 0 ] . d = ' \x02 ' ;
pCurrScreen - > buttons [ 1 ] . u = ' \x01 ' ;
pCurrScreen - > buttons [ iVar8 ] . d = ' \x01 ' ;
pPVar5 = pCurrScreen ;
pCurrScreen - > buttons [ 0 ] . action = 0 ;
pPVar5 - > buttons [ 5 ] . action = 0x500 ;
}
pCurrButton = pPVar5 - > buttons ;
DAT_FRNT__001c6a8c = 0 ;
LAB_FRNT__001c40d8 :
if ( DAT_FRNT__001c6a78 = = - 1 ) {
SetupExtraPoly ( s_DATA_CITY_RAW_FRNT__001c088c , DAT_FRNT__001c6a70 , 0 ) ;
}
else {
DAT_FRNT__001c6a90 = 1 ;
}
feVariableSave [ 0 ] = 0xffffffff ;
feVariableSave [ 1 ] = 0xffffffff ;
feVariableSave [ 2 ] = 0xffffffff ;
feVariableSave [ 3 ] = 0xffffffff ;
DAT_FRNT__001c6a74 = 1 ;
return 1 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ MissionCityScreen(int bSetup /*$a0*/)
// line 3632, offset 0x001c4338
/* begin block 1 */
// Start line: 3638
// Start offset: 0x001C4338
/* begin block 1.1 */
// Start line: 3703
// Start offset: 0x001C449C
/* begin block 1.1.1 */
// Start line: 3703
// Start offset: 0x001C449C
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.1.1 */
// End offset: 0x001C449C
// End Line: 3703
/* end block 1.1 */
// End offset: 0x001C449C
// End Line: 3703
/* begin block 1.2 */
// Start line: 3709
// Start offset: 0x001C44C4
/* begin block 1.2.1 */
// Start line: 3709
// Start offset: 0x001C44C4
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.2.1 */
// End offset: 0x001C44C4
// End Line: 3709
/* end block 1.2 */
// End offset: 0x001C44C4
// End Line: 3709
/* end block 1 */
// End offset: 0x001C4600
// End Line: 3720
/* begin block 2 */
// Start line: 8321
/* end block 2 */
// End Line: 8322
/* begin block 3 */
// Start line: 8329
/* end block 3 */
// End Line: 8330
/* begin block 4 */
// Start line: 8334
/* end block 4 */
// End Line: 8335
int MissionCityScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
byte bVar1 ;
DB * pDVar2 ;
PSXSCREEN * pPVar3 ;
int iVar4 ;
uint * puVar5 ;
undefined4 local_10 ;
undefined4 local_c ;
pPVar3 = pCurrScreen ;
if ( bSetup = = 0 ) {
if ( ( uRam001cc5dc & 0x10 ) ! = 0 ) {
DAT_FRNT__001c6a90 = 0 ;
FESound ( 0 ) ;
DAT_FRNT__001c6aac = 1 ;
LoadBackgroundFile ( s_DATA_GFX_RAW_FRNT__001c07f4 ) ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x1000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x4000 ) = = 0 ) {
DAT_FRNT__001c6a70 = ( uint ) pCurrButton - > u & 3 ;
return 0 ;
}
bVar1 = pCurrButton - > d ;
}
else {
bVar1 = pCurrButton - > u ;
}
local_10 = DAT_FRNT__001c0884 ;
local_c = DAT_FRNT__001c0888 ;
DAT_FRNT__001c6a70 = ( uint ) bVar1 - 1 ;
LoadImage ( & local_10 , & DAT_0013f400 + DAT_FRNT__001c6a70 * 0x8000 ) ;
DrawSync ( 0 ) ;
DisplayOnScreenText ( ) ;
pDVar2 = current ;
DAT_FRNT__001cc5c8 = DAT_FRNT__001cc5c8 & 0xff000000 | * ( uint * ) current - > ot [ 2 ] & 0xffffff ;
* ( uint * ) current - > ot [ 2 ] = * ( uint * ) current - > ot [ 2 ] & 0xff000000 | 0x1cc5c8 ;
DAT_FRNT__001cbdb8 = DAT_FRNT__001cbdb8 & 0xff000000 | * ( uint * ) pDVar2 - > ot [ 3 ] & 0xffffff ;
puVar5 = ( uint * ) pDVar2 - > ot [ 3 ] ;
* puVar5 = * puVar5 & 0xff000000 | 0x1cbdb8 ;
EndFrame ( ) ;
return 0 ;
}
GameType = GAME_MISSION ;
if ( gFurthestMission = = 0 ) {
iVar4 = 0x300 ;
LAB_FRNT__001c43f4 :
pCurrScreen - > buttons [ 0 ] . action = iVar4 ;
pPVar3 - > buttons [ 1 ] . action = iVar4 ;
pPVar3 - > buttons [ 2 ] . action = iVar4 ;
}
else {
if ( gFurthestMission < 10 ) {
pCurrScreen - > buttons [ 0 ] . action = 0x113 ;
pPVar3 - > buttons [ 1 ] . action = 0x300 ;
pPVar3 - > buttons [ 2 ] . action = 0x300 ;
pPVar3 - > buttons [ 3 ] . action = 0x300 ;
goto LAB_FRNT__001c4404 ;
}
if ( gFurthestMission < 0x15 ) {
pCurrScreen - > buttons [ 0 ] . action = 0x113 ;
pPVar3 - > buttons [ 1 ] . action = 0x113 ;
pPVar3 - > buttons [ 2 ] . action = 0x300 ;
pPVar3 - > buttons [ 3 ] . action = 0x300 ;
goto LAB_FRNT__001c4404 ;
}
if ( 0x1e < gFurthestMission ) {
iVar4 = 0x113 ;
goto LAB_FRNT__001c43f4 ;
}
iVar4 = 0x300 ;
pCurrScreen - > buttons [ 0 ] . action = 0x113 ;
pPVar3 - > buttons [ 1 ] . action = 0x113 ;
pPVar3 - > buttons [ 2 ] . action = 0x113 ;
}
pPVar3 - > buttons [ 3 ] . action = iVar4 ;
LAB_FRNT__001c4404 :
LoadBackgroundFile ( s_DATA_CITYBACK_RAW_FRNT__001c08b4 ) ;
if ( DAT_FRNT__001c6a78 = = - 1 ) {
SetupExtraPoly ( s_DATA_CITY_RAW_FRNT__001c088c , 0 , 0 ) ;
}
else {
DAT_FRNT__001c6a90 = 1 ;
}
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ CutSceneSelectScreen(int bSetup /*$a0*/)
// line 3728, offset 0x001c4600
/* begin block 1 */
// Start line: 3730
// Start offset: 0x001C4600
// Variables:
// struct RENDER_ARGS renderArgs; // stack offset -48
// int extraVal; // $a0
// struct RECT rect; // stack offset -24
/* begin block 1.1 */
// Start line: 3789
// Start offset: 0x001C4798
/* begin block 1.1.1 */
// Start line: 3789
// Start offset: 0x001C4798
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.1.1 */
// End offset: 0x001C4798
// End Line: 3789
/* end block 1.1 */
// End offset: 0x001C4798
// End Line: 3789
/* begin block 1.2 */
// Start line: 3729
// Start offset: 0x001C4844
// Variables:
// int offset; // $a1
/* begin block 1.2.1 */
// Start line: 3729
// Start offset: 0x001C4844
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.2.1 */
// End offset: 0x001C4844
// End Line: 3729
/* end block 1.2 */
// End offset: 0x001C4844
// End Line: 3729
/* begin block 1.3 */
// Start line: 3808
// Start offset: 0x001C4900
/* begin block 1.3.1 */
// Start line: 3808
// Start offset: 0x001C4900
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.3.1 */
// End offset: 0x001C4900
// End Line: 3808
/* end block 1.3 */
// End offset: 0x001C4900
// End Line: 3808
/* begin block 1.4 */
// Start line: 3813
// Start offset: 0x001C4940
/* begin block 1.4.1 */
// Start line: 3813
// Start offset: 0x001C4940
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.4.1 */
// End offset: 0x001C4940
// End Line: 3813
/* end block 1.4 */
// End offset: 0x001C4940
// End Line: 3813
/* end block 1 */
// End offset: 0x001C4B30
// End Line: 3847
/* begin block 2 */
// Start line: 8520
/* end block 2 */
// End Line: 8521
/* begin block 3 */
// Start line: 8529
/* end block 3 */
// End Line: 8530
/* begin block 4 */
// Start line: 8530
/* end block 4 */
// End Line: 8531
/* begin block 5 */
// Start line: 8534
/* end block 5 */
// End Line: 8535
int CutSceneSelectScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
byte bVar1 ;
DB * pDVar2 ;
PSXBUTTON * pPVar3 ;
int iVar4 ;
uint * puVar5 ;
PSXBUTTON * * ppPVar6 ;
undefined * puVar7 ;
undefined4 local_18 ;
undefined4 local_14 ;
undefined4 local_10 ;
undefined4 local_c ;
iVar4 = ScreenDepth ;
local_18 = DAT_FRNT__001c0884 ;
local_14 = DAT_FRNT__001c0888 ;
if ( bSetup = = 0 ) {
if ( ( uRam001cc5dc & 0x10 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x40 ) ! = 0 ) {
if ( DAT_FRNT__001c6a8c = = 0 ) {
if ( DAT_FRNT__001c69a0 = = 0 ) {
DAT_FRNT__001c69a0 = * ( int * ) ( & DAT_FRNT__001c69b8 + ( DAT_FRNT__001c6a70 + 1 ) * 4 ) - 1U ;
if ( ( int ) ( uint ) ( byte ) ( & DAT_FRNT__001c69e0 ) [ gFurthestMission ] <
( int ) ( ( * ( int * ) ( & DAT_FRNT__001c69b8 + ( DAT_FRNT__001c6a70 + 1 ) * 4 ) - 1U ) +
* ( int * ) ( & DAT_FRNT__001c69cc + DAT_FRNT__001c6a70 * 4 ) + 1 ) ) {
DAT_FRNT__001c69a0 = ( uint ) ( byte ) ( & DAT_FRNT__001c69e0 ) [ gFurthestMission ] ;
}
puVar7 = & DAT_0015f400 + DAT_FRNT__001c69a0 * 0x8000 ;
}
else {
DAT_FRNT__001c69a0 = DAT_FRNT__001c69a0 - 1 ;
puVar7 = & DAT_0015f400 + DAT_FRNT__001c69a0 * 0x8000 ;
}
}
else {
if ( DAT_FRNT__001c6a8c ! = 2 ) {
bReturnToMain = 0 ;
ppPVar6 = pButtonStack10 + ScreenDepth ;
pScreenStack10 [ ScreenDepth ] = pCurrScreen ;
pPVar3 = pCurrButton ;
feVariableSave [ 1 ] = DAT_FRNT__001c6a70 ;
feVariableSave [ 0 ] = DAT_FRNT__001c69a0 ;
* ppPVar6 = pCurrButton ;
ScreenNames12 [ iVar4 ] = pPVar3 - > Name ;
StartRender ( feVariableSave [ 0 ] +
* ( int * ) ( & DAT_FRNT__001c69cc + feVariableSave [ 1 ] * 4 ) + 1 ) ;
return 0 ;
}
if ( ( DAT_FRNT__001c69a0 = =
* ( int * ) ( & DAT_FRNT__001c69b8 + ( DAT_FRNT__001c6a70 + 1 ) * 4 ) + - 1 ) | |
( ( int ) ( uint ) ( byte ) ( & DAT_FRNT__001c69e0 ) [ gFurthestMission ] < =
( int ) ( DAT_FRNT__001c69a0 + * ( int * ) ( & DAT_FRNT__001c69cc + DAT_FRNT__001c6a70 * 4 ) + 1 )
) ) {
puVar7 = & DAT_0015f400 ;
DAT_FRNT__001c69a0 = 0 ;
}
else {
DAT_FRNT__001c69a0 = DAT_FRNT__001c69a0 + 1 ;
puVar7 = & DAT_0015f400 + DAT_FRNT__001c69a0 * 0x8000 ;
}
}
local_c = DAT_FRNT__001c0888 ;
local_10 = DAT_FRNT__001c0884 ;
LoadImage ( & local_10 , puVar7 ) ;
DrawSync ( 0 ) ;
DisplayOnScreenText ( ) ;
pDVar2 = current ;
DAT_FRNT__001cc5c8 = DAT_FRNT__001cc5c8 & 0xff000000 | * ( uint * ) current - > ot [ 2 ] & 0xffffff ;
* ( uint * ) current - > ot [ 2 ] = * ( uint * ) current - > ot [ 2 ] & 0xff000000 | 0x1cc5c8 ;
DAT_FRNT__001cbdb8 = DAT_FRNT__001cbdb8 & 0xff000000 | * ( uint * ) pDVar2 - > ot [ 3 ] & 0xffffff ;
puVar5 = ( uint * ) pDVar2 - > ot [ 3 ] ;
* puVar5 = * puVar5 & 0xff000000 | 0x1cbdb8 ;
EndFrame ( ) ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x1000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x4000 ) = = 0 ) {
return 0 ;
}
bVar1 = pCurrButton - > d ;
}
else {
bVar1 = pCurrButton - > u ;
}
DAT_FRNT__001c6a8c = ( uint ) bVar1 - 1 ;
}
else {
DAT_FRNT__001c6a90 = 0 ;
DAT_FRNT__001c6a80 = 0 ;
}
iVar4 = 0 ;
}
else {
LoadBackgroundFile ( s_DATA_CUTS_CUTBACK_RAW_FRNT__001c08c8 ) ;
DAT_FRNT__001c6a70 = feVariableSave [ 1 ] ;
if ( feVariableSave [ 0 ] = = - 1 ) {
DAT_FRNT__001c69a0 = 0 ;
DAT_FRNT__001c6a70 = GameLevel ;
}
else {
DAT_FRNT__001c69a0 = feVariableSave [ 0 ] ;
feVariableSave [ 3 ] = 0xffffffff ;
feVariableSave [ 2 ] = 0xffffffff ;
feVariableSave [ 1 ] = - 1 ;
feVariableSave [ 0 ] = - 1 ;
}
if ( ( int ) DAT_FRNT__001c6a7a = = GameLevel ) {
DAT_FRNT__001c6a90 = 1 ;
LoadImage ( & local_18 , & DAT_0015f400 ) ;
DrawSync ( 0 ) ;
}
else {
SetupExtraPoly ( ( & PTR_s_DATA_CUTS_CCUTS_RAW_FRNT__001c073c_FRNT__001c69a8 ) [ GameLevel ] ,
DAT_FRNT__001c69a0 , 0x20000 ) ;
}
iVar4 = 1 ;
DAT_FRNT__001c6a80 = 1 ;
DAT_FRNT__001c6a8c = 1 ;
DAT_FRNT__001c69a4 = 1 ;
pCurrButton = pCurrScreen - > buttons + 1 ;
}
return iVar4 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ CutSceneCitySelectScreen(int bSetup /*$a0*/)
// line 3855, offset 0x001c4b30
/* begin block 1 */
// Start line: 3857
// Start offset: 0x001C4B30
// Variables:
// struct RECT rect; // stack offset -24
/* begin block 1.1 */
// Start line: 3856
// Start offset: 0x001C4E6C
/* begin block 1.1.1 */
// Start line: 3856
// Start offset: 0x001C4E6C
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.1.1 */
// End offset: 0x001C4E6C
// End Line: 3856
/* end block 1.1 */
// End offset: 0x001C4E6C
// End Line: 3856
/* begin block 1.2 */
// Start line: 3856
// Start offset: 0x001C4E6C
/* begin block 1.2.1 */
// Start line: 3856
// Start offset: 0x001C4E6C
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.2.1 */
// End offset: 0x001C4E6C
// End Line: 3856
/* end block 1.2 */
// End offset: 0x001C4E6C
// End Line: 3856
/* begin block 1.3 */
// Start line: 3856
// Start offset: 0x001C4EB4
/* begin block 1.3.1 */
// Start line: 3856
// Start offset: 0x001C4EB4
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.3.1 */
// End offset: 0x001C4EB4
// End Line: 3856
/* end block 1.3 */
// End offset: 0x001C4EB4
// End Line: 3856
/* begin block 1.4 */
// Start line: 3856
// Start offset: 0x001C4FAC
/* begin block 1.4.1 */
// Start line: 3856
// Start offset: 0x001C4FAC
// Variables:
// struct RECT rect; // stack offset -16
/* end block 1.4.1 */
// End offset: 0x001C50A0
// End Line: 3856
/* end block 1.4 */
// End offset: 0x001C50A0
// End Line: 3856
/* end block 1 */
// End offset: 0x001C50B0
// End Line: 3995
/* begin block 2 */
// Start line: 8827
/* end block 2 */
// End Line: 8828
/* begin block 3 */
// Start line: 8836
/* end block 3 */
// End Line: 8837
/* begin block 4 */
// Start line: 8837
/* end block 4 */
// End Line: 8838
int CutSceneCitySelectScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
DB * pDVar1 ;
PSXSCREEN * pPVar2 ;
PSXBUTTON * pPVar3 ;
PSXBUTTON * * ppPVar4 ;
uint * puVar5 ;
int offset ;
undefined * puVar6 ;
undefined4 local_18 ;
undefined4 local_14 ;
undefined4 local_10 ;
undefined4 local_c ;
offset = ScreenDepth ;
local_18 = DAT_FRNT__001c0884 ;
local_14 = DAT_FRNT__001c0888 ;
if ( bSetup ! = 0 ) {
LoadBackgroundFile ( s_DATA_CITYBACK_RAW_FRNT__001c08b4 ) ;
if ( feVariableSave [ 0 ] = = - 1 ) {
if ( DAT_FRNT__001c69a4 = = 0 ) {
DAT_FRNT__001c6a70 = 0 ;
DAT_FRNT__001c69a4 = 1 ;
}
}
else {
DAT_FRNT__001c6a70 = feVariableSave [ 0 ] ;
feVariableSave [ 3 ] = 0xffffffff ;
feVariableSave [ 2 ] = 0xffffffff ;
feVariableSave [ 1 ] = 0xffffffff ;
feVariableSave [ 0 ] = - 1 ;
}
pCurrScreen - > buttons [ 3 ] . d = ' \x01 ' ;
pCurrScreen - > buttons [ 0 ] . u = ' \x04 ' ;
pPVar2 = pCurrScreen ;
offset = gFurthestMission ;
if ( gFurthestMission = = 0 ) {
pCurrScreen - > buttons [ 0 ] . action = 0x300 ;
pPVar2 - > buttons [ 1 ] . action = 0x300 ;
pPVar2 - > buttons [ 2 ] . action = 0x300 ;
pPVar2 - > buttons [ 3 ] . action = 0x300 ;
}
else {
if ( gFurthestMission < 10 ) {
pCurrScreen - > buttons [ 0 ] . action = 0x116 ;
pPVar2 - > buttons [ 1 ] . action = 0x300 ;
pPVar2 - > buttons [ 2 ] . action = 0x300 ;
pPVar2 - > buttons [ 3 ] . action = 0x300 ;
}
else {
if ( gFurthestMission < 0x15 ) {
pCurrScreen - > buttons [ 0 ] . action = 0x116 ;
pPVar2 - > buttons [ 1 ] . action = 0x116 ;
pPVar2 - > buttons [ 2 ] . action = 0x300 ;
pPVar2 - > buttons [ 3 ] . action = 0x300 ;
}
else {
if ( gFurthestMission < 0x1f ) {
pCurrScreen - > buttons [ 0 ] . action = 0x116 ;
pPVar2 - > buttons [ 1 ] . action = 0x116 ;
pPVar2 - > buttons [ 2 ] . action = 0x116 ;
pPVar2 - > buttons [ 3 ] . action = 0x300 ;
}
else {
pCurrScreen - > buttons [ 0 ] . action = 0x116 ;
pPVar2 - > buttons [ 1 ] . action = 0x116 ;
pPVar2 - > buttons [ 2 ] . action = 0x116 ;
pPVar2 - > buttons [ 3 ] . action = 0x116 ;
if ( offset = = 0x28 ) {
pPVar2 - > buttons [ 3 ] . d = ' \x05 ' ;
pCurrScreen - > buttons [ 0 ] . u = ' \x05 ' ;
}
}
}
}
}
if ( DAT_FRNT__001c6a78 = = - 1 ) {
offset = DAT_FRNT__001c6a70 ;
if ( DAT_FRNT__001c6a70 = = 4 ) {
offset = 0 ;
}
SetupExtraPoly ( s_DATA_CITY_RAW_FRNT__001c088c , offset , 0 ) ;
return 0 ;
}
DAT_FRNT__001c6a90 = 1 ;
if ( DAT_FRNT__001c6a70 = = 4 ) {
LoadImage ( & local_18 , & DAT_0013f400 ) ;
}
else {
LoadImage ( & local_18 , & DAT_0013f400 + DAT_FRNT__001c6a70 * 0x8000 ) ;
}
DrawSync ( 0 ) ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x40 ) ! = 0 ) {
DAT_FRNT__001c6a7b = 0xff ;
DAT_FRNT__001c6a7c = ( undefined ) GameLevel ;
if ( GameLevel ! = 4 ) {
DAT_FRNT__001c6a7b = 0xff ;
return 0 ;
}
bReturnToMain = 0 ;
ppPVar4 = pButtonStack10 + ScreenDepth ;
pScreenStack10 [ ScreenDepth ] = pCurrScreen ;
pPVar3 = pCurrButton ;
* ppPVar4 = pCurrButton ;
ScreenNames12 [ offset ] = pPVar3 - > Name ;
feVariableSave [ 0 ] = DAT_FRNT__001c6a70 ;
StartRender ( 0x60 ) ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x10 ) ! = 0 ) {
FESound ( 0 ) ;
DAT_FRNT__001c6aac = 1 ;
LoadBackgroundFile ( s_DATA_GFX_RAW_FRNT__001c07f4 ) ;
DAT_FRNT__001c69a4 = 0 ;
DAT_FRNT__001c6a90 = 0 ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x1000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x4000 ) = = 0 ) {
return 0 ;
}
GameLevel = ( uint ) pCurrButton - > d - 1 ;
DAT_FRNT__001c6a70 = GameLevel ;
if ( GameLevel ! = 4 ) {
local_10 = DAT_FRNT__001c0884 ;
local_c = DAT_FRNT__001c0888 ;
LoadImage ( & local_10 , & DAT_0013f400 + GameLevel * 0x8000 ) ;
DrawSync ( 0 ) ;
DisplayOnScreenText ( ) ;
pDVar1 = current ;
DAT_FRNT__001cc5c8 = DAT_FRNT__001cc5c8 & 0xff000000 | * ( uint * ) current - > ot [ 2 ] & 0xffffff ;
* ( uint * ) current - > ot [ 2 ] = * ( uint * ) current - > ot [ 2 ] & 0xff000000 | 0x1cc5c8 ;
DAT_FRNT__001cbdb8 = DAT_FRNT__001cbdb8 & 0xff000000 | * ( uint * ) pDVar1 - > ot [ 3 ] & 0xffffff ;
puVar5 = ( uint * ) pDVar1 - > ot [ 3 ] ;
* puVar5 = * puVar5 & 0xff000000 | 0x1cbdb8 ;
EndFrame ( ) ;
return 0 ;
}
}
else {
DAT_FRNT__001c6a70 = ( uint ) pCurrButton - > u - 1 ;
if ( DAT_FRNT__001c6a70 ! = 4 ) {
puVar6 = & DAT_0013f400 + DAT_FRNT__001c6a70 * 0x8000 ;
goto LAB_FRNT__001c4ec0 ;
}
}
puVar6 = & DAT_0013f400 ;
LAB_FRNT__001c4ec0 :
local_10 = DAT_FRNT__001c0884 ;
local_c = DAT_FRNT__001c0888 ;
GameLevel = DAT_FRNT__001c6a70 ;
LoadImage ( & local_10 , puVar6 ) ;
DrawSync ( 0 ) ;
DisplayOnScreenText ( ) ;
pDVar1 = current ;
DAT_FRNT__001cc5c8 = DAT_FRNT__001cc5c8 & 0xff000000 | * ( uint * ) current - > ot [ 2 ] & 0xffffff ;
* ( uint * ) current - > ot [ 2 ] = * ( uint * ) current - > ot [ 2 ] & 0xff000000 | 0x1cc5c8 ;
DAT_FRNT__001cbdb8 = DAT_FRNT__001cbdb8 & 0xff000000 | * ( uint * ) pDVar1 - > ot [ 3 ] & 0xffffff ;
puVar5 = ( uint * ) pDVar1 - > ot [ 3 ] ;
* puVar5 = * puVar5 & 0xff000000 | 0x1cbdb8 ;
EndFrame ( ) ;
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ SetVolumeScreen(int bSetup /*$a0*/)
// line 4005, offset 0x001c50b0
/* begin block 1 */
// Start line: 4007
// Start offset: 0x001C50B0
// Variables:
// int last; // $s2
// char text[4]; // stack offset -48
// int ypos[2]; // stack offset -40
// struct RECT rect; // stack offset -32
/* begin block 1.1 */
// Start line: 4048
// Start offset: 0x001C5254
/* begin block 1.1.1 */
// Start line: 4048
// Start offset: 0x001C5254
// Variables:
// struct DB *db_hold; // $a1
/* end block 1.1.1 */
// End offset: 0x001C5254
// End Line: 4048
/* end block 1.1 */
// End offset: 0x001C5254
// End Line: 4048
/* begin block 1.2 */
// Start line: 4070
// Start offset: 0x001C5284
/* begin block 1.2.1 */
// Start line: 4070
// Start offset: 0x001C5284
// Variables:
// struct DB *db_hold; // $a1
/* end block 1.2.1 */
// End offset: 0x001C5284
// End Line: 4070
/* end block 1.2 */
// End offset: 0x001C5284
// End Line: 4070
/* begin block 1.3 */
// Start line: 4097
// Start offset: 0x001C52CC
/* begin block 1.3.1 */
// Start line: 4097
// Start offset: 0x001C52CC
// Variables:
// struct DB *db_hold; // $a1
/* end block 1.3.1 */
// End offset: 0x001C52CC
// End Line: 4097
/* end block 1.3 */
// End offset: 0x001C52CC
// End Line: 4097
/* begin block 1.4 */
// Start line: 4119
// Start offset: 0x001C5420
/* begin block 1.4.1 */
// Start line: 4119
// Start offset: 0x001C5420
// Variables:
// struct DB *db_hold; // $a1
/* end block 1.4.1 */
// End offset: 0x001C5530
// End Line: 4122
/* end block 1.4 */
// End offset: 0x001C5530
// End Line: 4122
/* end block 1 */
// End offset: 0x001C55F8
// End Line: 4148
/* begin block 2 */
// Start line: 9157
/* end block 2 */
// End Line: 9158
/* begin block 3 */
// Start line: 9168
/* end block 3 */
// End Line: 9169
/* begin block 4 */
// Start line: 9169
/* end block 4 */
// End Line: 9170
/* begin block 5 */
// Start line: 9172
/* end block 5 */
// End Line: 9173
int SetVolumeScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
char * * ppcVar1 ;
byte bVar2 ;
int iVar3 ;
int iVar4 ;
DB * pDVar5 ;
DB * pDVar6 ;
char acStack48 [ 8 ] ;
int local_28 ;
int local_24 ;
undefined4 local_20 ;
undefined4 local_1c ;
iVar4 = gMasterVolume ;
iVar3 = gMusicVolume ;
local_28 = DAT_FRNT__001c08e0 ;
local_24 = DAT_FRNT__001c08e4 ;
local_20 = DAT_FRNT__001c0884 ;
local_1c = DAT_FRNT__001c0888 ;
if ( bSetup ! = 0 ) {
DAT_FRNT__001c6a8c = 0 ;
DAT_FRNT__001cc260 = gMasterVolume ;
DAT_FRNT__001cc588 = gMusicVolume ;
LoadBackgroundFile ( s_DATA_VOL_RAW_FRNT__001c08e8 ) ;
sprintf ( acStack48 , ( char * ) & PTR_DAT_FRNT__001c08f8 , ( int ) ( & DAT_00002710 + gMasterVolume ) / 100 ) ;
FEPrintString ( acStack48 , 0x98 , local_28 , 2 , 0x80 , 0x80 , 0x80 ) ;
sprintf ( acStack48 , ( char * ) & PTR_DAT_FRNT__001c08f8 , ( int ) ( & DAT_00002710 + gMusicVolume ) / 100 ) ;
FEPrintString ( acStack48 , 0x98 , local_24 , 2 , 0x80 , 0x80 , 0x80 ) ;
return 0 ;
}
bVar2 = pCurrButton - > u ;
DAT_FRNT__001c6a8c = ( uint ) bVar2 & 3 ;
if ( ( ( int ) ( short ) uRam001cc5dc & 0x8000U ) = = 0 ) {
if ( ( uRam001cc5dc & 0x2000 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x10 ) ! = 0 ) {
FESound ( 0 ) ;
DAT_FRNT__001c6aac = 1 ;
gMasterVolume = DAT_FRNT__001cc260 ;
gMusicVolume = DAT_FRNT__001cc588 ;
LoadBackgroundFile ( s_DATA_GFX_RAW_FRNT__001c07f4 ) ;
SetMasterVolume ( gMasterVolume ) ;
SetXMVolume ( gMusicVolume ) ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x40 ) = = 0 ) {
return 0 ;
}
if ( DAT_FRNT__001c6a8c ! = 2 ) {
return 0 ;
}
LoadBackgroundFile ( s_DATA_GFX_RAW_FRNT__001c07f4 ) ;
return 0 ;
}
if ( ( bVar2 & 3 ) ! = 0 ) {
if ( DAT_FRNT__001c6a8c ! = 1 ) goto LAB_FRNT__001c5530 ;
gMusicVolume = gMusicVolume + 100 ;
if ( gMusicVolume < 1 ) goto LAB_FRNT__001c5418 ;
gMusicVolume = 0 ;
LAB_FRNT__001c5408 :
FESound ( 1 ) ;
goto LAB_FRNT__001c5424 ;
}
gMasterVolume = gMasterVolume + 100 ;
if ( gMasterVolume < 1 ) goto LAB_FRNT__001c52c4 ;
gMasterVolume = 0 ;
LAB_FRNT__001c52b4 :
FESound ( 1 ) ;
}
else {
if ( ( bVar2 & 3 ) ! = 0 ) {
if ( DAT_FRNT__001c6a8c ! = 1 ) goto LAB_FRNT__001c5530 ;
gMusicVolume = gMusicVolume + - 100 ;
if ( gMusicVolume < - 10000 ) {
gMusicVolume = - 10000 ;
goto LAB_FRNT__001c5408 ;
}
LAB_FRNT__001c5418 :
FESound ( 3 ) ;
LAB_FRNT__001c5424 :
sprintf ( acStack48 , ( char * ) & PTR_DAT_FRNT__001c08f8 , ( int ) ( & DAT_00002710 + gMusicVolume ) / 100 ) ;
FEPrintString ( acStack48 , 0x98 , local_24 , 2 , 0x80 , 0x80 , 0x80 ) ;
sprintf ( acStack48 , ( char * ) & PTR_DAT_FRNT__001c08f8 , ( int ) ( & DAT_00002710 + iVar3 ) / 100 ) ;
FEPrintString ( acStack48 , 0x98 , local_24 , 2 , 0 , 0 , 0 ) ;
DrawSync ( 0 ) ;
VSync ( 0 ) ;
PutDispEnv ( & current - > disp ) ;
PutDrawEnv ( & current - > draw ) ;
pDVar6 = last ;
pDVar5 = current ;
ppcVar1 = & last - > primtab ;
current = last ;
last = pDVar5 ;
pDVar6 - > primptr = * ppcVar1 ;
DrawOTag ( pDVar5 - > ot + 0x10 ) ;
ClearOTagR ( current - > ot , 0x10 ) ;
VSync ( 0 ) ;
goto LAB_FRNT__001c5530 ;
}
gMasterVolume = gMasterVolume + - 100 ;
if ( gMasterVolume < - 10000 ) {
gMasterVolume = - 10000 ;
goto LAB_FRNT__001c52b4 ;
}
LAB_FRNT__001c52c4 :
FESound ( 3 ) ;
}
sprintf ( acStack48 , ( char * ) & PTR_DAT_FRNT__001c08f8 , ( int ) ( & DAT_00002710 + gMasterVolume ) / 100 ) ;
FEPrintString ( acStack48 , 0x98 , local_28 , 2 , 0x80 , 0x80 , 0x80 ) ;
sprintf ( acStack48 , ( char * ) & PTR_DAT_FRNT__001c08f8 , ( int ) ( & DAT_00002710 + iVar4 ) / 100 ) ;
FEPrintString ( acStack48 , 0x98 , local_28 , 2 , 0 , 0 , 0 ) ;
DrawSync ( 0 ) ;
VSync ( 0 ) ;
PutDispEnv ( & current - > disp ) ;
PutDrawEnv ( & current - > draw ) ;
pDVar6 = last ;
pDVar5 = current ;
ppcVar1 = & last - > primtab ;
current = last ;
last = pDVar5 ;
pDVar6 - > primptr = * ppcVar1 ;
DrawOTag ( pDVar5 - > ot + 0x10 ) ;
ClearOTagR ( current - > ot , 0x10 ) ;
VSync ( 0 ) ;
LAB_FRNT__001c5530 :
SetMasterVolume ( gMasterVolume ) ;
SetXMVolume ( gMusicVolume ) ;
return 0 ; */
}
// decompiled code
// original method signature:
// void /*$ra*/ DisplayScoreTable()
// line 4165, offset 0x001c55f8
/* begin block 1 */
// Start line: 4167
// Start offset: 0x001C55F8
// Variables:
// int offset; // $a2
// int i; // $s4
// char text[32]; // stack offset -80
// struct SCORE_ENTRY *pSE; // stack offset -48
// int min; // $v1
// int frac; // $t0
/* end block 1 */
// End offset: 0x001C59A0
// End Line: 4221
/* begin block 2 */
// Start line: 9490
/* end block 2 */
// End Line: 9491
/* begin block 3 */
// Start line: 9508
/* end block 3 */
// End Line: 9509
/* begin block 4 */
// Start line: 9509
/* end block 4 */
// End Line: 9510
/* begin block 5 */
// Start line: 9517
/* end block 5 */
// End Line: 9518
/* WARNING: Unknown calling convention yet parameter storage is locked */
void DisplayScoreTable ( void )
{
UNIMPLEMENTED ( ) ;
/*
int iVar1 ;
int iVar2 ;
int y ;
int iVar3 ;
char acStack80 [ 32 ] ;
SCORE_ENTRY * local_30 [ 2 ] ;
gSubGameNumber = DAT_FRNT__001c6ce8 ;
OnScoreTable ( local_30 ) ;
sprintf ( acStack80 , ScreenNames12 [ ScreenDepth + - 1 ] ) ;
FEPrintString ( acStack80 , 0x14 , 200 , 2 , ( uint ) DAT_FRNT__001c6d00 , ( uint ) DAT_FRNT__001c6d01 ,
( uint ) DAT_FRNT__001c6d02 ) ;
sprintf ( acStack80 , ( & PTR_s_Chicago_FRNT__001c0910_FRNT__001c6cec ) [ GameLevel ] ) ;
FEPrintString ( acStack80 , 0x118 , 200 , 2 , ( uint ) DAT_FRNT__001c6d00 , ( uint ) DAT_FRNT__001c6d01 ,
( uint ) DAT_FRNT__001c6d02 ) ;
iVar2 = ( ( uint ) GameType - 4 ) * 8 ;
if ( ( GameType = = GAME_TAKEADRIVE ) & & ( NumPlayers = = 2 ) ) {
iVar2 = 0x30 ;
}
if ( GameType = = GAME_COPSANDROBBERS ) {
iVar2 = 0x20 ;
}
if ( GameType = = GAME_CAPTURETHEFLAG ) {
iVar2 = 0x28 ;
}
if ( ( GameType ! = GAME_PURSUIT ) & & ( GameType ! = GAME_SURVIVAL ) ) {
sprintf ( acStack80 , ( char * ) & PTR_DAT_FRNT__001c0918 ,
( & PTR_s_Downtown_FRNT__001c019c_FRNT__001c6774 )
[ iVar2 + GameLevel * 2 + DAT_FRNT__001c6ce8 ] ) ;
FEPrintStringSized ( acStack80 , 0x1a4 , 0xce , 0xc00 , 2 , ( uint ) DAT_FRNT__001c6d00 ,
( uint ) DAT_FRNT__001c6d01 , ( uint ) DAT_FRNT__001c6d02 ) ;
}
y = 0xf0 ;
iVar2 = 0 ;
iVar3 = 4 ;
do {
sprintf ( acStack80 , local_30 [ 0 ] - > name + iVar2 ) ;
FEPrintString ( acStack80 , 0x14 , y , 2 , ( uint ) DAT_FRNT__001c6cfc , ( uint ) DAT_FRNT__001c6cfd ,
( uint ) DAT_FRNT__001c6cfe ) ;
if ( ( GameType = = GAME_GATERACE ) | | ( GameType = = GAME_TRAILBLAZER ) ) {
if ( * ( short * ) ( ( int ) & local_30 [ 0 ] - > items + iVar2 ) ! = - 1 ) {
sprintf ( acStack80 , ( char * ) & PTR_DAT_FRNT__001c08f8 ) ;
FEPrintString ( acStack80 , 0x8c , y , 2 , ( uint ) DAT_FRNT__001c6cfc , ( uint ) DAT_FRNT__001c6cfd ,
( uint ) DAT_FRNT__001c6cfe ) ;
}
}
iVar1 = * ( int * ) ( ( int ) & local_30 [ 0 ] - > time + iVar2 ) ;
if ( iVar1 ! = - 1 ) {
sprintf ( acStack80 , s__d__02d__02d_FRNT__001c091c , iVar1 / 180000 ,
iVar1 / 3000 + ( iVar1 / 180000 ) * - 0x3c , ( iVar1 % 3000 ) / 0x1e ) ;
FEPrintString ( acStack80 , 0x118 , y , 2 , ( uint ) DAT_FRNT__001c6cfc , ( uint ) DAT_FRNT__001c6cfd ,
( uint ) DAT_FRNT__001c6cfe ) ;
}
y = y + 0x24 ;
iVar3 = iVar3 + - 1 ;
iVar2 = iVar2 + 0xc ;
} while ( - 1 < iVar3 ) ;
return ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ ScoreScreen(int bSetup /*$a0*/)
// line 4227, offset 0x001c59a0
/* begin block 1 */
// Start line: 9657
/* end block 1 */
// End Line: 9658
/* begin block 2 */
// Start line: 9664
/* end block 2 */
// End Line: 9665
/* begin block 3 */
// Start line: 9666
/* end block 3 */
// End Line: 9667
int ScoreScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
if ( bSetup ! = 0 ) {
GameLevel = 0 ;
DisplayScoreTable ( ) ;
DAT_FRNT__001c699c = 1 ;
DAT_FRNT__001c6a8c = 0 ;
return 0 ;
}
if ( ( uRam001cc5dc & 0x40 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x10 ) ! = 0 ) {
DAT_FRNT__001c699c = 0 ;
return 0 ;
}
if ( ( ( uRam001cc5dc & 0x1000 ) = = 0 ) & & ( ( uRam001cc5dc & 0x4000 ) = = 0 ) ) {
return 0 ;
}
DAT_FRNT__001c6a8c = DAT_FRNT__001c6a8c ^ 1 ;
return 0 ;
}
if ( DAT_FRNT__001c6a8c = = 0 ) {
if ( ( GameType ! = GAME_SURVIVAL ) & & ( GameType ! = GAME_PURSUIT ) ) {
if ( DAT_FRNT__001c6ce8 = = 1 ) {
DAT_FRNT__001c6ce8 = 0 ;
}
else {
DAT_FRNT__001c6ce8 = 1 ;
GameLevel = GameLevel + - 1 ;
if ( GameLevel < 0 ) {
GameLevel = 3 ;
}
}
LAB_FRNT__001c5ab0 :
DisplayScoreTable ( ) ;
DAT_FRNT__001c6aa0 = 1 ;
return 0 ;
}
GameLevel = GameLevel + - 1 ;
if ( GameLevel < 0 ) {
GameLevel = 3 ;
}
}
else {
if ( ( ( GameType ! = GAME_SURVIVAL ) & & ( GameType ! = GAME_PURSUIT ) ) & & ( DAT_FRNT__001c6ce8 = = 0 ) ) {
DAT_FRNT__001c6ce8 = 1 ;
goto LAB_FRNT__001c5ab0 ;
}
GameLevel = GameLevel + 1 ;
if ( 3 < GameLevel ) {
GameLevel = 0 ;
}
}
DAT_FRNT__001c6ce8 = 0 ;
DisplayScoreTable ( ) ;
DAT_FRNT__001c6aa0 = 1 ;
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ SubtitlesOnOffScreen(int bSetup /*$a0*/)
// line 4322, offset 0x001c64b0
/* begin block 1 */
// Start line: 12820
/* end block 1 */
// End Line: 12821
/* begin block 2 */
// Start line: 12821
/* end block 2 */
// End Line: 12822
/* WARNING: Control flow encountered bad instruction data */
int SubtitlesOnOffScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/* WARNING: Bad instruction - Truncating control flow here */
//halt_baddata();
}
// decompiled code
// original method signature:
// int /*$ra*/ CityCutOffScreen(int bSetup /*$a0*/)
// line 4345, offset 0x001c64fc
/* begin block 1 */
// Start line: 12866
/* end block 1 */
// End Line: 12867
/* begin block 2 */
// Start line: 12867
/* end block 2 */
// End Line: 12868
/* WARNING: Control flow encountered bad instruction data */
2020-03-29 18:10:37 +02:00
// [D]
2020-03-27 21:47:29 +01:00
int CityCutOffScreen ( int bSetup )
{
2020-04-19 09:59:51 +02:00
return 0 ; // [A]
2020-03-29 18:10:37 +02:00
PSXSCREEN * pPVar1 ;
pPVar1 = pCurrScreen ;
if ( bSetup ! = 0 ) {
if ( gFurthestMission < 0x14 ) {
pCurrScreen - > buttons [ 2 ] . action = 0x300 ;
}
else {
if ( 0x1d < gFurthestMission ) {
return 0 ;
}
}
pPVar1 - > buttons [ 3 ] . action = 0x300 ;
}
2020-03-27 21:47:29 +01:00
return 0 ;
}
// decompiled code
// original method signature:
// int /*$ra*/ ControllerScreen(int bSetup /*$a0*/)
// line 4378, offset 0x001c6548
/* begin block 1 */
// Start line: 12932
/* end block 1 */
// End Line: 12933
/* begin block 2 */
// Start line: 12933
/* end block 2 */
// End Line: 12934
int ControllerScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
if ( bSetup = = 0 ) {
if ( ( uRam001cc5dc & 0x40 ) = = 0 ) {
if ( ( uRam001cc5dc & 0x10 ) ! = 0 ) {
DAT_FRNT__001c699c = 0 ;
LoadBackgroundFile ( s_DATA_GFX_RAW_FRNT__001c07f4 ) ;
}
}
else {
DAT_FRNT__001c6a8c = DAT_FRNT__001c6a8c ^ 1 ;
LoadBackgroundFile ( ( & PTR_s_DATA_CARCONT_RAW_FRNT__001c0940_FRNT__001c6d04 ) [ DAT_FRNT__001c6a8c ]
) ;
DAT_FRNT__001c6aa0 = 1 ;
}
}
else {
DAT_FRNT__001c699c = 1 ;
DAT_FRNT__001c6a8c = 0 ;
pCurrScreen - > numButtons = ' \0 ' ;
LoadBackgroundFile ( ( & PTR_s_DATA_CARCONT_RAW_FRNT__001c0940_FRNT__001c6d04 ) [ DAT_FRNT__001c6a8c ] ) ;
}
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ MainScreen(int bSetup /*$a0*/)
// line 4412, offset 0x001c6614
/* begin block 1 */
// Start line: 13006
/* end block 1 */
// End Line: 13007
/* begin block 2 */
// Start line: 13007
/* end block 2 */
// End Line: 13008
int MainScreen ( int bSetup )
{
if ( bSetup ! = 0 ) {
2020-03-29 16:08:55 +02:00
if ( numPadsConnected = = 2 ) {
2020-03-27 21:47:29 +01:00
pCurrScreen - > buttons [ 3 ] . action = 0x106 ;
}
else {
pCurrScreen - > buttons [ 3 ] . action = 0x300 ;
}
}
2020-03-29 16:08:55 +02:00
return 0 ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// int /*$ra*/ CheatScreen(int bSetup /*$a0*/)
// line 4434, offset 0x001c5b4c
/* begin block 1 */
// Start line: 4436
// Start offset: 0x001C5B4C
// Variables:
// int numOpen; // $s5
// int i; // $s1
// int k; // $s6
// int *uc; // $s2
// unsigned char cheatOn[12]; // stack offset -104
// int hackLookup1[4]; // stack offset -88
// int hackLookup2[4]; // stack offset -72
/* begin block 1.1 */
// Start line: 4473
// Start offset: 0x001C5C6C
// Variables:
// int evilRuss[4]; // stack offset -56
/* end block 1.1 */
// End offset: 0x001C606C
// End Line: 4560
/* end block 1 */
// End offset: 0x001C60A0
// End Line: 4568
/* begin block 2 */
// Start line: 10082
/* end block 2 */
// End Line: 10083
/* begin block 3 */
// Start line: 10083
/* end block 3 */
// End Line: 10084
/* begin block 4 */
// Start line: 10087
/* end block 4 */
// End Line: 10088
int CheatScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
PSXSCREEN * pPVar1 ;
PSXSCREEN * pPVar2 ;
int iVar3 ;
int iVar4 ;
uint * puVar5 ;
int iVar6 ;
byte bVar7 ;
int iVar8 ;
int iVar9 ;
byte local_68 [ 16 ] ;
int local_58 [ 4 ] ;
int local_48 [ 4 ] ;
uint local_38 [ 4 ] ;
local_58 [ 0 ] = DAT_FRNT__001c0954 ;
local_58 [ 1 ] = DAT_FRNT__001c0958 ;
local_58 [ 2 ] = DAT_FRNT__001c095c ;
local_58 [ 3 ] = DAT_FRNT__001c0960 ;
local_48 [ 0 ] = DAT_FRNT__001c0964 ;
local_48 [ 1 ] = DAT_FRNT__001c0968 ;
local_48 [ 2 ] = DAT_FRNT__001c096c ;
local_48 [ 3 ] = DAT_FRNT__001c0970 ;
if ( bSetup = = 0 ) {
return 0 ;
}
if ( gFurthestMission = = 0x28 ) {
bVar7 = 4 ;
}
else {
bVar7 = ( ( byte ) AvailableCheats & 1 ) + ( ( byte ) AvailableCheats > > 1 & 1 ) +
( ( byte ) AvailableCheats > > 2 & 1 ) + ( ( byte ) AvailableCheats > > 3 & 1 ) ;
}
if ( bVar7 = = 0 ) {
pCurrScreen - > buttons [ 0 ] . u = ' \x01 ' ;
pCurrScreen - > buttons [ 0 ] . d = ' \x01 ' ;
pCurrScreen - > numButtons = ' \x01 ' ;
pPVar1 = pCurrScreen ;
pCurrScreen - > buttons [ 0 ] . action = 0x400 ;
sprintf ( pPVar1 - > buttons [ 0 ] . Name , PTR_s_Non_ci_sono_segreti_FRNT__001c01e4_FRNT__001c6874 ) ;
return 0 ;
}
puVar5 = local_38 ;
iVar4 = 0 ;
pCurrScreen - > numButtons = bVar7 ;
local_38 [ 0 ] = ( uint ) ( byte ) AvailableCheats & 1 ;
local_38 [ 1 ] = ( uint ) ( ( byte ) AvailableCheats > > 1 ) & 1 ;
local_38 [ 2 ] = ( uint ) ( ( byte ) AvailableCheats > > 2 ) & 1 ;
local_38 [ 3 ] = ( uint ) ( ( byte ) AvailableCheats > > 3 ) & 1 ;
iVar3 = 4 ;
iVar8 = 0 ;
do {
if ( ( * puVar5 = = 1 ) | | ( iVar6 = iVar3 , iVar9 = iVar8 , gFurthestMission = = 0x28 ) ) {
iVar6 = iVar3 + 0x3c ;
sprintf ( ( char * ) ( ( int ) & pCurrScreen - > buttons [ 0 ] . var + iVar3 ) ,
( & PTR_s_Non_ci_sono_segreti_FRNT__001c01e4_FRNT__001c6874 ) [ iVar4 + 1 ] ) ;
iVar9 = iVar8 + 1 ;
local_68 [ iVar8 ] = ( byte ) iVar4 ;
}
pPVar1 = pCurrScreen ;
iVar4 = iVar4 + 1 ;
puVar5 = puVar5 + 1 ;
iVar3 = iVar6 ;
iVar8 = iVar9 ;
} while ( iVar4 < 4 ) ;
if ( bVar7 = = 2 ) {
pCurrScreen - > buttons [ 0 ] . action = local_58 [ local_68 [ 0 ] ] ;
pPVar1 - > buttons [ 1 ] . action = local_58 [ local_68 [ 1 ] ] ;
pPVar1 - > buttons [ 0 ] . var = local_48 [ local_68 [ 0 ] ] ;
iVar3 = local_48 [ local_68 [ 1 ] ] ;
pPVar1 - > buttons [ 0 ] . d = ' \x02 ' ;
pPVar2 = pCurrScreen ;
pPVar1 - > buttons [ 1 ] . var = iVar3 ;
pPVar2 - > buttons [ 0 ] . u = ' \x02 ' ;
pCurrScreen - > buttons [ 1 ] . d = ' \x01 ' ;
pCurrScreen - > buttons [ 1 ] . u = ' \x01 ' ;
DAT_FRNT__001c6a8c = 0 ;
return 0 ;
}
if ( bVar7 < 3 ) {
if ( bVar7 = = 1 ) {
pCurrScreen - > buttons [ 0 ] . action = local_58 [ local_68 [ 0 ] ] ;
iVar3 = local_48 [ local_68 [ 0 ] ] ;
pPVar1 - > buttons [ 0 ] . d = ' \x01 ' ;
pPVar2 = pCurrScreen ;
pPVar1 - > buttons [ 0 ] . var = iVar3 ;
pPVar2 - > buttons [ 0 ] . u = ' \x01 ' ;
DAT_FRNT__001c6a8c = 0 ;
return 0 ;
}
}
else {
if ( bVar7 = = 3 ) {
pCurrScreen - > buttons [ 0 ] . action = local_58 [ local_68 [ 0 ] ] ;
pPVar1 - > buttons [ 1 ] . action = local_58 [ local_68 [ 1 ] ] ;
pPVar1 - > buttons [ 2 ] . action = local_58 [ local_68 [ 2 ] ] ;
pPVar1 - > buttons [ 0 ] . var = local_48 [ local_68 [ 0 ] ] ;
pPVar1 - > buttons [ 1 ] . var = local_48 [ local_68 [ 1 ] ] ;
iVar3 = local_48 [ local_68 [ 2 ] ] ;
pPVar1 - > buttons [ 0 ] . d = ' \x02 ' ;
pPVar2 = pCurrScreen ;
pPVar1 - > buttons [ 2 ] . var = iVar3 ;
pPVar2 - > buttons [ 0 ] . u = ' \x03 ' ;
pCurrScreen - > buttons [ 1 ] . d = ' \x03 ' ;
pCurrScreen - > buttons [ 1 ] . u = ' \x01 ' ;
pCurrScreen - > buttons [ 2 ] . d = ' \x01 ' ;
pCurrScreen - > buttons [ 2 ] . u = ' \x02 ' ;
DAT_FRNT__001c6a8c = 0 ;
return 0 ;
}
if ( bVar7 = = 4 ) {
pCurrScreen - > buttons [ 0 ] . action = local_58 [ local_68 [ 0 ] ] ;
pPVar1 - > buttons [ 1 ] . action = local_58 [ local_68 [ 1 ] ] ;
pPVar1 - > buttons [ 2 ] . action = local_58 [ local_68 [ 2 ] ] ;
pPVar1 - > buttons [ 3 ] . action = local_58 [ local_68 [ 3 ] ] ;
pPVar1 - > buttons [ 0 ] . var = local_48 [ local_68 [ 0 ] ] ;
pPVar1 - > buttons [ 1 ] . var = local_48 [ local_68 [ 1 ] ] ;
pPVar1 - > buttons [ 2 ] . var = local_48 [ local_68 [ 2 ] ] ;
iVar3 = local_48 [ local_68 [ 3 ] ] ;
pPVar1 - > buttons [ 0 ] . d = ' \x02 ' ;
pPVar2 = pCurrScreen ;
pPVar1 - > buttons [ 3 ] . var = iVar3 ;
pPVar2 - > buttons [ 0 ] . u = ' \x04 ' ;
pCurrScreen - > buttons [ 1 ] . d = ' \x03 ' ;
pCurrScreen - > buttons [ 1 ] . u = ' \x01 ' ;
pCurrScreen - > buttons [ 2 ] . d = ' \x04 ' ;
pCurrScreen - > buttons [ 2 ] . u = ' \x02 ' ;
pCurrScreen - > buttons [ 3 ] . d = ' \x01 ' ;
pCurrScreen - > buttons [ 3 ] . u = ' \x03 ' ;
DAT_FRNT__001c6a8c = 0 ;
return 0 ;
}
}
pCurrScreen - > numButtons = ' \0 ' ;
DAT_FRNT__001c6a8c = 0 ;
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ ImmunityOnOffScreen(int bSetup /*$a0*/)
// line 4575, offset 0x001c6654
/* begin block 1 */
// Start line: 13332
/* end block 1 */
// End Line: 13333
/* begin block 2 */
// Start line: 13333
/* end block 2 */
// End Line: 13334
/* WARNING: Control flow encountered bad instruction data */
int ImmunityOnOffScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/* WARNING: Bad instruction - Truncating control flow here */
//halt_baddata();
}
// decompiled code
// original method signature:
// int /*$ra*/ InvincibleOnOffScreen(int bSetup /*$a0*/)
// line 4597, offset 0x001c66a0
/* begin block 1 */
// Start line: 13376
/* end block 1 */
// End Line: 13377
/* begin block 2 */
// Start line: 13377
/* end block 2 */
// End Line: 13378
/* WARNING: Control flow encountered bad instruction data */
int InvincibleOnOffScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/* WARNING: Bad instruction - Truncating control flow here */
//halt_baddata();
}
// decompiled code
// original method signature:
// int /*$ra*/ GamePlayScreen(int bSetup /*$a0*/)
// line 4619, offset 0x001c66ec
/* begin block 1 */
// Start line: 13420
/* end block 1 */
// End Line: 13421
/* begin block 2 */
// Start line: 13421
/* end block 2 */
// End Line: 13422
int GamePlayScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
int iVar1 ;
if ( bSetup ! = 0 ) {
if ( DAT_FRNT__001c6ab4 = = 0 ) {
iVar1 = 0x300 ;
}
else {
iVar1 = 0x111 ;
}
pCurrScreen - > buttons [ 2 ] . action = iVar1 ;
}
return 0 ; */
}
// decompiled code
// original method signature:
// int /*$ra*/ GameNameScreen(int bSetup /*$a0*/)
// line 4642, offset 0x001c60a0
/* begin block 1 */
// Start line: 4644
// Start offset: 0x001C60A0
// Variables:
// int offset; // $s3
/* end block 1 */
// End offset: 0x001C61AC
// End Line: 4656
/* begin block 2 */
// Start line: 10496
/* end block 2 */
// End Line: 10497
/* begin block 3 */
// Start line: 10571
/* end block 3 */
// End Line: 10572
/* begin block 4 */
// Start line: 10572
/* end block 4 */
// End Line: 10573
/* begin block 5 */
// Start line: 10573
/* end block 5 */
// End Line: 10574
int GameNameScreen ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/*
int iVar1 ;
if ( bSetup ! = 0 ) {
iVar1 = ( ( uint ) GameType - 4 ) * 8 ;
if ( ( GameType = = GAME_TAKEADRIVE ) & & ( NumPlayers = = 2 ) ) {
iVar1 = 0x30 ;
}
if ( GameType = = GAME_COPSANDROBBERS ) {
iVar1 = 0x20 ;
}
if ( GameType = = GAME_CAPTURETHEFLAG ) {
iVar1 = 0x28 ;
}
if ( ( GameType = = GAME_CHECKPOINT ) & & ( NumPlayers = = 2 ) ) {
iVar1 = 0x38 ;
}
sprintf ( pCurrScreen - > buttons [ 0 ] . Name ,
( & PTR_s_Downtown_FRNT__001c019c_FRNT__001c6774 ) [ iVar1 + GameLevel * 2 ] ) ;
sprintf ( pCurrScreen - > buttons [ 1 ] . Name ,
( & PTR_s_Downtown_FRNT__001c019c_FRNT__001c6774 ) [ iVar1 + GameLevel * 2 + 1 ] ) ;
}
return 0 ; */
}
// decompiled code
// original method signature:
// void /*$ra*/ FEInitCdIcon()
// line 4671, offset 0x001c61ac
/* begin block 1 */
// Start line: 4673
// Start offset: 0x001C61AC
// Variables:
// int i; // $a0
// struct RECT dest; // stack offset -24
// unsigned short *palette; // $a2
/* end block 1 */
// End offset: 0x001C62F8
// End Line: 4709
/* begin block 2 */
// Start line: 10614
/* end block 2 */
// End Line: 10615
/* begin block 3 */
// Start line: 10630
/* end block 3 */
// End Line: 10631
/* begin block 4 */
// Start line: 10631
/* end block 4 */
// End Line: 10632
/* begin block 5 */
// Start line: 10633
/* end block 5 */
// End Line: 10634
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-28 16:43:40 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void FEInitCdIcon ( void )
{
2020-03-28 16:43:40 +01:00
ushort * puVar1 ;
int iVar2 ;
RECT16 rect ;
2020-04-01 15:24:35 +02:00
puVar1 = cd_icon + 10 ;
2020-03-28 16:43:40 +01:00
iVar2 = 0xd ;
2020-03-27 21:47:29 +01:00
do {
2020-03-28 16:43:40 +01:00
iVar2 = iVar2 + - 1 ;
* puVar1 = * puVar1 & 0x7fff ;
puVar1 = puVar1 + 1 ;
} while ( - 1 < iVar2 ) ;
cd_icon [ 10 ] = 0 ;
rect . x = 0x3c0 ;
rect . y = 0x1b2 ;
rect . w = 8 ;
rect . h = 0x20 ;
cd_icon [ 24 ] = cd_icon [ 24 ] | 0x8000 ;
cd_icon [ 25 ] = cd_icon [ 25 ] | 0x8000 ;
LoadImage ( & rect , ( u_long * ) ( cd_icon + 0x18 ) ) ;
setPolyFT4 ( & cd_sprite ) ;
2020-04-01 15:24:35 +02:00
cd_sprite . r0 = 128 ;
cd_sprite . g0 = 128 ;
cd_sprite . b0 = 128 ;
cd_sprite . v0 = - 0x4d ;
cd_sprite . v1 = - 0x4d ;
2020-03-28 16:43:40 +01:00
cd_sprite . u0 = ' \0 ' ;
cd_sprite . u1 = ' ' ;
cd_sprite . u2 = ' \0 ' ;
2020-04-01 15:24:35 +02:00
cd_sprite . v2 = - 0x2d ;
2020-03-28 16:43:40 +01:00
cd_sprite . u3 = ' ' ;
2020-04-01 15:24:35 +02:00
cd_sprite . v3 = - 0x2d ;
cd_sprite . clut = GetClut ( 0x3c0 , 0x1b1 ) ;
cd_sprite . tpage = GetTPage ( 0 , 0 , 0x3c0 , 0x100 ) ;
2020-03-28 16:43:40 +01:00
bCdIconSetup = 1 ;
2020-04-01 15:24:35 +02:00
cd_sprite . x0 = 0x50 ;
cd_sprite . y0 = 0x26 ;
cd_sprite . x1 = 0x76 ;
cd_sprite . y1 = 0x26 ;
cd_sprite . x2 = 0x50 ;
cd_sprite . y2 = 0x3b ;
cd_sprite . x3 = 0x76 ;
cd_sprite . y3 = 0x3b ;
return ;
2020-03-27 21:47:29 +01:00
}
// decompiled code
// original method signature:
// void /*$ra*/ FEDrawCDicon()
// line 4716, offset 0x001c62f8
/* begin block 1 */
// Start line: 4718
// Start offset: 0x001C62F8
// Variables:
// unsigned short *palette; // $a1
// int temp; // $a2
// int i; // $a0
// struct RECT dest; // stack offset -16
/* end block 1 */
// End offset: 0x001C6378
// End Line: 4735
/* begin block 2 */
// Start line: 10758
/* end block 2 */
// End Line: 10759
/* begin block 3 */
// Start line: 10766
/* end block 3 */
// End Line: 10767
/* begin block 4 */
// Start line: 10767
/* end block 4 */
// End Line: 10768
/* WARNING: Unknown calling convention yet parameter storage is locked */
2020-03-29 01:56:49 +01:00
// [D]
2020-03-27 21:47:29 +01:00
void FEDrawCDicon ( void )
{
2020-03-29 01:56:49 +01:00
ushort * puVar1 ;
2020-03-27 21:47:29 +01:00
int iVar2 ;
2020-03-29 01:56:49 +01:00
RECT16 dest ;
2020-03-27 21:47:29 +01:00
2020-03-29 01:56:49 +01:00
cd_icon [ 23 ] = cd_icon [ 11 ] ;
2020-03-27 21:47:29 +01:00
iVar2 = 0xb ;
2020-03-29 01:56:49 +01:00
puVar1 = cd_icon + 10 ;
2020-03-27 21:47:29 +01:00
do {
iVar2 = iVar2 + - 1 ;
puVar1 [ 1 ] = puVar1 [ 2 ] ;
puVar1 = puVar1 + 1 ;
} while ( - 1 < iVar2 ) ;
2020-03-29 01:56:49 +01:00
dest . x = 960 ;
dest . y = 433 ;
dest . w = 16 ;
dest . h = 1 ;
LoadImage ( & dest , ( u_long * ) ( cd_icon + 10 ) ) ;
DrawPrim ( & cd_sprite ) ;
2020-03-27 21:47:29 +01:00
DrawSync ( 0 ) ;
}
// decompiled code
// original method signature:
// int /*$ra*/ CheatNumlayerSelect(int bSetup /*$a0*/)
// line 4742, offset 0x001c6724
/* begin block 1 */
// Start line: 13666
/* end block 1 */
// End Line: 13667
/* begin block 2 */
// Start line: 13667
/* end block 2 */
// End Line: 13668
/* WARNING: Control flow encountered bad instruction data */
int CheatNumlayerSelect ( int bSetup )
{
UNIMPLEMENTED ( ) ;
return 0 ;
/* WARNING: Bad instruction - Truncating control flow here */
//halt_baddata();
}