	1 * 1	00 04 06 01 PIG_YARD
		08 "ISRR"

		// Sprite layout
		1A 02
			// 00 (x)
			42
			\dx000003F4 \wx0000 // ground sprite
			\dx8000042D \wx0002 // back platform
			00 00 00 // x/y/z offset
			10 05 07 // x/y/z extent
			06 // register
			\dx8000042E \wx0002 // front platform
			00 0B 00 // x/y/z offset
			10 05 07 // x/y/z extent
			06 // register

			// 01 (y)
			42
			\dx000003F3 \wx0000 // ground sprite
			\dx8000042F \wx0002 // back platform
			00 00 00 // x/y/z offset
			05 10 07 // x/y/z extent
			06 // register
			\dx80000430 \wx0002 // front platform
			0B 00 00 // x/y/z offset
			05 10 07 // x/y/z extent
			06 // register


		0B 02 // use callback to determine layout

		10 \w400 // set little/lots threshold

		11 FF // pylon placement (all)

		12 \dx00000010 // cargo types for randomisation triggers


	// Test tile along platform to south for pig yard
	1 * 1	02 04 01 // ID
		85 68 01 // station info param 0/1; check tile along platform to S
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx800C PIG_YARD 05 PIG_YARD 05 // pig yard - middle
		\wx8008 // south end

	// Test tile along platform to south for pig yard
	1 * 1	02 04 02 // ID
		85 68 01 // station info param 0/1; check tile along platform to S
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx8004 PIG_YARD 05 PIG_YARD 05 // pig yard - north end
		\wx8000 // single tile

	// Test tile along platform to north for pig yard
	1 * 1	02 04 03 // ID
		85 68 0F // station info param 0/-1; check tile along platform to N
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx0001 PIG_YARD 05 PIG_YARD 05 // pig yard
		\wx0002 // else


//@@WARNING DISABLE 170
//@@WARNING DISABLE 100

	1 * 1	02 04 15 // ID
		85
		7E 03 // get sprite offset
		20 \wx00FF
		\2sto 1A
		00 \wx0006 // store in register
		01
		\wx00D8 \w0 \w0
		\wx00D8

	// Purchase
	1 * 1	02 04 16 // ID
		85
		1A // all bits on
		20 \w0
		\2sto 1A
		00 \wx0006 // store in register
		01
		\wx00D8 \w0 \w0
		\wx00D8

	// Empty
	1 * 1	02 04 17 // ID
		85
		7E 03 // get sprite offset
		20 \wx00FF
		\2sto 1A
		00 \wx0006 // store in register
		01
		\wx00D7 \w0 \w0
		\wx00D7

//@@WARNING ENABLE 170
//@@WARNING ENABLE 100

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

	// Purchase
	1 * 1	02 04 05 // ID
		81 0C // callback
		00 FF
		01
		\wx8000 14 14 // sprite layout
		\wx0016 // real sprites

//@@WARNING DISABLE 113

	// Random action 2 outside callback triggers re-randomisation
	1 * 1	02 04 07 // ID
		80
		02 // no more cargo
		12 // trigger bits 18 and 19
		04
		\wx0017
		\wx0017
		\wx0017
		\wx0017

//@@WARNING ENABLE 113

	// No suitable cargo
	1 * 1	02 04 06 // ID
		81 0C // callback
		00 FF
		01
		\wx8000 14 14 // sprite layout
		\wx0007 // real sprites

	1 * 1	03 04
		01 PIG_YARD
		02
		04 \wx0004 // livestock
		FF \wx0005 // purchase
		\wx0006 // no suitable cargo


	1 * 1	00 04 06 01 CATTLE_DOCKS
		08 "ISRR"

		// Sprite layout
		1A 02
			// 00 (x)
			42
			\dx000003F4 \wx0000 // ground sprite
			\dx8000042D \wx0002 // back platform
			00 00 00 // x/y/z offset
			10 05 07 // x/y/z extent
			06 // register
			\dx8000042D \wx0002 // front platform
			00 0B 00 // x/y/z offset
			10 05 07 // x/y/z extent
			07 // register

			// 01 (y)
			42
			\dx000003F3 \wx0000 // ground sprite
			\dx8000042E \wx0002 // back platform
			00 00 00 // x/y/z offset
			05 10 07 // x/y/z extent
			06 // register
			\dx8000042E \wx0002 // front platform
			0B 00 00 // x/y/z offset
			05 10 07 // x/y/z extent
			07 // register

		0B 02 // use callback to determine layout

		10 \w400 // set little/lots threshold

		11 FF // pylon placement (all)

		12 \dx00000010 // cargo types for randomisation triggers


	// Test tile along platform to south for cattle docks
	1 * 1	02 04 0B // ID
		85 68 01 // station info param 0/1; check tile along platform to S
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx8000 CATTLE_DOCKS 05 CATTLE_DOCKS 05 // cattle docks
		\wx8002 // south end

	// Test tile along platform to north for cattle docks
	1 * 1	02 04 0D // ID
		85 68 0F // station info param 0/-1; check tile along platform to N
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx8008 CATTLE_DOCKS 05 CATTLE_DOCKS 05 // cattle docks
		\wx8000 // north end

	// Test tile on platform to north for cattle docks
	1 * 1	02 04 09 // ID
		85 68 F0 // station info param -1/0; check tile on next platform to N
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx8004 CATTLE_DOCKS 05 CATTLE_DOCKS 05 // cattle docks
		\wx8000 // else

