aboutsummaryrefslogtreecommitdiff
path: root/Source/Game.c
diff options
context:
space:
mode:
authorXaviDCR92 <xavi.dcr@gmail.com>2017-05-22 07:06:17 +0200
committerXaviDCR92 <xavi.dcr@gmail.com>2017-05-22 07:06:17 +0200
commitaefe5f8c1c45f4cdeafe08113953a9f03df3c644 (patch)
treec7f609ec694a2180237b77c182705a79f81f4725 /Source/Game.c
parent3a8f91466126c97427d7cf0c86c36581662981be (diff)
downloadairport-aefe5f8c1c45f4cdeafe08113953a9f03df3c644.tar.gz
* Split screen from now on is only calling GsDrawList() once. The reason for this is that now DMA is used instead of GPIO for drawenv/dispenv management.
* (PSXSDK internals): incorrect bit shifting was being made on 0xE3 and 0xE4 GPU instructions (drawenv management). * (Bugfix): Timers were not being reset properly because pad1_cheat_timer and pad2_cheat_timer were being accidentally reset to NULL on calling memset() for cheatsArray. * Timers are now updated every 100 ms instead of every second. * Mouse sprite should be now drawn on X_SCREEN_RESOLUTION >> 2 in 2-player mode. TODO: check why this isn't working!
Diffstat (limited to 'Source/Game.c')
-rw-r--r--Source/Game.c42
1 files changed, 19 insertions, 23 deletions
diff --git a/Source/Game.c b/Source/Game.c
index 51f4a9e..bdb49f1 100644
--- a/Source/Game.c
+++ b/Source/Game.c
@@ -76,8 +76,10 @@ enum
{
MOUSE_W = 8,
MOUSE_H = 8,
- MOUSE_X = X_SCREEN_RESOLUTION - (X_SCREEN_RESOLUTION >> 1),
- MOUSE_Y = Y_SCREEN_RESOLUTION - (Y_SCREEN_RESOLUTION >> 1),
+ MOUSE_X = (X_SCREEN_RESOLUTION >> 1),
+ MOUSE_Y = (Y_SCREEN_RESOLUTION >> 1),
+ MOUSE_X_2PLAYER = (X_SCREEN_RESOLUTION >> 2),
+ MOUSE_Y_2PLAYER = (Y_SCREEN_RESOLUTION >> 1)
};
/* *************************************
@@ -305,8 +307,17 @@ void GameInit(void)
firstActiveAircraft = 0;
lastActiveAircraft = 0;
- GameMouseSpr.x = MOUSE_X;
- GameMouseSpr.y = MOUSE_Y;
+ if(GameTwoPlayersActive() == true)
+ {
+ GameMouseSpr.x = MOUSE_X;
+ GameMouseSpr.y = MOUSE_Y;
+ }
+ else
+ {
+ GameMouseSpr.x = MOUSE_X_2PLAYER;
+ GameMouseSpr.y = MOUSE_Y_2PLAYER;
+ }
+
GameMouseSpr.w = MOUSE_W;
GameMouseSpr.h = MOUSE_H;
GameMouseSpr.attribute = COLORMODE(COLORMODE_16BPP);
@@ -556,9 +567,7 @@ void GameGraphics(void)
int i;
bool split_screen = false;
- while( (GfxIsGPUBusy() == true)
- ||
- (SystemRefreshNeeded() == false) );
+ while(GfxIsGPUBusy() == true);
if(TwoPlayersActive == true)
{
@@ -583,15 +592,8 @@ void GameGraphics(void)
GameRenderLevel(&PlayerData[i]);
AircraftRender(&PlayerData[i]);
-
- /*for(i = 0; i < MAX_PLAYERS ; i++)
- {*/
- GameGuiAircraftList(&PlayerData[i], &FlightData);
- //}
-
- GfxDrawScene_NoSwap();
-
- while(GfxIsGPUBusy() == true);
+
+ GameGuiAircraftList(&PlayerData[i], &FlightData);
}
}
@@ -603,13 +605,7 @@ void GameGraphics(void)
GameGuiClock(GameHour,GameMinutes);
- GfxDrawScene_NoSwap();
-
- while(GfxIsGPUBusy() == true);
-
- GfxSwapBuffers();
-
- SystemCyclicHandler();
+ GfxDrawScene();
}
void GameLoadLevel(void)