* LEVEL3.PLT was incorrectly using Windows CRLF end of line.
* When assigning a parking slot, busy parking slots cannot be selected. Some work TODO yet, though.
This commit is contained in:
parent
e4ab93f21e
commit
135a1e93cb
BIN
Bin/AIRPORT.bin
BIN
Bin/AIRPORT.bin
Binary file not shown.
|
@ -6,12 +6,12 @@
|
|||
#For example:
|
||||
14:55
|
||||
#Aircraft arrival (or departure) must be set relative to initial time, in HH:MM format.
|
||||
ARRIVAL;PHX1802;100;00:10;0;360
|
||||
ARRIVAL;PHX1805;125;00:10;0;360
|
||||
ARRIVAL;PHX1806;125;00:30;0;360
|
||||
ARRIVAL;PHX1807;125;00:50;0;360
|
||||
ARRIVAL;PHX1808;125;01:30;0;360
|
||||
DEPARTURE;PHX1000;53;00:05;152;360
|
||||
DEPARTURE;PHX1001;53;00:15;153;360
|
||||
DEPARTURE;PHX1002;53;00:30;154;360
|
||||
DEPARTURE;PHX1003;53;00:45;155;360
|
||||
ARRIVAL;PHX1802;100;00:10;0;60
|
||||
ARRIVAL;PHX1805;125;00:10;0;60
|
||||
ARRIVAL;PHX1806;125;00:30;0;60
|
||||
ARRIVAL;PHX1807;125;00:50;0;60
|
||||
ARRIVAL;PHX1808;125;01:30;0;60
|
||||
DEPARTURE;PHX1000;53;00:05;152;120
|
||||
DEPARTURE;PHX1001;53;00:15;153;120
|
||||
DEPARTURE;PHX1002;53;00:30;154;120
|
||||
DEPARTURE;PHX1003;53;00:45;155;120
|
||||
|
|
|
@ -55,7 +55,6 @@ static GsSprite UpDownArrowSpr;
|
|||
static GsSprite LeftRightArrowSpr;
|
||||
static TYPE_ISOMETRIC_POS AircraftCenterIsoPos;
|
||||
static TYPE_CARTESIAN_POS AircraftCenterPos;
|
||||
static char* AircraftLiveryNamesTable[] = {"PHX", NULL};
|
||||
static AIRCRAFT_LIVERY AircraftLiveryTable[] = {AIRCRAFT_LIVERY_0, AIRCRAFT_LIVERY_UNKNOWN};
|
||||
|
||||
// Used to quickly link FlightData indexes against AircraftData indexes.
|
||||
|
@ -245,6 +244,12 @@ bool AircraftAddNew( TYPE_FLIGHT_DATA* const ptrFlightData,
|
|||
|
||||
static AIRCRAFT_LIVERY AircraftLiveryFromFlightNumber(char* strFlightNumber)
|
||||
{
|
||||
static const char* const AircraftLiveryNamesTable[] =
|
||||
{
|
||||
"PHX",
|
||||
NULL
|
||||
};
|
||||
|
||||
int32_t liveryIndex;
|
||||
char strLivery[4];
|
||||
|
||||
|
@ -811,7 +816,7 @@ TYPE_ISOMETRIC_POS AircraftGetIsoPos(const uint8_t FlightDataIdx)
|
|||
return retIsoPos;
|
||||
}
|
||||
|
||||
void AircraftAddTargets(TYPE_AIRCRAFT_DATA* const ptrAircraft, uint16_t* targets)
|
||||
void AircraftAddTargets(TYPE_AIRCRAFT_DATA* const ptrAircraft, const uint16_t* const targets)
|
||||
{
|
||||
memcpy(ptrAircraft->Target, targets, sizeof (uint16_t) * AIRCRAFT_MAX_TARGETS);
|
||||
ptrAircraft->TargetIdx = 0;
|
||||
|
@ -851,7 +856,7 @@ TYPE_AIRCRAFT_DATA* AircraftFromFlightDataIndex(const uint8_t index)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
void AircraftFromFlightDataIndexAddTargets(uint8_t index, uint16_t* targets)
|
||||
void AircraftFromFlightDataIndexAddTargets(const uint8_t index, const uint16_t* const targets)
|
||||
{
|
||||
TYPE_AIRCRAFT_DATA* const ptrAircraft = AircraftFromFlightDataIndex(index);
|
||||
|
||||
|
|
|
@ -16,8 +16,8 @@ void AircraftInit(void);
|
|||
void AircraftHandler(void);
|
||||
void AircraftRender(TYPE_PLAYER* const ptrPlayer, uint8_t aircraftIdx);
|
||||
TYPE_AIRCRAFT_DATA* AircraftFromFlightDataIndex(uint8_t index);
|
||||
void AircraftFromFlightDataIndexAddTargets(uint8_t index, uint16_t* targets);
|
||||
void AircraftAddTargets(TYPE_AIRCRAFT_DATA* const ptrAircraft, uint16_t* targets);
|
||||
void AircraftFromFlightDataIndexAddTargets(const uint8_t index, const uint16_t* const targets);
|
||||
void AircraftAddTargets(TYPE_AIRCRAFT_DATA* const ptrAircraft, const uint16_t* const targets);
|
||||
TYPE_ISOMETRIC_POS AircraftGetIsoPos(const uint8_t FlightDataIdx);
|
||||
uint16_t AircraftGetTileFromFlightDataIndex(const uint8_t index);
|
||||
bool AircraftRemove(uint8_t aircraftIdx);
|
||||
|
|
Binary file not shown.
Binary file not shown.
206
Source/Game.c
206
Source/Game.c
|
@ -245,7 +245,27 @@ static SsVag TakeoffSnd;
|
|||
static SsVag BeepSnd;
|
||||
|
||||
// Instances for player-specific data
|
||||
static TYPE_PLAYER PlayerData[MAX_PLAYERS];
|
||||
static TYPE_PLAYER PlayerData[MAX_PLAYERS] =
|
||||
{
|
||||
[PLAYER_ONE] =
|
||||
{
|
||||
.PadKeyPressed_Callback = &PadOneKeyPressed,
|
||||
.PadKeyReleased_Callback = &PadOneKeyReleased,
|
||||
.PadKeySinglePress_Callback = &PadOneKeySinglePress,
|
||||
.PadDirectionKeyPressed_Callback = &PadOneDirectionKeyPressed,
|
||||
.PadLastKeySinglePressed_Callback = &PadOneGetLastKeySinglePressed
|
||||
},
|
||||
|
||||
[PLAYER_TWO] =
|
||||
{
|
||||
.PadKeyPressed_Callback = &PadTwoKeyPressed,
|
||||
.PadKeyReleased_Callback = &PadTwoKeyReleased,
|
||||
.PadDirectionKeyPressed_Callback = &PadTwoDirectionKeyPressed,
|
||||
.PadKeySinglePress_Callback = &PadTwoKeySinglePress,
|
||||
.PadLastKeySinglePressed_Callback = &PadTwoGetLastKeySinglePressed
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
static void* GamePltDest[] = {(TYPE_FLIGHT_DATA*)&FlightData };
|
||||
|
||||
|
@ -434,7 +454,6 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
|
|||
};
|
||||
|
||||
uint8_t i;
|
||||
uint32_t track;
|
||||
static bool loaded;
|
||||
|
||||
GameStartupFlag = true;
|
||||
|
@ -452,7 +471,7 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
|
|||
LoadMenu( &pGameCfg->PLTPath,
|
||||
GamePltDest,
|
||||
sizeof (char),
|
||||
sizeof (GamePltDest) / sizeof (GamePltDest[0]) );
|
||||
ARRAY_SIZE(GamePltDest));
|
||||
|
||||
GameLoadLevel(pGameCfg->LVLPath);
|
||||
|
||||
|
@ -465,11 +484,6 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
|
|||
memset(GameUsedRwy, 0, GAME_MAX_RUNWAYS * sizeof (uint16_t) );
|
||||
|
||||
PlayerData[PLAYER_ONE].Active = true;
|
||||
PlayerData[PLAYER_ONE].PadKeyPressed_Callback = &PadOneKeyPressed;
|
||||
PlayerData[PLAYER_ONE].PadKeyReleased_Callback = &PadOneKeyReleased;
|
||||
PlayerData[PLAYER_ONE].PadKeySinglePress_Callback = &PadOneKeySinglePress;
|
||||
PlayerData[PLAYER_ONE].PadDirectionKeyPressed_Callback = &PadOneDirectionKeyPressed;
|
||||
PlayerData[PLAYER_ONE].PadLastKeySinglePressed_Callback = &PadOneGetLastKeySinglePressed;
|
||||
PlayerData[PLAYER_ONE].FlightDataPage = 0;
|
||||
PlayerData[PLAYER_ONE].UnboardingSequenceIdx = 0;
|
||||
|
||||
|
@ -488,12 +502,7 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
|
|||
|
||||
if (PlayerData[PLAYER_TWO].Active)
|
||||
{
|
||||
PlayerData[PLAYER_TWO].PadKeyPressed_Callback = &PadTwoKeyPressed;
|
||||
PlayerData[PLAYER_TWO].PadKeyReleased_Callback = &PadTwoKeyReleased;
|
||||
PlayerData[PLAYER_TWO].PadDirectionKeyPressed_Callback = &PadTwoDirectionKeyPressed;
|
||||
PlayerData[PLAYER_TWO].FlightDataPage = 0;
|
||||
PlayerData[PLAYER_TWO].PadKeySinglePress_Callback = &PadTwoKeySinglePress;
|
||||
PlayerData[PLAYER_TWO].PadLastKeySinglePressed_Callback = &PadTwoGetLastKeySinglePressed;
|
||||
PlayerData[PLAYER_TWO].UnboardingSequenceIdx = 0;
|
||||
|
||||
PlayerData[PLAYER_TWO].ShowAircraftData = false;
|
||||
|
@ -553,7 +562,10 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
|
|||
GameMouseSpr.g = NORMAL_LUMINANCE;
|
||||
GameMouseSpr.b = NORMAL_LUMINANCE;
|
||||
|
||||
GameSpawnMinTime = TimerCreate(GAME_MINIMUM_PARKING_SPAWN_TIME, false, &GameMinimumSpawnTimeout);
|
||||
if (GameSpawnMinTime != NULL)
|
||||
{
|
||||
GameSpawnMinTime = TimerCreate(GAME_MINIMUM_PARKING_SPAWN_TIME, false, &GameMinimumSpawnTimeout);
|
||||
}
|
||||
|
||||
spawnMinTimeFlag = false;
|
||||
|
||||
|
@ -573,9 +585,11 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
|
|||
|
||||
GfxSetGlobalLuminance(0);
|
||||
|
||||
track = SystemRand(GAMEPLAY_FIRST_TRACK, GAMEPLAY_LAST_TRACK);
|
||||
{
|
||||
const uint32_t track = SystemRand(GAMEPLAY_FIRST_TRACK, GAMEPLAY_LAST_TRACK);
|
||||
|
||||
SfxPlayTrack(track);
|
||||
SfxPlayTrack(track);
|
||||
}
|
||||
}
|
||||
|
||||
/* ***************************************************************************************
|
||||
|
@ -732,20 +746,10 @@ void GameEmergencyMode(void)
|
|||
{
|
||||
uint8_t i;
|
||||
uint8_t disconnected_players = 0x00;
|
||||
bool (*PadXConnected[MAX_PLAYERS])(void) = { [PLAYER_ONE] = &PadOneConnected,
|
||||
[PLAYER_TWO] = &PadTwoConnected };
|
||||
|
||||
enum
|
||||
static bool (*const PadXConnected[MAX_PLAYERS])(void) =
|
||||
{
|
||||
ERROR_RECT_X = 32,
|
||||
ERROR_RECT_W = X_SCREEN_RESOLUTION - (ERROR_RECT_X << 1),
|
||||
|
||||
ERROR_RECT_Y = 16,
|
||||
ERROR_RECT_H = Y_SCREEN_RESOLUTION - (ERROR_RECT_Y << 1),
|
||||
|
||||
ERROR_RECT_R = 0,
|
||||
ERROR_RECT_G = 32,
|
||||
ERROR_RECT_B = NORMAL_LUMINANCE
|
||||
[PLAYER_ONE] = &PadOneConnected,
|
||||
[PLAYER_TWO] = &PadTwoConnected
|
||||
};
|
||||
|
||||
enum
|
||||
|
@ -759,21 +763,37 @@ void GameEmergencyMode(void)
|
|||
{
|
||||
bool enabled = false;
|
||||
|
||||
GsRectangle errorRct = {.x = ERROR_RECT_X,
|
||||
.w = ERROR_RECT_W,
|
||||
.y = ERROR_RECT_Y,
|
||||
.h = ERROR_RECT_H,
|
||||
.r = ERROR_RECT_R,
|
||||
.g = ERROR_RECT_G,
|
||||
.b = ERROR_RECT_B };
|
||||
|
||||
if (SystemGetEmergencyMode())
|
||||
{
|
||||
enum
|
||||
{
|
||||
ERROR_RECT_X = 32,
|
||||
ERROR_RECT_W = X_SCREEN_RESOLUTION - (ERROR_RECT_X << 1),
|
||||
|
||||
ERROR_RECT_Y = 16,
|
||||
ERROR_RECT_H = Y_SCREEN_RESOLUTION - (ERROR_RECT_Y << 1),
|
||||
|
||||
ERROR_RECT_R = 0,
|
||||
ERROR_RECT_G = 32,
|
||||
ERROR_RECT_B = NORMAL_LUMINANCE
|
||||
};
|
||||
|
||||
static const GsRectangle errorRct =
|
||||
{
|
||||
.x = ERROR_RECT_X,
|
||||
.w = ERROR_RECT_W,
|
||||
.y = ERROR_RECT_Y,
|
||||
.h = ERROR_RECT_H,
|
||||
.r = ERROR_RECT_R,
|
||||
.g = ERROR_RECT_G,
|
||||
.b = ERROR_RECT_B
|
||||
};
|
||||
|
||||
// One of the pads has been disconnected during gameplay
|
||||
// Show an error screen until it is disconnected again.
|
||||
|
||||
GsSortCls(0,0,0);
|
||||
GsSortRectangle(&errorRct);
|
||||
GsSortRectangle((GsRectangle*)&errorRct);
|
||||
|
||||
for (i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
|
@ -1466,12 +1486,6 @@ static void GameLoadLevel(const char* path)
|
|||
|
||||
static void GameAircraftState(const uint8_t i)
|
||||
{
|
||||
uint16_t target[2] = {0};
|
||||
// Arrays are copied to AircraftAddNew, so we create a first and only
|
||||
// target which is the parking tile itself, and the second element
|
||||
// is just the NULL character.
|
||||
// Not an ideal solution, but the best one currently available.
|
||||
|
||||
if (FlightData.Finished[i] == false)
|
||||
{
|
||||
if ((FlightData.Hours[i] == 0)
|
||||
|
@ -1515,6 +1529,12 @@ static void GameAircraftState(const uint8_t i)
|
|||
|
||||
if (bParkingBusy == false)
|
||||
{
|
||||
uint16_t target[2] = {0};
|
||||
// Arrays are copied to AircraftAddNew, so we create a first and only
|
||||
// target which is the parking tile itself, and the second element
|
||||
// is just the NULL character.
|
||||
// Not an ideal solution, but the best one currently available.
|
||||
|
||||
FlightData.State[i] = STATE_PARKED;
|
||||
|
||||
aircraftCreated = true;
|
||||
|
@ -1535,12 +1555,12 @@ static void GameAircraftState(const uint8_t i)
|
|||
}
|
||||
else if (FlightData.FlightDirection[i] == ARRIVAL)
|
||||
{
|
||||
const uint32_t idx = SystemRand(SOUND_M1_INDEX, ARRAY_SIZE(ApproachSnds));
|
||||
|
||||
Serial_printf("Flight %d set to STATE_APPROACH.\n", i);
|
||||
FlightData.State[i] = STATE_APPROACH;
|
||||
aircraftCreated = true;
|
||||
|
||||
const uint32_t idx = SystemRand(SOUND_M1_INDEX, ARRAY_SIZE(ApproachSnds));
|
||||
|
||||
// Play chatter sound.
|
||||
SfxPlaySound(&ApproachSnds[idx]);
|
||||
|
||||
|
@ -1727,9 +1747,38 @@ static void GameRenderTerrainPrecalculations(TYPE_PLAYER* const ptrPlayer, const
|
|||
||
|
||||
(CurrentTile == TILE_PARKING_2) ) )
|
||||
{
|
||||
tileData->r = NORMAL_LUMINANCE >> 2;
|
||||
tileData->g = rwy_sine;
|
||||
tileData->b = NORMAL_LUMINANCE >> 2;
|
||||
bool parkingBusy = false;
|
||||
|
||||
uint8_t aircraftIndex;
|
||||
|
||||
for (aircraftIndex = 0; aircraftIndex < GAME_MAX_AIRCRAFT; aircraftIndex++)
|
||||
{
|
||||
const TYPE_AIRCRAFT_DATA* const ptrAircraft = AircraftFromFlightDataIndex(aircraftIndex);
|
||||
|
||||
if (ptrAircraft->State == STATE_PARKED)
|
||||
{
|
||||
const uint16_t tile = AircraftGetTileFromFlightDataIndex(aircraftIndex);
|
||||
|
||||
if (i == tile)
|
||||
{
|
||||
parkingBusy = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parkingBusy)
|
||||
{
|
||||
tileData->r = rwy_sine;
|
||||
tileData->g = NORMAL_LUMINANCE >> 2;
|
||||
tileData->b = NORMAL_LUMINANCE >> 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
tileData->r = NORMAL_LUMINANCE >> 2;
|
||||
tileData->g = rwy_sine;
|
||||
tileData->b = NORMAL_LUMINANCE >> 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (ptrPlayer->ShowAircraftData)
|
||||
|
@ -2050,7 +2099,6 @@ static void GameStateLockTarget(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA*
|
|||
|
||||
static void GameStateSelectTaxiwayRunway(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA* const ptrFlightData)
|
||||
{
|
||||
TYPE_ISOMETRIC_POS IsoPos = CameraGetIsoPos(ptrPlayer);
|
||||
uint8_t i;
|
||||
uint16_t target_tile;
|
||||
|
||||
|
@ -2062,8 +2110,6 @@ static void GameStateSelectTaxiwayRunway(TYPE_PLAYER* const ptrPlayer, TYPE_FLIG
|
|||
ptrPlayer->LockTarget = false;
|
||||
ptrPlayer->LockedAircraft = FLIGHT_DATA_INVALID_IDX;
|
||||
|
||||
ptrPlayer->SelectedTile = GameGetTileFromIsoPosition(&IsoPos);
|
||||
|
||||
if (GamePathToTile(ptrPlayer, ptrFlightData) == false)
|
||||
{
|
||||
ptrPlayer->InvalidPath = true;
|
||||
|
@ -2159,7 +2205,6 @@ static void GameStateSelectTaxiwayRunway(TYPE_PLAYER* const ptrPlayer, TYPE_FLIG
|
|||
* **************************************************************************************************/
|
||||
static void GameStateSelectTaxiwayParking(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA* const ptrFlightData)
|
||||
{
|
||||
TYPE_ISOMETRIC_POS IsoPos = CameraGetIsoPos(ptrPlayer);
|
||||
uint8_t i;
|
||||
uint16_t target_tile;
|
||||
|
||||
|
@ -2169,13 +2214,37 @@ static void GameStateSelectTaxiwayParking(TYPE_PLAYER* const ptrPlayer, TYPE_FLI
|
|||
ptrPlayer->LockTarget = false;
|
||||
ptrPlayer->LockedAircraft = FLIGHT_DATA_INVALID_IDX;
|
||||
|
||||
ptrPlayer->SelectedTile = GameGetTileFromIsoPosition(&IsoPos);
|
||||
|
||||
if (GamePathToTile(ptrPlayer, ptrFlightData) == false)
|
||||
{
|
||||
ptrPlayer->InvalidPath = true;
|
||||
}
|
||||
|
||||
#if 0
|
||||
for (i = 0; GAME_MAX_AIRCRAFT; i++)
|
||||
{
|
||||
if (ptrPlayer->InvalidPath == false)
|
||||
{
|
||||
const TYPE_AIRCRAFT_DATA* const ptrAircraft = AircraftFromFlightDataIndex(i);
|
||||
|
||||
if (ptrAircraft != NULL)
|
||||
{
|
||||
if (ptrAircraft->State == STATE_PARKED)
|
||||
{
|
||||
const uint16_t tile = AircraftGetTileFromFlightDataIndex(i);
|
||||
|
||||
if (ptrPlayer->SelectedTile == tile)
|
||||
{
|
||||
ptrPlayer->InvalidPath = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
Serial_printf("Yo\n");
|
||||
|
||||
if (ptrPlayer->PadKeySinglePress_Callback(PAD_TRIANGLE))
|
||||
{
|
||||
// State exit.
|
||||
|
@ -2201,13 +2270,6 @@ static void GameStateSelectTaxiwayParking(TYPE_PLAYER* const ptrPlayer, TYPE_FLI
|
|||
|
||||
target_tile = levelBuffer[ptrPlayer->Waypoints[ptrPlayer->LastWaypointIdx]] & ~(TILE_MIRROR_FLAG);
|
||||
|
||||
Serial_printf("ptrPlayer->LastWaypointIdx = %d\n",
|
||||
ptrPlayer->LastWaypointIdx);
|
||||
|
||||
Serial_printf("target_tile = %d, TILE_PARKING = %d\n",
|
||||
target_tile,
|
||||
TILE_PARKING);
|
||||
|
||||
SfxPlaySound(&BeepSnd);
|
||||
|
||||
if ( (target_tile == TILE_PARKING)
|
||||
|
@ -2287,7 +2349,6 @@ static void GameStateSelectRunway(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA
|
|||
}
|
||||
else if (ptrPlayer->PadKeySinglePress_Callback(PAD_CROSS))
|
||||
{
|
||||
ptrPlayer->SelectRunway = false;
|
||||
bool success = false;
|
||||
|
||||
if (SystemContains_u16(GameRwy[ptrPlayer->SelectedRunway], GameUsedRwy, GAME_MAX_RUNWAYS) == false)
|
||||
|
@ -2725,10 +2786,13 @@ void GameAssignRunwaytoAircraft(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA*
|
|||
// TODO: Algorithm is not correct. If TILE_RWY_EXIT is placed further,
|
||||
// but returns a match earlier than other rwyExitTiles[], invalid targets
|
||||
// are returned to aircraft. We should check this before proceeding.
|
||||
uint8_t rwyExitTiles[] = { TILE_RWY_EXIT,
|
||||
TILE_RWY_EXIT | TILE_MIRROR_FLAG,
|
||||
TILE_RWY_EXIT_2,
|
||||
TILE_RWY_EXIT_2 | TILE_MIRROR_FLAG };
|
||||
static const uint8_t rwyExitTiles[] =
|
||||
{
|
||||
TILE_RWY_EXIT,
|
||||
TILE_RWY_EXIT | TILE_MIRROR_FLAG,
|
||||
TILE_RWY_EXIT_2,
|
||||
TILE_RWY_EXIT_2 | TILE_MIRROR_FLAG
|
||||
};
|
||||
|
||||
ptrFlightData->State[aircraftIndex] = STATE_FINAL;
|
||||
GameScore += SCORE_REWARD_FINAL;
|
||||
|
@ -2742,7 +2806,7 @@ void GameAssignRunwaytoAircraft(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA*
|
|||
|
||||
for (i = 0; (i < GAME_MAX_RWY_LENGTH) && (rwyExit == 0); i++)
|
||||
{
|
||||
for (j = 0; j < (sizeof (rwyExitTiles) / sizeof (rwyExitTiles[0])); j++)
|
||||
for (j = 0; j < ARRAY_SIZE(rwyExitTiles); j++)
|
||||
{
|
||||
if (rwyTiles[i] == rwyExitTiles[j])
|
||||
{
|
||||
|
@ -2995,7 +3059,7 @@ FL_STATE GameTargetsReached(uint16_t firstTarget, uint8_t index)
|
|||
*
|
||||
* ****************************************************************************/
|
||||
|
||||
uint16_t GameGetTileFromIsoPosition(TYPE_ISOMETRIC_POS* IsoPos)
|
||||
uint16_t GameGetTileFromIsoPosition(const TYPE_ISOMETRIC_POS* const IsoPos)
|
||||
{
|
||||
uint16_t tile;
|
||||
|
||||
|
@ -3194,6 +3258,10 @@ bool GamePathToTile(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DATA* const ptrFli
|
|||
uint16_t y_diff;
|
||||
uint16_t temp_tile;
|
||||
|
||||
const TYPE_ISOMETRIC_POS IsoPos = CameraGetIsoPos(ptrPlayer);
|
||||
|
||||
ptrPlayer->SelectedTile = GameGetTileFromIsoPosition(&IsoPos);
|
||||
|
||||
if (ptrPlayer->SelectedTile == GAME_INVALID_TILE_SELECTION)
|
||||
{
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ fix16_t GameGetYFromTile(uint16_t tile);
|
|||
short GameGetXFromTile_short(uint16_t tile);
|
||||
short GameGetYFromTile_short(uint16_t tile);
|
||||
FL_STATE GameTargetsReached(uint16_t firstTarget, uint8_t index);
|
||||
uint16_t GameGetTileFromIsoPosition(TYPE_ISOMETRIC_POS* IsoPos);
|
||||
uint16_t GameGetTileFromIsoPosition(const TYPE_ISOMETRIC_POS* const IsoPos);
|
||||
FL_STATE GameGetFlightDataStateFromIdx(uint8_t FlightDataIdx);
|
||||
uint32_t GameGetScore(void);
|
||||
bool GameInsideLevelFromIsoPos(TYPE_ISOMETRIC_FIX16_POS* ptrIsoPos);
|
||||
|
|
|
@ -214,10 +214,10 @@ typedef struct
|
|||
uint16_t NextAircraftTime;
|
||||
|
||||
// Pad callbacks.
|
||||
bool (*PadKeyPressed_Callback)(unsigned short);
|
||||
bool (*PadKeyReleased_Callback)(unsigned short);
|
||||
bool (*PadKeySinglePress_Callback)(unsigned short);
|
||||
bool (*PadDirectionKeyPressed_Callback)(void);
|
||||
bool (*const PadKeyPressed_Callback)(unsigned short);
|
||||
bool (*const PadKeyReleased_Callback)(unsigned short);
|
||||
bool (*const PadKeySinglePress_Callback)(unsigned short);
|
||||
bool (*const PadDirectionKeyPressed_Callback)(void);
|
||||
unsigned short (*PadLastKeySinglePressed_Callback)(void);
|
||||
}TYPE_PLAYER;
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ GNU_SIZE = mipsel-unknown-elf-size
|
|||
|
||||
# Custom define flags for GCC
|
||||
DEFINE= -DFIXMATH_FAST_SIN -D_PAL_MODE_
|
||||
#DEFINE += -DPSXSDK_DEBUG
|
||||
DEFINE += -DPSXSDK_DEBUG
|
||||
DEFINE += -DNO_CDDA
|
||||
DEFINE += -DNO_INTRO
|
||||
|
||||
|
@ -27,7 +27,7 @@ CDROM_ROOT=$(PROJECT_DIR)/cdimg
|
|||
BIN_TARGET_PATH = $(PROJECT_DIR)/Bin
|
||||
|
||||
#Uncomment this DEFINE below to use Airport together with OpenSend + QPSXSerial toolchain.
|
||||
#DEFINE += -DSERIAL_INTERFACE
|
||||
DEFINE += -DSERIAL_INTERFACE
|
||||
|
||||
# PSXSDK tools definitions
|
||||
# ELF2EXE:
|
||||
|
@ -124,7 +124,7 @@ SPRITE_OBJECTS += $(addprefix $(OBJ_FONTS_PATH)/, INTROFNT.TIM \
|
|||
# Instructions
|
||||
# ------------------------------------
|
||||
|
||||
$(BIN_TARGET_PATH)/$(PROJECT).bin: $(EXE_PATH)/$(PROJECT).iso $(MUSIC_TRACKS)
|
||||
$(BIN_TARGET_PATH)/$(PROJECT).bin: $(EXE_PATH)/$(PROJECT).iso
|
||||
#~ mkpsxiso $< $@ $(LICENSE_FILE) -s $(addprefix --track=, $(MUSIC_TRACKS))
|
||||
mkpsxiso $< $@ $(LICENSE_FILE) -s
|
||||
# $(PROJECT).cue is automatically generated by mkpsxiso
|
||||
|
|
|
@ -95,7 +95,7 @@ static unsigned short pad2_cheat_array[CHEAT_ARRAY_SIZE];
|
|||
static TYPE_TIMER* pad1_cheat_timer;
|
||||
static TYPE_TIMER* pad2_cheat_timer;
|
||||
|
||||
static TYPE_CHEAT * cheatsArray[PAD_MAX_CHEATS];
|
||||
static const TYPE_CHEAT* cheatsArray[PAD_MAX_CHEATS];
|
||||
|
||||
psx_pad_state PadOneGetState(void)
|
||||
{
|
||||
|
@ -558,7 +558,7 @@ void PadCheatHandler(uint8_t n_pad)
|
|||
cheat_array[j] = key;
|
||||
}
|
||||
|
||||
bool PadAddCheat(TYPE_CHEAT * cheat)
|
||||
bool PadAddCheat(const TYPE_CHEAT* const cheat)
|
||||
{
|
||||
static uint8_t idx = 0;
|
||||
|
||||
|
|
|
@ -61,7 +61,7 @@ bool PadTwoIsVibrationEnabled(void);
|
|||
unsigned short PadOneGetRawData(void);
|
||||
unsigned short PadTwoGetRawData(void);
|
||||
|
||||
bool PadAddCheat(TYPE_CHEAT * cheat);
|
||||
bool PadAddCheat(const TYPE_CHEAT* const cheat);
|
||||
|
||||
unsigned short* PadGetPlayerOneCheatArray(void);
|
||||
|
||||
|
|
594
Source/System.c
594
Source/System.c
File diff suppressed because it is too large
Load Diff
|
@ -81,7 +81,7 @@ bool SystemContains_u8(const uint8_t value, const uint8_t* const buffer, const s
|
|||
bool SystemContains_u16(const uint16_t value, const uint16_t* const buffer, const size_t sz);
|
||||
|
||||
// Compares two arrays of unsigned short type.
|
||||
bool SystemArrayCompare(unsigned short* arr1, unsigned short* arr2, size_t sz);
|
||||
bool SystemArrayCompare(const unsigned short* const arr1, const unsigned short* const arr2, const size_t sz);
|
||||
|
||||
// Prints stack pointer address using Serial_printf()
|
||||
void SystemPrintStackPointerAddress(void);
|
||||
|
@ -92,7 +92,7 @@ void SystemCheckStack(void);
|
|||
|
||||
// Looks for string "str" inside a string array pointed to by "array".
|
||||
// Returns index inside string array on success, -1 if not found.
|
||||
int32_t SystemIndexOfStringArray(char* str, char** array);
|
||||
int32_t SystemIndexOfStringArray(const char* str, const char* const* array);
|
||||
|
||||
// Function overload for uint16_t data type.
|
||||
int32_t SystemIndexOf_U16(const uint16_t value, const uint16_t* array, const uint32_t sz);
|
||||
|
|
|
@ -54,13 +54,15 @@ TYPE_TIMER* TimerCreate(uint32_t t, bool rf, void (*timer_callback)(void) )
|
|||
|
||||
for (i = 0; i < MAX_TIMERS; i++)
|
||||
{
|
||||
if (timer_array[i].busy == false)
|
||||
TYPE_TIMER* const ptrTimer = &timer_array[i];
|
||||
|
||||
if (ptrTimer->busy == false)
|
||||
{
|
||||
timer_array[i].Timeout_Callback = timer_callback;
|
||||
timer_array[i].time = t;
|
||||
timer_array[i].orig_time = t;
|
||||
timer_array[i].repeat_flag = rf;
|
||||
timer_array[i].busy = true;
|
||||
ptrTimer->Timeout_Callback = timer_callback;
|
||||
ptrTimer->time = t;
|
||||
ptrTimer->orig_time = t;
|
||||
ptrTimer->repeat_flag = rf;
|
||||
ptrTimer->busy = true;
|
||||
success = true;
|
||||
break;
|
||||
}
|
||||
|
|
0
Source/build-MapEditor-Desktop_Qt_5_12_0_GCC_64bit-Release/MapEditor
Executable file → Normal file
0
Source/build-MapEditor-Desktop_Qt_5_12_0_GCC_64bit-Release/MapEditor
Executable file → Normal file
|
@ -6,12 +6,12 @@
|
|||
#For example:
|
||||
14:55
|
||||
#Aircraft arrival (or departure) must be set relative to initial time, in HH:MM format.
|
||||
ARRIVAL;PHX1802;100;00:10;0;360
|
||||
ARRIVAL;PHX1805;125;00:10;0;360
|
||||
ARRIVAL;PHX1806;125;00:30;0;360
|
||||
ARRIVAL;PHX1807;125;00:50;0;360
|
||||
ARRIVAL;PHX1808;125;01:30;0;360
|
||||
DEPARTURE;PHX1000;53;00:05;152;360
|
||||
DEPARTURE;PHX1001;53;00:15;153;360
|
||||
DEPARTURE;PHX1002;53;00:30;154;360
|
||||
DEPARTURE;PHX1003;53;00:45;155;360
|
||||
ARRIVAL;PHX1802;100;00:10;0;60
|
||||
ARRIVAL;PHX1805;125;00:10;0;60
|
||||
ARRIVAL;PHX1806;125;00:30;0;60
|
||||
ARRIVAL;PHX1807;125;00:50;0;60
|
||||
ARRIVAL;PHX1808;125;01:30;0;60
|
||||
DEPARTURE;PHX1000;53;00:05;152;120
|
||||
DEPARTURE;PHX1001;53;00:15;153;120
|
||||
DEPARTURE;PHX1002;53;00:30;154;120
|
||||
DEPARTURE;PHX1003;53;00:45;155;120
|
||||
|
|
Loading…
Reference in New Issue