// Front platform
	// Test tile on platform to south for cattle docks
	1 * 1	02 04 0A // ID
		85 68 10 // station info param 1/0; check tile on next platform to S
		00 \wx0FFF // mask 12 bits for tile ID, type and direction
		01
		\wx8000 CATTLE_DOCKS 05 CATTLE_DOCKS 05 // cattle docks
		\wx000B // else

//@@WARNING DISABLE 170
//@@WARNING DISABLE 100

	1 * 1	02 04 15 // ID
		85
		7E 0B // get south end offset
		20 \wx00FF
		\2+
		7E 0D // add north end offset
		20 \wx00FF
		\2+
		7E 09 // add platform to north offset
		20 \wx00FF
		\2sto 1A
		20 \wx0006 // store in register
		\2rst
		7E 0A // get tile type offset
		20 \wx00FF
		\2+
		7E 0D // get north end offset
		20 \wx00FF
		\2sto 1A
		00 \wx0007 // store in register
		01
		\wx00D6 \w0 \w0
		\wx00D6

	// Purchase
	1 * 1	02 04 16 // ID
		85
		1A // all bits on
		20 \wx0002
		\2sto 1A
		20 \wx0006 // store in register
		\2sto 1A
		00 \wx0007 // store in register
		01
		\wx00D6 \w0 \w0
		\wx00D6

	1 * 1	02 04 17 // ID
		85
		7E 0B // get south end offset
		20 \wx00FF
		\2+
		7E 0D // add north end offset
		20 \wx00FF
		\2+
		7E 09 // add platform to north offset
		20 \wx00FF
		\2sto 1A
		20 \wx0006 // store in register
		\2rst
		7E 0A // get tile type offset
		20 \wx00FF
		\2+
		7E 0D // get north end offset
		20 \wx00FF
		\2sto 1A
		00 \wx0007 // store in register
		01
		\wx00D5 \w0 \w0
		\wx00D5

//@@WARNING ENABLE 170
//@@WARNING ENABLE 100

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

	// Purchase
	1 * 1	02 04 05 // ID
		81 0C // callback
		00 FF
		01
		\wx8000 14 14 // sprite layout
		\wx0016 // real sprites

//@@WARNING DISABLE 113

	// Random action 2 outside callback triggers re-randomisation
	1 * 1	02 04 07 // ID
		80
		02 // no more cargo
		12 // trigger bits 18 and 19
		04
		\wx0017
		\wx0017
		\wx0017
		\wx0017

