/* File XCTables.h */

char PreCyTable[]		/* Different syntax from EventTable: for PreCycle */
{	AndBits,		/* Turn off print request at beginning of world */
	PORT3A,
	~(PRINT←REQ←OFF),

	OrBits,
	PORT3A,
	PRINT←REQ←OFF,

	OrBits,
	PORT1B,
	AC,

	AndBits,	/* diverter up */
	PORT3A,
	~(DIVERTER),

	OrBits,
	PORT1A,
	ERASE,

	AndBits,
	PORT1A,
	~(DRUM←DRIVE | EL←STRIPS | C←B←MOTOR | C←R←MOTOR | C←B←BIAS | C←R←BIAS),

	OrBits,
	PORT1B,
	VACUUM | FUSER←DRIVE | LASER | ROS | FUS←CLOCK | FUS←DIR,

	AndBits,
	PORT2B,
	~(CHARGE | TRANSFER | PRE←CLEAN | DETACK),

	OrBits,
	PORT1A,
	DRUM←DRIVE | EL←STRIPS | ERASE | C←B←MOTOR | C←R←MOTOR | C←B←BIAS | C←R←BIAS,

	AndBits,
	PORT1B,
	~(FUS←CLOCK | FUS←DIR),

	OrBits,
	PORT2B,
	CHARGE | TRANSFER | PRE←CLEAN | DETACK
};


/*==================================================================	
 PreEventTable is used as a cold-start beginning to a print sequence
================================================================== */	

char PreEventTable[]
{	/* Event T0 -- BE SURE PRINT REQUEST FLOP IS TURNED OFF BEFORE HERE*/
	T0,
	/* # of things to do in T0 */
	2,


	always,
	AndBits,
	PORT1A,
	~(EL←STRIPS | PADDLE | C←B←MOTOR | C←R←MOTOR | C←B←BIAS | C←R←BIAS),

	always,
	OrBits,
	PORT1A,
	ERASE,

	T1,
	1,

	always,
	OrBits,
	PORT1B,
	VACUUM | BMI | FUS←CLOCK | FUS←DIR,

	T2,
	2,
	
	always,
	OrBits,
	PORT2A,
	/*All developer motors forward */
	H1←CLEANER | H2←CLEANER | H3←CLEANER | H4←CLEANER,

	always,
	AndBits,
	PORT2B,
	~(CHARGE | TRANSFER | PRE←CLEAN | DETACK),

	T3,
	1,

	always,
	OrBits,
	PORT3A,
	DIVERTER	/* PUT DIVERTER DOWN */

};

/*==================================================================	
 PreEventTable is used as a continuation of the print sequence.  It can
    be looped in. See AnotherPage() for details
================================================================== */	

