aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier ASUS <xavi92psx@gmail.com>2018-11-25 18:02:18 +0100
committerXavier ASUS <xavi92psx@gmail.com>2018-11-25 18:02:18 +0100
commit64dbf5cdd5c16ab6ccdadcfd66949aba5b8fa1e2 (patch)
treed408c06ac5573c35eaee8fd451114fd73acde2f8
parent135a1e93cb9b3a859c4269a94ababe33b3558f9a (diff)
Bugfix: minutes were not being retrieved from PLT files.
Game.c: parking slots cannot be selected if an aircraft in STATE_PARKED state is on it. Other fixes and improvements. Added some tiles from TILESET2.TIM
-rw-r--r--Bin/AIRPORT.binbin1733424 -> 1728720 bytes
-rw-r--r--Levels/EASY.PLT2
-rw-r--r--Levels/LEVEL2.LVLbin576 -> 576 bytes
-rw-r--r--Levels/LEVEL3.LVLbin576 -> 576 bytes
-rw-r--r--Source/Airport.geany123
-rw-r--r--Source/Camera.c45
-rwxr-xr-x[-rw-r--r--]Source/Exe/AIRPORT.elfbin485576 -> 380044 bytes
-rw-r--r--Source/Exe/AIRPORT.isobin1509376 -> 1505280 bytes
-rw-r--r--Source/Game.c299
-rw-r--r--Source/Makefile2
-rw-r--r--Source/MapEditor/MapEditor.pro.user2
-rw-r--r--Source/MapEditor/mainwindow.cpp189
-rw-r--r--Source/MapEditor/mainwindow.h3
-rw-r--r--Source/MapEditor/mygraphicsscene.cpp2
-rw-r--r--Source/MapEditor/tileset.ini8
-rw-r--r--Source/PltParser.c12
-rw-r--r--Source/Serial.c26
-rw-r--r--Source/System.c3
-rw-r--r--Sprites/TILESET2.bmpbin24630 -> 18486 bytes
-rw-r--r--cdimg/DATA/LEVELS/EASY.PLT2
-rw-r--r--cdimg/DATA/LEVELS/LEVEL2.LVLbin576 -> 576 bytes
-rw-r--r--cdimg/DATA/LEVELS/LEVEL3.LVLbin576 -> 576 bytes
-rw-r--r--cdimg/DATA/SPRITES/TILESET2.TIMbin16404 -> 12308 bytes
23 files changed, 435 insertions, 283 deletions
diff --git a/Bin/AIRPORT.bin b/Bin/AIRPORT.bin
index beb0632..a1332db 100644
--- a/Bin/AIRPORT.bin
+++ b/Bin/AIRPORT.bin
Binary files differ
diff --git a/Levels/EASY.PLT b/Levels/EASY.PLT
index f3209b0..cf1bead 100644
--- a/Levels/EASY.PLT
+++ b/Levels/EASY.PLT
@@ -16,4 +16,4 @@ DEPARTURE;PHX1001;100;00:25;21;240
DEPARTURE;PHX1002;200;01:00;19;240
DEPARTURE;PHX1003;200;01:30;21;240
DEPARTURE;PHX1004;200;02:00;19;240
-DEPARTURE;PHX1004;200;03:00;21;240 \ No newline at end of file
+DEPARTURE;PHX1004;200;03:00;21;240
diff --git a/Levels/LEVEL2.LVL b/Levels/LEVEL2.LVL
index bc93219..1d08d3d 100644
--- a/Levels/LEVEL2.LVL
+++ b/Levels/LEVEL2.LVL
Binary files differ
diff --git a/Levels/LEVEL3.LVL b/Levels/LEVEL3.LVL
index dffa05e..bd729fd 100644
--- a/Levels/LEVEL3.LVL
+++ b/Levels/LEVEL3.LVL
Binary files differ
diff --git a/Source/Airport.geany b/Source/Airport.geany
index 32e07a5..76ee5f8 100644
--- a/Source/Airport.geany
+++ b/Source/Airport.geany
@@ -28,53 +28,100 @@ long_line_behaviour=1
long_line_column=120
[files]
-current_page=41
-FILE_NAME_0=6076;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FAircraft.c;0;4
-FILE_NAME_1=266;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FCamera.c;0;4
-FILE_NAME_2=4018;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FEndAnimation.c;0;4
-FILE_NAME_3=6782;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FFont.c;0;4
-FILE_NAME_4=108515;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGame.c;0;4
-FILE_NAME_5=20231;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGameGui.c;0;4
-FILE_NAME_6=18939;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGfx.c;0;4
-FILE_NAME_7=11629;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FLoadMenu.c;0;4
-FILE_NAME_8=746;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2Fmain.c;0;4
+current_page=16
+FILE_NAME_0=29974;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FAircraft.c;0;4
+FILE_NAME_1=5814;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FCamera.c;0;4
+FILE_NAME_2=4555;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FEndAnimation.c;0;4
+FILE_NAME_3=6794;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FFont.c;0;4
+FILE_NAME_4=131182;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGame.c;0;4
+FILE_NAME_5=43334;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGameGui.c;0;4
+FILE_NAME_6=19750;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGfx.c;0;4
+FILE_NAME_7=14837;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FLoadMenu.c;0;4
+FILE_NAME_8=717;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2Fmain.c;0;4
FILE_NAME_9=745;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMainMenuBtnAni.c;0;4
-FILE_NAME_10=26018;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMemCard.c;0;4
-FILE_NAME_11=3987;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMenu.c;0;4
-FILE_NAME_12=1486;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMessage.c;0;4
-FILE_NAME_13=7435;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPad.c;0;4
-FILE_NAME_14=10669;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPltParser.c;0;4
-FILE_NAME_15=8394;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPSXSDKIntro.c;0;4
-FILE_NAME_16=1758;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSerial.c;0;4
-FILE_NAME_17=1221;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSfx.c;0;4
-FILE_NAME_18=23798;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSystem.c;0;4
-FILE_NAME_19=2698;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FTimer.c;0;4
-FILE_NAME_20=451;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FAircraft.h;0;4
-FILE_NAME_21=848;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FCamera.h;0;4
+FILE_NAME_10=30632;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMemCard.c;0;4
+FILE_NAME_11=24291;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMenu.c;0;4
+FILE_NAME_12=3904;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMessage.c;0;4
+FILE_NAME_13=11137;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPad.c;0;4
+FILE_NAME_14=7538;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPltParser.c;0;4
+FILE_NAME_15=9894;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPSXSDKIntro.c;0;4
+FILE_NAME_16=1144;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSerial.c;0;4
+FILE_NAME_17=2669;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSfx.c;0;4
+FILE_NAME_18=2662;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSystem.c;0;4
+FILE_NAME_19=3753;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FTimer.c;0;4
+FILE_NAME_20=1270;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FAircraft.h;0;4
+FILE_NAME_21=913;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FCamera.h;0;4
FILE_NAME_22=529;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FEndAnimation.h;0;4
-FILE_NAME_23=1133;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FFont.h;0;4
-FILE_NAME_24=1633;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGameGui.h;0;4
-FILE_NAME_25=413;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGame.h;0;4
-FILE_NAME_26=3831;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGameStructures.h;0;4
-FILE_NAME_27=3564;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGfx.h;0;4
-FILE_NAME_28=406;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGlobal_Inc.h;0;4
-FILE_NAME_29=273;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FLoadMenu.h;0;4
+FILE_NAME_23=1145;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FFont.h;0;4
+FILE_NAME_24=1682;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGameGui.h;0;4
+FILE_NAME_25=1854;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGame.h;0;4
+FILE_NAME_26=7318;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGameStructures.h;0;4
+FILE_NAME_27=3576;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGfx.h;0;4
+FILE_NAME_28=709;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FGlobal_Inc.h;0;4
+FILE_NAME_29=630;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FLoadMenu.h;0;4
FILE_NAME_30=559;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMainMenuBtnAni.h;0;4
FILE_NAME_31=4622;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMemCard.h;0;4
FILE_NAME_32=387;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMenu.h;0;4
-FILE_NAME_33=439;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMessage.h;0;4
-FILE_NAME_34=1550;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPad.h;0;4
-FILE_NAME_35=548;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPltParser.h;0;4
+FILE_NAME_33=806;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMessage.h;0;4
+FILE_NAME_34=1731;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPad.h;0;4
+FILE_NAME_35=762;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPltParser.h;0;4
FILE_NAME_36=684;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FPSXSDKIntro.h;0;4
-FILE_NAME_37=752;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSerial.h;0;4
-FILE_NAME_38=831;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSfx.h;0;4
-FILE_NAME_39=3384;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSystem.h;0;4
+FILE_NAME_37=490;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSerial.h;0;4
+FILE_NAME_38=815;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSfx.h;0;4
+FILE_NAME_39=4207;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FSystem.h;0;4
FILE_NAME_40=1066;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FTimer.h;0;4
-FILE_NAME_41=592;Make;0;EUTF-8;1;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMakefile;0;4
-FILE_NAME_42=623;None;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FLevels%2FLEVEL3.PLT;0;4
+FILE_NAME_41=521;Make;0;EUTF-8;1;1;0;%2Fhome%2Fxavier%2FAirport%2FSource%2FMakefile;0;4
+FILE_NAME_42=319;None;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FLevels%2FLEVEL3.PLT;0;4
+FILE_NAME_43=319;None;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FLevels%2FEASY.PLT;0;4
+FILE_NAME_44=319;None;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FLevels%2FLEVEL1.PLT;0;4
+FILE_NAME_45=319;None;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2FAirport%2FLevels%2FLEVEL2.PLT;0;4
+FILE_NAME_46=1551;None;0;EISO-8859-1;0;1;0;%2Fhome%2Fxavier%2FAirport%2FLevels%2FTUTORIA1.PLT;0;4
+FILE_NAME_47=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fatexit.c;0;4
+FILE_NAME_48=4528;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fcdrom.c;0;4
+FILE_NAME_49=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fcop.c;0;4
+FILE_NAME_50=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fexception.c;0;4
+FILE_NAME_51=20953;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fgpu.c;0;4
+FILE_NAME_52=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Flibc.c;0;4
+FILE_NAME_53=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fmemcard.c;0;4
+FILE_NAME_54=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fmemory.c;0;4
+FILE_NAME_55=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fpad.c;0;4
+FILE_NAME_56=7762;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fpsxsdk.c;0;4
+FILE_NAME_57=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fsetup.c;0;4
+FILE_NAME_58=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fsio.c;0;4
+FILE_NAME_59=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fspu.c;0;4
+FILE_NAME_60=0;C;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Futil.c;0;4
+FILE_NAME_61=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fbitstring.h;0;4
+FILE_NAME_62=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fctype.h;0;4
+FILE_NAME_63=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Ferrno.h;0;4
+FILE_NAME_64=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Ffcntl.h;0;4
+FILE_NAME_65=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Finttypes.h;0;4
+FILE_NAME_66=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fmemcard.h;0;4
+FILE_NAME_67=3314;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxbios.h;0;4
+FILE_NAME_68=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxcdrom.h;0;4
+FILE_NAME_69=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxgpu.h;0;4
+FILE_NAME_70=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxgte.h;0;4
+FILE_NAME_71=9980;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsx.h;0;4
+FILE_NAME_72=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxpad.h;0;4
+FILE_NAME_73=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxsio.h;0;4
+FILE_NAME_74=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxspu.h;0;4
+FILE_NAME_75=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fpsxutil.h;0;4
+FILE_NAME_76=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Frunexe.h;0;4
+FILE_NAME_77=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fsearch.h;0;4
+FILE_NAME_78=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fstdint.h;0;4
+FILE_NAME_79=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fstdio.h;0;4
+FILE_NAME_80=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fstdlib.h;0;4
+FILE_NAME_81=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fstring.h;0;4
+FILE_NAME_82=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fstrings.h;0;4
+FILE_NAME_83=1969;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Fthread.h;0;4
+FILE_NAME_84=0;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Ftypes.h;0;4
+FILE_NAME_85=231;C++;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Finclude%2Funistd.h;0;4
+FILE_NAME_86=0;ASM;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fcdromh.s;0;4
+FILE_NAME_87=70;ASM;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fexc1.s;0;4
+FILE_NAME_88=2629;ASM;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fsyscalls.s;0;4
+FILE_NAME_89=647;ASM;0;EUTF-8;0;1;0;%2Fhome%2Fxavier%2Fpsxsdk-20150729%2Flibpsx%2Fsrc%2Fstart%2Fstart.s;0;4
[VTE]
-last_dir=/home/xavier/Airport/Bin
+last_dir=/home/xavier
[build-menu]
NF_01_LB=Make Custom _Target...
diff --git a/Source/Camera.c b/Source/Camera.c
index 9c05f27..e23a54f 100644
--- a/Source/Camera.c
+++ b/Source/Camera.c
@@ -21,6 +21,11 @@
static int32_t Camera_Max_X_Offset;
static int32_t Camera_Max_Y_Offset;
+static int32_t Camera_Max_X_Limit;
+static int32_t Camera_Min_X_Limit;
+//~ static int32_t Camera_Min_Y_Limit;
+//~ static int32_t Camera_Max_Y_Limit;
+
/* *************************************
* Local Prototypes
* *************************************/
@@ -38,6 +43,13 @@ void CameraInit(TYPE_PLAYER* const ptrPlayer)
Camera_Max_X_Offset = GameGetLevelColumns() << TILE_SIZE_BIT_SHIFT;
Camera_Max_Y_Offset = GameGetLevelColumns() * TILE_SIZE_H;
+
+ Camera_Min_X_Limit = -Camera_Max_X_Offset;
+ Camera_Max_X_Limit = GameGetLevelColumns() << (TILE_SIZE_BIT_SHIFT - 1);
+ Camera_Max_X_Limit += Camera_Max_X_Limit >> 1;
+
+ DEBUG_PRINT_VAR(Camera_Min_X_Limit);
+ DEBUG_PRINT_VAR(Camera_Max_X_Limit);
}
void CameraApplyCoordinatesToSprite(TYPE_PLAYER* const ptrPlayer, GsSprite* spr)
@@ -167,11 +179,38 @@ void CameraHandler(TYPE_PLAYER* const ptrPlayer)
CameraUpdateSpeed(ptrPlayer);
}
- ptrPlayer->Camera.X_Offset += ptrPlayer->Camera.X_Speed;
+ bool limitAchieved = false;
+
+ if (ptrPlayer->Camera.X_Offset < 0)
+ {
+ if ((ptrPlayer->Camera.X_Offset + ptrPlayer->Camera.X_Speed) <= Camera_Min_X_Limit)
+ {
+ DEBUG_PRINT_VAR(ptrPlayer->Camera.X_Offset);
+ if (ptrPlayer->Camera.X_Speed < 0)
+ {
+ limitAchieved = true;
+ ptrPlayer->Camera.X_Speed = 0;
+ }
+ }
+ }
+ else if ((ptrPlayer->Camera.X_Offset + ptrPlayer->Camera.X_Speed) >= Camera_Max_X_Limit)
+ {
+ if (ptrPlayer->Camera.X_Speed > 0)
+ {
+ limitAchieved = true;
+ ptrPlayer->Camera.X_Speed = 0;
+ }
+ }
+
+ if (limitAchieved == false)
+ {
+ ptrPlayer->Camera.X_Offset += ptrPlayer->Camera.X_Speed;
+ }
+
ptrPlayer->Camera.Y_Offset += ptrPlayer->Camera.Y_Speed;
- //DEBUG_PRINT_VAR(ptrPlayer->Camera.X_Offset);
- //DEBUG_PRINT_VAR(ptrPlayer->Camera.Y_Offset);
+ //~ DEBUG_PRINT_VAR(ptrPlayer->Camera.X_Offset);
+ //~ DEBUG_PRINT_VAR(ptrPlayer->Camera.Y_Offset);
}
bool CameraSpecialConditions(TYPE_PLAYER* const ptrPlayer)
diff --git a/Source/Exe/AIRPORT.elf b/Source/Exe/AIRPORT.elf
index 19c91f2..759910d 100644..100755
--- a/Source/Exe/AIRPORT.elf
+++ b/Source/Exe/AIRPORT.elf
Binary files differ
diff --git a/Source/Exe/AIRPORT.iso b/Source/Exe/AIRPORT.iso
index f6006af..4ac4e41 100644
--- a/Source/Exe/AIRPORT.iso
+++ b/Source/Exe/AIRPORT.iso
Binary files differ
diff --git a/Source/Game.c b/Source/Game.c
index 85918f7..71267d3 100644
--- a/Source/Game.c
+++ b/Source/Game.c
@@ -96,7 +96,7 @@ enum
enum
{
- BUILDING_NONE = 0,
+ BUILDING_NONE,
BUILDING_HANGAR,
BUILDING_ILS,
BUILDING_ATC_TOWER,
@@ -111,7 +111,7 @@ enum
enum
{
- TILE_GRASS = 0,
+ TILE_GRASS,
TILE_ASPHALT_WITH_BORDERS,
TILE_WATER,
TILE_ASPHALT,
@@ -136,17 +136,18 @@ enum
TILE_TAXIWAY_4WAY_CROSSING,
TILE_RWY_EXIT_2,
- LAST_TILE_TILESET1 = TILE_RWY_EXIT_2
-};
+ LAST_TILE_TILESET1 = TILE_RWY_EXIT_2,
-enum
-{
- LAST_TILE_TILESET2 = LAST_TILE_TILESET1
+ TILE_UNUSED_1,
+ TILE_TAXIWAY_CORNER_GRASS_3,
+
+ FIRST_TILE_TILESET2 = TILE_UNUSED_1,
+ LAST_TILE_TILESET2 = TILE_TAXIWAY_CORNER_GRASS_3
};
enum
{
- SOUND_M1_INDEX = 0,
+ SOUND_M1_INDEX,
SOUND_W1_INDEX,
MAX_RADIO_CHATTER_SOUNDS
@@ -195,7 +196,6 @@ static void GameActiveAircraftList(TYPE_PLAYER* const ptrPlayer, TYPE_FLIGHT_DAT
static void GameRemainingAircraft(const uint8_t i);
static void GameMinimumSpawnTimeout(void);
static void GameRenderBuildingAircraft(TYPE_PLAYER* const ptrPlayer);
-static void GameBuildingsInit(void);
static void GameGetAircraftTilemap(const uint8_t i);
static bool GameWaypointCheckExisting(TYPE_PLAYER* const ptrPlayer, uint16_t temp_tile);
static void GameDrawBackground(TYPE_PLAYER* const ptrPlayer);
@@ -229,7 +229,6 @@ static bool spawnMinTimeFlag;
static bool aircraftCreated;
static bool GameAircraftCollisionFlag;
static uint8_t GameAircraftCollisionIdx;
-static TYPE_BUILDING_DATA GameBuildingData[MAX_BUILDING_ID];
static uint8_t GameAircraftTilemap[GAME_MAX_MAP_SIZE][GAME_MAX_AIRCRAFT_PER_TILE];
static TYPE_TILE_UV_DATA GameLevelBuffer_UVData[GAME_MAX_MAP_SIZE];
@@ -428,6 +427,7 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
static const char* const GameFileList[] =
{
"DATA\\SPRITES\\TILESET1.TIM",
+ "DATA\\SPRITES\\TILESET2.TIM",
"DATA\\SPRITES\\GAMEPLN.TIM",
"DATA\\SPRITES\\PLNBLUE.CLT",
"DATA\\SPRITES\\MOUSE.TIM",
@@ -442,6 +442,7 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
static void* GameFileDest[] =
{
&GameTilesetSpr,
+ &GameTileset2Spr,
&GamePlaneSpr,
NULL, // CLT files must use NULL pointers
&GameMouseSpr,
@@ -477,8 +478,6 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
GameGuiInit();
- GameBuildingsInit();
-
memset(GameRwy, 0, GAME_MAX_RUNWAYS * sizeof (uint16_t) );
memset(GameUsedRwy, 0, GAME_MAX_RUNWAYS * sizeof (uint16_t) );
@@ -594,141 +593,6 @@ void GameInit(const TYPE_GAME_CONFIGURATION* const pGameCfg)
/* ***************************************************************************************
*
- * @name: void GameBuildingsInit(void)
- *
- * @author: Xavier Del Campo
- *
- *
- * @brief:
- * Reportedly, it initializes coordinate/size data for each building instance.
- *
- * @remarks:
- *
- *
- * ***************************************************************************************/
-static void GameBuildingsInit(void)
-{
- enum
- {
- BUILDING_ATC_LOC_OFFSET_X = TILE_SIZE >> 1,
- BUILDING_ATC_LOC_OFFSET_Y = TILE_SIZE >> 1,
-
- BUILDING_ILS_OFFSET_X = 0,
- BUILDING_ILS_OFFSET_Y = 0,
-
- BUILDING_GATE_OFFSET_X = (TILE_SIZE >> 1) - 4,
- BUILDING_GATE_OFFSET_Y = 0,
-
- BUILDING_HANGAR_OFFSET_X = 4,
- BUILDING_HANGAR_OFFSET_Y = TILE_SIZE >> 1,
-
- BUILDING_ATC_TOWER_OFFSET_X = TILE_SIZE >> 2,
- BUILDING_ATC_TOWER_OFFSET_Y = TILE_SIZE >> 1,
- };
-
- enum
- {
- BUILDING_ILS_U = 34,
- BUILDING_ILS_V = 0,
- BUILDING_ILS_W = 24,
- BUILDING_ILS_H = 34,
-
- BUILDING_GATE_U = 0,
- BUILDING_GATE_V = 70,
- BUILDING_GATE_W = 28,
- BUILDING_GATE_H = 25,
-
- BUILDING_HANGAR_U = 0,
- BUILDING_HANGAR_V = 34,
- BUILDING_HANGAR_W = 51,
- BUILDING_HANGAR_H = 36,
-
- BUILDING_ATC_TOWER_U = 58,
- BUILDING_ATC_TOWER_V = 0,
- BUILDING_ATC_TOWER_W = 29,
- BUILDING_ATC_TOWER_H = 34,
- };
-
- enum
- {
- BUILDING_ILS_ORIGIN_X = 10,
- BUILDING_ILS_ORIGIN_Y = 22,
-
- BUILDING_GATE_ORIGIN_X = 20,
- BUILDING_GATE_ORIGIN_Y = 8,
-
- BUILDING_HANGAR_ORIGIN_X = 20,
- BUILDING_HANGAR_ORIGIN_Y = 11,
-
- BUILDING_ATC_TOWER_ORIGIN_X = 12,
- BUILDING_ATC_TOWER_ORIGIN_Y = 20,
- };
-
- memset(GameBuildingData, 0, sizeof (TYPE_BUILDING_DATA) );
-
- GameBuildingData[BUILDING_GATE].IsoPos.x = BUILDING_GATE_OFFSET_X;
- GameBuildingData[BUILDING_GATE].IsoPos.y = BUILDING_GATE_OFFSET_Y;
- // z coordinate set to 0 by default.
-
- // BUILDING_ATC_LOC coordinates inside tile.
- GameBuildingData[BUILDING_ATC_LOC].IsoPos.x = BUILDING_ATC_LOC_OFFSET_X;
- GameBuildingData[BUILDING_ATC_LOC].IsoPos.y = BUILDING_ATC_LOC_OFFSET_Y;
- // z coordinate set to 0 by default.
- GameBuildingData[BUILDING_GATE].orig_x = BUILDING_GATE_ORIGIN_X;
- GameBuildingData[BUILDING_GATE].orig_y = BUILDING_GATE_ORIGIN_Y;
- GameBuildingData[BUILDING_GATE].u = BUILDING_GATE_U;
- GameBuildingData[BUILDING_GATE].v = BUILDING_GATE_V;
- GameBuildingData[BUILDING_GATE].w = BUILDING_GATE_W;
- GameBuildingData[BUILDING_GATE].h = BUILDING_GATE_H;
-
- // BUILDING_ILS coordinates inside tile.
- GameBuildingData[BUILDING_ILS].IsoPos.x = BUILDING_ILS_OFFSET_X;
- GameBuildingData[BUILDING_ILS].IsoPos.y = BUILDING_ILS_OFFSET_Y;
- // z coordinate set to 0 by default.
- GameBuildingData[BUILDING_ILS].orig_x = BUILDING_ILS_ORIGIN_X;
- GameBuildingData[BUILDING_ILS].orig_y = BUILDING_ILS_ORIGIN_Y;
- GameBuildingData[BUILDING_ILS].u = BUILDING_ILS_U;
- GameBuildingData[BUILDING_ILS].v = BUILDING_ILS_V;
- GameBuildingData[BUILDING_ILS].w = BUILDING_ILS_W;
- GameBuildingData[BUILDING_ILS].h = BUILDING_ILS_H;
-
- // BUILDING_HANGAR coordinates inside tile.
- GameBuildingData[BUILDING_HANGAR].IsoPos.x = BUILDING_HANGAR_OFFSET_X;
- GameBuildingData[BUILDING_HANGAR].IsoPos.y = BUILDING_HANGAR_OFFSET_Y;
- // z coordinate set to 0 by default.
- GameBuildingData[BUILDING_HANGAR].orig_x = BUILDING_HANGAR_ORIGIN_X;
- GameBuildingData[BUILDING_HANGAR].orig_y = BUILDING_HANGAR_ORIGIN_Y;
- GameBuildingData[BUILDING_HANGAR].u = BUILDING_HANGAR_U;
- GameBuildingData[BUILDING_HANGAR].v = BUILDING_HANGAR_V;
- GameBuildingData[BUILDING_HANGAR].w = BUILDING_HANGAR_W;
- GameBuildingData[BUILDING_HANGAR].h = BUILDING_HANGAR_H;
-
- // BUILDING_ATC_TOWER coordinates inside tile.
- GameBuildingData[BUILDING_ATC_TOWER].IsoPos.x = BUILDING_ATC_TOWER_OFFSET_X;
- GameBuildingData[BUILDING_ATC_TOWER].IsoPos.y = BUILDING_ATC_TOWER_OFFSET_Y;
- // z coordinate set to 0 by default.
- GameBuildingData[BUILDING_ATC_TOWER].orig_x = BUILDING_ATC_TOWER_ORIGIN_X;
- GameBuildingData[BUILDING_ATC_TOWER].orig_y = BUILDING_ATC_TOWER_ORIGIN_Y;
- GameBuildingData[BUILDING_ATC_TOWER].u = BUILDING_ATC_TOWER_U;
- GameBuildingData[BUILDING_ATC_TOWER].v = BUILDING_ATC_TOWER_V;
- GameBuildingData[BUILDING_ATC_TOWER].w = BUILDING_ATC_TOWER_W;
- GameBuildingData[BUILDING_ATC_TOWER].h = BUILDING_ATC_TOWER_H;
-
- // BUILDING_GATE coordinates inside tile.
- GameBuildingData[BUILDING_GATE].IsoPos.x = BUILDING_GATE_OFFSET_X;
- GameBuildingData[BUILDING_GATE].IsoPos.y = BUILDING_GATE_OFFSET_Y;
- // z coordinate set to 0 by default.
-
- /*BUILDING_ILS,
- BUILDING_ATC_TOWER,
- BUILDING_ATC_LOC,
- BUILDING_TERMINAL,
- BUILDING_TERMINAL_2,
- BUILDING_GATE,*/
-}
-
-/* ***************************************************************************************
- *
* @name: void GameEmergencyMode(void)
*
* @author: Xavier Del Campo
@@ -1242,6 +1106,133 @@ void GameDrawBackground(TYPE_PLAYER* const ptrPlayer)
void GameRenderBuildingAircraft(TYPE_PLAYER* const ptrPlayer)
{
+ enum
+ {
+ BUILDING_ATC_LOC_OFFSET_X = TILE_SIZE >> 1,
+ BUILDING_ATC_LOC_OFFSET_Y = TILE_SIZE >> 1,
+
+ BUILDING_ILS_OFFSET_X = 0,
+ BUILDING_ILS_OFFSET_Y = 0,
+
+ BUILDING_GATE_OFFSET_X = (TILE_SIZE >> 1) - 4,
+ BUILDING_GATE_OFFSET_Y = 0,
+
+ BUILDING_HANGAR_OFFSET_X = 4,
+ BUILDING_HANGAR_OFFSET_Y = TILE_SIZE >> 1,
+
+ BUILDING_ATC_TOWER_OFFSET_X = TILE_SIZE >> 2,
+ BUILDING_ATC_TOWER_OFFSET_Y = TILE_SIZE >> 1,
+ };
+
+ enum
+ {
+ BUILDING_ILS_U = 34,
+ BUILDING_ILS_V = 0,
+ BUILDING_ILS_W = 24,
+ BUILDING_ILS_H = 34,
+
+ BUILDING_GATE_U = 0,
+ BUILDING_GATE_V = 70,
+ BUILDING_GATE_W = 28,
+ BUILDING_GATE_H = 25,
+
+ BUILDING_HANGAR_U = 0,
+ BUILDING_HANGAR_V = 34,
+ BUILDING_HANGAR_W = 51,
+ BUILDING_HANGAR_H = 36,
+
+ BUILDING_ATC_TOWER_U = 58,
+ BUILDING_ATC_TOWER_V = 0,
+ BUILDING_ATC_TOWER_W = 29,
+ BUILDING_ATC_TOWER_H = 34,
+ };
+
+ enum
+ {
+ BUILDING_ILS_ORIGIN_X = 10,
+ BUILDING_ILS_ORIGIN_Y = 22,
+
+ BUILDING_GATE_ORIGIN_X = 20,
+ BUILDING_GATE_ORIGIN_Y = 8,
+
+ BUILDING_HANGAR_ORIGIN_X = 20,
+ BUILDING_HANGAR_ORIGIN_Y = 11,
+
+ BUILDING_ATC_TOWER_ORIGIN_X = 12,
+ BUILDING_ATC_TOWER_ORIGIN_Y = 20,
+ };
+
+ static const TYPE_BUILDING_DATA GameBuildingData[MAX_BUILDING_ID] =
+ {
+ [BUILDING_GATE] =
+ {
+ .IsoPos.x = BUILDING_GATE_OFFSET_X,
+ .IsoPos.y = BUILDING_GATE_OFFSET_Y,
+ .orig_x = BUILDING_GATE_ORIGIN_X,
+ .orig_y = BUILDING_GATE_ORIGIN_Y,
+ .u = BUILDING_GATE_U,
+ .v = BUILDING_GATE_V,
+ .w = BUILDING_GATE_W,
+ .h = BUILDING_GATE_H,
+ // z coordinate set to 0 by default.
+ },
+
+ [BUILDING_ATC_LOC] =
+ {
+ .IsoPos.x = BUILDING_ATC_LOC_OFFSET_X,
+ .IsoPos.y = BUILDING_ATC_LOC_OFFSET_Y,
+ },
+
+ [BUILDING_ILS] =
+ {
+ .IsoPos.x = BUILDING_ILS_OFFSET_X,
+ .IsoPos.y = BUILDING_ILS_OFFSET_Y,
+ // z coordinate set to 0 by default.
+ .orig_x = BUILDING_ILS_ORIGIN_X,
+ .orig_y = BUILDING_ILS_ORIGIN_Y,
+ .u = BUILDING_ILS_U,
+ .v = BUILDING_ILS_V,
+ .w = BUILDING_ILS_W,
+ .h = BUILDING_ILS_H,
+ },
+
+ [BUILDING_HANGAR] =
+ {
+ // BUILDING_HANGAR coordinates inside tile.
+ .IsoPos.x = BUILDING_HANGAR_OFFSET_X,
+ .IsoPos.y = BUILDING_HANGAR_OFFSET_Y,
+ // z coordinate set to 0 by default.
+ .orig_x = BUILDING_HANGAR_ORIGIN_X,
+ .orig_y = BUILDING_HANGAR_ORIGIN_Y,
+ .u = BUILDING_HANGAR_U,
+ .v = BUILDING_HANGAR_V,
+ .w = BUILDING_HANGAR_W,
+ .h = BUILDING_HANGAR_H,
+ },
+
+ [BUILDING_ATC_TOWER] =
+ {
+ // BUILDING_ATC_TOWER coordinates inside tile.
+ .IsoPos.x = BUILDING_ATC_TOWER_OFFSET_X,
+ .IsoPos.y = BUILDING_ATC_TOWER_OFFSET_Y,
+ // z coordinate set to 0 by default.
+ .orig_x = BUILDING_ATC_TOWER_ORIGIN_X,
+ .orig_y = BUILDING_ATC_TOWER_ORIGIN_Y,
+ .u = BUILDING_ATC_TOWER_U,
+ .v = BUILDING_ATC_TOWER_V,
+ .w = BUILDING_ATC_TOWER_W,
+ .h = BUILDING_ATC_TOWER_H,
+ },
+
+ [BUILDING_GATE] =
+ {
+ // BUILDING_GATE coordinates inside tile.
+ .IsoPos.x = BUILDING_GATE_OFFSET_X,
+ .IsoPos.y = BUILDING_GATE_OFFSET_Y,
+ // z coordinate set to 0 by default.
+ }
+ };
+
uint16_t tileNr;
uint8_t rows = 0;
uint8_t columns = 0;
@@ -1589,6 +1580,11 @@ static void GameInitTileUVTable(void)
uint8_t CurrentTile = (uint8_t)(levelBuffer[i] & 0x007F); // Remove building data
// and mirror flag.
+ if (CurrentTile >= FIRST_TILE_TILESET2)
+ {
+ CurrentTile -= FIRST_TILE_TILESET2;
+ }
+
GameLevelBuffer_UVData[i].u = (short)(CurrentTile % COLUMNS_PER_TILESET) << TILE_SIZE_BIT_SHIFT;
GameLevelBuffer_UVData[i].v = (short)(CurrentTile / COLUMNS_PER_TILESET) * TILE_SIZE_H;
}
@@ -1843,7 +1839,6 @@ static void GameRenderTerrainPrecalculations(TYPE_PLAYER* const ptrPlayer, const
void GameRenderTerrain(TYPE_PLAYER* const ptrPlayer)
{
uint16_t i;
- uint8_t aux_id;
for (i = 0 ; i < GameLevelSize; i++)
{
@@ -1851,7 +1846,7 @@ void GameRenderTerrain(TYPE_PLAYER* const ptrPlayer)
{
bool flip_id;
GsSprite* ptrTileset;
-
+ uint8_t aux_id;
uint8_t CurrentTile = (uint8_t)(levelBuffer[i] & 0x00FF);
// Flipped tiles have bit 7 set.
@@ -2219,8 +2214,7 @@ static void GameStateSelectTaxiwayParking(TYPE_PLAYER* const ptrPlayer, TYPE_FLI
ptrPlayer->InvalidPath = true;
}
-#if 0
- for (i = 0; GAME_MAX_AIRCRAFT; i++)
+ for (i = 0; i < GAME_MAX_AIRCRAFT; i++)
{
if (ptrPlayer->InvalidPath == false)
{
@@ -2241,9 +2235,6 @@ static void GameStateSelectTaxiwayParking(TYPE_PLAYER* const ptrPlayer, TYPE_FLI
}
}
}
-#endif
-
- Serial_printf("Yo\n");
if (ptrPlayer->PadKeySinglePress_Callback(PAD_TRIANGLE))
{
diff --git a/Source/Makefile b/Source/Makefile
index 9e3ff2a..2189e97 100644
--- a/Source/Makefile
+++ b/Source/Makefile
@@ -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:
diff --git a/Source/MapEditor/MapEditor.pro.user b/Source/MapEditor/MapEditor.pro.user
index dc09951..2ef5a22 100644
--- a/Source/MapEditor/MapEditor.pro.user
+++ b/Source/MapEditor/MapEditor.pro.user
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 4.7.2, 2018-11-24T13:04:29. -->
+<!-- Written by QtCreator 4.7.2, 2018-11-25T17:34:10. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
diff --git a/Source/MapEditor/mainwindow.cpp b/Source/MapEditor/mainwindow.cpp
index 3758925..e641a4d 100644
--- a/Source/MapEditor/mainwindow.cpp
+++ b/Source/MapEditor/mainwindow.cpp
@@ -251,20 +251,24 @@ void MainWindow::processMapFile(const QByteArray& data)
level_size = ch;
- const QString filePath = "../../Sprites/TILESET1.bmp";
-
- QPixmap tile1(filePath);
+ if (not tilesetPaths[0].isEmpty()
+ &&
+ not tilesetPaths[1].isEmpty())
+ {
+ QPixmap tile1(tilesetPaths[0]);
+ QPixmap tile2(tilesetPaths[1]);
- const int expected_filesize = (DATA_HEADER_SIZE + (level_size * level_size));
+ const int expected_filesize = (DATA_HEADER_SIZE + (level_size * level_size));
- if (data.count() >= expected_filesize)
- {
- parseMapData(ds, tile1);
- }
- else
- {
- showError(tr("Invalid file size. Expected ")
- + QString::number(expected_filesize, 10));
+ if (data.count() >= expected_filesize)
+ {
+ parseMapData(ds, tile1, tile2);
+ }
+ else
+ {
+ showError(tr("Invalid file size. Expected ")
+ + QString::number(expected_filesize, 10));
+ }
}
}
else
@@ -273,7 +277,7 @@ void MainWindow::processMapFile(const QByteArray& data)
}
}
-void MainWindow::parseMapData(QDataStream& ds, const QPixmap& tileSet)
+void MainWindow::parseMapData(QDataStream& ds, const QPixmap& tileSet, const QPixmap& tileSet2)
{
char airportName[0x1A];
@@ -290,89 +294,143 @@ void MainWindow::parseMapData(QDataStream& ds, const QPixmap& tileSet)
{
for (int i = 0; i < level_size; i++)
{
+ enum
+ {
+ TILE_GRASS = 0,
+ TILE_ASPHALT_WITH_BORDERS,
+ TILE_WATER,
+ TILE_ASPHALT,
+
+ TILE_RWY_MID,
+ TILE_RWY_START_1,
+ TILE_RWY_START_2,
+ TILE_PARKING,
+
+ TILE_PARKING_2,
+ TILE_TAXIWAY_INTERSECT_GRASS,
+ TILE_TAXIWAY_GRASS,
+ TILE_TAXIWAY_CORNER_GRASS,
+
+ TILE_HALF_WATER_1,
+ TILE_HALF_WATER_2,
+ TILE_RWY_HOLDING_POINT,
+ TILE_RWY_HOLDING_POINT_2,
+
+ TILE_RWY_EXIT,
+ TILE_TAXIWAY_CORNER_GRASS_2,
+ TILE_TAXIWAY_4WAY_CROSSING,
+ TILE_RWY_EXIT_2,
+
+ LAST_TILE_TILESET1 = TILE_RWY_EXIT_2,
+
+ TILE_UNUSED_1,
+ TILE_TAXIWAY_CORNER_GRASS_3,
+
+ FIRST_TILE_TILESET2 = TILE_UNUSED_1,
+ LAST_TILE_TILESET2 = TILE_TAXIWAY_CORNER_GRASS_3
+ };
+
int u;
int v;
char byte[2];
ds.readRawData(byte, 2);
quint8 CurrentTile = static_cast<quint8>(byte[1]);
+ quint8 CurrentBuilding = static_cast<quint8>(byte[0]);
+ quint8 buildingNoMirror = CurrentBuilding & 0x7F;
+ quint8 tileNoMirror = CurrentTile & 0x7F;
+ const QPixmap* p = nullptr;
- if (CurrentTile & TILE_MIRROR_FLAG)
+ if (tileNoMirror <= LAST_TILE_TILESET1)
{
- u = static_cast<int>(((CurrentTile & 0x7F) % 4) * 64);
- v = static_cast<int>(((CurrentTile & 0x7F) / 4) * 48);
+ p = &tileSet;
}
- else
+ else if (tileNoMirror <= LAST_TILE_TILESET2)
{
- u = static_cast<int>((CurrentTile % 4) * 64);
- v = static_cast<int>((CurrentTile / 4) * 48);
+ p = &tileSet2;
+ CurrentTile -= FIRST_TILE_TILESET2;
+ tileNoMirror -= FIRST_TILE_TILESET2;
}
- QImage cropped = tileSet.copy(u, v, 64, 48).toImage();
-
- if (CurrentTile & TILE_MIRROR_FLAG)
+ if (p != nullptr)
{
- cropped = cropped.mirrored(true, false);
- }
+ if (CurrentTile & TILE_MIRROR_FLAG)
+ {
+ u = static_cast<int>((tileNoMirror % 4) * 64);
+ v = static_cast<int>((tileNoMirror / 4) * 48);
+ }
+ else
+ {
+ u = static_cast<int>((CurrentTile % 4) * 64);
+ v = static_cast<int>((CurrentTile / 4) * 48);
+ }
- bool selected = false;
+ QImage cropped = p->copy(u, v, 64, 48).toImage();
- if (selected_item != -1)
- {
- if (selected_item == ((j * level_size) + i))
+ if (CurrentTile & TILE_MIRROR_FLAG)
{
- selected = true;
+ cropped = cropped.mirrored(true, false);
}
- }
- cropped = cropped.convertToFormat(QImage::Format_ARGB32); // or maybe other format
+ bool selected = false;
- for (int i = 0; i < cropped.width(); i++)
- {
- for (int j = 0; j < cropped.height(); j++)
+ if (selected_item != -1)
{
- QColor rgb = cropped.pixel(i, j);
-
- if (rgb == QColor(Qt::magenta))
+ if (selected_item == ((j * level_size) + i))
{
- cropped.setPixel(i, j, qRgba(0,0,0,0));
+ selected = true;
}
- else if (selected )
- {
- QColor c = cropped.pixelColor(i, j);
+ }
- c.setRed(255 - c.red());
- c.setBlue(255 - c.blue());
- c.setGreen(255 - c.green());
+ cropped = cropped.convertToFormat(QImage::Format_ARGB32); // or maybe other format
- cropped.setPixel(i, j, qRgb(c.red(), c.green(), c.blue()));
+ for (int i = 0; i < cropped.width(); i++)
+ {
+ for (int j = 0; j < cropped.height(); j++)
+ {
+ QColor rgb = cropped.pixel(i, j);
+
+ if (rgb == QColor(Qt::magenta))
+ {
+ cropped.setPixel(i, j, qRgba(0,0,0,0));
+ }
+ else if (selected )
+ {
+ QColor c = cropped.pixelColor(i, j);
+
+ c.setRed(255 - c.red());
+ c.setBlue(255 - c.blue());
+ c.setGreen(255 - c.green());
+
+ cropped.setPixel(i, j, qRgb(c.red(), c.green(), c.blue()));
+ }
}
}
- }
-
- QGraphicsPixmapItem* const it = gscene.addPixmap(QPixmap::fromImage(cropped));
- if (it != nullptr)
- {
- const int x = ((i * TILE_SIZE) - (i * (TILE_SIZE / 2))) - (j * (TILE_SIZE / 2));
- const int y = (j * (TILE_SIZE / 4)) + (i * (TILE_SIZE / 4));
-
- it->setX(x);
- it->setY(y);
+ QGraphicsPixmapItem* const it = gscene.addPixmap(QPixmap::fromImage(cropped));
- if (ui.showNumbers_Checkbox->isChecked() )
+ if (it != nullptr)
{
- QGraphicsTextItem* const io = new QGraphicsTextItem();
+ const int x = ((i * TILE_SIZE) - (i * (TILE_SIZE / 2))) - (j * (TILE_SIZE / 2));
+ const int y = (j * (TILE_SIZE / 4)) + (i * (TILE_SIZE / 4));
+
+ it->setX(x);
+ it->setY(y);
- if (io != nullptr)
+ if (ui.showNumbers_Checkbox->isChecked() )
{
- io->setPos(x + (TILE_SIZE / 4), y);
- io->setPlainText(QString::number(i + (j * level_size)));
+ QGraphicsTextItem* const io = new QGraphicsTextItem();
- gscene.addItem(io);
+ if (io != nullptr)
+ {
+ io->setPos(x + (TILE_SIZE / 4), y);
+ io->setPlainText(QString::number(i + (j * level_size)));
- /* Append pointer to the list so it can be
- * safely removed on the constructor. */
- textItems.append(io);
+ gscene.addItem(io);
+
+ /* Append pointer to the list so it can be
+ * safely removed on the constructor. */
+ textItems.append(io);
+ }
}
}
}
@@ -438,12 +496,15 @@ void MainWindow::loadTilesetData(void)
tilesets_to_check << "tileset1";
tilesets_to_check << "tileset2";
+ int j = 0;
int i = 0;
foreach (QString tileset, tilesets_to_check)
{
tilesetFile.beginGroup(tileset);
+ tilesetPaths[j++] = tilesetFile.value("path").toString();
+
while (1)
{
QString tileNumber = "tile" + QString::number(i);
diff --git a/Source/MapEditor/mainwindow.h b/Source/MapEditor/mainwindow.h
index 40963c9..97e39ef 100644
--- a/Source/MapEditor/mainwindow.h
+++ b/Source/MapEditor/mainwindow.h
@@ -37,7 +37,7 @@ private:
void appSettings(void);
void loadTilesetData(void);
void loadBuildingData(void);
- void parseMapData(QDataStream &ds, const QPixmap &tileSet);
+ void parseMapData(QDataStream &ds, const QPixmap &tileSet, const QPixmap &tileSet2);
Ui::MainWindow ui;
QString _last_dir;
@@ -49,6 +49,7 @@ private:
QList<QGraphicsTextItem*> textItems;
QShortcut tileSet;
QShortcut tileMoveUp;
+ QString tilesetPaths[2];
private slots:
void loadMap(void);
diff --git a/Source/MapEditor/mygraphicsscene.cpp b/Source/MapEditor/mygraphicsscene.cpp
index e108375..d0241ae 100644
--- a/Source/MapEditor/mygraphicsscene.cpp
+++ b/Source/MapEditor/mygraphicsscene.cpp
@@ -15,7 +15,7 @@ void MyGraphicsScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
{
QGraphicsItem *it = this->itemAt(mouseEvent->scenePos(), QTransform());
- if (it != NULL)
+ if (it != nullptr)
{
emit positionClicked(mouseEvent->scenePos());
}
diff --git a/Source/MapEditor/tileset.ini b/Source/MapEditor/tileset.ini
index 488e023..8030b9f 100644
--- a/Source/MapEditor/tileset.ini
+++ b/Source/MapEditor/tileset.ini
@@ -1,4 +1,5 @@
[tileset1]
+path = "../../Sprites/TILESET1.bmp"
tile0 = "Grass"
tile1 = "Asphalt with borders"
tile2 = "Water"
@@ -18,4 +19,9 @@ tile15 = "Runway holding point 2"
tile16 = "Runway enter/exit, asphalt border 1"
tile17 = "Taxiway corner, grass border 2"
tile18 = "Taxiway 4-way crossing, grass border"
-tile19 = "Runway enter/exit, asphalt border 2" \ No newline at end of file
+tile19 = "Runway enter/exit, asphalt border 2"
+
+[tileset2]
+path = "../../Sprites/TILESET2.bmp"
+tile20 = "Unused"
+tile21 = "Taxiway corner, grass border 3"
diff --git a/Source/PltParser.c b/Source/PltParser.c
index 4d01135..0d97739 100644
--- a/Source/PltParser.c
+++ b/Source/PltParser.c
@@ -45,8 +45,8 @@ bool PltParserLoadFile(const char* strPath, TYPE_FLIGHT_DATA* const ptrFlightDat
char lineBuffer[LINE_MAX_CHARACTERS];
char* lineBufferPtr;
char* pltBufferSavePtr;
- char strHour[PLT_HOUR_MINUTE_CHARACTERS];
- char strMinutes[PLT_HOUR_MINUTE_CHARACTERS];
+ char strHour[PLT_HOUR_MINUTE_CHARACTERS] = {'\0'};
+ char strMinutes[PLT_HOUR_MINUTE_CHARACTERS] = {'\0'};;
uint8_t* strPltBuffer;
if (SystemLoadFile(strPath) == false)
@@ -112,7 +112,6 @@ bool PltParserLoadFile(const char* strPath, TYPE_FLIGHT_DATA* const ptrFlightDat
if (i == PLT_COLON_POSITION)
{
j = 0;
- buffer = strtok(NULL,"\n");
continue;
}
else if (i < PLT_COLON_POSITION)
@@ -126,17 +125,14 @@ bool PltParserLoadFile(const char* strPath, TYPE_FLIGHT_DATA* const ptrFlightDat
}
GameSetTime((uint8_t)atoi(strHour),(uint8_t)atoi(strMinutes) );
- Serial_printf("Game time set to %.2d:%.2d.\n",(uint8_t)atoi(strHour),(uint8_t)atoi(strMinutes) );
}
else
{
- typedef enum t_lineType
+ enum
{
MESSAGE_INFO,
AIRCRAFT_DATA
- }TYPE_LINE;
-
- TYPE_LINE tLine = AIRCRAFT_DATA; // Default value
+ } tLine = AIRCRAFT_DATA; // Default value
TYPE_MESSAGE_DATA tMessage = {0};
// File header (initial game time) has already been read
diff --git a/Source/Serial.c b/Source/Serial.c
index 57d9bb4..b654412 100644
--- a/Source/Serial.c
+++ b/Source/Serial.c
@@ -1,11 +1,11 @@
/* *************************************
- * Includes
+ * Includes
* *************************************/
#include "Serial.h"
/* *************************************
- * Defines
+ * Defines
* *************************************/
#define SERIAL_BAUDRATE 115200
@@ -15,7 +15,7 @@
#define SERIAL_PRINTF_INTERNAL_BUFFER_SIZE 256
/* **************************************
- * Structs and enums *
+ * Structs and enums *
* *************************************/
typedef enum
@@ -26,21 +26,29 @@ typedef enum
}SERIAL_STATE;
/* *************************************
- * Local Variables
+ * Local Variables
* *************************************/
static volatile SERIAL_STATE SerialState;
static volatile bool serial_busy;
+static void ISR_Serial(void);
/* *************************************
- * Local Prototypes
+ * Local Prototypes
* *************************************/
void SerialInit(void)
{
+ SetSIOHandler(&ISR_Serial);
+
SIOStart(115200);
}
+static void ISR_Serial(void)
+{
+ Serial_printf("SIO\n");
+}
+
bool SerialRead(uint8_t* ptrArray, size_t nBytes)
{
if (nBytes == 0)
@@ -100,10 +108,10 @@ void Serial_printf(const char* str, ...)
va_start(ap, str);
- result = vsnprintf( internal_buffer,
- SERIAL_PRINTF_INTERNAL_BUFFER_SIZE,
- str,
- ap );
+ result = vsnprintf( internal_buffer,
+ SERIAL_PRINTF_INTERNAL_BUFFER_SIZE,
+ str,
+ ap );
SerialWrite(internal_buffer, result);
}
diff --git a/Source/System.c b/Source/System.c
index 44b6571..dcdf127 100644
--- a/Source/System.c
+++ b/Source/System.c
@@ -86,6 +86,9 @@ void SystemInit(void)
PSX_InitEx(PSX_INIT_SAVESTATE | PSX_INIT_CD);
#endif // SERIAL_INTERFACE
+ // SIO init
+ SerialInit();
+
//Graphics init
GsInit();
//Clear VRAM
diff --git a/Sprites/TILESET2.bmp b/Sprites/TILESET2.bmp
index a36c04a..7eef359 100644
--- a/Sprites/TILESET2.bmp
+++ b/Sprites/TILESET2.bmp
Binary files differ
diff --git a/cdimg/DATA/LEVELS/EASY.PLT b/cdimg/DATA/LEVELS/EASY.PLT
index f3209b0..cf1bead 100644
--- a/cdimg/DATA/LEVELS/EASY.PLT
+++ b/cdimg/DATA/LEVELS/EASY.PLT
@@ -16,4 +16,4 @@ DEPARTURE;PHX1001;100;00:25;21;240
DEPARTURE;PHX1002;200;01:00;19;240
DEPARTURE;PHX1003;200;01:30;21;240
DEPARTURE;PHX1004;200;02:00;19;240
-DEPARTURE;PHX1004;200;03:00;21;240 \ No newline at end of file
+DEPARTURE;PHX1004;200;03:00;21;240
diff --git a/cdimg/DATA/LEVELS/LEVEL2.LVL b/cdimg/DATA/LEVELS/LEVEL2.LVL
index bc93219..1d08d3d 100644
--- a/cdimg/DATA/LEVELS/LEVEL2.LVL
+++ b/cdimg/DATA/LEVELS/LEVEL2.LVL
Binary files differ
diff --git a/cdimg/DATA/LEVELS/LEVEL3.LVL b/cdimg/DATA/LEVELS/LEVEL3.LVL
index dffa05e..bd729fd 100644
--- a/cdimg/DATA/LEVELS/LEVEL3.LVL
+++ b/cdimg/DATA/LEVELS/LEVEL3.LVL
Binary files differ
diff --git a/cdimg/DATA/SPRITES/TILESET2.TIM b/cdimg/DATA/SPRITES/TILESET2.TIM
index 1be72e9..5fbf2d9 100644
--- a/cdimg/DATA/SPRITES/TILESET2.TIM
+++ b/cdimg/DATA/SPRITES/TILESET2.TIM
Binary files differ