	1 * 1	00 04 07 01 WOOD_STAT
		08 "ISRA"

		// Sprite layout
		1A 0A
			// 00 (x) - wood platforms
			43
			\dx000003F4 \wx0002 // ground sprite - track
			10 // register
			\dx8000042D \wx0040 // ground overlay sprite (child) - platforms
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042D \wx0042 // logs back
			00 00 00 // x/y/z offset
			10 05 0C // x/y/z extent
			11 // register
			05 // value for variable 10
			\dx8000042E \wx0043 // logs front
			00 0B 00 // x/y/z offset
			10 05 0C // x/y/z extent
			14 15 // registers
			05 // value for variable 10

			// 01 (y) - wood platforms
			43
			\dx000003F3 \wx0002 // ground sprite - track
			10 // register
			\dx8000042E \wx0040 // ground overlay sprite (child) - platforms
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042F \wx0042 // logs back
			00 00 00 // x/y/z offset
			05 10 0C // x/y/z extent
			11 // register
			05 // value for variable 10
			\dx80000430 \wx0043 // logs front
			0B 00 00 // x/y/z offset
			05 10 0C // x/y/z extent
			14 15 // registers
			05 // value for variable 10

			// 02 (x) - wood platforms with shelter or hut
			44
			\dx000003F4 \wx0002 // ground sprite - track
			10 // register
			\dx8000042D \wx0040 // ground overlay sprite (child) - platforms
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042F \wx0002 // shelter or hut back
			00 00 00 // x/y/z offset
			10 05 10 // x/y/z extent
			13 // register
			\dx80000435 \wx0003 // shelter or hut snow
			00 00 80 // x/y/z offset
			03 13 // registers
			\dx8000042E \wx0042 // logs front
			00 0B 00 // x/y/z offset
			10 05 0C // x/y/z extent
			15 // register
			05 // value for variable 10

			// 03 (y) - wood platforms with shelter or hut
			44
			\dx000003F3 \wx0002 // ground sprite - track
			10 // register
			\dx8000042E \wx0040 // ground overlay sprite (child) - platforms
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx80000430 \wx0002 // shelter or hut back
			00 00 00 // x/y/z offset
			05 10 10 // x/y/z extent
			13 // register
			\dx80000436 \wx0003 // shelter or hut snow
			00 00 80 // x/y/z offset
			03 13 // registers
			\dx80000430 \wx0042 // logs front
			0B 00 00 // x/y/z offset
			05 10 0C // x/y/z extent
			15 // register
			05 // value for variable 10

			// 04 (x) - crossing
			42
			\dx000003F4 \wx0002 // ground sprite - track
			10 // register
			\dx8000042D \wx0042 // ground overlay sprite (child) - crossing
			00 00 80 // x/y/z offset
			0A // register
			06 // value for variable 10
			\dx8000842F \wx0043 // crawler crane
			00 0B 00 // x/y/z offset
			10 05 2B // x/y/z extent
			12 09 // registers
			07 // value for variable 10

			// 05 (y) - crossing
			42
			\dx000003F3 \wx0002 // ground sprite - track
			10 // register
			\dx8000042E \wx0042 // ground overlay sprite (child) - crossing
			00 00 80 // x/y/z offset
			0A // register
			06 // value for variable 10
			\dx80008430 \wx0043 // crawler crane
			0B 00 00 // x/y/z offset
			05 10 2B // x/y/z extent
			12 09 // registers
			07 // value for variable 10

			// 06 (x) - shed
			43
			\dx000003F4 \wx0002 // ground sprite - track
			10 // register
			\dx8000042D \wx0040 // ground overlay sprite (child) - platforms
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042D \wx0000 // shed
			00 00 00 // x/y/z offset
			10 05 12 // x/y/z extent
			\dx80000433 \wx0001 // shed snow
			00 00 80 // x/y/z offset
			03 // register

			// 07 (y) - shed
			43
			\dx000003F3 \wx0002 // ground sprite - track
			10 // register
			\dx8000042E \wx0040 // ground overlay sprite (child) - platforms
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042E \wx0000 // shed
			00 00 00 // x/y/z offset
			05 10 12 // x/y/z extent
			\dx80000434 \wx0001 // shed snow
			00 00 80 // x/y/z offset
			03 // register

			// 08 (x) - purchase
			41
			\dx000003F4 \wx0000 // ground sprite - track
			\dx8000042D \wx0000 // purchase list sprite
			00 00 00 // x/y/z offset
			10 10 20 // x/y/z extent

			// 09 (y) - purchase
			41
			\dx000003F3 \wx0000 // ground sprite - track
			\dx8000042E \wx0000 // purchase list sprite
			00 00 00 // x/y/z offset
			10 10 20 // x/y/z extent


		0B 02 // use callback to determine layout

		10 \w400 // set little / lots threshold

		11 F3 // pylon placement (all but crossing)
		14 0C // wires - (not shown on crossing)

		12 \dx00080080 // cargo types for randomisation triggers


	1 * 1	01 04 01 0C
	1 images/newwood4.pcx       3 137 09 24 37 -30  -8 // 042D x, shed
	1 images/newwood4.pcx      48 137 09 24 37  -5  -8 // 042E y, shed
	1 images/newwood4.pcx      99 137 09 31 39 -29 -12 // 042F x, shelter
	1 images/newwood4.pcx     145 137 09 31 39  -8 -12 // 0430 y, shelter
	1 images/newwood4.pcx     191 137 09 23 25 -21  -9 // 0431 x, hut
	1 images/newwood4.pcx     222 137 09 23 25  -2  -9 // 0432 y, hut

	1 images/newwood4.pcx       3 111 09 18 37   0   0 // 0433 x, shed snow
	1 images/newwood4.pcx      48 111 09 18 37   0   0 // 0434 y, shed snow
	1 images/newwood4.pcx      99 111 09 20 39   0   0 // 0435 x, shelter snow
	1 images/newwood4.pcx     145 111 09 20 39   0   0 // 0436 y, shelter snow
	1 images/newwood4.pcx     191 111 09 14 25   0   1 // 0437 x, hut snow
	1 images/newwood4.pcx     222 111 09 14 25   0   1 // 0438 y, hut snow

	1 * 1	02 04 01 // ID
		00 01
		\w0

	1 * 1	01 04 01 02
	// Purchase list
	1 images/purchaseicons.pcx 19 151 09 47 64 -31 -16 // 042D x
	1 images/purchaseicons.pcx 91 151 09 47 64 -31 -16 // 042E y

	1 * 1	02 04 00 // ID
		00 01
		\w0


