(svn r10682) [NewGRF_ports] -Feature: Added code to import FSM from within the newgrf, and allocate to compatible structures within Airport. Eventually, it will load to its own dedicated structures. NewGRF_ports
authorrichk
Tue, 24 Jul 2007 21:54:45 +0000
branchNewGRF_ports
changeset 6737 2b971fcc9a08
parent 6736 72a36d4a65ff
child 6738 72d1a2997952
(svn r10682) [NewGRF_ports] -Feature: Added code to import FSM from within the newgrf, and allocate to compatible structures within Airport. Eventually, it will load to its own dedicated structures.
You can now build an aircraft in a hangar of the Commuter airport. Do not try to start the aircraft. Block handling is completely crippled atm.
opntitle.dat is disabled as existing state machines have been disabled, and it crashes. A load translator will be written later.
rb_airport2.grf updated.
bin/data/opntitle.dat
bin/data/opntitle.datold
bin/data/rb_airport2.grf
src/airport.cpp
src/airport.h
src/airport_movement.h
src/airport_states.h
src/newgrf.cpp
src/newgrf_fsmports.h
Binary file bin/data/opntitle.dat has changed
Binary file bin/data/opntitle.datold has changed
Binary file bin/data/rb_airport2.grf has changed
--- a/src/airport.cpp	Mon Jul 23 22:39:24 2007 +0000
+++ b/src/airport.cpp	Tue Jul 24 21:54:45 2007 +0000
@@ -215,14 +215,14 @@
 
 
 AirportFTAClass::AirportFTAClass(
-	const AirportMovingData *moving_data_,
-	const byte *terminals_,
-	const byte *helipads_,
-	const byte *entry_points_,
+	AirportMovingData *moving_data_,
+	byte *terminals_,
+	byte *helipads_,
+	byte *entry_points_,
 	Flags flags_,
-	const AirportFTAbuildup *apFA,
+	AirportFTAbuildup *apFA,
 	TileIndexDiffC *depots_,
-	const byte nof_depots_,
+	byte nof_depots_,
 	uint size_x_,
 	uint size_y_,
 	byte delta_z_,
@@ -243,6 +243,7 @@
 {
 	byte nofterminalgroups, nofhelipadgroups;
 
+
 	/* Set up the terminal and helipad count for an airport.
 	 * TODO: If there are more than 10 terminals or 4 helipads, internal variables
 	 * need to be changed, so don't allow that for now */
@@ -279,7 +280,10 @@
 	 * airport is working correctly or will not deadlock for example */
 	uint ret = AirportTestFTA(nofelements, layout, terminals);
 	if (ret != MAX_ELEMENTS) DEBUG(misc, 0, "[Ap] problem with element: %d", ret - 1);
-	assert(ret == MAX_ELEMENTS);
+
+
+	//TODO: validation error disabled, as new airports will need a new validation system
+	//assert(ret == MAX_ELEMENTS);
 
 #ifdef DEBUG_AIRPORT
 	AirportPrintOut(nofelements, layout, DEBUG_AIRPORT);
--- a/src/airport.h	Mon Jul 23 22:39:24 2007 +0000
+++ b/src/airport.h	Tue Jul 24 21:54:45 2007 +0000
@@ -52,12 +52,12 @@
 		};
 
 		AirportFTAClass(
-			const AirportMovingData *moving_data,
-			const byte *terminals,
-			const byte *helipads,
-			const byte *entry_points,
+			AirportMovingData *moving_data,
+			byte *terminals,
+			byte *helipads,
+			byte *entry_points,
 			Flags flags,
-			const AirportFTAbuildup *apFA,
+			AirportFTAbuildup *apFA,
 			TileIndexDiffC *depots,
 			byte nof_depots,
 			uint size_x,
@@ -68,21 +68,21 @@
 
 		~AirportFTAClass();
 
-		const AirportMovingData *MovingData(byte position) const
+		AirportMovingData *MovingData(byte position)
 		{
 			assert(position < nofelements);
 			return &moving_data[position];
 		}
 
-	const AirportMovingData *moving_data;
+	AirportMovingData *moving_data;
 	struct AirportFTA *layout;            // state machine for airport
-	const byte *terminals;
-	const byte *helipads;
+	byte *terminals;
+	byte *helipads;
 	TileIndexDiffC *airport_depots; // gives the position of the depots on the airports
 	Flags flags;
 	byte nof_depots;                      // number of depots this airport has
 	byte nofelements;                     // number of positions the airport consists of
-	const byte *entry_points;             ///< when an airplane arrives at this airport, enter it at position entry_point, index depends on direction
+	byte *entry_points;             ///< when an airplane arrives at this airport, enter it at position entry_point, index depends on direction
 	byte size_x;
 	byte size_y;
 	byte delta_z;                         // Z adjustment for helicopter pads
--- a/src/airport_movement.h	Mon Jul 23 22:39:24 2007 +0000
+++ b/src/airport_movement.h	Tue Jul 24 21:54:45 2007 +0000
@@ -19,7 +19,7 @@
 ///////////////////////////////////////////////////////////////////////
 /////*********Movement Positions on Airports********************///////
 
-static const AirportMovingData _airport_moving_data_dummy[] = {
+static AirportMovingData _airport_moving_data_dummy[] = {
 	{    0,    0, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
 	{    0,   96, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
 	{   96,   96, AMED_NOSPDCLAMP | AMED_SLOWTURN,     {DIR_N} },
@@ -27,7 +27,7 @@
 };
 
 // Country Airfield (small) 4x3
-static const AirportMovingData _airport_moving_data_country[22] = {
+static AirportMovingData _airport_moving_data_country[22] = {
 	{   53,    3, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar
 	{   53,   27, 0,                               {DIR_N} }, // 01 Taxi to right outside depot
 	{   32,   23, AMED_EXACTPOS,                   {DIR_NW} }, // 02 Terminal 1
@@ -53,7 +53,7 @@
 };
 
 // Commuter Airfield (small) 5x4
-static const AirportMovingData _airport_moving_data_commuter[37] = {
+static AirportMovingData _airport_moving_data_commuter[37] = {
 	{   69,    3, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar
 	{   72,   22, 0,                               {DIR_N} }, // 01 Taxi to right outside depot
 	{    8,   22, AMED_EXACTPOS,                   {DIR_SW} }, // 01 Taxi to right outside depot
@@ -95,7 +95,7 @@
 };
 
 // City Airport (large) 6x6
-static const AirportMovingData _airport_moving_data_town[] = {
+static AirportMovingData _airport_moving_data_town[] = {
 	{   85,    3, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar
 	{   85,   27, 0,                               {DIR_N} }, // 01 Taxi to right outside depot
 	{   26,   41, AMED_EXACTPOS,                   {DIR_SW} }, // 02 Terminal 1
@@ -129,7 +129,7 @@
 };
 
 // Metropolitan Airport (metropolitan) - 2 runways
-static const AirportMovingData _airport_moving_data_metropolitan[27] = {
+static AirportMovingData _airport_moving_data_metropolitan[27] = {
 	{   85,    3, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar
 	{   85,   27, 0,                               {DIR_N} }, // 01 Taxi to right outside depot
 	{   26,   41, AMED_EXACTPOS,                   {DIR_SW} }, // 02 Terminal 1
@@ -160,7 +160,7 @@
 };
 
 // International Airport (international) - 2 runways, 6 terminals, dedicated helipod
-static const AirportMovingData _airport_moving_data_international[51] = {
+static AirportMovingData _airport_moving_data_international[51] = {
 	{    7,   55, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar 1
 	{  100,   21, AMED_EXACTPOS,                   {DIR_SE} }, // 01 In Hangar 2
 	{    7,   70, 0,                               {DIR_N} }, // 02 Taxi to right outside depot
@@ -216,7 +216,7 @@
 };
 
 // Intercontinental Airport - 4 runways, 8 terminals, 2 dedicated helipads
-static const AirportMovingData _airport_moving_data_intercontinental[77] = {
+static AirportMovingData _airport_moving_data_intercontinental[77] = {
 	{    7,   87, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar 1
 	{  135,   72, AMED_EXACTPOS,                   {DIR_SE} }, // 01 In Hangar 2
 	{    7,  104, 0,                               {DIR_N} }, // 02 Taxi to right outside depot 1
@@ -299,7 +299,7 @@
 
 
 // Heliport (heliport)
-static const AirportMovingData _airport_moving_data_heliport[9] = {
+static AirportMovingData _airport_moving_data_heliport[9] = {
 	{    5,    9, AMED_EXACTPOS,                   {DIR_NE} }, // 0 - At heliport terminal
 	{    2,    9, AMED_HELI_RAISE,                 {DIR_N} }, // 1 - Take off (play sound)
 	{   -3,    9, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 2 - In position above landing spot helicopter
@@ -312,7 +312,7 @@
 };
 
 // HeliDepot 2x2 (heliport)
-static const AirportMovingData _airport_moving_data_helidepot[18] = {
+static AirportMovingData _airport_moving_data_helidepot[18] = {
 	{   24,    4, AMED_EXACTPOS,                   {DIR_NE} }, // 0 - At depot
 	{   24,   28, 0,                               {DIR_N} }, // 1 Taxi to right outside depot
 	{    5,   38, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 2 Flying
@@ -334,7 +334,7 @@
 };
 
 // HeliDepot 2x2 (heliport)
-static const AirportMovingData _airport_moving_data_helistation[33] = {
+static AirportMovingData _airport_moving_data_helistation[33] = {
 	{    8,    3, AMED_EXACTPOS,                   {DIR_SE} }, // 00 In Hangar2
 	{    8,   22, 0,                               {DIR_N} }, // 01 outside hangar 2
 	{  116,   24, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 02 Fly to landing position in air
@@ -371,7 +371,7 @@
 };
 
 // Oilrig
-static const AirportMovingData _airport_moving_data_oilrig[9] = {
+static AirportMovingData _airport_moving_data_oilrig[9] = {
 	{   31,    9, AMED_EXACTPOS,                   {DIR_NE} }, // 0 - At oilrig terminal
 	{   28,    9, AMED_HELI_RAISE,                 {DIR_N} }, // 1 - Take off (play sound)
 	{   23,    9, AMED_NOSPDCLAMP | AMED_SLOWTURN, {DIR_N} }, // 2 - In position above landing spot helicopter
@@ -385,8 +385,8 @@
 
 ///////////////////////////////////////////////////////////////////////
 /////**********Movement Machine on Airports*********************///////
-static const byte _airport_entries_dummy[] = {0, 1, 2, 3};
-static const AirportFTAbuildup _airport_fta_dummy[] = {
+static byte _airport_entries_dummy[] = {0, 1, 2, 3};
+static AirportFTAbuildup _airport_fta_dummy[] = {
 	{ 0, 0, 0, 3},
 	{ 1, 0, 0, 0},
 	{ 2, 0, 0, 1},
@@ -397,9 +397,9 @@
 /* First element of terminals array tells us how many depots there are (to know size of array)
  * this may be changed later when airports are moved to external file  */
 static TileIndexDiffC _airport_depots_country[] = {{3, 0}};
-static const byte _airport_terminal_country[] = {1, 2};
-static const byte _airport_entries_country[] = {16, 16, 16, 16};
-static const AirportFTAbuildup _airport_fta_country[] = {
+static byte _airport_terminal_country[] = {1, 2};
+static byte _airport_entries_country[] = {16, 16, 16, 16};
+static AirportFTAbuildup _airport_fta_country[] = {
 	{  0, HANGAR, NOTHING_block, 1 },
 	{  1, 255, AIRPORT_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM1, TERM1_block, 2 }, { 1, TERM2, 0, 4 }, { 1, HELITAKEOFF, 0, 19 }, { 1, 0, 0, 6 },
 	{  2, TERM1, TERM1_block, 1 },
@@ -429,10 +429,10 @@
 };
 
 static TileIndexDiffC _airport_depots_commuter[] = { { 4, 0 } };
-static const byte _airport_terminal_commuter[] = { 1, 3 };
-static const byte _airport_helipad_commuter[] = { 1, 2 };
-static const byte _airport_entries_commuter[] = {21, 21, 21, 21};
-static const AirportFTAbuildup _airport_fta_commuter[] = {
+static byte _airport_terminal_commuter[] = { 1, 3 };
+static byte _airport_helipad_commuter[] = { 1, 2 };
+static byte _airport_entries_commuter[] = {21, 21, 21, 21};
+static AirportFTAbuildup _airport_fta_commuter[] = {
 	{  0, HANGAR, NOTHING_block, 1 }, { 0, HELITAKEOFF, HELIPAD2_block, 1 }, { 0, 0, 0, 1 },
 	{  1, 255, TAXIWAY_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TAKEOFF, 0, 11 }, { 1, TERM1, TAXIWAY_BUSY_block, 10 }, { 1, TERM2, TAXIWAY_BUSY_block, 10 }, { 1, TERM3, TAXIWAY_BUSY_block, 10 }, { 1, HELIPAD1, TAXIWAY_BUSY_block, 10 }, { 1, HELIPAD2, TAXIWAY_BUSY_block, 10 }, { 1, HELITAKEOFF, TAXIWAY_BUSY_block, 10 }, { 1, 0, 0, 0 },
 	{  2, 255, AIRPORT_ENTRANCE_block, 2 }, { 2, HANGAR, 0, 8 }, { 2, TERM1, 0, 8 }, { 2, TERM2, 0, 8 }, { 2, TERM3, 0, 8 }, { 2, HELIPAD1, 0, 8 }, { 2, HELIPAD2, 0, 8 }, { 2, HELITAKEOFF, 0, 8 }, { 2, 0, 0, 2 },
@@ -480,9 +480,9 @@
 };
 
 static TileIndexDiffC _airport_depots_city[] = { { 5, 0 } };
-static const byte _airport_terminal_city[] = { 1, 3 };
-static const byte _airport_entries_city[] = {26, 29, 27, 28};
-static const AirportFTAbuildup _airport_fta_city[] = {
+static byte _airport_terminal_city[] = { 1, 3 };
+static byte _airport_entries_city[] = {26, 29, 27, 28};
+static AirportFTAbuildup _airport_fta_city[] = {
 	{  0, HANGAR, NOTHING_block, 1 }, { 0, TAKEOFF, OUT_WAY_block, 1 }, { 0, 0, 0, 1 },
 	{  1, 255, TAXIWAY_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM2, 0, 6 }, { 1, TERM3, 0, 6 }, { 1, 0, 0, 7 }, // for all else, go to 7
 	{  2, TERM1, TERM1_block, 7 }, { 2, TAKEOFF, OUT_WAY_block, 7 }, { 2, 0, 0, 7 },
@@ -521,9 +521,9 @@
 };
 
 static TileIndexDiffC _airport_depots_metropolitan[] = { { 5, 0 } };
-static const byte _airport_terminal_metropolitan[] = { 1, 3 };
-static const byte _airport_entries_metropolitan[] = {20, 20, 20, 20};
-static const AirportFTAbuildup _airport_fta_metropolitan[] = {
+static byte _airport_terminal_metropolitan[] = { 1, 3 };
+static byte _airport_entries_metropolitan[] = {20, 20, 20, 20};
+static AirportFTAbuildup _airport_fta_metropolitan[] = {
 	{  0, HANGAR, NOTHING_block, 1 },
 	{  1, 255, TAXIWAY_BUSY_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, TERM2, 0, 6 }, { 1, TERM3, 0, 6 }, { 1, 0, 0, 7 }, // for all else, go to 7
 	{  2, TERM1, TERM1_block, 7 },
@@ -559,10 +559,10 @@
 };
 
 static TileIndexDiffC _airport_depots_international[] = { { 0, 3 }, { 6, 1 } };
-static const byte _airport_terminal_international[] = { 2, 3, 3 };
-static const byte _airport_helipad_international[] = { 1, 2 };
-static const byte _airport_entries_international[] = { 37, 37, 37, 37 };
-static const AirportFTAbuildup _airport_fta_international[] = {
+static byte _airport_terminal_international[] = { 2, 3, 3 };
+static byte _airport_helipad_international[] = { 1, 2 };
+static byte _airport_entries_international[] = { 37, 37, 37, 37 };
+static AirportFTAbuildup _airport_fta_international[] = {
 	{  0, HANGAR, NOTHING_block, 2 }, { 0, 255, TERM_GROUP1_block, 0 }, { 0, 255, TERM_GROUP2_ENTER1_block, 1 }, { 0, HELITAKEOFF, HELIPAD1_block, 2 }, { 0, 0, 0, 2 },
 	{  1, HANGAR, NOTHING_block, 3 }, { 1, 255, HANGAR2_AREA_block, 1 }, { 1, HELITAKEOFF, HELIPAD2_block, 3 }, { 1, 0, 0, 3 },
 	{  2, 255, AIRPORT_ENTRANCE_block, 0 }, { 2, HANGAR, 0, 0 }, { 2, TERM4, 0, 12 }, { 2, TERM5, 0, 12 }, { 2, TERM6, 0, 12 }, { 2, HELIPAD1, 0, 12 }, { 2, HELIPAD2, 0, 12 }, { 2, HELITAKEOFF, 0, 12 }, { 2, 0, 0, 23 },
@@ -625,10 +625,10 @@
 
 // intercontinental
 static TileIndexDiffC _airport_depots_intercontinental[] = { { 0, 5 }, { 8, 4 } };
-static const byte _airport_terminal_intercontinental[] = { 2, 4, 4 };
-static const byte _airport_helipad_intercontinental[] = { 1, 2 };
-static const byte _airport_entries_intercontinental[] = { 43, 43, 43, 43 };
-static const AirportFTAbuildup _airport_fta_intercontinental[] = {
+static byte _airport_terminal_intercontinental[] = { 2, 4, 4 };
+static byte _airport_helipad_intercontinental[] = { 1, 2 };
+static byte _airport_entries_intercontinental[] = { 43, 43, 43, 43 };
+static AirportFTAbuildup _airport_fta_intercontinental[] = {
 	{  0, HANGAR, NOTHING_block, 2 }, { 0, 255, HANGAR1_AREA_block | TERM_GROUP1_block, 0 }, { 0, 255, HANGAR1_AREA_block | TERM_GROUP1_block, 1 }, { 0, TAKEOFF, HANGAR1_AREA_block | TERM_GROUP1_block, 2 }, { 0, 0, 0, 2 },
 	{  1, HANGAR, NOTHING_block, 3 }, { 1, 255, HANGAR2_AREA_block, 1 }, { 1, 255, HANGAR2_AREA_block, 0 }, { 1, 0, 0, 3 },
 	{  2, 255, HANGAR1_AREA_block, 0 }, { 2, 255, TERM_GROUP1_block, 0 }, { 2, 255, TERM_GROUP1_block, 1 }, { 2, HANGAR, 0, 0 }, { 2, TAKEOFF, TERM_GROUP1_block, 27 }, { 2, TERM5, 0, 26 }, { 2, TERM6, 0, 26 }, { 2, TERM7, 0, 26 }, { 2, TERM8, 0, 26 }, { 2, HELIPAD1, 0, 26 }, { 2, HELIPAD2, 0, 26 }, { 2, HELITAKEOFF, 0, 74 }, { 2, 0, 0, 27 },
@@ -719,9 +719,9 @@
 
 
 // heliports, oilrigs don't have depots
-static const byte _airport_helipad_heliport_oilrig[] = { 1, 1 };
-static const byte _airport_entries_heliport_oilrig[] = { 7, 7, 7, 7 };
-static const AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
+static byte _airport_helipad_heliport_oilrig[] = { 1, 1 };
+static byte _airport_entries_heliport_oilrig[] = { 7, 7, 7, 7 };
+static AirportFTAbuildup _airport_fta_heliport_oilrig[] = {
 	{ 0, HELIPAD1, HELIPAD1_block, 1 },
 	{ 1, HELITAKEOFF, NOTHING_block, 0 }, // takeoff
 	{ 2, 255, AIRPORT_BUSY_block, 0 }, { 2, HELILANDING, 0, 3 }, { 2, HELITAKEOFF, 0, 1 },
@@ -737,9 +737,9 @@
 
 // helidepots
 static TileIndexDiffC _airport_depots_helidepot[] = { { 1, 0 } };
-static const byte _airport_helipad_helidepot[] = { 1, 1 };
-static const byte _airport_entries_helidepot[] = { 4, 4, 4, 4 };
-static const AirportFTAbuildup _airport_fta_helidepot[] = {
+static byte _airport_helipad_helidepot[] = { 1, 1 };
+static byte _airport_entries_helidepot[] = { 4, 4, 4, 4 };
+static AirportFTAbuildup _airport_fta_helidepot[] = {
 	{  0, HANGAR, NOTHING_block, 1 },
 	{  1, 255, HANGAR2_AREA_block, 0 }, { 1, HANGAR, 0, 0 }, { 1, HELIPAD1, HELIPAD1_block, 14 }, { 1, HELITAKEOFF, 0, 15 }, { 1, 0, 0, 0 },
 	{  2, FLYING, NOTHING_block, 3 }, { 2, HELILANDING, PRE_HELIPAD_block, 7 }, { 2, HANGAR, 0, 12 }, { 2, HELITAKEOFF, NOTHING_block, 16 },
@@ -767,9 +767,9 @@
 
 // helistation
 static TileIndexDiffC _airport_depots_helistation[] = { { 0, 0 } };
-static const byte _airport_helipad_helistation[] = { 1, 3 };
-static const byte _airport_entries_helistation[] = { 25, 25, 25, 25 };
-static const AirportFTAbuildup _airport_fta_helistation[] = {
+static byte _airport_helipad_helistation[] = { 1, 3 };
+static byte _airport_entries_helistation[] = { 25, 25, 25, 25 };
+static AirportFTAbuildup _airport_fta_helistation[] = {
 	{  0, HANGAR, NOTHING_block, 8 },    { 0, HELIPAD1, 0, 1 }, { 0, HELIPAD2, 0, 1 }, { 0, HELIPAD3, 0, 1 }, { 0, HELITAKEOFF, 0, 1 }, { 0, 0, 0, 0 },
 	{  1, 255, HANGAR2_AREA_block, 0 },  { 1, HANGAR, 0, 0 }, { 1, HELITAKEOFF, 0, 3 }, { 1, 0, 0, 4 },
 	// landing
--- a/src/airport_states.h	Mon Jul 23 22:39:24 2007 +0000
+++ b/src/airport_states.h	Tue Jul 24 21:54:45 2007 +0000
@@ -23,33 +23,33 @@
 /* Movement States on Airports (headings target) */
 enum {
 	TO_ALL         =  0,
-	HANGAR         =  1,
-	TERM1          =  2,
-	TERM2          =  3,
-	TERM3          =  4,
-	TERM4          =  5,
-	TERM5          =  6,
-	TERM6          =  7,
-	HELIPAD1       =  8,
-	HELIPAD2       =  9,
-	TAKEOFF        = 10,
-	STARTTAKEOFF   = 11,
-	ENDTAKEOFF     = 12,
-	HELITAKEOFF    = 13,
-	FLYING         = 14,
-	LANDING        = 15,
-	ENDLANDING     = 16,
-	HELILANDING    = 17,
-	HELIENDLANDING = 18,
-	TERM7          = 19,
-	TERM8          = 20,
-	HELIPAD3       = 21,
-	HELIPAD4       = 22,
-	TERM9          = 23,
-	TERM10         = 24,
-	TERM11         = 25,
-	TERM12         = 26,
-	SHORTTAKEOFF   = 27,  /* Only used in movement command choices. If used as the heading in the first command element, treated as TAKEOFF.
+	HANGAR         =  64,
+	TERM1          =  1,
+	TERM2          =  2,
+	TERM3          =  3,
+	TERM4          =  4,
+	TERM5          =  5,
+	TERM6          =  6,
+	HELIPAD1       = 37,
+	HELIPAD2       = 38,
+	TAKEOFF        = 65,
+	STARTTAKEOFF   = 66,
+	ENDTAKEOFF     = 67,
+	HELITAKEOFF    = 81,
+	FLYING         = 127,
+	LANDING        = 68,
+	ENDLANDING     = 69,
+	HELILANDING    = 83,
+	HELIENDLANDING = 84,
+	TERM7          = 7,
+	TERM8          = 8,
+	HELIPAD3       = 39,
+	HELIPAD4       = 40,
+	TERM9          = 9,
+	TERM10         = 10,
+	TERM11         = 11,
+	TERM12         = 12,
+	SHORTTAKEOFF   = 73,  /* Only used in movement command choices. If used as the heading in the first command element, treated as TAKEOFF.
 						   * This is best placed on the TAKEOFF line at the start of the runway. The aircraft will make the acceleration noise,
 						   * and then you give the instruction of where to go to for the SHORTTAKEOFF instruction sequence. eg.:
 						   * { 40, TAKEOFF, RUNWAY_OUT_block, 0 }, { 40, SHORTTAKEOFF, RUNWAY_OUT_block2, 42 }, { 40, 0, RUNWAY_OUT_block2, 41 },
--- a/src/newgrf.cpp	Mon Jul 23 22:39:24 2007 +0000
+++ b/src/newgrf.cpp	Tue Jul 24 21:54:45 2007 +0000
@@ -2233,6 +2233,55 @@
 				ret = true;
 				break;
 
+			case 0x1A: // Finite State Machine and Movement Orders
+				fsmportspec->portFSM->nofelements = grf_load_byte(&buf);
+				fsmportspec->portFSM->layout = MallocT<AirportFTA>(fsmportspec->portFSM->nofelements);
+				fsmportspec->portFSM->moving_data = MallocT<AirportMovingData>(fsmportspec->portFSM->nofelements);
+				for (uint element = 0; element < fsmportspec->portFSM->nofelements; element++)
+				{
+					//TODO: this will load into a totally new structure for the FSMport controller to handle generically
+					AirportMovingData md;
+					md.x = grf_load_word(&buf);
+					md.y = grf_load_word(&buf);
+					grf_load_word(&buf);  // store z in moving data eventually
+					byte state = grf_load_byte(&buf);
+					md.flag = grf_load_word(&buf);  // needs unpacking / recoding but only until fsmport system complete
+					md.direction = (Direction)((md.flag >> 1) & 0x07);  // not required in new fsmport system
+
+					fsmportspec->portFSM->moving_data[element] = md;
+
+					byte block = grf_load_byte(&buf);
+
+					byte count = grf_load_byte(&buf);
+
+					/* always store one position */
+					AirportFTA *current = &fsmportspec->portFSM->layout[element];
+					current->heading = grf_load_byte(&buf);
+					current->block = grf_load_byte(&buf);
+					byte release = grf_load_byte(&buf);
+					current->next_position = grf_load_byte(&buf);
+
+					for (uint step = 1; step < count; step++)
+					{
+						AirportFTA *newNode = MallocT<AirportFTA>(1);
+						newNode->position = state;
+						newNode->heading = grf_load_byte(&buf);
+
+						// needs converting to bitmap, and storing in 2 uint64s. also handle multiblock sequence
+						newNode->block = grf_load_byte(&buf);
+
+						// needs converting to bitmap, and storing in 2 uint64s. also handle multiblock sequence
+						byte release = grf_load_byte(&buf);  // new feature not yet used
+
+						newNode->next_position = grf_load_byte(&buf);
+						current->next = newNode;
+						current = current->next;
+					}
+					current->next = NULL;
+				}
+				ret = true;
+				break;
+
 			case 0x1C: // Entry points
 				//TODO: store entry points
 				grf_load_byte(&buf);
--- a/src/newgrf_fsmports.h	Mon Jul 23 22:39:24 2007 +0000
+++ b/src/newgrf_fsmports.h	Tue Jul 24 21:54:45 2007 +0000
@@ -30,7 +30,7 @@
 	byte next;     // next position from this position
 };
 
-static const AirportFTAbuildup fsmport_fta_dummy[] = {
+static AirportFTAbuildup fsmport_fta_dummy[] = {
 	{0, 0, 0, 0},
 	{ MAX_ELEMENTS, 0, 0, 0 } // end marker. DO NOT REMOVE
 };