;----------------------------------------------------------------------------
;File name:	CIV_2.S			Revision date:	1994.03.25
;Disassembler:	Anatsu Ronara		Disassembled:	1993.10.02
;----------------------------------------------------------------------------
;Remarks:
;
;This file contains a patch to allow replay without quitting.
;----------------------------------------------------------------------------
	SECTION	TEXT
;----------------------------------------------------------------------------
_CaptureCity:
	LINK	A6,#-$1A
	MOVEM.L	A2-A3/D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.B	11(A1),D0
	EXT.W	D0
	MOVE.L	D6,D1
	EXT.L	D1
	MOVE.W	D0,-2(A6)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	MOVE.L	D6,D1
	EXT.L	D1
	MOVE.W	D0,-4(A6)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	5(A1),D0
	MOVEM.W	D0,-6(A6)
	MOVE.W	_Player,D0
	CMP.W	D0,D7
	BNE.S	L063E
	MOVE.W	-2(A6),D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_LastContact,A1
	ADDA.L	D1,A1
	MOVE.W	#-2,(A1)
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.B	11(A1),D0
	EXT.W	D0
	MOVE.W	D0,-2(A6)
L063E:
	MOVE.W	-2(A6),D0
	MOVE.W	_Player,D1
	MOVE.L	D1,D2
	CMP.W	D0,D2
	BEQ	L0640
	MOVE.L	D6,D2
	EXT.L	D2
	MOVE.L	D2,D0
	MOVEQ	#$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E.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.L	A0,32(sp)
	JSR	_UnitType
	ADDQ.W	#4,sp
	MOVEA.L	28(sp),A0
	MOVE.B	D0,9(A0)
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.B	9(A1),D0
	TST.B	D0
	BMI.S	L065C
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$38,D1
	JSR	__CXM22
	LEA	_prod,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.B	9(A0),D0
	EXT.W	D0
	MOVE.L	D0,D1
	EXT.L	D1
	ADD.L	D1,D1
	ADDA.L	D1,A1
	ADDQ.W	#1,(A1)
L065C:
	MOVE.W	D7,-(sp)
	MOVE.W	-2(A6),-(sp)
	JSR	_KillCiv
	MOVEM.L	-54(A6),A2-A3/D5-D7/D2-D3
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_KillSS:
	MOVEM.L	D7/D2,-(sp)
	MOVE.W	12(sp),D7
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$B,D1
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	A0,-(sp)
	PEA	_XEB
	JSR	_strcpy
	PEA	L1BD0
	PEA	_XEB
	JSR	_strcat
	LEA	16(sp),sp
	MOVE.L	D7,D0
	ADDQ.W	#8,D0
	MOVEQ	#1,D1
	MOVE.L	D1,D2
	ASL.W	D0,D2
	MOVE.W	_Launched,D0
	AND.W	D0,D2
	BEQ.S	L0660
	ASL.W	D7,D1
	AND.W	D1,D0
	BEQ.S	L065E
	PEA	L1BD1
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L065F
;
L065E:
	PEA	L1BD2
	PEA	_X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ADD.L	D0,D0
	LEA	_Npop,A2
	MOVEA.L	A2,A3
	ADDA.L	D0,A3
	MOVE.W	(A3),D0
	ADDQ.W	#1,D0
	EXT.L	D1
	DIVS	D0,D1
	MOVE.L	D1,D0
	BRA.S	L0663
;
L0662:
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Npop,A2
	ADDA.L	D0,A2
	MOVE.W	(A2),D0
	ADDQ.W	#1,D0
	MOVE.W	(A1),D1
	EXT.L	D1
	DIVS	D0,D1
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.W	D1,16(sp)
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	MOVE.W	16(sp),D1
	MULS	D0,D1
	MOVE.L	D1,D0
L0663:
	MOVEM.L	(sp)+,A2-A3/D6-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_TakeCiv
	LINK	A6,#-$9A
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	TST.W	D7
	BEQ	L066E
	TST.W	D6
	BEQ	L066E
	MOVEQ	#0,D4
	PEA	L1BD3
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVE.W	#-1,-150(A6)
	MOVEQ	#$47,D5
L0665:
	TST.W	D5
	BMI	L0667
	MOVE.W	D5,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BNE.S	L0666
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L0666
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$16,D1
	JSR	__CXM22
	LEA	_cv,A0
	ADDA.L	D0,A0
	MOVE.L	A0,-(sp)
	P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E.L	A0,-(sp)
	PEA	_XEB
	JSR	_strcpy
	PEA	L1BD5
	PEA	_XEB
	JSR	_strcat
	MOVE.W	-152(A6),D0
	EXT.L	D0
	MOVEQ	#$16,D1
	JSR	__CXM22
	LEA	_cv,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1BD6
	PEA	_XEB
	JSR	_strcat
	LEA	28(sp),sp
	MOVEQ	#-1,D0
	CMP.W	_parlez,D0
	BNE.S	L066C
	MOVEQ	#$50,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_sMenu
	ADDQ.W	#8,sp
	BRA.S	L066D
;
L066C:
	MOVE.W	#$8B,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$14,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_kMenu
	ADDQ.W	#8,sp
L066D:
	MOVE.W	D6,-(sp)
	MOVE.W	-152(A6),-(sp)
	MOVE.W	D7,-(sp)
	JSR	_HasCivilized
	MOVEQ	#-1,D0
	MOVE.W	D0,(sp)
	MOVE.W	D7,-(sp)
	JSR	_ResetProduction
	ADDQ.W	#8,sp
L066E:
	MOVEM.L	(sp)+,D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_CityName:
	LINK	A6,#-4
	MOVE.L	D7,-(sp)
	MOVE.W	16(sp),D7
	MOVEQ	#-1,D0
	CMP.W	D0,D7
	BNE.S	L0670
	PEA	L1BD7
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L0671
;
L0670:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	22(A0),D0
	MOVEQ	#$D,D1
	JSR	__CXM22
	LEA	_cNames,A0
	ADDA.L	D0,A0
	PEA	_XEB
	MOVE.L	A0,8(sp)
	JSR	_strlen
	LEA	_XEB,A0
	ADDA.W	D0,A0
	MOVEQ	#$D,D0
	MOVE.W	D0,(sp)
	MOVE.L	A0,-(sp)
	MOVE.L	12(sp),-(sp)
	JSR	_MoveFartoNear
	LEA	12(sp),sp
L0671:
	MOVE.L	(sp)+,D7
	UNLK	A6
	RTS
;
;
_WaitForIt
	JSR	_DeBounce
L0673:
	JSR	_getmouse
	TST.W	mouse_butts
	BNE.S	L0674
	JSR	_kbhit
	TST.W	D0
	BEQ.S	L0673
L0674:
	TST.W	mouse_butts
	BNE.S	L0675
	JSR	_getch
	TST.W	D0
	BNE.S	L0675
	JSR	_getch
L0675:
	RTS