char PageEventTable[]
{	T11,
	2,

	always,
	AndBits,
	PORT3A,
	~(PAPER←FEED | GRIP←TRANS),

	always,
	OrBits,
	PORT3A,
	FUS←SPEED,

	T16,
	1,

	always,
	OrBits,
	PORT3A,
	GRIP←TRANS,

	T24,
	2,

	always,
	AndBits,
	PORT2A,
	~(H1←MOTOR),

	always,
	AndBits,
	PORT2B,
	~(BIAS1),

	T28,
	1,

	always,
	AndBits,
	PORT2A,
	~(PAGE←SYNC),

	T50,
	1,

	always,
	OrBits,
	PORT3A,
	GRIP←BAR,

	T56,
	1,

	always,
	AndBits,
	PORT3A,
	~(PAPER←FEED),

	T60,
	1,

	always,
	AndBits,
	PORT3A,
	~(GRIP←BAR),

	T61,
	1,

	always,
	AndBits,
	PORT3A,
	~(GRIP←TRANS),

	T66,
	3,

	always,
	OrBits,
	PORT3A,
	GRIP←TRANS,

	always,
	OrBits,
	PORT2A,
	H1←MOTOR,


	always,
	OrBits,
	PORT2B,
	BIAS1,

	T68,
	2,

	always,
	OrBits,
	PORT3A,
	PAGE←SYNC,

	always,
	AndBits,
	PORT2A,
	~(H1←CLEANER),

	T70,
	1,

	always,
	AndBits,
	PORT2A,
	~(H1←MOTOR),

	T78,
	1,

	always,
	AndBits,
	PORT3A,
	~(PAGE←SYNC),

	T83,
	3,

	always,
	OrBits,
	PORT2A,
	H1←MOTOR | H1←CLEANER,

	always,
	AndBits,
	PORT2A,
	~(H2←MOTOR),

	always,
	AndBits,
	PORT2B,
	~(BIAS2),

	T93,
	1,

	always,
	AndBits,
	PORT3A,
	~(DIVERTER),

	T95,
	1,

	always,
	Normalize,
	T100,
	
	T114,
	1,

	always,
	OrBits,
	PORT3A,
	DIVERTER,

	T119,
	1,

	always,
	OrBits,
	PORT3A,
	PAGE←SYNC,

	T128,
	1,

	always,
	AndBits,
	PORT3A,
	~(PAGE←SYNC),

	T132,
	2,

	always,
	OrBits,
	PORT2A,
	H2←MOTOR,

	always,
	OrBits,
	PORT2B,
	BIAS2,

	T134,
	1,

	always,
	AndBits,
	PORT2B,
	~(H2←CLEANER),

	T136,
	1,

	always,
	AndBits,
	PORT2B,
	~(H2←MOTOR),

	T143,
	1,

	always,
	AndBits,
	PORT3A,
	~(DIVERTER),

	T145,
	1,

	always,
	OrBits,
	PORT2A,
	H2←MOTOR | H2←CLEANER,


	T146,
	2,

	always,
	AndBits,
	PORT2A,
	~(H3←MOTOR),

	always,
	AndBits,
	PORT2B,
	~(BIAS3),

	T164,
	1,

	always,
	OrBits,
	PORT3A,
	DIVERTER,

	T168,
	1,

	always,
	AndBits,
	PORT3A,
	~(PAGE←SYNC),

	T178,
	1,

	always,
	OrBits,
	PORT3A,
	PAGE←SYNC,

	T193,
	2,

	always,
	OrBits,
	PORT2B,
	BIAS3,

	always,
	OrBits,
	PORT2A,
	H3←MOTOR,

	T194,
	1,

	always,
	AndBits,
	PORT3A,
	~(DIVERTER),

	T195,
	1,

	always,
	AndBits,
	PORT2A,
	~(H3←CLEANER),

	T197,
	1,

	always,
	AndBits,
	PORT2A,
	~(H3←MOTOR),

	T198,
	1,

	always,
	Normalize,
	T200,

	T209,
	1,

	always,
	OrBits,
	PORT3A,
	DIVERTER,


	T210,
	3,

	always,
	OrBits,
	PORT2A,
	H3←MOTOR | H3←CLEANER,

	always,
	AndBits,
	PORT2A,
	~(H4←MOTOR),

	always,
	AndBits,
	PORT2B,
	~(BIAS4),

	T219,
	1,

	always,
	AndBits,
	PORT3A,
	~(PAGE←SYNC),

	T220,
	1,

	always,
	OrBits,
	PORT3A,
	PAGE←SYNC,


	T254,
	3,

	always,
	OrBits,
	PORT2A,
	H4←MOTOR,

	always,
	OrBits,
	PORT2B,
	BIAS4,

	always,
	AndBits,
	PORT2A,
	~(H4←CLEANER),

	T258,
	3,

	always,
	AndBits,
	PORT2A,
	~(H4←MOTOR),

	T262,
	1,

	always,
	AndBits,
	PORT3A,
	~(GRIP←TRANS),


	T267,
	1,

	always,
	OrBits,
	PORT3A,
	GRIP←TRANS,

	T271,
	1,

	always,
	OrBits,
	PORT2A,
	H4←MOTOR | H4←CLEANER,

	T292,
	1,

	always,
	AndBits,
	PORT3A,
	~(DIVERTER),

	T293,
	1,

	always,
	Normalize,
	T300,

	T302,
	2,

	always,
	OrBits,
	PORT3A,
	GRIP←BAR,

	always,
	AndBits,
	PORT1B,
	~(FUS←CLOCK),

	T304,
	2,

	always,
	AndBits,
	PORT1B,
	~(FUS←DIR),

	always,
	OrBits,
	PORT1B,
	FUS←CLOCK,

	T305,
	2,

	always,
	OrBits,
	PORT1B,
	FUS←DIR,

	always,
	AndBits,
	PORT1B,
	~(FUS←CLOCK),

	T306,
	1,

	always,
	OrBits,
	PORT1B,
	FUS←CLOCK,

	T377,
	1,

	ifPageReq,
	AnotherPage,

	T380,
	6,

	always,
	DriveOff,

	always,
	OrBits,
	PORT1A,
	(DRUM←DRIVE | EL←STRIPS | PADDLE | ERASE | C←B←MOTOR | C←R←MOTOR | C←B←BIAS | C←R←BIAS),

	always,
	AndBits,
	PORT1B,
	~(VACUUM | BMI),

	always,
	OrBits,
	PORT2A,
	(H1←CLEANER | H2←CLEANER | H3←CLEANER | H4←CLEANER),

	always,
	OrBits,
	PORT2B,
	(CHARGE | TRANSFER | PRE←CLEAN | DETACK),

	always,
	OrBits,
	PORT3A,
	DIVERTER,

	allOnes
};