// Real Sprites
// ------------
	// Test variable 10 for real sprites
	1 * 1	02 04 1D // ID
		81 10 // additional information for sprite selection
		00 0F
		04
		\wx00FD 04 04 // ground overlay sprites
		\wx00DE 05 05 // log pile sprites
		\wx00F6 06 06 // crossing sprites
		\wx00CF 07 07 // crawler crane sprites
		\wx0001 // building sprites

	// Test variable 10 for real sprites - empty
	1 * 1	02 04 1E // ID
		81 10 // additional information for sprite selection
		00 0F
		04
		\wx00FD 04 04 // ground overlay sprites
		\wx00DD 05 05 // log pile sprites
		\wx00F6 06 06 // crossing sprites
		\wx00CF 07 07 // crawler crane sprites
		\wx0001 // building sprites


	// Procedure to show/hide logs on S platform
	1 * 1	02 04 3D // ID
		85 68 10 // station info param +1/0; check tile on platform to S
		00 FF 3F // mask 14 bits for tile ID, type, direction and part
		01
		\wx8000 WOOD_STAT 35 WOOD_STAT 35 // part #06/07 - shed - hide logs
		\wx8001 // show logs

	// Random crane variety for modern cranes
	1 * 1	02 04 15 // ID
		80
		00 // don't re-randomise
		10 // use bit 16
		02
		\wx8000 // cc crane
		\wx8004 // red/white crane

	// Select age related crane type
	1 * 1	02 04 14 // ID
		85 FA // date station was built
		00 \wxFFFF
		01
		\wx8008 \w0 \w01/01/1950 // before 1950 - steam crane
		\wx0015 // modern crane

	// Procedure to maybe show crane
	1 * 1	02 04 3E // ID
		80
		00 // don't re-randomise
		12 // use bits 18 and 19
		04
		\wx8000
		\wx8001
		\wx8000
		\wx8000

	// Procedure to select hut or shelter
	1 * 1	02 04 3F // ID
		80
		00 // don't re-randomise
		13 // use bit 19
		02
		\wx8000
		\wx8002

	// Procedure to select log type front
	1 * 1	02 04 3C // ID
		80
		00 // no more cargo (triggered by random in graphics chain)
		11 // use bit 17
		02
		\wx8000
		\wx8004

	// Procedure to select log type back
	1 * 1	02 04 40 // ID
		80
		00 // no more cargo (triggered by random in graphics chain)
		10 // use bit 16
		02
		\wx8000
		\wx8004