;
;----------------------------------------------------------------------------
;
_AddCLink:
	LINK	A6,#-$14
	MOVEM.L	A2/D5-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.B	11(A0),D0
	EXT.W	D0
	MOVE.L	D5,D1
	EXT.L	D1
	MOVE.W	D0,-2(A6)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	MOVE.W	-2(A6),D1
	EXT.L	D1
	MOVE.W	D0,16(sp)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	MOVE.L	D5,D1
	EXT.L	D1
	MOVE.W	D0,18(sp)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	5(A1),D0
	MOVE.W	-2(A6),D1
	EXT.L	D1
	MOVE.W	D0,20(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.W	#$39,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_DoSprite
	ADDQ.W	#6,sp
	CMPI.W	#8,-14(A6)
	BLT.S	L0692
	MOVEQ	#0,D0
	ADDQ.W	#8,-16(A6)
	MOVE.W	D0,-14(A6)
	BRA.S	L0693
;
L0692:
	MOVE.W	-12(A6),D0
	ADD.W	D0,-14(A6)
L0693:
	SUBQ.W	#1,-8(A6)
	BRA.S	L0691
;
L0694:
	ADDQ.W	#1,-10(A6)
	BRA	L0690
;
L0695:
	TST.W	-6(A6)
	BNE.S	L0696
	MOVEQ	#1,D0
	CMP.W	D0,D5
	BNE.S	L0696
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_XMove,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	ASL.W	#4,D0
	ADDI.W	#$A5,D0
	MOVE.L	D6,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_YMove,A0
	ADDA.L	D1,A0
	MOVE.W	(A0),D1
	ASL.W	#4,D1
	ADDI.W	#$3D,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#$D,D2
	MOVE.W	D2,-(sp)
	JSR	_DoSprite
	ADDQ.W	#6,sp
L0696:
	CLR.W	_InEcon
	MOVEM.L	(sp)+,A2/D5-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_BlockProd
	LINK	A6,#-6
	MOVEM.L	A2/D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_OnMap
	ADDQ.W	#4,sp
	TST.W	D0
	BNE.S	L0698
	MOVEQ	#0,D0
	BRA	L06AD
;
L0698:
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_TerAt
	MOVE.L	D0,D4
	MOVE.W	D6,(sp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EA.L	A1,A2
	ADDA.L	D0,A2
	CMPI.W	#1,(A2)
	BGT.S	L06A5
	SUBQ.W	#1,-4(A6)
L06A5:
	TST.W	_InEcon
	BEQ.S	L06A6
	SUBQ.W	#2,_GoDespot
L06A6:
	TST.W	-4(A6)
	BEQ.S	L06AA
	MOVEQ	#2,D0
	CMP.W	D0,D5
	BNE.S	L06AA
	TST.W	_InEcon
	BEQ.S	L06A7
	ADDQ.W	#1,_GoRepublic
L06A7:
	MOVE.W	_who,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_Politics,A0
	ADDA.L	D1,A0
	MOVE.W	_TheCity,D1
	EXT.L	D1
	MOVEQ	#$1C,D0
	JSR	__CXM22
	LEA	_ct,A1
	ADDA.L	D0,A1
	BTST	#6,6(A1)
	BEQ.S	L06A8
	MOVEQ	#2,D0
	BRA.S	L06A9
;
L06A8:
	MOVEQ	#4,D0
L06A9:
	MOVE.W	(A0),D1
	CMP.W	D0,D1
	BLT.S	L06AA
	ADDQ.W	#1,-4(A6)
L06AA:
	BTST	#6,-5(A6)
	BEQ.S	L06AC
	MOVE.W	-4(A6),D0
	ADDQ.W	#1,D0
	TST.W	D0
	BPL.S	L06AB
	ADDQ.W	#1,D0
L06AB:
	ASR.W	#1,D0
	MOVE.W	D0,-4(A6)
L06AC:
	MOVE.W	-4(A6),D0
	TST.W	D0
	BGT.S	L06AD
	MOVEQ	#0,D0
L06AD:
	MOVEM.L	(sp)+,A2/D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_HasWonder
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVEQ	#1,D4
L06AF:
	MOVEQ	#8,D0
	CMP.W	D0,D4
	BGE.S	L06B1
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_EndWonder,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D4,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L06B0
	MOVEQ	#0,D0
	BRA.S	L06B3
;
L06B0:
	ADDQ.W	#1,D4
	BRA.S	L06AF
;
L06B1:
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Wonders,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D5
	MOVEQ	#-1,D0
	CMP.W	D0,D5
	BEQ.S	L06B2
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	11(A0),D0
	EXT.W	D0
	CMP.W	D7,D0
	BNE.S	L06B2
	MOVEQ	#1,D0
	BRA.S	L06B3
;
L06B2:
	MOVEQ	#0,D0
L06B3:
	MOVEM.L	(sp)+,D4-D7
	RTS
;
;----------------------------------------------------------------------------
;
_CityWonder:
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVEQ	#1,D6
L06B5:
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGE.S	L06B7
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_EndWonder,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D6,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L06B6
	MOVEQ	#-1,D0
	BRA.S	L06B8
;
L06B6:
	ADDQ.W	#1,D6
	BRA.S	L06B5
;
L06B7:
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Wonders,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
L06B8:
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_AddPollution:
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Special
	ADDQ.W	#4,sp
	BTST	#6,D0
	BNE.S	L06BA
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#$40,D0
	MOVE.W	D0,-(sp)
	JSR	_PutSpecial
	MOVE.W	D6,(sp)
	MOVE.W	D7,-(sp)
	JSR	_SynchSpecial
	ADDQ.W	#8,sp
	ADDQ.W	#1,_Polluted
L06BA:
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_PutElvis:
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	L06BC
	ADD.W	D7,D7
	MOVE.W	_TheCity,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#3,D0
	ASL.W	D7,D0
	NOT.W	D0
	AND.W	D0,20(A1)
	MOVE.W	_TheCity,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	ASL.W	D7,D0
	OR.W	D0,20(A0)
L06BC:
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_GetElvis:
	MOVE.L	D7,-(sp)
	MOVE.W	8(sp),D7
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BLT.S	L06BE
	MOVEQ	#1,D0
	BRA.S	L06BF
;
L06BE:
	ADD.W	D7,D7
	MOVE.W	_TheCity,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.W	20(A0),D0
	ASR.W	D7,D0
	ANDI.W	#3,D0
L06BF:
	MOVE.L	(sp)+,D7
	RTS
;
;----------------------------------------------------------------------------
;
_NElvis:
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVEQ	#0,D5
	MOVEQ	#0,D6
L06C1:
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGE.S	L06C3
	MOVE.W	D6,-(sp)
	BSR.S	_GetElvis
	ADDQ.W	#2,sp
	CMP.W	D7,D0
	BNE.S	L06C2
	ADDQ.W	#1,D5
L06C2:
	ADDQ.W	#1,D6
	BRA.S	L06C1
;
L06C3:
	MOVE.L	D5,D0
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_FixEff:
	LINK	A6,#-2
	MOVEM.L	D6-D7/D2,-(sp)
	MOVE.W	22(sp),D7
	MOVE.W	24(sp),D6
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	L2038,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D0,L2038
L06C5:
	TST.W	_riot5
	BEQ.S	L06C6
	MOVE.W	L2039,D0
	MOVE.W	_riot5,D1
	MOVE.L	D1,D2
	CMP.W	D0,D2
	BLE.S	L06C6
	SUBQ.W	#1,_riot5
	ADDQ.W	#1,L2039
	BRA.S	L06C5
;
L06C6:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	L2039,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D0,L2039
L06C7:
	MOVE.W	L2038,D0
	ADD.W	L2039,D0
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.W	D0,12(sp)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	SUB.W	D6,D0
	MOVEQ	#$63,D1
	MOVE.W	D1,-(sp)
	CLR.W	-(sp)
	MOVE.W	D0,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	12(sp),D1
	CMP.W	D0,D1
	BLE	L06CA
	TST.W	_riot5
	BEQ.S	L06C8
	SUBQ.W	#1,_riot5
	BRA.S	L06C9
;
L06C8:
	SUBQ.W	#1,L2038
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	L2038,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D0,L2038
L06C9:
	SUBQ.W	#1,L2039
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	L2039,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D0,L2039
	BRA	L06C7
;
L06CA:
	MOVEM.L	(sp)+,D6-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Population:
	LINK	A6,#-8
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVEQ	#0,D0
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.W	D0,-6(A6)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.B	7(A1),D0
	EXT.W	D0
	MOVE.L	D0,D1
	LSL.W	#3,D1
	SUB.W	D0,D1
	MOVE.W	16(A6),D0
	CMP.W	D0,D1
	BLE.S	L06CC
	MOVE.L	D7,D1
	EXT.L	D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CLR.W	-2(A6)
L06D4:
	MOVE.W	-2(A6),D0
	MOVE.L	D0,D1
	CMP.W	L2039,D1
	BGE.S	L06D6
	ANDI.W	#1,D0
	ADDQ.W	#4,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_csprite,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ShowSprite2
	LEA	10(sp),sp
	MOVE.W	-2(A6),D0
	CMP.W	_riot5,D0
	BGE.S	L06D5
	MOVEQ	#$C,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#5,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$E,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ChangeColor
	LEA	16(sp),sp
L06D5:
	ADD.W	-4(A6),D6
	ADDQ.W	#1,-2(A6)
	BRA.S	L06D4
;
L06D6:
	ADDQ.W	#4,D6
	CLR.W	-2(A6)
L06D7:
	MOVE.W	-2(A6),D0
	MOVE.L	D0,D1
	CMP.W	D4,D1
	BGE.S	L06D8
	MOVE.W	D0,-(sp)
	BSR	_GetElvis
	ADDQ.W	#5,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_csprite,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ShowSprite2
	LEA	12(sp),sp
	ADD.W	-4(A6),D6
	ADDQ.W	#1,-2(A6)
	BRA.S	L06D7
;
L06D8:
	MOVE.W	-4(A6),D0
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_DrawImprove
	MOVEM.L	D5-D7/D2-D3,-(sp)
	MOVE.W	24(sp),D7
	MOVE.W	26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0,D2
	MOVE.W	D2,-(sp)
	MOVE.L	_RpMap,-(sp)
	MOVE.W	D0,-6(A6)
	JSR	_RectCopy
	LEA	24(sp),sp
	MOVE.W	-6(A6),D0
	ADD.W	D0,-2(A6)
	SUB.W	D0,D5
	TST.W	D5
	BGT.S	L06E2
	MOVE.W	-8(A6),D0
	ADD.W	D0,-4(A6)
	SUB.W	D0,D4
	TST.W	D4
	BGT.S	L06E1
L06E3:
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_MButton
	LINK	A6,#-4
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVE.L	D5,D0
	SUB.W	D7,D0
	MOVE.L	D4,D1
	SUB.W	D6,D1
	MOVE.W	20(A6),-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.L	_Rp1,-(sp)
	MOVE.W	D0,-2(A6)
	MOVE.W	D1,-4(A6)
	JSR	_RectumFill
	LEA	14(sp),sp
	MOVE.W	20(A6),D0
	MOVEQ	#8,D1
	CMP.W	D1,D0
	BGE.S	L06E5
	ADDQ.W	#8,D0
	BRA.S	L06E6
;
L06E5:
	MOVEQ	#7,D0
L06E6:
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Line
	LEA	10(sp),sp
	MOVE.W	20(A6),D0
	MOVEQ	#8,D1
	CMP.W	D1,D0
	BGE.S	L06E7
	ADDQ.W	#8,D0
	BRA.S	L06E8
;
L06E7:
	MOVEQ	#7,D0
L06E8:
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	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A6)
	JSR	_TerAt
	ADDQ.W	#4,sp
	MOVE.W	D0,-16(A6)
	MOVEQ	#$A,D1
	CMP.W	D1,D0
	BNE.S	L06F2
	MOVEQ	#1,D0
	BRA.S	L06F3
;
L06F2:
	MOVEQ	#2,D0
L06F3:
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	-12(A6),-(sp)
	MOVE.W	-10(A6),-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
L06F4:
	ADDQ.W	#1,D5
	BRA	L06EF
;
L06F5:
	ADDQ.W	#1,D4
	BRA	L06EE
;
L06F6:
	MOVEQ	#9,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$4B,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$79,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$75,D3
	MOVE.W	D3,-(sp)
	MOVEQ	#$64,D0
	MOVE.W	D0,-(sp)
	JSR	_Box
	MOVEM.L	-40(A6),D2-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Set32
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.W	20(sp),D5
	MOVEQ	#2,D0
	CMP.W	_CMode,D0
	BNE.S	L06FA
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_FirstX,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	SUB.W	(A0),D0
	ADDI.W	#$28,D0
	MOVE.W	D0,-(sp)
	JSR	_xrange
	MOVE.L	D0,D7
	MOVE.L	D7,D0
	ADD.W	D0,D0
	ADD.W	D7,D0
	TST.W	D0
	BPL.S	L06F8
	ADDQ.W	#1,D0
L06F8:
	ASR.W	#1,D0
	MOVE.L	D0,D7
	ADDI.W	#$65,D7
	MOVE.L	D6,D0
	ADD.W	D0,D0
	ADD.W	D6,D0
	TST.W	D0
	BPL.S	L06F9
	ADDQ.W	#1,D0
L06F9:
	ASR.W	#1,D0
	MOVE.L	D0,D6
	ADDI.W	#$76,D6
	MOVE.W	D5,-(sp)
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	16(sp),sp
L06FA:
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_ElvisErr:
	PEA	L1BDE
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$20,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_Menu
	LEA	14(sp),sp
	RTS
;
;----------------------------------------------------------------------------
;
_DoPolitics:
	MOVEM.L	A2/D5-D7/D2,-(sp)
	MOVE.W	24(sp),D7
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Politics,A0
	ADDA.L	D0,A0
	TST.W	(A0)
	BNE	L0700
	MOVE.W	_Player,D0
	CMP.W	D7,D0
	BNE.S	L06FE
	MOVEQ	#3,D0
	AND.W	_Rtime,D0
	BNE.S	L06FE
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	BTST	#2,1(A1)
	BEQ.S	L06FD
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	ADDA.L	D0,A0
	BCLR	#2,1(A0)
	BRA.S	L0700
;
L06FD:
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	BSR	_NewGovt
	ADDQ.W	#4,sp
	BRA.S	L0700
;
L06FE:
	MOVEQ	#3,D0
	AND.W	_Rtime,D0
	BEQ.S	L06FF
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_HasWonder
	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R	_DelTreaty
	LEA	10(sp),sp
	MOVE.L	D6,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BSET	#3,1(A0)
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_LastContact,A0
	ADDA.L	D0,A0
	MOVEQ	#$10,D0
	ADD.W	_Rtime,D0
	MOVE.W	D0,(A0)
L070E:
	JSR	_UnLoadKing
	JSR	_ResetKing
L070F:
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BCLR	#5,1(A0)
	ADDQ.W	#1,D6
	BRA	L0709
;
L0710:
	MOVEM.L	(sp)+,A2/D5-D7/D2
	RTS
;
;----------------------------------------------------------------------------
;
_NewGovt
	LINK	A6,#-$14
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Politics,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-18(A6)
	MOVEQ	#1,D0
	ASL.W	D7,D0
	MOVE.W	_Human,D1
	AND.W	D0,D1
	BEQ	L071C
L0712:
	PEA	L1BE6
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVEQ	#0,D0
	MOVE.L	D0,D4
	MOVEQ	#1,D5
	MOVE.W	D0,-20(A6)
L0713:
	MOVEQ	#6,D0
	CMP.W	D0,D5
	BGE	L0719
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_HasWonder
	ADDQ.W	#4,sp
	TST.W	D0
	BNE.S	L0717
	MOVEQ	#2,D0
	CMP.W	D0,D5
	BNE.S	L0714
	MO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5
	BGE.S	L0724
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BCLR	#3,1(A0)
	ADDQ.W	#1,D5
	BRA.S	L0723
;
L0724:
	MOVEM.L	(sp)+,D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Contact
	LINK	A6,#-8
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	TST.W	D7
	BEQ	L0735
	TST.W	D6
	BEQ	L0735
	MOVE.W	_Player,D0
	CMP.W	D7,D0
	BNE.S	L0727
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BTST	#0,1(A0)
	BEQ.S	L0726
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_LastContact,A0
	ADDA.L	D0,A0
	MOVE.W	_Rtime,D0
	SUB.W	(A0),D0
	MOVEQ	#$10,D1
	CMP.W	D1,D0
	BLT.S	L0727
L0726:
	CLR.W	-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_Econtact
	ADDQ.W	#8,sp
L0727:
	MOVE.W	_Player,D0
	CMP.W	D6,D0
	BNE.S	L0729
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BTST	#0,1(A0)
	BEQ.S	L0728
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_LastContact,A0
	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A.L	D0,A0
	MOVE.L	A0,-(sp)
	PEA	_XEB
	JSR	_strcpy
	PEA	L1BEE
	PEA	_XEB
	JSR	_strcat
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$C,D1
	JSR	__CXM22
	LEA	_ArmyTexts,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	LEA	20(sp),sp
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BTST	#1,1(A0)
	BEQ.S	L0732
	PEA	L1BEF
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L0733
;
L0732:
	PEA	L1BF0
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L0733:
	MOVE.W	#1,_MSource
	MOVEQ	#$50,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_sMenu
	ADDQ.W	#8,sp
L0734:
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_DelTreaty
	ADDQ.W	#6,sp
L0735:
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_AddTreaty
	MOVEM.L	D5-D7/D2,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVE.W	24(sp),D5
	MOVEQ	#2,D0
	CMP.W	D0,D5
	BNE.S	L0737
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_Treaties,A0
	ADDA.L	D1,A0
	MOVE.L	D6,D1
	EXT.L	D1
	ADD.L	D1,D1
	ADDA.L	D1,A0
	MOVE.W	(A0),D0
	AND.W	D5,D0
	BNE.S	L0737
	MOVE.L	D7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OVEQ	#1,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_AddReplay
	ADDQ.W	#6,sp
L073A:
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A1
	MOVE.L	D5,D1
	NOT.W	D1
	AND.W	D1,(A1)
	MOVE.L	D6,D1
	EXT.L	D1
	ASL.L	#4,D1
	MOVEA.L	A0,A1
	ADDA.L	D1,A1
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	ADDA.L	D1,A1
	MOVE.L	D5,D2
	NOT.W	D2
	AND.W	D2,(A1)
	BTST	#1,D5
	BEQ.S	L073B
	MOVE.L	D7,D2
	EXT.L	D2
	ASL.L	#4,D2
	MOVEA.L	A0,A1
	ADDA.L	D2,A1
	ADDA.L	D0,A1
	BCLR	#2,1(A1)
	MOVE.L	D6,D0
	EXT.L	D0
	ASL.L	#4,D0
	ADDA.L	D0,A0
	ADDA.L	D1,A0
	BCLR	#2,1(A0)
L073B:
	MOVEM.L	(sp)+,D5-D7/D2
	RTS
;
;----------------------------------------------------------------------------
;
_IsEnemy
	LINK	A6,#-$E
	MOVEM.L	A2-A3/D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	BTST	#0,L216B
	BNE.S	L073D
	MOVEQ	#1,D0
	BRA	L074D
;
L073D:
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A1
	MOVEQ	#3,D0
	AND.W	(A1),D0
	SUBQ.W	#1,D0
	BNE.S	L073E
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Ncombat,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,-8(A6)
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_Rcity,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	ADD.W	D0,-10(A6)
L0749:
	ADDQ.W	#1,D5
	BRA	L0745
;
L074A:
	MOVE.W	-6(A6),D0
	ASL.W	#2,D0
	EXT.L	D0
	DIVS	-8(A6),D0
	MOVE.L	D4,D1
	ADDQ.W	#4,D1
	CMP.W	D1,D0
	BGE.S	L074B
	TST.W	-10(A6)
	BNE.S	L074C
L074B:
	MOVEQ	#1,D0
	BRA.S	L074D
;
L074C:
	MOVEQ	#0,D0
L074D:
	MOVEM.L	(sp)+,A2-A3/D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Exchange:
	LINK	A6,#-8
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVEQ	#0,D4
	MOVEQ	#0,D5
L074F:
	MOVEQ	#$48,D0
	CMP.W	D0,D5
	BGE.S	L0752
	MOVE.W	D5,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BNE.S	L0750
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L0750
	BSET	#0,D4
	MOVE.W	D5,-6(A6)
L0750:
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BNE.S	L0751
	MOVE.W	D5,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L0751
	BSET	#1,D4
	MOVE.W	D5,-8(A6)
L0751:
	ADDQ.W	#1,D5
	BRA.S	L074F
;
L0752:
	MOVEQ	#3,D0
	CMP.W	D0,D4
	BNE.S	L0753
	MOVE.W	D6,-(sp)
	MOVE.W	-6(A6),-(sp)
	MOVE.W	D7,-(sp)
	JSR	_HasCivilized
	MOVE.W	D7,(sp)
	MOVE.W	-8(A6),-(sp)
	MOVE.W	D6,-(sp)
	JSR	_HasCivilized
	MOVEQ	#1,D0
	BRA.S	L0754
;
L0753:
	MOVEQ	#0,D0
L0754:
	MOVEM.L	-24(A6),D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_PalaceDist:
	LINK	A6,#-8
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVEQ	#$10,D4
	CLR.W	-4(A6)
L0756:
	MOVE.W	-4(A6),D0
	CMPI.W	#$80,D0
	BGE	L0758
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	CMPI.B	#-1,6(A1)
	BEQ	L0757
	MOVE.W	-4(A6),D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.B	11(A1),D0
	EXT.W	D0
	CMP.W	D7,D0
	BNE.S	L0757
	MOVE.W	-4(A6),D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	BTST	#0,3(A1)
	BEQ.S	L0757
	MOVE.W	-4(A6),D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	MOVE.W	-4(A6),D1
	EXT.L	D1
	MOVE.W	D0,16(sp)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	5(A0),D0
	MOVE.W	D5,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	22(sp),-(sp)
	JSR	_mapdist
	ADDQ.W	#8,sp
	MOVE.W	D0,-6(A6)
	CMP.W	D4,D0
	BGE.S	L0757
	MOVE.L	D0,D4
L0757:
	ADDQ.W	#1,-4(A6)
	BRA	L0756
;
L0758:
	MOVE.L	D4,D0
	MOVEM.L	(sp)+,D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_RattackA:
	LINK	A6,#0
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_Rattack,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	MOVEM.L	(sp)+,D6-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_RunitsA
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_Runits,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_NukesA:
	MOVE.L	D7,-(sp)
	MOVE.W	8(sp),D7
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$38,D1
	JSR	__CXM22
	LEA	_units,A0
	ADDA.L	D0,A0
	MOVE.W	50(A0),D0
	MOVE.L	(sp)+,D7
	RTS
;
;----------------------------------------------------------------------------
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_Estrat:
	LINK	A6,#-$76
	MOVEM.L	A5/A2-A3/D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#0,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L	D0,D0
	ADDQ.W	#1,-92(A6,D0.L)
L07B6:
	ADDQ.W	#1,D6
	BRA	L07A6
;
L07B7:
	MOVEM.L	(sp)+,A5/A2-A3/D5-D7/D2-D3
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Emove
	LINK	A6,#-$72
	MOVEM.L	A5/A2-A3/D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	CMP.W	_AStop,D7
	BNE.S	L07B9
	CMP.W	_UStop,D6
	BNE.S	L07B9
	JSR	_Stop
L07B9:
	TST.W	D7
	BNE.S	L07BA
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_BMove
	BRA	L0881
;
L07BA:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.L	D0,40(sp)
	MOVEQ	#$F,D2
	CMP.B	3(A1),D2
	BNE.S	L07BB
	MOVE.L	D7,D2
	EXT.L	D2
	MOVE.L	D2,D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	40(sp),D0
	ADDA.L	D0,A1
	MOVE.B	5(A1),D0
	TST.B	D0
	BGT.S	L07BB
	MOVEQ	#$68,D0
	BRA	L0881
;
L07BB:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.L	D0,40(sp)
	MOVEQ	#$E,D2
	CMP.B	3(A1),D2
	BNE	L07C6
	MOVE.L	D7,D2
	EXT.L	D2
	MOVE.L	D2,D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MO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
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	CMPI.B	#3,4(A1)
	BGE.S	L0880
	MOVEQ	#0,D0
	MOVE.W	D0,-18(A6)
L0880:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.W	-18(A6),D0
	MOVE.B	D0,8(A0)
L0881:
	MOVEM.L	-150(A6),A5/A2-A3/D2-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Stop:
	RTS
;
;----------------------------------------------------------------------------
;
_ClearDest
	MOVEM.L	D6-D7/D2-D3,-(sp)
	MOVE.W	20(sp),D7
	MOVEQ	#0,D6
L0884:
	MOVEQ	#$20,D0
	CMP.W	D0,D6
	BGE.S	L0885
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestType,A0
	ADDA.L	D0,A0
	ADDA.W	D6,A0
	MOVE.B	#-1,(A0)
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestVal,A0
	ADDA.L	D0,A0
	ADDA.W	D6,A0
	CLR.B	(A0)
	ADDQ.W	#1,D6
	BRA.S	L0884
;
L0885:
	MOVEQ	#0,D6
L0886:
	MOVEQ	#$10,D0
	CMP.W	D0,D6
	BGE	L0888
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestType,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	ADDA.W	D6,A1
	CMPI.B	#-1,(A1)
	BEQ.S	L0887
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	ADDA.W	D6,A1
	CMPI.B	#2,(A1)
	BGT.S	L0887
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestX,A1
	ADDA.L	D0,A1
	ADDA.W	D6,A1
	MOVE.B	(A1),D0
	EXT.W	D0
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_SDestY,A1
	ADDA.L	D1,A1
	ADDA.W	D6,A1
	MOVE.B	(A1),D1
	EXT.W	D1
	MOVE.L	D7,D2
	EXT.L	D2
	ASL.L	#4,D2
	ADDA.L	D2,A0
	ADDA.W	D6,A0
	MOVE.B	(A0),D2
	EXT.W	D2
	MOVE.L	D7,D3
	EXT.L	D3
	ASL.L	#4,D3
	LEA	_SDestVal,A0
	ADDA.L	D3,A0
	ADDA.W	D6,A0
	MOVE.B	(A0),D3
	EXT.W	D3
	MOVE.W	D3,-(sp)
	MOVE.W	D2,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	BSR	_AddDest
	LEA	10(sp),sp
L0887:
	ADDQ.W	#1,D6
	BRA	L0886
;
L0888:
	MOVEM.L	(sp)+,D6-D7/D2-D3
	RTS
;
;----------------------------------------------------------------------------
;
_AddDest
	LINK	A6,#-$E
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	CLR.W	-2(A6)
L088A:
	MOVE.W	-2(A6),D0
	MOVEQ	#$20,D1
	CMP.W	D1,D0
	BGE.S	L088C
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#5,D1
	LEA	_DestX,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.B	(A0),D1
	EXT.W	D1
	CMP.W	D6,D1
	BNE.S	L088B
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#5,D1
	LEA	_DestY,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.B	(A0),D1
	EXT.W	D1
	CMP.W	D5,D1
	BNE.S	L088B
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#5,D1
	LEA	_DestType,A0
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T.W	D1
	CMP.W	16(A6),D1
	BGE.S	L0893
L0892:
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_PushDest
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestX,A0
	ADDA.L	D0,A0
	MOVE.W	-2(A6),D0
	ADDA.W	D0,A0
	MOVE.L	D6,D1
	MOVE.B	D1,(A0)
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#5,D1
	LEA	_DestY,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.L	D5,D1
	MOVE.B	D1,(A0)
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#5,D1
	LEA	_DestType,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.L	D4,D1
	MOVE.B	D1,(A0)
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#5,D1
	LEA	_DestVal,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.W	16(A6),D0
	MOVE.B	D0,(A0)
	BRA.S	L0894
;
L0893:
	ADDQ.W	#1,-2(A6)
	BRA	L0891
;
L0894:
	MOVEM.L	-38(A6),D2-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_PushDest:
	MOVEM.L	A2/D5-D7,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVEQ	#$1E,D5
L0896:
	CMP.W	D6,D5
	BLT	L0898
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestVal,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	TST.B	(A1)
	BEQ.S	L0897
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestX,A1
	MOVEA.L	A1,A2
	ADDA.L	D0,A2
	ADDA.W	D5,A2
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	MOVE.B	(A1),1(A2)
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestY,A1
	MOVEA.L	A1,A2
	ADDA.L	D0,A2
	ADDA.W	D5,A2
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	MOVE.B	(A1),1(A2)
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_DestType,A1
	MOVEA.L	A1,A2
	ADDA.L	D0,A2
	ADDA.W	D5,A2
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	MOVE.B	(A1),1(A2)
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	ADDA.L	D0,A0
	ADDA.W	D5,A0
	MOVE.B	(A0),1(A1)
L0897:
	SUBQ.W	#1,D5
	BRA	L0896
;
L0898:
	MOVEM.L	(sp)+,A2/D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_ClearSDest:
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVEQ	#0,D6
L089A:
	MOVEQ	#$10,D0
	CMP.W	D0,D6
	BGE.S	L089B
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestType,A0
	ADDA.L	D0,A0
	ADDA.W	D6,A0
	MOVE.B	#-1,(A0)
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestVal,A0
	ADDA.L	D0,A0
	ADDA.W	D6,A0
	CLR.B	(A0)
	ADDQ.W	#1,D6
	BRA.S	L089A
;
L089B:
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_AddSDest:
	LINK	A6,#-2
	MOVEM.L	D4-D7,-(s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.S	L08A2
L08A1:
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_PushSDest
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestX,A0
	ADDA.L	D0,A0
	MOVE.W	-2(A6),D0
	ADDA.W	D0,A0
	MOVE.L	D6,D1
	MOVE.B	D1,(A0)
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_SDestY,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.L	D5,D1
	MOVE.B	D1,(A0)
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_SDestType,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.L	D4,D1
	MOVE.B	D1,(A0)
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_SDestVal,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.W	16(A6),D0
	MOVE.B	D0,(A0)
	BRA.S	L08A3
;
L08A2:
	ADDQ.W	#1,-2(A6)
	BRA	L08A0
;
L08A3:
	MOVEM.L	-18(A6),D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_PushSDest
	MOVEM.L	A2/D5-D7,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVEQ	#$E,D5
L08A5:
	CMP.W	D6,D5
	BLT	L08A7
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestVal,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	TST.B	(A1)
	BEQ.S	L08A6
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestX,A1
	MOVEA.L	A1,A2
	ADDA.L	D0,A2
	ADDA.W	D5,A2
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	ADDA.L	D0,A1
	ADDA.W	D5,A1
	MOVE.B	(A1),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est
	LINK	A6,#-4
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	CLR.W	-2(A6)
L08AD:
	MOVE.W	-2(A6),D0
	MOVEQ	#$10,D1
	CMP.W	D1,D0
	BGE.S	L08AF
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_SDestType,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.B	(A0),D1
	EXT.W	D1
	CMP.W	D6,D1
	BNE.S	L08AE
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_SDestX,A0
	ADDA.L	D1,A0
	ADDA.W	D0,A0
	MOVE.B	(A0),D1
	EXT.W	D1
	MOVE.L	D7,D2
	EXT.L	D2
	ASL.L	#4,D2
	LEA	_SDestY,A0
	ADDA.L	D2,A0
	ADDA.W	D0,A0
	MOVE.B	(A0),D0
	EXT.W	D0
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D5,-(sp)
	JSR	_mapdist
	ADDQ.W	#8,sp
	MOVE.W	D0,-4(A6)
	CMP.W	16(A6),D0
	BGT.S	L08AE
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_SDestType,A0
	ADDA.L	D0,A0
	ADDA.W	-2(A6),A0
	MOVE.B	#-1,(A0)
L08AE:
	ADDQ.W	#1,-2(A6)
	BRA.S	L08AD
;
L08AF:
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_ResetProduction
	LINK	A6,#-2
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	22(sp),D7
	MOVE.W	24(sp),D6
	MOVEQ	#0,D5
L08B1:
	CMPI.W	#$80,D5
	BGE	L08B4
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22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,A0
	ADDA.L	D0,A0
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BTST	#1,1(A0)
	BEQ.S	L08BC
	MOVEQ	#$50,D0
	ADD.W	-16(A6),D0
	MOVE.W	-18(A6),-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_GetPixel
	ADDQ.W	#6,sp
	CMP.W	_Player,D0
	BNE.S	L08BC
	SUBQ.W	#1,-10(A6)
L08BC:
	ADDQ.W	#1,-8(A6)
	BRA	L08BB
;
L08BD:
	MOVE.W	-10(A6),D0
	MOVE.L	D0,D1
	CMP.W	-2(A6),D1
	BLE.S	L08BE
	MOVE.W	-6(A6),-4(A6)
	MOVE.W	D0,-2(A6)
L08BE:
	ADDQ.W	#1,-6(A6)
	BRA	L08B9
;
L08BF:
	MOVE.W	-4(A6),D0
	MOVEM.L	(sp)+,D5-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_BMove
	LINK	A6,#-$66
	MOVEM.L	A2-A3/D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A1
	MOVE.L	D0,32(sp)
	CMPI.B	#2,2(A1)
	BCS.S	L08C1
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.L	#$600,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	32(sp),D0
	ADDA.L	D0,A0
	CMPI.B	#$30,2(A0)
	BCS.S	L08C2
L08C1:
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_RemoveUnit
	BRA	L08EE
;
L08C2:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__C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,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	CMPI.B	#-1,10(A1)
	BNE.S	L08ED
	CMPI.W	#$63,-4(A6)
	BGE.S	L08ED
	MOVEQ	#$20,D0
	BRA.S	L08EE
;
L08ED:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.W	-18(A6),D0
	MOVE.B	D0,8(A0)
L08EE:
	MOVEM.L	-130(A6),A2-A3/D5-D7/D2-D3
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_EmptyCity
	LINK	A6,#-$12
	MOVEM.L	D5-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.W	D0,-6(A6)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	5(A0),D0
	MOVEQ	#1,D6
	MOVE.W	D0,-8(A6)
L08F0:
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGE	L08F4
	MOVE.W	_Player,D0
	MOVE.L	D0,D1
	CMP.W	D6,D1
	BEQ	L08F3
	MOVE.L	D6,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_Treaties,A0
	ADDA.L	D1,A0
	MOVE.L	D0,D1
	EXT.L	D1
	ADD.L	D1,D1
	ADDA.L	D1,A0
	BTST	#1,1(A0)
	BNE	L08F3
	MOVEQ	#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A6),D0
	MOVE.B	D0,7(A0)
L08F2:
	ADDQ.W	#1,D5
	BRA	L08F1
;
L08F3:
	ADDQ.W	#1,D6
	BRA	L08F0
;
L08F4:
	MOVEM.L	(sp)+,D5-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_Combat:
	LINK	A6,#-$2E
	MOVEM.L	A2-A3/D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.B	3(A1),D0
	EXT.W	D0
	MOVE.L	D5,D2
	EXT.L	D2
	MOVE.W	D0,-4(A6)
	MOVE.L	D2,D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	14(A6),D0
	MULS	#$C,D0
	ADDA.L	D0,A1
	MOVE.B	3(A1),D1
	EXT.W	D1
	MOVE.L	D5,D2
	EXT.L	D2
	MOVE.L	D0,36(sp)
	MOVE.L	D2,D0
	MOVE.W	D1,-6(A6)
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	36(sp),D0
	ADDA.L	D0,A1
	MOVEQ	#0,D1
	MOVE.B	1(A1),D1
	MOVE.L	D5,D2
	EXT.L	D2
	MOVE.L	D2,D0
	MOVE.W	D1,40(sp)
	MOVE.L	#$600,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	ADDA.L	36(sp),A0
	MOVEQ	#0,D0
	MOVE.B	2(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	42(sp),-(sp)
	JSR	_TerAt
	CLR.W	-32(A6)
	MOVE.W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	BEQ.S	L093F
	MOVE.L	D5,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.W	14(A6),D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	BSET	#5,(A0)
L093F:
	MOVEQ	#0,D0
L0940:
	MOVEM.L	-78(A6),A2-A3/D2-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_AddLink
	LINK	A6,#-$C
	MOVEM.L	A2/D5-D7/D2,-(sp)
	MOVE.W	40(sp),D7
	MOVE.W	42(sp),D6
	MOVE.W	44(sp),D5
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D5,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.L	D0,24(sp)
	CMPI.B	#-1,10(A1)
	BNE.S	L0942
	MOVE.L	D7,D2
	EXT.L	D2
	MOVE.L	D2,D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	24(sp),D0
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVE.B	D0,10(A1)
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.L	D5,D0
	MOVE.B	D0,10(A1)
	BRA.S	L0943
;
L0942:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A2
	ADDA.L	D0,A2
	MOVE.L	D5,D0
	MULS	#$C,D0
	ADDA.L	D0,A2
	MOVE.B	10(A2),10(A1)
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.L	D0,28(sp)
	MOVE.L	#$600,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	28(sp),D0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MOVE.B	D0,10(A0)
L0943:
	MOVEM.L	(sp)+,A2/D5-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_DelLink
	LINK	A6,#-8
	MOVEM.L	A2/D4-D7,-(sp)
	MOVE.W	36(sp),D7
	MOVE.W	38(sp),D6
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.B	10(A1),D5
	EXT.W	D5
	MOVEQ	#-1,D0
	CMP.W	D0,D5
	BEQ	L0949
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D5,D0
	MULS	#$C,D0
	ADDA.L	D0,A1
	MOVE.B	10(A1),D1
	EXT.W	D1
	MOVE.L	D0,24(sp)
	CMP.W	D6,D1
	BNE.S	L0945
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.L	#$600,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	24(sp),D0
	ADDA.L	D0,A0
	MOVE.B	#-1,10(A0)
	BRA	L0948
;
L0945:
	MOVEQ	#0,D4
L0946:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.B	10(A0),D5
	EXT.W	D5
	ADDQ.W	#1,D4
	MOVEQ	#$20,D0
	CMP.W	D0,D4
	BGE.S	L0947
	MOVEQ	#-1,D0
	CMP.W	D0,D5
	BEQ.S	L0947
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.B	10(A0),D0
	EXT.W	D0
	CMP.W	D6,D0
	BNE.S	L0946
L0947:
	MOVEQ	#$20,D0
	CMP.W	D0,D4
	BGE.S	L0948
	MOVEQ	#-1,D0
	CMP.W	D0,D5
	BEQ.S	L0948
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D5,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	MOVEA.L	A0,A2
	ADDA.L	D0,A2
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A2
	MOVE.B	10(A2),10(A1)
L0948:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.B	#-1,10(A0)
L0949:
	MOVEM.L	(sp)+,A2/D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Annoy:				;asks if treaty should be broken to do act
	MOVE.L	D7,-(sp)
	MOVE.W	8(sp),D7
	MOVE.W	_Player,D0
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	BTST	#1,1(A0)
	BEQ	L094D
	PEA	we_have_treaty_s
	PEA	_XEB
	JSR	_strcpy
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$C,D1
	JSR	__CXM22
	LEA	_ArmyTexts,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	break_treaty_q_s
	PEA	_XEB
	JSR	_strcat
	MOVE.W	#5,_MSource
	MOVEQ	#0,D0
	MOVE.W	D0,_DefaultItem
	MOVE.W	D0,_NoHi
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_sMenu
	LEA	26(sp),sp
	SUBQ.W	#1,D0
	BEQ.S	L094B
	MOVEQ	#-1,D0
	BRA.S	L094E
;
L094B:
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Politics,A0
	ADDA.L	D0,A0
	CMPI.W	#4,(A0)
	BLT.S	L094C
	PEA	overruled_by_senate_s
	PEA	_XEB
	JSR	_strcpy
	MOVE.W	#4,_MSource
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_sMenu
	LEA	14(sp),sp
	MOVEQ	#-1,D0
	BRA.S	L094E
;
L094C:
	MOVEQ	#1,D0
	BRA.S	L094E
;
L094D:
	MOVEQ	#0,D0
L094E:
	MOVE.L	(sp)+,D7
	RTS
;
;----------------------------------------------------------------------------
;
_NukeAttack:
	LINK	A6,#-$C
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	_Player,D0
	CMP.W	D7,D0
	BEQ.S	L0950
	MOVE.W	#3,_MSource
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$C,D1
	JSR	__CXM22
	LEA	_ArmyTexts,A0
	ADD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-1,D0
	MOVE.W	D0,-8(A6)
L0952:
	MOVE.W	-8(A6),D0
	MOVEQ	#-1,D1
	CMP.W	D1,D0
	BEQ.S	L0953
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	_armyAt,-(sp)
	JSR	_StackCheck
	MOVE.L	D7,D1
	EXT.L	D1
	ASL.L	#4,D1
	LEA	_killed,A0
	ADDA.L	D1,A0
	MOVE.W	_armyAt,D1
	EXT.L	D1
	ADD.L	D1,D1
	ADDA.L	D1,A0
	ADD.W	D0,(A0)
	PEA	_RemoveUnit
	MOVE.W	-8(A6),-(sp)
	MOVE.W	_armyAt,-(sp)
	MOVE.W	D0,-12(A6)
	JSR	_UnitList
	LEA	14(sp),sp
	MOVE.W	_armyAt,D0
	CMP.W	D0,D7
	BEQ.S	L0953
	EXT.L	D0
	ASL.L	#4,D0
	LEA	_Treaties,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVE.W	#$88,D0
	OR.W	D0,(A0)
L0953:
	SUBQ.W	#1,D4
	BRA	L0951
;
L0954:
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_NukeAt
	MOVEM.L	-28(A6),D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_NukeAt:
	LINK	A6,#-8
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVEQ	#0,D5
L0956:
	MOVEQ	#8,D0
	CMP.W	D0,D5
	BGT	L095A
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_MoveX,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	ADD.W	(A0),D0
	MOVE.W	D0,-(sp)
	JSR	_xrange
	MOVE.L	D0,D4
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_MoveY,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	ADD.W	(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-6(A6)
	JSR	_Special
	ADDQ.W	#6,sp
	BTST	#0,D0
	BEQ.S	L0958
	MOVE.W	-6(A6),-(sp)
	MOVE.W	D4,-(sp)
	JSR	_FindCity
	ADDQ.W	#4,sp
	MOVE.W	D0,-8(A6)
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	-8(A6),D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.B	7(A0),D0
	EXT.W	D0
	TST.W	D0
	BPL.S	L0957
	ADDQ.W	#1,D0
L0957:
	ASR.W	#1,D0
	MOVE.B	7(A1),D1
	EXT.W	D1
	MOVE.L	D1,D2
	SUB.W	D0,D2
	MOVE.B	D2,7(A1)
	BRA.S	L0959
;
L0958:
	MOVEQ	#3,D0
	MOVE.W	D0,-(sp)
	JSR	_rnd
	ADDQ.W	#2,sp
	TST.W	D0
	BEQ.S	L0959
	MOVE.W	-6(A6),-(sp)
	MOVE.W	D4,-(sp)
	JSR	_TerAt
	ADDQ.W	#4,sp
	MOVEQ	#$A,D1
	CMP.W	D1,D0
	BEQ.S	L0959
	MOVE.W	-6(A6),-(sp)
	MOVE.W	D4,-(sp)
	JSR	_AddPollution
	ADDQ.W	#4,sp
L0959:
	MOVE.W	-6(A6),-(sp)
	MOVE.W	D4,-(sp)
	JSR	_ShowBlock
	ADDQ.W	#4,sp
	ADDQ.W	#1,D5
	BRA	L0956
;
L095A:
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_ShowMap
	LINK	A6,#-$1E
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MO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:
	ADDQ.W	#1,-4(A6)
	BRA	L096C
;
L096F:
	MOVEQ	#8,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$F,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$31,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$4F,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	JSR	_Box2
	MOVE.L	D6,D0
	SUB.W	-8(A6),D0
	SUBQ.W	#1,D0
	MOVE.L	D5,D1
	SUB.W	-10(A6),D1
	ADDQ.W	#7,D1
	MOVEQ	#$F,D2
	MOVE.W	D2,(sp)
	MOVEQ	#$A,D3
	MOVE.W	D3,-(sp)
	MOVEQ	#$11,D4
	MOVE.W	D4,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_Box
	MOVE.W	-16(A6),_Army
	JSR	_showmouse
	MOVEM.L	-54(A6),D2-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_RestoreBlock:
	LINK	A6,#-$24
	MOVEM.L	D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVEQ	#1,D0
	CMP.W	_MapView,D0
	BNE	L0974
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Special
	ADDQ.W	#4,sp
	BTST	#0,D0
	BEQ.S	L0971
	MOVE.L	D7,D0
	ASL.W	#2,D0
	MOVE.L	D6,D1
	ASL.W	#2,D1
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	D0,24(sp)
	MOVE.W	D1,26(sp)
	JSR	_WhoOwns
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_armycolor,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),(sp)
	MOVEQ	#4,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	30(sp),-(sp)
	MOVE.W	30(sp),-(sp)
	MOVE.L	_Rp1,-(sp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7
	MOVE.W	-18(A6),D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	CMPI.B	#-1,26(A0)
	BEQ.S	L09B8
L09B7:
	CLR.W	-(sp)
	MOVEQ	#$F,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	-14(A6),-(sp)
	MOVE.W	-12(A6),-(sp)
	JSR	_Box
	LEA	10(sp),sp
L09B8:
	MOVE.W	-18(A6),D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	BTST	#7,3(A0)
	BEQ.S	L09B9
	MOVE.W	-12(A6),D0
	ADDQ.W	#1,D0
	MOVE.W	-14(A6),D1
	ADDQ.W	#1,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#$1D,D2
	MOVE.W	D2,-(sp)
	JSR	_DoSprite
	ADDQ.W	#6,sp
L09B9:
	MOVE.W	_CityW,D0
	MOVEQ	#$20,D1
	CMP.W	D1,D0
	BGE.S	L09BA
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_CityX,A0
	ADDA.L	D0,A0
	MOVE.W	-12(A6),(A0)
	MOVE.W	_CityW,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_CityY,A0
	ADDA.L	D0,A0
	MOVE.W	-14(A6),(A0)
	MOVE.W	_CityW,D0
	EXT.L	D0
	ADDQ.W	#1,_CityW
	ADD.L	D0,D0
	LEA	_CityI,A0
	ADDA.L	D0,A0
	MOVE.W	-18(A6),(A0)
L09BA:
	JSR	_showmouse
	MOVEQ	#1,D0
L09BB:
	MOVEM.L	(sp)+,D5-D7/D2-D3
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_ShowUnit:
	LINK	A6,#-$1A
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVEQ	#1,D0
	C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,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	CMPI.B	#-1,10(A0)
	BEQ.S	L09C3
	MOVE.L	D7,D0
	ASL.W	#5,D0
	ADD.W	-12(A6),D0
	ADDI.W	#$40,D0
	MOVE.L	D5,D1
	ADDQ.W	#1,D1
	MOVE.L	D4,D2
	ADDQ.W	#1,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_DoSprite
	ADDQ.W	#6,sp
L09C3:
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_DrawUnit
	JSR	_showmouse
	MOVEQ	#1,D0
L09C4:
	MOVEM.L	-46(A6),D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_DrawUnit:
	LINK	A6,#-$A
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVE.L	D7,D0
	ASL.W	#5,D0
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.W	D0,24(sp)
	MOVE.L	#$600,D0
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVE.B	3(A0),D0
	EXT.W	D0
	MOVE.W	24(sp),D1
	ADD.W	D0,D1
	ADDI.W	#$40,D1
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D1,-(sp)
	JSR	_DoSprite
	ADDQ.W	#6,sp
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	BTST	#3,(A0)
	BEQ.S	L09C6
	MOVE.W	D4,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)
	MOVE.W	D5,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ChangeColor
	MOVEQ	#7,D0
	MOVE.W	D0,(sp)
	MOVEQ	#8,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$10,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D2,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ChangeColor
	LEA	30(sp),sp
L09D5:
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_ShowBlock
	MOVEM.L	D5-D7/D2,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	BSR	_RestoreBlock
	ADDQ.W	#4,sp
	TST.W	_Tflag
	BNE	L09D8
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_UnitAt
	ADDQ.W	#4,sp
	MOVE.L	D0,D5
	MOVEQ	#-1,D0
	CMP.W	D0,D5
	BEQ.S	L09D8
	TST.W	_debug
	BNE.S	L09D7
	MOVE.W	_Army,D0
	MOVE.W	_Player,D1
	MOVE.L	D1,D2
	CMP.W	D0,D2
	BEQ.S	L09D7
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVEQ	#1,D0
	MOVE.W	_Player,D1
	ASL.W	D1,D0
	MOVE.B	9(A0),D1
	EXT.W	D1
	AND.W	D0,D1
	TST.W	D1
	BEQ.S	L09D8
L09D7:
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	BSR	_Special
	ADDQ.W	#4,sp
	BTST	#0,D0
	BNE.S	L09D8
	MOVE.W	D5,-(sp)
	MOVE.W	_Army,-(sp)
	BSR	_ShowMUnit
	ADDQ.W	#4,sp
L09D8:
	MOVE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NLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_OnMap
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	TST.W	D7
	BMI.S	L09E1
	MOVEQ	#$50,D0
	CMP.W	D0,D7
	BGE.S	L09E1
	TST.W	D6
	BMI.S	L09E1
	MOVEQ	#$32,D0
	CMP.W	D0,D6
	BLT.S	L09E2
L09E1:
	MOVEQ	#0,D0
	BRA.S	L09E3
;
L09E2:
	MOVEQ	#1,D0
L09E3:
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_TerAt
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	JSR	_GetPixel
	ADDQ.W	#6,sp
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_TerTypes,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_WhoOwns
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$A0,D0
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_GetPixel
	ADDQ.W	#6,sp
	MOVE.L	D0,D5
	MOVE.L	D5,D0
	ANDI.W	#7,D0
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_NowOwns
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	24(sp),D7
	MOVE.W	26(sp),D6
	MOVE.W	28(sp),D5
	MOVE.L	D6,D0
	ADDI.W	#$A0,D0
	MOVE.W	D5,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_GetPixel
	MOVE.L	D0,D4
	MOVE.L	D6,D0
	ADDI.W	#$A0,D0
	MOVE.L	D4,D1
	ANDI.W	#8,D1
	ADD.W	D7,D1
	MOVEQ	#2,D2
	MOVE.W	D2,(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_PutPixel
	LEA	12(sp),sp
	MOVEM.L	(sp)+,D4-D7/D2
	RTS
;
;----------------------------------------------------------------------------
;
_AddUnitAt
	LINK	A6,#-2
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	JSR	_UnitAt
	ADDQ.W	#4,sp
	MOVE.W	D0,-2(A6)
	MOVEQ	#-1,D1
	CMP.W	D1,D0
	BEQ.S	L09E8
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_AddLink
	ADDQ.W	#6,sp
L09E8:
	MOVE.L	D5,D0
	ADDI.W	#$A0,D0
	MOVE.L	D7,D1
	ADDQ.W	#8,D1
	MOVEQ	#2,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_PutPixel
	MOVEM.L	-22(A6),D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_DeleteUnitAt:
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVE.W	24(sp),D5
	MOVE.W	26(sp),D4
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	CMPI.B	#-1,10(A0)
	BEQ.S	L09EA
	MOVE.W	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09EE
	MOVE.L	D5,D0
	MOVE.W	D0,_armyAt
	MOVE.W	D0,_Army
	MOVE.L	D4,D0
	BRA.S	L09F0
;
L09EE:
	ADDQ.W	#1,D4
	BRA	L09ED
;
L09EF:
	MOVE.L	D7,D0
	ADDI.W	#$A0,D0
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	CLR.W	-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_PutPixel
	MOVEQ	#-1,D0
L09F0:
	MOVEM.L	-28(A6),D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_IsUnitAt:
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$A0,D0
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_GetPixel
	ADDQ.W	#6,sp
	MOVE.L	D0,D5
	BTST	#3,D5
	BEQ.S	L09F2
	MOVE.L	D5,D0
	ANDI.W	#7,D0
	BRA.S	L09F3
;
L09F2:
	MOVEQ	#-1,D0
L09F3:
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_PutUnitAt
	LINK	A6,#-2
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	18(sp),D7
	MOVE.W	20(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$A0,D0
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,14(sp)
	JSR	_GetPixel
	ANDI.W	#7,D0
	ADDQ.W	#8,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	18(sp),-(sp)
	JSR	_PutPixel
	MOVEM.L	-10(A6),D6-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
	LINK	A6,#-2
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	18(sp),D7
	MOVE.W	20(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$A0,D0
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,14(sp)
	JSR	_GetPixel
	ANDI.W	#7,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	18(sp),-(sp)
	JSR	_PutPixel
	MOVEM.L	-10(A6),D6-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_RRat:
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	BSR	_Special
	ADDQ.W	#4,sp
	ANDI.W	#8,D0
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_Special
	LINK	A6,#-2
	MOVEM.L	D6-D7/D2,-(sp)
	MOVE.W	22(sp),D7
	MOVE.W	24(sp),D6
	MOVE.L	D6,D0
	ADDI.W	#$64,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_GetPixel
	MOVE.L	D6,D1
	ADDI.W	#$96,D1
	MOVE.W	D1,(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#2,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,22(sp)
	JSR	_GetPixel
	LEA	10(sp),sp
	ASL.W	#4,D0
	MOVE.W	12(sp),D1
	ADD.W	D0,D1
	MOVE.L	D1,D0
	MOVEM.L	(sp)+,D6-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_Special2:
	LINK	A6,#-2
	MOVEM.L	D6-D7/D2-D3,-(sp)
	MOVE.W	26(sp),D7
	MOVE.W	28(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$50,D0
	MOVE.L	D6,D1
	ADDI.W	#$64,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D2
	MOVE.W	D2,-(sp)
	JSR	_GetPixel
	MOVE.L	D7,D1
	ADDI.W	#$50,D1
	MOVE.L	D6,D2
	ADDI.W	#$96,D2
	MOVE.W	D2,(sp)
	MOVE.W	D1,-(sp)
	MOVEQ	#2,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D0,26(sp)
	JSR	_GetPixel
	LEA	10(sp),sp
	ASL.W	#4,D0
	MOVE.W	16(sp),D1
	ADD.W	D0,D1
	MOVE.L	D1,D0
	MOVEM.L	(sp)+,D6-D7/D2-D3
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_SynchSpecial:
	LINK	A6,#-4
	MOVEM.L	D6-D7/D2,-(sp)
	MOVE.W	24(sp),D7
	MOVE.W	26(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$50,D0
	MOVE.L	D6,D1
	ADDI.W	#$64,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#2,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,18(sp)
	MOVE.W	D1,20(sp)
	JSR	_GetPixel
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	22(sp),-(sp)
	MOVE.W	22(sp),-(sp)
	JSR	_PutPixel
	MOVE.L	D7,D0
	ADDI.W	#$50,D0
	MOVE.L	D6,D1
	ADDI.W	#$96,D1
	MOVE.W	D1,(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#2,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,28(sp)
	MOVE.W	D1,30(sp)
	JSR	_GetPixel
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	32(sp),-(sp)
	MOVE.W	32(sp),-(sp)
	JSR	_PutPixel
	MOVEM.L	-16(A6),D6-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_PutSpecial:
	LINK	A6,#-2
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	22(sp),D7
	MOVE.W	24(sp),D6
	MOVE.W	26(sp),D5
	TST.W	D7
	BEQ.S	L09FB
	MOVEQ	#$10,D0
	CMP.W	D0,D7
	BGE.S	L09FA
	MOVE.L	D5,D0
	ADDI.W	#$64,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,18(sp)
	JSR	_GetPixel
	OR.W	D7,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	20(sp),-(sp)
	MOVE.W	D6,-(sp)
	JSR	_PutPixel
	LEA	12(sp),sp
	BRA.S	L09FC
;
L09FA:
	MOVE.L	D5,D0
	ADDI.W	#$96,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,18(sp)
	JSR	_GetPixel
	MOVE.L	D7,D1
	ASR.W	#4,D1
	OR.W	D1,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	20(sp),-(sp)
	MOVE.W	D6,-(sp)
	JSR	_PutPixel
	LEA	12(sp),sp
	BRA.S	L09FC
;
L09FB:
	MOVE.L	D5,D0
	ADDI.W	#$64,D0
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	CLR.W	-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_PutPixel
	MOVE.L	D5,D0
	ADDI.W	#$96,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	CLR.W	-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_PutPixel
	LEA	14(sp),sp
L09FC:
	MOVE.W	_MyTurn,D0
	CMP.W	_Player,D0
	BNE.S	L09FD
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	BSR	_SynchSpecial
	ADDQ.W	#4,sp
L09FD:
	MOVEM.L	(sp)+,D5-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_DelSpecial:
	LINK	A6,#-2
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	22(sp),D7
	MOVE.W	24(sp),D6
	MOVE.W	26(sp),D5
	MOVE.L	D7,D0
	ANDI.W	#$F,D0
	BEQ.S	L09FF
	MOVE.L	D5,D0
	ADDI.W	#$64,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,18(sp)
	JSR	_GetPixel
	MOVE.L	D7,D1
	NOT.W	D1
	AND.W	D1,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	20(sp),-(sp)
	MOVE.W	D6,-(sp)
	JSR	_PutPixel
	LEA	12(sp),sp
L09FF:
	MOVE.L	D7,D0
	ANDI.W	#$F0,D0
	BEQ.S	L0A00
	MOVE.L	D5,D0
	ADDI.W	#$96,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,18(sp)
	JSR	_GetPixel
	MOVE.L	D7,D1
	ASR.W	#4,D1
	NOT.W	D1
	AND.W	D1,D0
	MOVEQ	#2,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	20(sp),-(sp)
	MOVE.W	D6,-(sp)
	JSR	_PutPixel
	LEA	12(sp),sp
L0A00:
	MOVEM.L	(sp)+,D5-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_CityAt:
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
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RA.S	L0A0A
;
L0A08:
	TST.W	D7
	BPL.S	L0A09
	MOVEQ	#-1,D0
	BRA.S	L0A0A
;
L0A09:
	MOVEQ	#0,D0
L0A0A:
	MOVE.L	(sp)+,D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_GoodyAt:
	LINK	A6,#-2
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	10(A6),D7
	MOVE.W	12(A6),D6
	MOVEQ	#1,D0
	CMP.W	D0,D6
	BLE.S	L0A0C
	MOVEQ	#$30,D1
	CMP.W	D1,D6
	BLT.S	L0A0D
L0A0C:
	MOVEQ	#0,D0
	BRA.S	L0A0F
;
L0A0D:
	MOVE.L	D7,D0
	ASR.W	#2,D0
	MULS	#$D,D0
	MOVE.W	_rseed,D1
	ADD.W	D0,D1
	MOVE.L	D6,D0
	ASR.W	#2,D0
	MULS	#$B,D0
	ADD.W	D0,D1
	MOVE.L	D1,D5
	MOVE.L	D7,D0
	ANDI.W	#3,D0
	ASL.W	#2,D0
	MOVE.L	D6,D1
	ANDI.W	#3,D1
	ADD.W	D1,D0
	MOVE.L	D5,D1
	ANDI.W	#$F,D1
	CMP.W	D1,D0
	BEQ.S	L0A0E
	MOVEQ	#0,D0
	BRA.S	L0A0F
;
L0A0E:
	MOVEQ	#1,D0
L0A0F:
	MOVEM.L	(sp)+,D5-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_SurpriseAt:
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVE.W	24(sp),D5
	MOVEQ	#$A,D0
	CMP.W	D0,D7
	BEQ.S	L0A11
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$32,D1
	JSR	__CXM22
	LEA	_seen,A0
	ADDA.L	D0,A0
	ADDA.W	D5,A0
	BTST	#0,(A0)
	BNE.S	L0A11
	MOVEQ	#1,D0
	CMP.W	D0,D5
	BLE.S	L0A11
	MOVEQ	#$30,D0
	CMP.W	D0,D5
	BLT.S	L0A12
L0A11:
	MOVEQ	#0,D0
	BRA.S	L0A15
;
L0A12:
	MOVE.L	D6,D0
	ASR.W	#2,D0
	MULS	#$D,D0
	MOVE.W	_rseed,D1
	ADD.W	D0,D1
	MOVE.L	D5,D0
	ASR.W	#2,D0
	MULS	#$B,D0
	ADD.W	D0,D1
	MOVE.L	D1,D4
	ADDQ.W	#8,D4
	MOVE.L	D6,D0
	ANDI.W	#3,D0
	ASL.W	#2,D0
	MOVE.L	D5,D1
	ANDI.W	#3,D1
	ADD.W	D1,D0
	MOVE.L	D4,D1
	ANDI.W	#$1F,D1
	CMP.W	D1,D0
	BEQ.S	L0A13
	MOVEQ	#0,D0
	BRA.S	L0A15
;
L0A13:
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	BSR	_Special
	ADDQ.W	#4,sp
	BTST	#0,D0
	BEQ.S	L0A14
	MOVEQ	#0,D0
	BRA.S	L0A15
;
L0A14:
	MOVEQ	#1,D0
L0A15:
	MOVEM.L	(sp)+,D4-D7
	RTS
;
;----------------------------------------------------------------------------
;
	MOVEM.L	D6-D7/D2,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.L	D7,D0
	ADDI.W	#$50,D0
	MOVE.L	D6,D1
	ADDI.W	#$32,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D2
	MOVE.W	D2,-(sp)
	JSR	_GetPixel
	ADDQ.W	#6,sp
	MOVEM.L	(sp)+,D6-D7/D2
	RTS
;
;----------------------------------------------------------------------------
;
_GetRegion
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.L	D6,D0
	ADDI.W	#$32,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_GetPixel
	ADDQ.W	#6,sp
	MOVE.L	D0,D5
	MOVE.L	D5,D0
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_RegionSize:
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(sp),D7
	MOVE.W	14(sp),D6
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	BSR	_TerAt
	ADDQ.W	#4,sp
	MOVEQ	#$A,D1
	CMP.W	D1,D0
	BEQ.S	L0A18
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	BSR.S	_GetRegion
	ADDQ.W	#4,sp
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Regions,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	BRA.S	L0A19
;
L0A18:
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	BSR.S	_GetRegion
	ADDQ.W	#4,sp
	EXT.L	D0
	ADD.L	D0,D0
	LEA	L214D,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
L0A19:
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;----------------------------------------------------------------------------
;
_MasterMenu:
	MOVEM.L	D5-D7/D2,-(sp)
	MOVE.W	20(sp),D7
	MOVE.W	22(sp),D6
	MOVE.W	24(sp),D5
	MOVEQ	#-1,D0
	MOVE.W	D0,_TheOrder
	MOVEQ	#0,D1
	MOVE.W	D1,_NoHi
	MOVE.W	D1,_DefaultItem
	MOVE.W	D1,L2064
	CMP.W	D0,D5
	BNE.S	L0A1B
	MOVE.W	mouse_X,D0
	EXT.L	D0
	DIVS	#$3C,D0
	MOVEQ	#4,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.L	D0,D5
L0A1B:
	JSR	_hidemouse
	JSR	_SaveScreen
	JSR	_showmouse
	MOVE.L	D5,D0
	CMPI.W	#5,D0
	BCC.S	L0A1E
	ADD.W	D0,D0
	MOVE.W	MasterMenu_t(PC,D0.W),D0
	JMP	MasterMenu_t+2(PC,D0.W)
;
;----------------------------------------------------------------------------
;
MasterMenu_t:
L0A1C:
	dc.w	mm_GameMenu-MasterMenu_t-2
L0A1D:
	dc.w	mm_OrdersMenu-MasterMenu_t-2,mm_AdviceMenu-MasterMenu_t-2
	dc.w	mm_WorldMenu-MasterMenu_t-2,mm_BlurbMenu-MasterMenu_t-2
;
;----------------------------------------------------------------------------
;
mm_GameMenu:
	JSR	_GameMenu
	BRA.S	L0A1E
;
mm_OrdersMenu:
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_OrdersMenu
	ADDQ.W	#4,sp
	BRA.S	L0A1E
;
mm_AdviceMenu:
	JSR	_AdviceMenu
	BRA.S	L0A1E
;
mm_WorldMenu:
	JSR	_WorldMenu
	BRA.S	L0A1E
;
mm_BlurbMenu:
	JSR	_BlurbMenu1
L0A1E:
	JSR	_hidemouse
	MOVEQ	#1,D0
	CMP.W	L2064,D0
	BNE.S	L0A1F
	JSR	_ResetScreen
L0A1F:
	TST.W	L2064
	BNE.S	L0A20
	JSR	_RestoreScreen
L0A20:
	JSR	_showmouse
	MOVEM.L	(sp)+,D5-D7/D2
	RTS
;
;----------------------------------------------------------------------------
;
_GameMenu:
	LINK	A6,#-8
	MOVEM.L	A2/D6-D7/D2,-(sp)
	TST.W	_Rtime
	BNE.S	L0A22
	MOVE.W	#$10,_GreyOut	;Prevents saving with  _Rtime == 0
L0A22:
	PEA	game_menu_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	BTST	#0,_Launched
	BEQ.S	L0A23		;patch this branch to NOP to enable replay
	PEA	view_replay_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L0A23:
	MOVEQ	#8,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$10,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_PopMenu
	MOVE.L	D0,D7
	JSR	_DeBounce
	ADDQ.W	#8,sp
	MOVE.L	D7,D0
	CMPI.W	#$A,D0
	BCC	gm_pass
	ADD.W	D0,D0
	MOVE.W	GameMenu_t(PC,D0.W),D0
	JMP	GameMenu_t+2(PC,D0.W)
;
;----------------------------------------------------------------------------
;
GameMenu_t:
L0A24:
	dc.w	gm_TaxRate-GameMenu_t-2
L0A25:
	dc.w	gm_LuxuryRate-GameMenu_t-2,gm_FindCity-GameMenu_t-2
	dc.w	gm_Options-GameMenu_t-2,gm_SaveGame-GameMenu_t-2
	dc.w	gm_Revolution-GameMenu_t-2,gm_pass-GameMenu_t-2
	dc.w	gm_Retire-GameMenu_t-2,gm_Quit-GameMenu_t-2
	dc.w	gm_ViewReplay-GameMenu_t-2
;
;----------------------------------------------------------------------------
;
gm_Revolution:
	MOVE.W	#-2,_TheOrder
	BRA	gm_pass
;
gm_TaxRate:
	MOVE.W	#'=',_TheOrder
	BRA	gm_pass
;
gm_LuxuryRate:
	MOVE.W	#'-',_TheOrder
	BRA	gm_pass
;
gm_FindCity:
	MOVE.W	#'?',_TheOrder
	BRA	gm_pass
;
gm_Options:
	PEA	options_menu_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
L0A26:
	MOVE.W	_Options,_CheckMarks
	MOVEQ	#$10,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$18,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_PopMenu
	ADDQ.W	#8,sp
	MOVE.L	D0,D7
	MOVEQ	#-1,D0
	CMP.W	D0,D7
	BEQ.S	L0A27
	TST.W	_Help
	BNE.S	L0A27
	MOVEQ	#1,D1
	ASL.W	D7,D1
	EOR.W	D1,_Options
L0A27:
	CMP.W	D0,D7
	BEQ.S	L0A28
	MOVE.W	D7,_DefaultItem
L0A28:
	MOVEQ	#-1,D0
	CMP.W	D0,D7
	BNE.S	L0A26
	TST.W	_Help
	BNE.S	L0A26
	MOVEQ	#$10,D6
	AND.W	_Options,D6
	MOVEQ	#0,D6
	TST.W	D6
	BEQ.S	L0A29
	MOVEQ	#$19,D0
	MOVE.W	D0,-(sp)
	JSR	_DoSound
	ADDQ.W	#2,sp
	MOVEQ	#$25,D0
	MOVE.W	D0,-(sp)
	TRAP	#$E		;xbios	Vsync
	ADDQ.W	#2,sp
L0A29:
	MOVEQ	#$10,D0
	AND.W	_Options,D0
	MOVE.W	D0,_MUSIC_FLAG
	BRA.S	gm_pass
;
gm_SaveGame:
	MOVE.W	#'S',_TheOrder
	BRA.S	gm_pass
;
gm_Retire:
	MOVE.W	#2,_Quit
	MOVE.W	#$1000,_TheOrder
	BRA.S	gm_pass
;
gm_Quit:
	MOVE.W	#1,_Quit
	MOVE.W	#$1000,_TheOrder
	BRA.S	gm_pass
;
gm_ViewReplay:
	JSR	_Replay
gm_pass:
L0A2A:
	MOVEM.L	(sp)+,A2/D6-D7/D2
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_OrdersMenu:
	LINK	A6,#-$36
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVEQ	#-1,D0
	CMP.W	D0,D6
	BEQ	L0A3F
	CMPI.W	#$80,D6
	BEQ	L0A3F
	MOVEQ	#0,D4
	CLR.B	_XEB
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A1
	MOVEQ	#0,D1
	MOVE.B	1(A1),D1
	MOVE.L	D7,D2
	EXT.L	D2
	MOVE.L	D0,24(sp)
	MOVE.L	D2,D0
	MOVE.W	D1,-8(A6)
	MOVE.L	#$600,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	24(sp),D0
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	2(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	-8(A6),-(sp)
	MOVE.W	D0,-10(A6)
	JSR	_Special
	MOVE.W	-10(A6),(sp)
	MOVE.W	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M22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	24(sp),D0
	ADDA.L	D0,A1
	MOVEQ	#$17,D0
	CMP.B	3(A1),D0
	BNE.S	L0A3D
L0A3C:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	CMPI.B	#-1,10(A0)
	BEQ.S	L0A3D
	PEA	L1C1B
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	MOVEA.L	D4,A0
	ADDQ.W	#1,D4
	MOVE.L	A0,D0
	MOVE.B	#$75,-46(A6,D0.W)
L0A3D:
	PEA	L1C1C
	PEA	_XEB
	JSR	_strcat
	MOVEA.L	D4,A0
	ADDQ.W	#1,D4
	MOVE.L	A0,D0
	CLR.B	-46(A6,D0.W)
	MOVEA.L	D4,A0
	ADDQ.W	#1,D4
	MOVE.L	A0,D0
	MOVE.B	#$44,-46(A6,D0.W)
	MOVEQ	#8,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$48,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_PopMenu
	LEA	14(sp),sp
	MOVE.L	D0,D5
	TST.W	D5
	BMI.S	L0A3E
	CMP.W	D4,D5
	BGE.S	L0A3E
	MOVE.B	-46(A6,D5.W),D0
	EXT.W	D0
	MOVE.W	D0,_TheOrder
	BRA.S	L0A3F
;
L0A3E:
	MOVE.W	#-1,_TheOrder
L0A3F:
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_AdviceMenu:
	LINK	A6,#-4
	MOVE.L	D7,-(sp)
	PEA	advice_menu_1_s
	PEA	_XEB
	JSR	_strcpy
	PEA	advice_menu_2_s
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#8,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$70,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_PopMenu
	MOVE.L	D0,D7
	JSR	_hidemouse
	JSR	_RestoreScreen
	JSR	_showmouse
	LEA	22(sp),sp
	MOVE.W	#-1,L2064
	MOVE.L	D7,D0
	CMPI.W	#6,D0
	BCC	L0A44
	ADD.W	D0,D0
	MOVE.W	AdviceMenu_t(PC,D0.W),D0
	JMP	AdviceMenu_t+2(PC,D0.W)
;
;----------------------------------------------------------------------------
;
AdviceMenu_t:
L0A41:
	dc.w	am_CityReport-AdviceMenu_t-2
;
L0A42:
	dc.w	am_MilitaryReport-AdviceMenu_t-2,am_IntelligenceReport-AdviceMenu_t-2
	dc.w	am_AttitudeReport-AdviceMenu_t-2,am_TradeReport-AdviceMenu_t-2
	dc.w	am_ScienceReport-AdviceMenu_t-2
;
;----------------------------------------------------------------------------
;
am_TradeReport:
	MOVE.W	_Player,-(sp)
	JSR	_Financial
	ADDQ.W	#2,sp
	BRA.S	L0A44
;
am_MilitaryReport:
	TST.W	_debug
	BEQ.S	L0A43
	MOVE.W	_Player,-(sp)
	JSR	_GameStatus
	ADDQ.W	#2,sp
	BRA.S	L0A44
;
L0A43:
	MOVE.W	_Player,-(sp)
	JSR	_MrMilitary
	ADDQ.W	#2,sp
	BRA.S	L0A44
;
am_IntelligenceReport:
	MOVE.W	_Player,-(sp)
	JSR	_Intelligence
	ADDQ.W	#2,sp
	BRA.S	L0A44
;
am_AttitudeReport:
	MOVE.W	_Player,-(sp)
	JSR	_Attitude
	ADDQ.W	#2,sp
	BRA.S	L0A44
;
am_CityReport:
	MOVE.W	_Player,-(sp)
	JSR	_Cities
	ADDQ.W	#2,sp
	BRA.S	L0A44
;
am_ScienceReport:
	MOVE.W	_Player,-(sp)
	JSR	_MrScience
	ADDQ.W	#2,sp
L0A44:
	MOVE.L	(sp)+,D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_WorldMenu
	LINK	A6,#-4
	MOVE.L	D7,-(sp)
	MOVE.W	#-$200,D0
	AND.W	_Launched,D0
	BNE.S	L0A46
	MOVE.W	#$20,_GreyOut
L0A46:
	PEA	world_menu_1_s
	PEA	_XEB
	JSR	_strcpy
	PEA	world_menu_2_s
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#8,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$90,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_PopMenu
	MOVE.L	D0,D7
	JSR	_hidemouse
	JSR	_RestoreScreen
	JSR	_showmouse
	LEA	22(sp),sp
	MOVE.W	#-1,L2064
	MOVE.L	D7,D0
	CMPI.W	#6,D0
	BCC.S	L0A49
	ADD.W	D0,D0
	MOVE.W	WorldMenu_t(PC,D0.W),D0
	JMP	WorldMenu_t+2(PC,D0.W)
;
;----------------------------------------------------------------------------
;
WorldMenu_t:
L0A47:
	dc.w	wm_Wonders-WorldMenu_t-2
L0A48:
	dc.w	wm_Top5-WorldMenu_t-2,wm_CivScore-WorldMenu_t-2
	dc.w	wm_GameMap-WorldMenu_t-2,wm_Demographics-WorldMenu_t-2
	dc.w	wm_SpaceShips-WorldMenu_t-2
;
;----------------------------------------------------------------------------
;
wm_Wonders:
	JSR	_TheWonders
	BRA.S	L0A49
;
wm_Demographics:
	MOVE.W	_Player,-(sp)
	JSR	_Demographics
	ADDQ.W	#2,sp
	BRA.S	L0A49
;
wm_CivScore:
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	_Player,-(sp)
	JSR	_FinalScore
	ADDQ.W	#4,sp
	BRA.S	L0A49
;
wm_Top5:
	JSR	_Top5
	BRA.S	L0A49
;
wm_GameMap:
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	JSR	_GameMap
	ADDQ.W	#2,sp
	BRA.S	L0A49
;
wm_SpaceShips:
	JSR	_SpaceShips
L0A49:
	MOVE.L	(sp)+,D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_BlurbMenu1:
	MOVE.L	D7,-(sp)
	PEA	blurb_menu_s
	PEA	_XEB
	JSR	_strcpy
	PEA	L1C22
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#8,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$B6,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_PopMenu
	LEA	22(sp),sp
	MOVE.L	D0,D7
	MOVEQ	#-1,D0
	CMP.W	D0,D7
	BEQ.S	L0A4B
	MOVE.L	D7,D0
	SUBQ.W	#1,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	JSR	_BlurbMenu
	ADDQ.W	#4,sp
	MOVE.W	#-1,L2064
	BRA.S	L0A4C
;
L0A4B:
	MOVE.W	#1,L2064
L0A4C:
	MOVE.L	(sp)+,D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_PopMenu:
	LINK	A6,#0
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(A6),D7
	MOVE.W	14(A6),D6
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.L	8(A6),-(sp)
	JSR	_xMenu
	MOVEM.L	-8(A6),D6-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Menu:
	LINK	A6,#0
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	12(A6),D7
	MOVE.W	14(A6),D6
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.L	8(A6),-(sp)
	JSR	_xMenu
	MOVEM.L	-8(A6),D6-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_xMenu:
	LINK	A6,#-$12
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	12(A6),D7
	MOVE.W	14(A6),D6
	MOVE.W	16(A6),D5
	TST.W	D5
	BEQ.S	L0A50
	JSR	_DeBounce
L0A50:
	MOVEQ	#-1,D0
	MOVEQ	#0,D1
	MOVE.W	D1,_UsedMouse
	MOVE.W	D1,_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	MOVE.L	D6,D2
	ADD.W	D1,D2
	ADDQ.W	#4,D2
	MOVE.W	_maxline,D1
	ADDQ.W	#5,D1
	TST.W	_Help
	BEQ.S	L0A70
	MOVEQ	#$B,D3
	BRA.S	L0A71
;
L0A70:
	MOVE.W	_FOREGD,D3
L0A71:
	MOVE.W	D3,-(sp)
	MOVEQ	#$B,D4
	MOVE.W	D4,-(sp)
	MOVE.W	-14(A6),-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ChangeColor
	LEA	16(sp),sp
L0A72:
	MOVEQ	#$14,D0
	JSR	_WaitTicks
	JSR	_showmouse
	BRA.S	L0A74
;
L0A73:
	MOVEQ	#0,D0
	MOVE.W	D0,_Help
L0A74:
	MOVEQ	#-1,D0
	MOVE.W	D0,_MSource
	MOVE.W	D0,_DefaultItem
	MOVEQ	#0,D0
	MOVE.W	D0,_HelpAvl
	MOVE.W	D0,_NoHi
	MOVE.W	D0,_GreyOut
	MOVE.W	D0,_CheckMarks
	MOVE.W	-4(A6),D0
L0A75:
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_MenuWindow:
	LINK	A6,#-$60
	MOVEM.L	A2-A3/D2-D7,-(sp)
	MOVE.W	12(A6),D7
	MOVE.W	14(A6),D6
	MOVE.W	16(A6),D5
	CLR.W	L2074
	MOVEQ	#1,D0
	CMP.W	_firsttime,D0
	BNE	L0A8F
	MOVEA.L	_Rp1,A0
	MOVE.W	16(A0),-(sp)
	JSR	_FontHeight
	ADDQ.W	#2,sp
	MOVE.W	D0,_FONTY
	MOVEQ	#9,D1
	CMP.W	D1,D0
	BNE.S	L0A77
	SUBQ.W	#1,_FONTY
L0A77:
	MOVEQ	#-1,D0
	CMP.W	_KingMood,D0
	BEQ.S	L0A78
	MOVE.W	#8,_FONTY
L0A78:
	CLR.W	-84(A6)
L0A79:
	MOVE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)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_Line
	MOVE.L	D4,D0
	ADD.W	D6,D0
	MOVE.W	16(A6),(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Line
	MOVEM.L	-16(A6),D4-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Box2:
	LINK	A6,#0
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVE.L	D5,D0
	ADD.W	D7,D0
	MOVE.W	18(A6),-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Line
	MOVE.L	D6,D0
	ADD.W	D4,D0
	MOVE.L	D5,D1
	ADD.W	D7,D1
	MOVE.W	16(A6),(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Line
	MOVE.L	D7,D0
	ADD.W	D5,D0
	MOVE.L	D4,D1
	ADD.W	D6,D1
	MOVE.W	18(A6),(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_Line
	MOVE.L	D6,D0
	ADDQ.W	#1,D0
	MOVE.L	D6,D1
	ADD.W	D4,D1
	MOVE.W	16(A6),(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Line
	MOVEM.L	-16(A6),D4-D7
	UNLK	A6
	RTS
;
;----------------------------------------------------------------------------
;
_GetCleanKey
	MOVE.L	D7,-(sp)
	JSR	_GetKey
	MOVE.L	D0,D7
	MO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	L0ABC
;
L0AB4:
	MOVE.W	#$4939,D7
	BRA.S	L0ABC
;
L0AB5:
	MOVE.W	#$4D36,D7
	BRA.S	L0ABC
;
L0AB6:
	MOVE.W	#$5133,D7
	BRA.S	L0ABC
;
L0AB7:
	MOVE.W	#$5032,D7
	BRA.S	L0ABC
;
L0AB8:
	MOVE.W	#$4F31,D7
	BRA.S	L0ABC
;
L0AB9:
	MOVE.W	#$4B34,D7
	BRA.S	L0ABC
;
L0ABA:
	MOVE.W	#$4737,D7
	BRA.S	L0ABC
;
L0ABB:
	MOVE.L	D7,D0
	ANDI.W	#$FF,D0
	BEQ.S	L0ABC
	MOVE.L	D0,D7
L0ABC:
	MOVE.L	D7,D0
	MOVE.L	(sp)+,D7
	RTS
;
;----------------------------------------------------------------------------
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
	RTS
;
;----------------------------------------------------------------------------
;
_seedme:
	CLR.L	-(sp)
	JSR	_time
	ADDQ.W	#4,sp
	ANDI.L	#$7FFF,D0
	MOVE.L	D0,_myseed
	CLR.L	-(sp)
	JSR	_time
	ANDI.L	#$7FFF,D0
	MOVE.W	D0,_rseed
	MOVE.W	D0,(sp)
	JSR	_srand
	ADDQ.W	#4,sp
	RTS
;
;----------------------------------------------------------------------------
;
_rnd:
	MOVE.L	D7,-(sp)
	MOVE.W	8(sp),D7
	JSR	_rand		;d0 = random word
	EXT.L	D0
	MOVE.L	D7,D1
	EXT.L	D1
	JSR	__CXM22		;d0 = arg * random_word
	ASR.L	#8,D0		;d0 = (arg * random_word) >> 8
	ASR.L	#7,D0		;d0 = (arg * random_word) >> 15
	MOVE.L	(sp)+,D7
	RTS
;
;----------------------------------------------------------------------------
;
_rand:
_rand_fix_1:			;;;patch to 'jmp nu__rand_fix_1'
	MOVE.L	_myseed,D0	;;;patching these 6 bytes
	MOVE.L	#$343FD,D1
	JSR	__CXM22
	ADDI.L	#$269EC3,D0
	MOVE.L	D0,_myseed
	SWAP	D0
	EXT.L	D0
	ANDI.L	#$7FFF,D0
	RTS
;
;----------------------------------------------------------------------------
;
_rng:		;short	_rng(short x,short lolim,short hilim) => enforce range 
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.W	20(sp),D5
	CMP.W	D6,D7
	BGE.S	L0AC1
	MOVE.L	D6,D7
L0AC1:
	CMP.W	D5,D7
	BLE.S	L0AC2
	MOVE.L	D5,D7
L0AC2:
	MOVE.L	D7,D0
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_DoSprite:
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVE.W	20(sp),D5
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_sprite,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ShowSprite2
	LEA	10(sp),sp
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;----------------------------------------------------------------------------
;
_FindCity:
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	MOVEQ	#0,D5
L0AC5:
	CMPI.W	#$80,D5
	BGE.S	L0AC7
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	CMPI.B	#-1,6(A1)
	BEQ.S	L0AC6
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	CMP.W	D7,D0
	BNE.S	L0AC6
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	5(A0),D0
	CMP.W	D6,D0
	BNE.S	L0AC6
	MOVE.L	D5,D0
	BRA.S	L0AC8
;
L0AC6:
	ADDQ.W	#1,D5
	BRA.S	L0AC5
;
L0AC7:
	MOVEQ	#-1,D0
L0AC8:
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_FindCloseCity
	LINK	A6,#-$A
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	#$3E7,D4
	MOVE.W	#-1,-6(A6)
	MOVEQ	#0,D5
L0ACA:
	CMPI.W	#$80,D5
	BGE.S	L0ACC
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	CMPI.B	#-1,6(A1)
	BEQ.S	L0ACB
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	4(A1),D0
	MOVE.L	D5,D1
	EXT.L	D1
	MOVE.W	D0,16(sp)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	5(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	20(sp),-(sp)
	MOVE.W	D7,-(sp)
	JSR	_mapdist
	ADDQ.W	#8,sp
	MOVE.W	D0,-8(A6)
	CMP.W	D4,D0
	BGE.S	L0ACB
	MOVE.L	D0,D4
	MOVE.W	D5,-6(A6)
L0ACB:
	ADDQ.W	#1,D5
	BRA.S	L0ACA
;
L0ACC:
	MOVE.W	D4,_CloseDist
	MOVE.W	-6(A6),D0
	MOVEM.L	(sp)+,D4-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_FindCloseUnit
	LINK	A6,#-$12
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VEQ	#$64,D0
	CMP.W	D0,D7
	BLT.S	L0AE2
	MOVE.L	D7,D0
	EXT.L	D0
	DIVS	#$64,D0
	MOVEQ	#$A,D1
	MOVE.W	D1,-(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1C35
	PEA	_XEB
	JSR	_strcat
	LEA	20(sp),sp
	MOVE.L	D7,D0
	EXT.L	D0
	DIVS	#$64,D0
	SWAP	D0
	MOVEQ	#$A,D1
	CMP.W	D1,D0
	BGE.S	L0AE2
	PEA	L1C36
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L0AE2:
	MOVE.L	D7,D0
	EXT.L	D0
	DIVS	#$64,D0
	SWAP	D0
	MOVEQ	#$A,D1
	MOVE.W	D1,-(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1C37
	PEA	_XEB
	JSR	_strcat
	LEA	20(sp),sp
	MOVE.L	(sp)+,D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Marble:
	LINK	A6,#-$A
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVE.W	D5,-10(A6)
	TST.W	_VGAMode
	BEQ.S	L0AE6
	MOVE.W	D6,-4(A6)
L0AE4:
	MOVEQ	#$10,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	D4,-(sp)
	BSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D7,-2(A6)
	MOVE.W	-10(A6),D5
	MOVE.W	D0,-8(A6)
L0AE5:
	MOVEQ	#$20,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	D5,-(sp)
	BSR	_rng
	MOVE.W	-4(A6),(sp)
	MOVE.W	-2(A6),-(sp)
	MOVE.L	_Rp1,-(sp)
	MOVE.W	-8(A6),-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#$78,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$120,D2
	MOVE.W	D2,-(sp)
	MOVE.L	_RpMap,-(sp)
	MOVE.W	D0,-6(A6)
	JSR	_RectCopy
	LEA	24(sp),sp
	MOVE.W	-6(A6),D0
	ADD.W	D0,-2(A6)
	SUB.W	D0,D5
	TST.W	D5
	BGT.S	L0AE5
	MOVE.W	-8(A6),D0
	ADD.W	D0,-4(A6)
	SUB.W	D0,D4
	TST.W	D4
	BGT.S	L0AE4
	BRA.S	L0AE7
;
L0AE6:
	MOVEQ	#7,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
L0AE7:
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
	LINK	A6,#-2
	UNLK	A6
	RTS
;
;
_MoveNeartoFar:
	MOVEM.L	A5/A3/D7,-(sp)
	MOVEA.L	16(sp),A5
	MOVEA.L	20(sp),A3
	MOVE.W	24(sp),D7
	MOVE.W	D7,-(sp)
	MOVE.L	A5,-(sp)
	MOVE.L	A3,-(sp)
	JSR	_memcpy
	LEA	10(sp),sp
	MOVEM.L	(sp)+,A5/A3/D7
	RTS
;
;NB: The routine above is identical, in every byte, to the one below.
;    They are both obviously redundant with a Motorola CPU.
;    2 args must be swapped for '_memcpy' to be called directly though.
;
_MoveFartoNear:
	MOVEM.L	A5/A3/D7,-(sp)
	MOVEA.L	16(sp),A5
	MOVEA.L	20(sp),A3
	MOVE.W	24(sp),D7
	MOVE.W	D7,-(sp)
	MOVE.L	A5,-(sp)
	MOVE.L	A3,-(sp)
	JSR	_memcpy
	LEA	10(sp),sp
	MOVEM.L	(sp)+,A5/A3/D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_freemem
	LINK	A6,#-2
	MOVEM.L	D6-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	D7,-(sp)
	JSR	_freesprite
	ADDQ.W	#2,sp
	MOVE.L	D0,D6
	MOVEQ	#-1,D0
	CMP.W	D0,D6
	BNE.S	L0AEB
	PEA	L1C38
	JSR	__writes
	ADDQ.W	#4,sp
	MOVE.W	D7,-(sp)
	PEA	L1C39
	JSR	__tinyprintf
	ADDQ.W	#6,sp
	MOVE.L	10(A6),-(sp)
	JSR	_printf
	ADDQ.W	#4,sp
L0AEB:
	MOVEM.L	(sp)+,D6-D7
	UNLK	A6
	RTS
;
;
	MOVE.L	D2,-(sp)
	PEA	L1C3A
	PEA	_XEB
	JSR	_strcpy
	JSR	_AvailSysMem
	MOVEQ	#$A,D1
	MOVE.W	D1,(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	CLR.W	(sp)
	MOVEQ	#3,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$A0,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_cPrint
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	LEA	34(sp),sp
	MOVE.L	(sp)+,D2
	RTS
;
;
_CycleSet:
	RTS
;
;
_CycleOn
	RTS
;
;
_CycleOff:
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_VGAdac:
	LINK	A6,#0
	UNLK	A6
	RTS
;
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_MoveTo:
	LINK	A6,#-$2E
	MOVEM.L	A2-A3/D5-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	M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-(sp)
	MOVE.W	D0,L207F
	JSR	_xrange
	MOVE.W	-54(A6),D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_MoveY,A0
	ADDA.L	D1,A0
	MOVE.W	-18(A6),D1
	ADD.W	(A0),D1
	ASL.W	#2,D1
	ADDQ.W	#1,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,L207F
	MOVE.W	D1,L2080
	JSR	_TerAt
	ADDQ.W	#6,sp
	MOVEQ	#$A,D2
	CMP.W	D2,D0
	SEQ	D1
	ANDI.W	#1,D1
	CMP.W	-58(A6),D1
	BEQ.S	L0B29
	ADDQ.W	#1,L207F
	MOVE.W	L2080,-(sp)
	MOVE.W	L207F,-(sp)
	JSR	_TerAt
	ADDQ.W	#4,sp
	MOVEQ	#$A,D2
	CMP.W	D2,D0
	SEQ	D1
	ANDI.W	#1,D1
	CMP.W	-58(A6),D1
	BEQ.S	L0B29
	ADDQ.W	#1,L2080
L0B29:
	MOVEQ	#-1,D0
	CMP.W	L207F,D0
	BNE.S	L0B2A
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	6(A1),D0
	MOVE.L	D7,D2
	EXT.L	D2
	MOVE.W	D0,L207F
	MOVE.L	D2,D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	7(A0),D0
	MOVE.W	D0,L2080
L0B2A:
	MOVE.W	-24(A6),D0
L0B2B:
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Find4
	LINK	A6,#-$14
	MOVEM.L	D5-D7/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	CMP.W	D5,D1
	BEQ.S	L0B34
	SUBQ.W	#1,-18(A6)
	MOVE.W	-20(A6),-(sp)
	MOVE.W	-18(A6),-(sp)
	JSR	_TerAt
	ADDQ.W	#4,sp
	MOVEQ	#$A,D2
	CMP.W	D2,D0
	SEQ	D1
	ANDI.W	#1,D1
	CMP.W	D5,D1
	BNE.S	L0B35
L0B34:
	MOVEQ	#$12,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	-20(A6),-(sp)
	MOVE.W	-18(A6),-(sp)
	JSR	_MoveDist
	LEA	12(sp),sp
	ADDQ.W	#1,D0
	BEQ.S	L0B35
	MOVE.W	-12(A6),-2(A6)
	MOVE.W	-6(A6),-4(A6)
L0B35:
	ADDQ.W	#1,-6(A6)
	BRA	L0B31
;
L0B36:
	MOVE.W	-4(A6),D0
	MOVEQ	#-1,D1
	CMP.W	D1,D0
	BEQ.S	L0B37
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_MoveX,A0
	ADDA.L	D0,A0
	MOVE.W	-14(A6),D0
	ADD.W	(A0),D0
	MOVE.W	-4(A6),D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_MoveY,A0
	ADDA.L	D1,A0
	MOVE.W	-16(A6),D1
	ADD.W	(A0),D1
	MOVE.W	D0,L207F
	MOVE.W	D1,L2080
	MOVEQ	#1,D0
	BRA.S	L0B38
;
L0B37:
	MOVEQ	#0,D0
L0B38:
	MOVEM.L	(sp)+,D5-D7/D2
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_CloseMove
	LINK	A6,#-$52
	MOVEM.L	A2/D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOV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E.S	L0B52
	MOVE.L	D7,D1
	EXT.L	D1
	MOVE.L	#$600,D0
	JSR	__CXM22
	LEA	_un,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.L	D6,D0
	MOVEQ	#$C,D1
	MULS	D1,D0
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	6(A1),D0
	MOVE.L	D7,D2
	EXT.L	D2
	MOVE.W	D0,L207F
	MOVE.L	D2,D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	7(A0),D0
	MOVE.W	D0,L2080
L0B52:
	MOVEQ	#-1,D0
L0B53:
	MOVEM.L	(sp)+,A2/D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_MoveDist:
	LINK	A6,#-2
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVE.L	D7,D0
	SUB.W	D5,D0
	MOVE.W	D0,-(sp)
	JSR	_abs
	ADDQ.W	#2,sp
	MOVEQ	#7,D1
	CMP.W	D1,D0
	BLE.S	L0B55
	MOVE.L	D6,D0
	SUB.W	D4,D0
	MOVE.W	D0,-(sp)
	JSR	_abs
	ADDQ.W	#2,sp
	MOVEQ	#7,D1
	CMP.W	D1,D0
	BLE.S	L0B55
	MOVEQ	#-1,D0
	BRA.S	L0B59
;
L0B55:
	MOVE.L	D7,D0
	MOVE.B	D0,L2145
	MOVE.L	D6,D0
	MOVE.B	D0,L2146
	TST.W	16(A6)
	BEQ.S	L0B56
	MOVEQ	#$10,D0
	BRA.S	L0B57
;
L0B56:
	MOVEQ	#1,D0
L0B57:
	MOVE.B	D0,L2147
	MOVE.W	D5,L207F
	MOVE.W	D4,L2080
	MOVE.W	18(A6),-(sp)
	MOVEQ	#$7F,D0
	MO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
	CMP.W	D7,D5
	BLE.S	L0B63
	MOVEA.L	A0,A1
	ADDA.W	D6,A1
	MOVEQ	#$20,D1
	CMP.B	(A1),D1
	BNE.S	L0B63
	LEA	L2129,A1
	ADDA.W	D6,A1
	CMP.B	(A1),D1
	BEQ.S	L0B63
	ADDA.W	D6,A0
	MOVE.B	D0,(A0)
	MOVEQ	#0,D5
L0B63:
	ADDQ.W	#1,D6
	BRA.S	L0B5F
;
L0B64:
	TST.W	D5
	BLE.S	L0B65
	PEA	L1C3B
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L0B65:
	MOVEM.L	(sp)+,A2/D5-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_BlockPrint:
	LINK	A6,#-$C
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	14(A6),D4
	MOVEQ	#0,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	16(A0),-(sp)
	MOVE.W	D0,-4(A6)
	MOVE.W	D0,-6(A6)
	MOVE.W	D0,-10(A6)
	JSR	_FontHeight
	ADDQ.W	#2,sp
	CLR.W	-2(A6)
	MOVE.W	D0,-12(A6)
L0B67:
	LEA	_XEB,A0
	MOVEA.L	A0,A1
L0B68:
	TST.B	(A1)+
	BNE.S	L0B68
	SUBQ.L	#1,A1
	SUBA.L	A0,A1
	MOVE.W	-2(A6),D0
	EXT.L	D0
	CMP.L	A1,D0
	BCC	L0B6E
	ADDA.W	-2(A6),A0
	MOVE.B	(A0),D0
	EXT.W	D0
	MOVE.W	D0,-(sp)
	MOVEA.L	_Rp1,A0
	MOVE.W	16(A0),-(sp)
	JSR	_CharWidth
	ADDQ.W	#4,sp
	ADD.W	D0,-4(A6)
	LEA	_XEB,A0
	MOVE.W	-2(A6),D0
	MOVEA.L	A0,A1
	ADDA.W	D0,A1
	MOVEQ	#$20,D1
	CMP.B	(A1),D1
	BEQ.S	L0B69
	MOVE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	#$C0,D5
	BGT.S	L0B6F
	LEA	_XEB,A0
	ADDA.W	-6(A6),A0
	MOVE.W	D4,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.L	A0,-(sp)
	JSR	_jPrint
	LEA	10(sp),sp
	ADD.W	-12(A6),D5
L0B6F:
	MOVE.L	D5,D0
	MOVEM.L	(sp)+,D4-D7/D2
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_ReadString:
	LINK	A6,#-$116
	MOVEM.L	A5/D5-D7,-(sp)
	MOVEQ	#0,D0
	MOVE.L	D0,D5
	MOVE.W	D0,-270(A6)
	MOVE.W	D0,-268(A6)
L0B71:
	MOVEA.L	12(A6),A0
L0B72:
	TST.B	(A0)+
	BNE.S	L0B72
	SUBQ.L	#1,A0
	SUBA.L	12(A6),A0
	MOVE.W	-270(A6),D0
	EXT.L	D0
	CMP.L	A0,D0
	BCC.S	L0B73
	MOVEA.L	12(A6),A0
	MOVE.W	-270(A6),D1
	MOVE.B	0(A0,D1.W),D0
	EXT.W	D0
	MULS	D1,D0
	ADD.W	D0,D5
	ADDQ.W	#1,-270(A6)
	BRA.S	L0B71
;
L0B73:
	ANDI.W	#$FF,D5
L0B74:
	PEA	L1C3C
	MOVE.L	8(A6),-(sp)
	JSR	_fopen
	MOVEA.L	D0,A5
	MOVE.L	D5,D0
	EXT.L	D0
	DIVS	#$20,D0
	MOVE.L	D5,D1
	ADD.W	D0,D1
	EXT.L	D1
	ADD.L	D1,D1
	CLR.W	(sp)
	MOVE.L	D1,-(sp)
	MOVE.L	A5,-(sp)
	JSR	_fseek
	MOVE.L	A5,(sp)
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	PEA	-272(A6)
	JSR	_fread2
	MOVE.L	A5,(sp)
	JSR	_fclose
	PEA	L1C3D
	MOVE.L	8(A6),-(sp)
	JSR	_fopen
	LEA	32(sp),sp
	MOVEA.L	D0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6)
	PEA	_XEB
	JSR	_strcat
	PEA	L1C41
	PEA	_XEB
	JSR	_strcat
	PEA	-259(A6)
	PEA	L1C42
	MOVE.L	A5,-(sp)
	JSR	_fscanf2
	LEA	28(sp),sp
	ADDQ.W	#1,D6
	MOVE.B	-259(A6),D0
	MOVEQ	#$2A,D1
	CMP.B	D1,D0
	BNE.S	L0B7A
	MOVEQ	#1,D7
	BRA.S	L0B7C
;
L0B7B:
	MOVEQ	#0,D7
L0B7C:
	MOVE.L	A5,-(sp)
	JSR	_fclose
	ADDQ.W	#4,sp
	TST.W	-268(A6)
	BNE.S	L0B7D
	TST.W	D7
	BEQ.S	L0B7D
	MOVEQ	#-1,D0
	CMP.W	-278(A6),D0
	BEQ.S	L0B7D
	PEA	L1C43
	MOVE.L	8(A6),-(sp)
	JSR	_fopen
	MOVEA.L	D0,A5
	MOVE.L	D5,D0
	EXT.L	D0
	DIVS	#$20,D0
	MOVE.L	D5,D1
	ADD.W	D0,D1
	EXT.L	D1
	ADD.L	D1,D1
	CLR.W	(sp)
	MOVE.L	D1,-(sp)
	MOVE.L	A5,-(sp)
	JSR	_fseek
	MOVE.L	A5,(sp)
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	PEA	-272(A6)
	JSR	_fwrite2
	MOVE.L	A5,(sp)
	JSR	_fclose
	LEA	24(sp),sp
L0B7D:
	TST.W	D7
	BEQ.S	L0B7E
	MOVE.L	D6,D0
	BRA.S	L0B7F
;
L0B7E:
	MOVEQ	#-1,D0
L0B7F:
	MOVEM.L	(sp)+,A5/D5-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_KingTalk:
	LINK	A6,#0
	MOVE.L	8(A6),-(sp)
	PEA	L1C54
	BSR	_ReadString
	JSR	_TextReplace
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	BSR	_BlockText
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Text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1.L),D0
	BEQ.S	L0B8C
	MOVEA.L	A5,A0
L0B8B:
	TST.B	(A0)+
	BNE.S	L0B8B
	SUBQ.L	#1,A0
	SUBA.L	A5,A0
	MOVE.L	A0,D0
	MOVE.B	#$2E,-2(A5,D0.L)
L0B8C:
	MOVEA.L	A5,A0
L0B8D:
	TST.B	(A0)+
	BNE.S	L0B8D
	SUBQ.L	#1,A0
	SUBA.L	A5,A0
	MOVE.L	A0,D0
	CLR.B	-1(A5,D0.L)
	BRA.S	L0B89
;
L0B8E:
	MOVEM.L	(sp)+,A5/D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Title
	LINK	A6,#-$4E
	MOVEM.L	D2-D7,-(sp)
	JSR	_AmigaInit
	MOVEQ	#1,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	D0,16(A0)
	MOVE.W	D0,_NDisk
	MOVEQ	#0,D1
	MOVE.W	D1,_pages
	MOVE.W	D0,_VGAMode
	MOVE.W	D1,_EGAMode
	JSR	_seedme
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#200,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#320,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
	TST.W	_VGAMode
	BNE.S	L0B90
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#200,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#320,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpEGA,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
L0B90:
	JSR	_OpenSprite
	PEA	L1C56
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	JSR	_LoadPicture
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$140,D1
	MOVE.W	D1,-(sp)
	MO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2:
	JSR	_DeBounce
	MOVE.W	#-1,_sMode
L0BD3:
	MOVEQ	#0,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	D0,(A0)
	MOVE.W	D0,-(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(sp)
	JSR	_RectumFill
	MOVE.W	D5,(sp)
	MOVEQ	#$40,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.L	_RpBack,-(sp)
	JSR	_ShowSprite2
	MOVEQ	#$14,D0
	MOVE.W	D0,(sp)
	MOVEQ	#1,D1
	MOVE.W	D1,-(sp)
	JSR	_FadePage
	MOVEQ	#0,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(sp)
	JSR	_RectCopy
	CLR.W	(sp)
	JSR	_ShowPage
	MOVEA.L	_Rp1,A0
	MOVE.W	#1,16(A0)
	MOVE.W	D5,(sp)
	JSR	_freemem
	MOVEM.L	-102(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_SpaceFlight
	LINK	A6,#-$24A
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#0,D0
	MOVEQ	#1,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-8(A6)
	JSR	_CheckForDisk
	PEA	L1C5B
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	JSR	_LoadPicture
	JSR	_OpenSprite
	LEA	10(sp),sp
	MOVEQ	#0,D6
L0BD5:
	MOVEQ	#$18,D0
	CMP.W	D0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,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	JSR	_CycleSet
	MOVEM.L	-610(A6),D2-D7
	UNLK	A6
	RTS
;
;
;----------------------------------------------------------------------------
;End of file:	CIV_2.S
;----------------------------------------------------------------------------