//@@WARNING ENABLE 113

	// No suitable cargo
	1 * 1	02 04 06 // ID
		81 0C // callback
		00 FF
		01
		\wx8000 14 14 // sprite layout
		\wx0007 // real sprites

	1 * 1	03 04
		01 CATTLE_DOCKS
		02
		04 \wx0004 // livestock
		FF \wx0005 // purchase
		\wx0006 // no suitable cargo


	1 * 1	00 04 04 01 MILK_TANKS
		08 "ISRR"

		// Sprite layout
		1A 04
			// 00 (x)
			43
			\dx000003F4 \wx0002 // ground sprite
			10 // register
			\dx8000042D \wx0040 // ground overlay sprite (child)
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000842D \wx0002 // back platform
			00 00 00 // x/y/z offset
			10 05 14 // x/y/z extent
			06 // register
			\dx8000842E \wx0002 // front platform
			00 0B 00 // x/y/z offset
			10 05 0C // x/y/z extent
			06 // register

			// 01 (y)
			43
			\dx000003F3 \wx0002 // ground sprite
			10 // register
			\dx8000042E \wx0040 // ground overlay sprite (child)
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000842F \wx0002 // back platform
			00 00 00 // x/y/z offset
			05 10 14 // x/y/z extent
			06 // register
			\dx80008430 \wx0002 // front platform
			0B 00 00 // x/y/z offset
			05 10 0C // x/y/z extent
			06 // register

			// 02 (x) - purchase
			43
			\dx000003F4 \wx0000 // ground sprite
			\dx8000042D \wx0040 // ground overlay sprite (child)
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx80008431 \wx0000 // back platform
			00 00 00 // x/y/z offset
			10 05 14 // x/y/z extent
			\dx80008432 \wx0000 // front platform
			00 0B 00 // x/y/z offset
			10 05 0C // x/y/z extent

			// 03 (y) - purchase
			43
			\dx000003F3 \wx0000 // ground sprite
			\dx8000042E \wx0040 // ground overlay sprite (child)
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx80008433 \wx0000 // back platform
			00 00 00 // x/y/z offset
			05 10 14 // x/y/z extent
			\dx80008434 \wx0000 // front platform
			0B 00 00 // x/y/z offset
			05 10 0C // x/y/z extent


		0B 02 // use callback to determine layout

		11 FF // pylon placement (all)


	// Test variable 10 for real sprites
	1 * 1	02 04 1B // ID
		81 10 // additional information for sprite selection
		00 0F
		01
		\wx00FD 04 04 // ground overlay sprites
		\wx00D4 // milk tank sprites

	1 * 1	02 04 06 // ID
		80
		00 // don't re-randomise
		10 // use bits 16 and 17
		04
		\wx8004
		\wx8008
		\wx800C
		\wx8010

	1 * 1	02 04 07 // ID
		81 41
		04 0F // position along platform from south
		01
		\wx8014 00 00
		\wx0006

	1 * 1	02 04 08 // ID
		81 41
		00 0F // position along platform from north
		01
		\wx8000 00 00
		\wx0007

	1 * 1	02 04 09 // ID
		81 41
		10 0F // length of platforms
		01
		\wx0006 01 01
		\wx0008

//@@WARNING DISABLE 170
//@@WARNING DISABLE 100

	1 * 1	02 04 15 // ID
		85
		7E 09 // get sprite offset
		20 \wx00FF
		\2sto 1A
		20 \wx0006 // 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 - ground sprite offset
		01
		\wx001B \w0 \w0
		\wx001B