//@@WARNING DISABLE 100

// Log platform sprite layout
	1 * 1	02 04 27 // ID
		85
		7E 40 // get random log type offset
		20 \wx00FF
		\2sto 1A
		20 \wx0011 // store in register
		\2rst
		7E 3C // get random log type offset
		20 \wx00FF
		\2sto 1A
		20 \wx0015 // store in register
		\2rst
		7E 3D // get front logs flag
		20 \wx00FF
		\2sto 1A
		20 \wx0014 // store in register
		\2rst
		7E BE // get normal/snow/desert offset
		20 \wx7FFF
		\2+
		7E BD // add monorail/maglev offset
		20 \wx00FF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001D \w0 \w0
		\wx001D

// Log platform sprite layout - empty
	1 * 1	02 04 28 // ID
		85
		1A // all bits on
		20 \w0 // val = 0
		\2sto 1A
		20 \wx0011 // store in register - random log type offset
		\2sto 1A
		20 \wx0015 // store in register - random log type offset
		\2sto 1A
		20 \wx0014 // store in register - front logs flag
		\2rst
		7E BE // get normal/snow/desert offset
		20 \wx7FFF
		\2+
		7E BD // add monorail/maglev offset
		20 \wx00FF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001E \w0 \w0
		\wx001E

// Crossing sprite layout
	1 * 1	02 04 26 // ID
		85
		7E BA // get crossing overlay offset
		20 \wx00FF
		\2sto 1A
		20 \wx000A // store in register
		\2rst
		7E 14 // get random crane type offset
		20 \wx00FF
		\2sto 1A
		20 \wx0009 // store in register
		\2rst
		7E 3E // get random crane visibility flag
		20 \wx00FF
		\2sto 1A
		20 \wx0012 // store in register
		\2rst
		7E BE // get normal/snow/desert offset
		20 \wx7FFF
		\2+
		7E BD // add monorail/maglev offset
		20 \wx00FF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001D \w0 \w0
		\wx001D

// Building sprite layout
	1 * 1	02 04 25 // ID
		85
		7E 40 // get random log type offset
		20 \wx00FF
		\2sto 1A
		20 \wx0015 // store in register
		\2rst
		7E 3F // get random shelter/hut offset
		20 \wx00FF
		\2sto 1A
		20 \wx0013 // store in register
		\2rst
		7E BB // get snow overlay flag
		20 \wx00FF
		\2sto 1A
		20 \wx0003 // store in register
		\2rst
		7E BE // get normal/snow/desert offset
		20 \wx7FFF
		\2+
		7E BD // add monorail/maglev offset
		20 \wx00FF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001D \w0 \w0
		\wx001D

// Shed sprite layout
	1 * 1	02 04 24 // ID
		85
		7E BB // get snow overlay flag
		20 \wx00FF
		\2sto 1A
		20 \wx0003 // store in register
		\2rst
		7E BE // get normal/snow/desert offset
		20 \wx7FFF
		\2+
		7E BD // add monorail/maglev offset
		20 \wx00FF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001D \w0 \w0
		\wx001D

//@@@WARNING ENABLE 100

	// Test tile at current position
	1 * 1	02 04 1A // ID
		81 68 00 // station info param 0/0; check this tile
		0A 0F
		03
		\wx0027 01 01 // part 00/01 - wood piles
		\wx0026 05 05 // part 02/03 - crossing
		\wx0025 09 09 // part 04/05 - building
		\wx0024 // part 06/07 - shed

	// Test tile at current position - empty
	1 * 1	02 04 1B // ID
		81 68 00 // station info param 0/0; check this tile
		0A 0F
		03
		\wx0028 01 01 // part 00/01 - wood piles
		\wx0026 05 05 // part 02/03 - crossing
		\wx0025 09 09 // part 04/05 - building
		\wx0024 // part 06/07 - shed


// Callback 14
// -----------
	// Test tile at current position
	1 * 1	02 04 20 // ID
		81 68 00 // station info param 0/0; check this tile
		0A 0F
		03
		\wx8000 01 01 // part 00/01 - wood piles
		\wx8004 05 05 // part 02/03 - crossing
		\wx8002 09 09 // part 04/05 - building
		\wx8006 // part 06/07 - shed


// Callback 24
// -----------
	// Platform 0
	1 * 1	02 04 05 // ID
		81 10 // platform info and relative position
		80 0F 00 06 // position along platform from N mod 6
		02
		\wx8004 01 01 // building
		\wx8002 03 03 // crossing
		\wx8000 // wood piles

	// Platform 1 and 2
	1 * 1	02 04 06 // ID
		81 10 // platform info and relative position
		80 0F 00 06 // position along platform from N mod 6
		02
		\wx8006 00 00 // shed
		\wx8002 03 03 // crossing
		\wx8000 // wood piles

	// Platform 3
	1 * 1	02 04 08 // ID
		81 10 // platform info and relative position
		80 0F 00 06 // position along platform from N mod 6
		02
		\wx8002 03 03 // crossing
		\wx8004 04 04 // building
		\wx8000 // wood piles

	1 * 1	02 04 09 // ID
		81 10 // platform info and relative position
		08 03 // platform number from N mod 4
		02
		\wx0005 00 00
		\wx0006 01 02
		\wx0008

// -------------------------

	1 * 1	02 04 04 // ID
		81 0C // callback
		00 FF
		01
		\wx0020 14 14 // sprite layout
		\wx001A // real sprites

	// For purchase list
	1 * 1	02 04 05 // ID
		81 0C // callback
		00 FF
		02
		\wx8008 14 14 // sprite layout
		\wx0009 24 24 // station layout
		\wx0000 // real sprites

//@@WARNING DISABLE 113

	// Random action 2 outside callback triggers re-randomisation
	1 * 1	02 04 0B // ID
		80
		02 // no more cargo
		10 // trigger bits 16 to 19
		10
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B

	1 * 1	02 04 0C // ID
		80
		02 // no more cargo
		10 // trigger bits 16 to 18 (19 is used for building type)
		08
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B
		\wx001B

//@@WARNING ENABLE 113

	// Only re-randomise wood platforms
	1 * 1	02 04 0A // ID
		81 68 00 // station info param 0/0; check this tile
		0A 0F
		02
		\wx000B 01 01 // part 00/01 - wood platforms
		\wx000C 09 09 // part 04/05 - building (with wood)
		\wx001B // else

	// No suitable cargo
	1 * 1	02 04 03 // ID
		81 0C // callback
		00 FF
		01
		\wx0020 14 14 // sprite layout
		\wx000A // real sprites

	1 * 1	03 04
		01 WOOD_STAT
		03
		07 \wx0004 // wood
		13 \wx0004 // tropic wood
		FF \wx0005 // purchase
		\wx0003 // no suitable cargo