//@@WARNING ENABLE 170
//@@WARNING ENABLE 100

	1 * 1	02 04 0A // ID
		81 0C // callback
		00 FF
		01
		\wx8000 14 14 // sprite layout
		\wx0015 // real sprites

	// Purchase list
	1 * 1	02 04 0C // ID
		81 0C // callback
		00 FF
		01
		\wx8002 14 14 // sprite layout
		\wx001B // real sprites

	1 * 1	03 04
		01 MILK_TANKS
		01
		FF \wx000C // purchase
		\wx000A


	1 * 1	00 04 08 01 CATTLE_SHEDS
		08 "ISRR"

		// Sprite layout
		1A 02
			// 00 (x)
			43
			\dx00000F8D \wx0002 // ground sprite
			10 // register
			\dx8000042D \wx0040 // ground overlay sprite (child)
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042D \wx0000 // sheds
			00 00 00 // x/y/z offset
			10 10 09 // x/y/z extent
			\dx8000042D \wx0041 // snow
			00 00 80 // x/y/z offset
			03 // register
			05 // value for variable 10

			// 01 (y)
			43
			\dx00000F8D \wx0002 // ground sprite
			10 // register
			\dx8000042D \wx0040 // ground overlay sprite (child)
			00 00 80 // x/y/z offset
			04 // value for variable 10
			\dx8000042E \wx0000 // sheds
			00 00 00 // x/y/z offset
			10 10 09 // x/y/z extent
			\dx8000042E \wx0041 // snow
			00 00 80 // x/y/z offset
			03 // register
			05 // value for variable 10

		0B 02 // use callback to determine layout

		10 \w600 // set little/lots threshold

		12 \dx00000010 // cargo types for randomisation triggers

		11 00 // no pylons
		14 FF // no wires

		15 FF // prevent trains entering the tile from any direction


	1 * 1	01 04 04 02

	1 images/newlivestock.pcx   5  275 01  31  50 -27  -5 // 042D x, empty
	1 images/newlivestock.pcx 225  275 01  31  50 -21  -5 // 042E y, empty
	1 images/newlivestock.pcx  60  275 01  31  50 -27  -5 // 042D x, level 1
	1 images/newlivestock.pcx 280  275 01  31  50 -21  -5 // 042E y, level 1
	1 images/newlivestock.pcx 115  275 01  31  50 -27  -5 // 042D x, level 2
	1 images/newlivestock.pcx 335  275 01  31  50 -21  -5 // 042E y, level 2
	1 images/newlivestock.pcx 170  275 01  31  50 -27  -5 // 042D x, level 3
	1 images/newlivestock.pcx 390  275 01  31  50 -21  -5 // 042E y, level 3

	1 * 1	02 04 10 // ID
		0E 01
		\w0 \w1 \w1 \w1 \w1 \w1 \w2 \w2 \w2 \w2 \w2 \w3 \w3 \w3
		\w3

	1 * 1	02 04 11 // ID
		0E 01
		\w0 \w0 \w1 \w1 \w1 \w1 \w1 \w2 \w2 \w2 \w2 \w2 \w3 \w3
		\w3

	1 * 1	02 04 12 // ID
		0E 01
		\w0 \w0 \w0 \w1 \w1 \w1 \w1 \w1 \w2 \w2 \w2 \w2 \w2 \w3
		\w3

	1 * 1	02 04 13 // ID
		0E 01
		\w0 \w0 \w0 \w0 \w1 \w1 \w1 \w1 \w1 \w2 \w2 \w2 \w2 \w2
		\w3

	1 * 1	02 04 00 // ID
		80
		00 // no more cargo (triggered by random in graphics chain)
		12 // use bits 18 and 19
		04
		\wx0010
		\wx0011
		\wx0012
		\wx0013

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

	1 * 1	01 04 01 02
	1 images/newlivestock.pcx  445  275  01  24  50   0   0 // 042D x, snow
	1 images/newlivestock.pcx  500  275  01  24  50   0   0 // 042E y, snow

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

	// Test variable 10 for real sprites
	1 * 1	02 04 1B // ID
		81 10 // additional information for sprite selection
		00 0F
		02
		\wx00FF 04 04 // ground overlay sprites
		\wx000A 05 05 // snow sprites
		\wx0000 // cattle shed sprites

	// Test variable 10 for real sprites - empty
	1 * 1	02 04 1C // ID
		81 10 // additional information for sprite selection
		00 0F
		02
		\wx00FF 04 04 // ground overlay sprites
		\wx000A 05 05 // snow sprites
		\wx0002 // cattle shed sprites - empty

//@@WARNING DISABLE 100
//@@WARNING DISABLE 170

	1 * 1	02 04 12 // ID
		85 
		7E BB // get snow overlay flag
		20 \wx00FF
		\2sto 1A
		20 \wx0003 // store in register - show/hide snow
		\2rst
		7E BF // get normal/snow/desert offset
		20 \wx7FFF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001B \w0 \w0
		\wx001B

	// Empty
	1 * 1	02 04 13 // ID
		85 
		7E BB // get snow overlay flag
		20 \wx00FF
		\2sto 1A
		20 \wx0003 // store in register - show/hide snow
		\2rst
		7E BF // get normal/snow/desert offset
		20 \wx7FFF
		\2sto 1A
		00 \wx0010 // store in register
		01
		\wx001C \w0 \w0
		\wx001C

	// Purchase
	1 * 1	02 04 14 // ID
		81
		1A // all bits on
		20 00
		\2sto 1A
		20 03 // store in register - show/hide snow
		\2sto 1A
		00 10 // store in register - ground sprite offset
		01
		\wx001B 00 00
		\wx001B

//@@WARNING ENABLE 170
//@@WARNING ENABLE 100

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

	// Purchase list
	1 * 1	02 04 05 // ID
		81 0C // callback
		00 FF
		01
		\wx8000 14 14 // sprite layout
		\wx0014 // real sprites

//@@WARNING DISABLE 113

	// Random action 2 outside callback triggers re-randomisation
	1 * 1	02 04 07 // ID
		80
		02 // no more cargo
		12 // trigger bits 18 and 19
		04
		\wx0013
		\wx0013
		\wx0013
		\wx0013

//@@WARNING ENABLE 113

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

	1 * 1	03 04
		01 CATTLE_SHEDS
		02
		04 \wx0001 // livestock
		FF \wx0005 // purchase
		\wx0003 // no suitable cargo
