;----------------------------------------------------------------------------
;File name:	CIV_3.S			Revision date:	1994.03.25
;Disassembler:	Anatsu Ronara		Disassembled:	1993.10.02
;----------------------------------------------------------------------------
;Remarks:
;
;This file contains a new patch (not the original crack) for the "Quiz",
;to ensure proper initialization of all game variables.
;
;NB: The "Quiz" will now occur, but all answers are accepted as correct.
;
;Another new patch allows up to 10 different save files instead of 4
;
;Some other patches are also suggested (seek for "patch" to find them).
;Many are for refs to difficulty titles that need to be patched
;to implement more levels.
;
;A large number of patches are needed to make '_KillKing' functional,
;so perhaps the routine should be replaced in toto instead.
;Several patch suggestions are included in that routine.
;----------------------------------------------------------------------------
	SECTION	TEXT
;----------------------------------------------------------------------------
_Archeologists:
	MOVEM.L	D2-D7,-(sp)
	JSR	_DeBounce
	JSR	_CycleOff
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	JSR	_CheckForDisk
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	JSR	_RectumFill
	MOVEQ	#$E,D0
	MOVE.W	D0,(sp)
	JSR	_DoSound
	MOVEQ	#1,D0
	MOVE.W	D0,(sp)
	PEA	L1C62
	JSR	_LoadPicMem
	MOVEQ	#1,D0
	MOVE.W	D0,(sp)
	CLR.W	-(sp)
	JSR	_CheckForDisk
	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
	MOVE.W	_Player,D0
	EXT.L	D0
	MOVEQ	#$E,D1
	JSR	__C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A,D0
	MOVE.W	D0,(sp)
	JSR	_DoSound
	MOVE.W	#$12C,D0
	JSR	_WaitTicks
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	JSR	_RectumFill
	JSR	_RestorePal
	LEA	16(sp),sp
	MOVEA.L	_Rp1,A0
	MOVE.W	#1,16(A0)
	MOVEM.L	(sp)+,D2-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Legend:
	LINK	A6,#-$C
	MOVEM.L	A2/D2-D7,-(sp)
	JSR	_hidemouse
	MOVE.W	_XMap,D6
	ADDQ.W	#7,D6
	MOVE.W	_YMap,D5
	ADDQ.W	#6,D5
	MOVEQ	#1,D7
L0BFC:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGT	L0BFF
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_MoveX,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	ADD.W	(A0),D0
	MOVE.W	D0,-(sp)
	JSR	_xrange
	MOVE.L	D0,D4
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_MoveY,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	ADD.W	(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-10(A6)
	JSR	_TerAt
	MOVE.W	D0,-12(A6)
	EXT.L	D0
	MOVEQ	#$13,D1
	JSR	__CXM22
	LEA	_tr,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcpy
	MOVE.W	-10(A6),(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	-12(A6),-(sp)
	JSR	_GoodyAt
	LEA	14(sp),sp
	TST.W	D0
	BEQ.S	L0BFD
	MOVE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3,-(sp)
	JSR	_LBox
	PEA	L1C68
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$18,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$58,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$20,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$30,D3
	MOVE.W	D3,-(sp)
	JSR	_LBox
	PEA	L1C69
	PEA	_XEB
	JSR	_strcpy
	MOVE.W	#$AA,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$58,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$80,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$28,D3
	MOVE.W	D3,-(sp)
	JSR	_LBox
	JSR	_showmouse
	JSR	_WaitForIt
	MOVEM.L	-40(A6),A2/D2-D7
	UNLK	A6
	RTS
;
;
_LBox:
	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	D4,D0
	ADDQ.W	#6,D0
	MOVEQ	#$F,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_Line
	PEA	L1C6A
	PEA	_XEB
	JSR	_strcat
	MOVE.W	#1,_NoWait
	MOVE.W	D4,(sp)
	MOVE.W	D5,-(sp)
	PEA	_XEB
	JSR	_Menu
	LEA	24(sp),sp
	MOVEM.L	(sp)+,D4-D7
	RTS
;
;
_GetCredit
	MOVE.L	A5,-(sp)
	MOVEA.L	8(sp),A5
	MOVE.L	A5,-(sp)
	PEA	L1C6B
	MOVE.L	_stream,-(sp)
	JSR	_fscanf2
	LEA	12(sp),sp
	MOVEA.L	(sp)+,A5
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_InitFame:
	LINK	A6,#-4
	MOVE.L	D7,-(sp)
	MOVEQ	#0,D7
L0C03:
	MOVEQ	#6,D0
	CMP.W	D0,D7
	BGE.S	L0C04
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22
	LEA	_Hall,A0
	ADDA.L	D0,A0
	MOVE.W	#-1,(A0)
	ADDQ.W	#1,D7
	BRA.S	L0C03
;
L0C04:
	MOVE.L	(sp)+,D7
	UNLK	A6
	RTS
;
;
_LoadFame:
	MOVE.L	D7,-(sp)
	BSR.S	_InitFame
	MOVE.W	#$80,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$102,D1
	MOVE.W	D1,-(sp)
	PEA	fame_dta_fn_1_s
new_fame_fix_1:
	JSR	_open		;patch to allow fame files in folder
	MOVE.L	D0,D7
	PEA	$114.w
	PEA	_XEB
	MOVE.W	D7,-(sp)
	JSR	_read
	MOVE.W	#$114,D0
	MOVE.W	D0,(sp)
	PEA	_Hall
	PEA	_XEB
	JSR	_MoveNeartoFar
	MOVE.W	D7,(sp)
old_fame_fix_1:
	JSR	_close		;patch to allow fame files in folder
	LEA	26(sp),sp
	MOVE.L	(sp)+,D7
	RTS
;
;
_SaveFame:
	MOVE.L	D7,-(sp)
	MOVE.W	#$80,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$302,D1
	MOVE.W	D1,-(sp)
	PEA	fame_dta_fn_2_s
new_fame_fix_2:
	JSR	_open		;patch to allow fame files in folder
	MOVE.L	D0,D7
	MOVE.W	#$114,D0
	MOVE.W	D0,(sp)
	PEA	_XEB
	PEA	_Hall
	JSR	_MoveFartoNear
	PEA	$114.w
	PEA	_XEB
	MOVE.W	D7,-(sp)
	JSR	_write
	MOVE.W	D7,(sp)
old_fame_fix_2:
	JSR	_close		;patch to allow fame files in folder
	LEA	26(sp),sp
	MOVE.L	(sp)+,D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_PrintFame
	LINK	A6,#-$20
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#$F,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$C8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EA	_Hall,A0
	ADDA.L	D0,A0
	MOVEQ	#$A,D0
	MOVE.W	D0,(sp)
	PEA	_ntmp
	MOVE.W	(A0),-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	LEA	36(sp),sp
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22
	LEA	_Hall,A0
	ADDA.L	D0,A0
	MOVE.W	2(A0),D0
famediff_fix_1:
;patch this by a jump to a fix routine to get more levels
;then return by jumping to L0C11
	CMPI.W	#5,D0
	BCC	L0C11
	ADD.W	D0,D0
	MOVE.W	fame_diff_t(PC,D0.W),D0
	JMP	fame_diff_t+2(PC,D0.W)
;
;
fame_diff_t:
L0C0F:
	dc.w	fame_chieftan-fame_diff_t-2
L0C10:
	dc.w	fame_warlord-fame_diff_t-2,fame_prince-fame_diff_t-2
	dc.w	fame_king-fame_diff_t-2,fame_emperor-fame_diff_t-2
;
;
fame_chieftan:
	PEA	fame_chieftan_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L0C11
;
fame_warlord:
	PEA	fame_warlord_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L0C11
;
fame_prince:
	PEA	fame_prince_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L0C11
;
fame_king:
	PEA	fame_king_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L0C11
;
fame_emperor:
	PEA	fame_emperor_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
famediff_fix_2:		;patch should jump here when done
L0C11:
	MOVE.L	D5,D0
	ADDI.W	#$C,D0
	MOVEQ	#7,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_jPrint
	ADDQ.W	#8,D4
	PEA	L1C86
	PEA	_XEB
	JSR	_strcpy
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.W	D0,(sp)
	MOVEQ	#$A,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$3C,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$BB,D3
	MOVE.W	D3,-(sp)
	MOVE.W	#$EC,D0
	MOVE.W	D0,-(sp)
	JSR	_Box
	LEA	18(sp),sp
L0C14:
	JSR	_WaitForIt
	MOVE.W	D0,-10(A6)
	MOVEQ	#-1,D1
	CMP.W	D1,D7
	BEQ.S	L0C16
	MOVEQ	#$63,D1
	CMP.W	D1,D0
	BEQ.S	L0C15
	MOVEQ	#$43,D1
	CMP.W	D1,D0
	BNE.S	L0C16
L0C15:
	MOVEQ	#1,D0
	BRA.S	L0C17
;
L0C16:
	MOVEQ	#0,D0
L0C17:
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_AddFame
	LINK	A6,#-$12
	MOVEM.L	A5/A2-A3/D6-D7,-(sp)
	CLR.W	-6(A6)
L0C19:
	MOVEQ	#0,D7		;d7 = 0,  index for first old score to check
addfame_check_loop:	;L0C1A:	;loop for checking all old fame blocks
	MOVEQ	#6,D0		;d0 = 6,  limit for check index
	CMP.W	D0,D7		;index >= limit ?
	BGE	addfame_error
	MOVE.W	_Diff,D0
	ADDQ.W	#2,D0
	MOVE.W	_FScore,D1
	MULS	D0,D1		;D1 = _FScore*(_Diff+2),  new rating
	MOVE.L	D7,D0		;d0 = index
	EXT.L	D0
	MOVE.W	D1,20(sp)	;temp store new rating
	MOVEQ	#$2E,D1		;D1 = 46,  fameblock_size
	JSR	__CXM22		;d0 = index * fameblock_size
	LEA	_Hall,A0	;a0 -> _Hall
	MOVEA.L	A0,A1		;a1 -> _Hall
	ADDA.L	D0,A1		;a1 -> _Hall[index*fameblock_size]
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = index * fameblock_size
	ADDA.L	D0,A0		;a1 -> _Hall[index*fameblock_size]
	MOVE.W	2(A0),D0	;d0 = old _Diff
	ADDQ.W	#2,D0		;d0 = old _Diff+2
	MOVE.W	(A1),D1		;d0 = old _FScore
	MULS	D0,D1		;d1 = old rating
	MOVE.W	20(sp),D0	;d0 = new rating
	CMP.W	D1,D0		;new > old ?
	BGT.S	L0C1B		;if so, exit loop to L0C1B
	MOVEQ	#5,D0		;d0 = 5, final check index
	CMP.W	D0,D7		;current index == final index ?
	BNE	addfame_check_next
L0C1B:				;here current index == scoring index unless too high
	MOVEQ	#5,D6		;d6 = 5,  top valid index
L0C1C:
	CMP.W	D7,D6		;score_index < top_index for copying
	BLE.S	L0C1D		;if not, goto L0C1D
	MOVE.L	D6,D0		;d0 = top_index
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d1 = top_index * fameblock_size
	LEA	_Hall,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1		;a1 -> _Hall[top_index*fameblock_size]
	MOVEA.L	A1,A5		;a5 -> _Hall[top_index*fameblock_size]
	MOVE.L	D6,D0
	SUBQ.W	#1,D0		;d0 = top_index-1
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = (top_index-1)*fameblock_size
	ADDA.L	D0,A0		;a0 -> _Hall[(top_index-1)*fameblock_size]
	MOVEA.L	A0,A3		;a3 -> _Hall[(top_index-1)*fameblock_size]
	MOVEQ	#$2E,D0
	MOVE.W	D0,-(sp)	;push 46,  _memcpy size
	MOVE.L	A3,-(sp)	;push a3,  _memcpy source
	MOVE.L	A5,-(sp)	;push a5,  _memcpy destination
	JSR	_memcpy		;call _memcpy
	LEA	10(sp),sp	;clean stack
	SUBQ.W	#1,D6		;lower top_index
	BRA.S	L0C1C		;loop back
;
L0C1D:
	MOVE.L	D7,D0		;d0 = score_index
	EXT.L	D0
	MOVEQ	#$2E,D1		;d1 = fameblock_size
	JSR	__CXM22		;d0 = score_index*fameblock_size
	LEA	_Hall,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1		;a1 -> _Hall[score_index*fameblock_size]
	MOVE.W	_FScore,(A1)	;Store new _FScore in scoring fameblock
	MOVE.W	_Player,D0
	EXT.L	D0
	MOVEQ	#$E,D1
	JSR	__CXM22		;d0 = nation_code*14
	LEA	_KingText,A1
	ADDA.L	D0,A1		;a1 -> _KingText[nation_code*14],  kingname string
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = score_index*fameblock_size
	ADDA.L	D0,A0		;a0 ->Hall[score_index*fameblock_size]
	LEA	14(A0),A2	;a2 ->Hall[score_index*fameblock_size + 14], kingname dest
	MOVEQ	#$E,D0
	MOVE.W	D0,-(sp)	;push 14,  kingname size limit
	MOVE.L	A2,-(sp)	;push a2,  kingname string destination
	MOVE.L	A1,-(sp)	;push a1,  kingname string source
	JSR	_MoveNeartoFar	;call _MoveNeartoFar to store kingname string
	MOVE.W	_Player,D0
	EXT.L	D0
	MOVEQ	#$C,D1
	JSR	__CXM22		;d0 = nation_code*12
	LEA	_ArmyTexts,A0
	ADDA.L	D0,A0		;a0 -> _ArmyTexts[nation_code*12],  nationality string
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = score_index*fameblock_size
	LEA	_Hall,A1
	ADDA.L	D0,A1		;a1 -> _Hall[score_index*fameblock_size]
	LEA	30(A1),A2	;a2 -> _Hall[score_index*fameblock_size+30]
	MOVEQ	#16,D0
	MOVE.W	D0,(sp)		;restack 16,  nationality size limit
	MOVE.L	A2,-(sp)	;push a2,  nationality string destination
	MOVE.L	A0,-(sp)	;push a0,  nationality string source
	JSR	_MoveNeartoFar	;call _MoveNeartoFar to store nationality string
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = score_index*fameblock_size
	LEA	_Hall,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1		;a1 -> _Hall[score_index*fameblock_size]
	MOVE.W	_Diff,2(A1)	;store new _Diff in scoring fameblock
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = score_index*fameblock_size
	MOVEA.L	A0,A1
	ADDA.L	D0,A1		;a1 -> _Hall[score_index*fameblock_size]
	MOVE.W	_Schisms,4(A1)	;store _Schisms
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22		;d0 = score_index*fameblock_size
	MOVEA.L	A0,A1
	ADDA.L	D0,A1		;a1 -> _Hall[score_index*fameblock_size]
	MOVE.W	_FScore1,8(A1)	;store _Fscore1
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	_FScore2,10(A1)	;store _Fscore2
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	_Year,6(A1)	;store _Year
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$2E,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.W	_Player,(sp)	;restack nation_code
	MOVE.L	A0,38(sp)	;protect a0
	JSR	_PopSize	;call _PopSize
	MOVEA.L	38(sp),A0	;restore a0
	MOVE.W	D0,12(A0)	;store population
	MOVE.W	D7,(sp)		;restack score_index
	BSR	_PrintFame	;display fame
	LEA	18(sp),sp	;clean stack
	TST.W	D0
	BEQ.S	L0C1E
	BSR	_InitFame
	BRA	L0C19
;
L0C1E:
	MOVE.L	D7,D0
	BRA.S	addfame_exit
;
addfame_check_next:	;L0C1F:
	ADDQ.W	#1,D7
	BRA	addfame_check_loop
;
addfame_error:		;L0C20:
	MOVEQ	#-1,D0
addfame_exit:		;L0C21:
	MOVEM.L	(sp)+,A5/A2-A3/D6-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Famous:
	LINK	A6,#-$A
	MOVEM.L	D2-D7,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A0
	MOVE.W	(A0),D0
	CMP.W	D7,D0
	BNE.S	L0C3E
	MOVE.W	-30(A6),D0
	CMPI.W	#$125,D0
	BGE.S	L0C3D
	MOVE.L	D5,D1
	ADDI.W	#$18,D1
	MOVEQ	#$C,D2
	ADD.W	-32(A6),D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D1,-(sp)
	JSR	_DrawImprove
	ADDQ.W	#6,sp
L0C3D:
	MOVEQ	#$13,D0
	ADD.W	D0,-30(A6)
L0C3E:
	ADDQ.W	#1,D5
	BRA.S	L0C3C
;
L0C3F:
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	LEA	_ct,A0
	ADDA.L	D0,A0
	MOVE.B	11(A0),D0
	EXT.W	D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_armycolor,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),-(sp)
	MOVEQ	#$19,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$12F,D1
	MOVE.W	D1,-(sp)
	MOVE.W	-32(A6),-(sp)
	MOVEQ	#8,D2
	MOVE.W	D2,-(sp)
	JSR	_Box
	LEA	10(sp),sp
	MOVEQ	#$20,D0
	ADD.W	D0,-32(A6)
L0C40:
	ADDQ.W	#1,D6
	BRA	L0C3B
;
L0C41:
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_HelpMe:
	LINK	A6,#-$18
	MOVEM.L	D2-D3,-(sp)
	PEA	L1C96
	PEA	-24(A6)
	JSR	_strcpy
	MOVE.L	8(A6),(sp)
	JSR	_strupr
	MOVE.W	D0,(sp)
	PEA	-24(A6)
	JSR	_strcat
	CLR.B	_XEB
	PEA	-24(A6)
	PEA	L1C97
	JSR	_ReadString
	LEA	20(sp),sp
	TST.W	D0
	BEQ.S	L0C43
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	CLR.W	(sp)
	MOVE.W	#$C0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$A0,D1
	MOVE.W	D1,-(sp)
	PEA	-24(A6)
	JSR	_cPrint
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$20,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D1,-(sp)
	JSR	_BlockPrint
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	LEA	28(sp),sp
L0C43:
	CLR.W	_Help
	MOVEM.L	(sp)+,D2-D3
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_SettleHelp:
	LINK	A6,#-$16
	MOVEM.L	A2/D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	CMPI.W	#$80,D6
	BGE	L0C4E
	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,28(sp)
	MOVE.L	D2,D0
	MOVE.W	D1,32(sp)
	MOVE.L	#$600,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	28(sp),D0
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	2(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	34(sp),-(sp)
	JSR	_TerAt
	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$40,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$20,D3
	MOVE.W	D3,-(sp)
	JSR	_BlockPrint
	MOVEA.L	_Rp1,A0
	MOVE.W	#1,16(A0)
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	LEA	42(sp),sp
L0C52:
	MOVEM.L	(sp)+,A5/D7/D2-D4
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_InitData:
	LINK	A6,#-$14
	MOVEM.L	A2/D2-D7,-(sp)
	JSR	_hidemouse
	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
	JSR	_showmouse
	MOVEA.L	_Rp1,A0
	MOVE.W	#7,16(A0)
	MOVEQ	#0,D0
	MOVE.W	D0,_NoHi
	MOVE.W	D0,_DefaultItem
izdiff_fix:
	PEA	izdiff_menu_s	;patch ptr for longer menu
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$23,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$A0,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	LEA	34(sp),sp
	MOVE.W	D0,_Diff
	TST.W	_HasMouse
	BEQ.S	L0C54
	TST.W	_UsedMouse
	BEQ.S	L0C54
	JSR	_getmouse
	CMPI.W	#135,mouse_X
	BGE.S	L0C54
	MOVEQ	#-$C,D0
	ADD.W	mouse_Y,D0
	EXT.L	D0
	DIVS	#35,D0
	MOVEQ	#4,D1
	MOVE.W	D1,-(sp)
	CLR.W	-(sp)
	MOVE.W	D0,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D0,_Diff
L0C54:
	MOVEQ	#-1,D0
	CMP.W	_Diff,D0
	B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diff,D1
	MULS	#$23,D1
	ADDQ.W	#6,D1
	MOVEQ	#$14,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$86,D3
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	MOVEQ	#$2F,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$35,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(sp)
DiffPic_fix_3:
	JSR	_RectCopy
	CLR.W	(sp)
	MOVEQ	#$51,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$58,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$63,D2
	MOVE.W	D2,-(sp)
	JSR	_BlockPrint
	JSR	_showmouse
	JSR	_WaitForIt
	MOVEM.L	-48(A6),A2/D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_NewCiv:
	LINK	A6,#-$3C
	MOVEM.L	A5/A2-A3/D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	_Player,D0
	CMP.W	D7,D0
	BNE.S	L0C8F
	TST.W	_Rtime
	BNE	L0CC0
L0C8F:
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Funds,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Knowledge,A1
	ADDA.L	D0,A1
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_TechLevel,A2
	ADDA.L	D0,A2
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_HRank,A3
	ADDA.L	D0,A3
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_SpacePop,A5
	ADDA.L	D0,A5
	MOVEQ	#0,D0
	MOVE.W	D0,(A5)
	MOVE.W	D0,(A3)
	MOVE.W	D0,(A2)
	MOVE.W	D0,(A1)
	MOVE.W	D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,A0
	MOVEQ	#0,D0
	MOVE.B	2(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	22(sp),-(sp)
	CLR.W	-(sp)
	MOVE.W	D7,-(sp)
	JSR	_AddUnit
	PEA	L1CBF
	PEA	_XEB
	JSR	_strcat
	LEA	16(sp),sp
L0CF3:
	MOVEQ	#0,D5
L0CF4:
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	-74(A6),D1
	SUB.W	-72(A6,D0.L),D1
	CMP.W	D1,D5
	BGE.S	L0CF6
	TST.W	D5
	BEQ.S	L0CF5
	PEA	L1CC0
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L0CF5:
	CLR.W	-(sp)
	MOVE.W	D7,-(sp)
	JSR	_AddCivilized
	EXT.L	D0
	MOVEQ	#$16,D1
	JSR	__CXM22
	LEA	_cv,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	ADDQ.W	#1,D5
	BRA.S	L0CF4
;
L0CF6:
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	-74(A6),D1
	CMP.W	-72(A6,D0.L),D1
	BNE.S	L0CF8
	PEA	L1CC1
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	MOVEQ	#-1,D0
	CMP.W	-90(A6),D0
	BEQ.S	L0CF7
	MOVEQ	#1,D0
	ASL.W	D7,D0
	MOVE.W	-92(A6),D1
	AND.W	D0,D1
	TST.W	D1
	BEQ.S	L0CF8
L0CF7:
	MOVE.W	D7,-90(A6)
L0CF8:
	ADDQ.W	#1,D7
	BRA	L0CF2
;
L0CF9:
	MOVE.W	-90(A6),D0
	MOVEM.L	(sp)+,A2/D5-D7/D2
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_InitSprites
	LINK	A6,#-4
	MOVEM.L	D2-D7,-(sp)
	JSR	_OpenSprite
	PEA	L1CC2
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sp),sp
	MOVEQ	#0,D5
L0D22:
	MOVEQ	#$1C,D0
	CMP.W	D0,D5
	BGE.S	L0D23
	MOVE.L	D7,D0
	ASL.W	#5,D0
	ADD.W	D5,D0
	ADDI.W	#$40,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_sprite,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$14,D1
	DIVS	D1,D0
	SWAP	D0
	ASL.W	#4,D0
	ADDQ.W	#1,D0
	MOVE.L	D5,D1
	EXT.L	D1
	DIVS	#$14,D1
	ASL.W	#4,D1
	ADDI.W	#$81,D1
	MOVEQ	#$F,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D2,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#1,D3
	MOVE.W	D3,-(sp)
	MOVE.L	A0,34(sp)
	JSR	_BuildSprite
	LEA	10(sp),sp
	MOVEA.L	24(sp),A0
	MOVE.W	D0,(A0)
	ADDQ.W	#1,D5
	BRA.S	L0D22
;
L0D23:
	ADDQ.W	#1,D7
	BRA	L0D1F
;
L0D24:
	JSR	_CloseSprite
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_LoadAdvisors:
	LINK	A6,#-$12
	MOVEM.L	D2-D3,-(sp)
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	JSR	_CheckForDisk
	PEA	L1CC5
	PEA	-18(A6)
	JSR	_strcpy
	LEA	12(sp),sp
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Politics,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	(A1),D0
	BPL.S	L0D26
	ADDQ.W	#1,D0
L0D26:
	ASR.W	#1,D0
	ADDI.W	#$30,D0
	MOVE.B	D0,-14(A6)
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L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
	MOVE.W	#$B4,D1
L0D2C:
	CLR.W	-(sp)
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_cPrint
	LEA	10(sp),sp
	ADDQ.W	#1,D7
	BRA	L0D2A
;
L0D2D:
	MOVEA.L	_Rp1,A0
	MOVE.W	#1,16(A0)
	JSR	_showmouse
	JSR	_WaitForIt
	JSR	_RestoreBackgrou
L0D2E:
	MOVEM.L	(sp)+,D7/D2-D5
	RTS
;
;
_ClearSS
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Arrives,A0
	ADDA.L	D0,A0
	MOVE.W	#-1,(A0)
	MOVEQ	#0,D6
L0D30:
	MOVEQ	#$F,D0
	CMP.W	D0,D6
	BGE.S	L0D33
	MOVEQ	#0,D5
L0D31:
	MOVEQ	#$C,D0
	CMP.W	D0,D5
	BGE.S	L0D32
	MOVE.L	D7,D1
	EXT.L	D1
	MOVEQ	#$5A,D0
	ADD.L	D0,D0
	JSR	__CXM22
	LEA	_dock,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	MULS	#$C,D0
	ADDA.L	D0,A0
	ADDA.W	D5,A0
	MOVE.B	#-1,(A0)
	ADDQ.W	#1,D5
	BRA.S	L0D31
;
L0D32:
	ADDQ.W	#1,D6
	BRA.S	L0D30
;
L0D33:
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Econtact:
	LINK	A6,#-$38
	MOVEM.L	A2/D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_SynchSpecial
	MOVE.W	D5,(sp)
	MOVE.W	D6,-(sp)
	JSR	_ShowBlock
	ADDQ.W	#6,sp
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0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D0
	MOVE.W	D0,-(sp)
	JSR	_DoSound
	ADDQ.W	#2,sp
L0DAF:
	MOVEQ	#-2,D0
	CMP.W	_parlez,D0
	BNE.S	L0DB0
	MOVE.W	D7,-(sp)
	JSR	_Intell
	ADDQ.W	#2,sp
	BRA	L0DAD
;
L0DB0:
	MOVEQ	#-1,D0
	CMP.W	_parlez,D0
	BEQ	L0DB2
	JSR	_hidemouse
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#5,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_LoadKing
	JSR	_showmouse
	ADDQ.W	#6,sp
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	LEA	_KingFont,A1
	ADDA.W	(A0),A1
	MOVE.B	(A1),D0
	EXT.W	D0
	ADDQ.W	#8,D0
	MOVEM.W	D0,L20A1
	MOVEQ	#$A,D1
	CMP.W	D1,D0
	BNE.S	L0DB1
	MOVEQ	#3,D1
	MOVE.W	D1,L20A1
L0DB1:
	MOVEA.L	_Rp1,A0
	MOVE.W	L20A1,16(A0)
	MOVEQ	#1,D0
	MOVE.W	D0,_CourtMood
	MOVE.W	D0,_KingMood
	MOVE.W	#-1,L20A6
	CLR.W	_court
	MOVE.W	#$C,_Talking
	MOVE.W	D7,-(sp)
	JSR	_Greetings
	MOVE.W	#$8B,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$14,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_kMenu
	LEA	10(sp),sp
L0DB2:
	MOVEQ	#$1A,D0
	MOVE.W	D0,-(sp)
	JSR	_DoSound
	ADDQ.W	#2,sp
	MOVE.W	_parlez,D0
L0DB3:
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Greetings
	LINK	A6,#-2
	MOVE.L	D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.L	D7,D0
	EXT.L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	LEA	_units,A0
	ADDA.L	D0,A0
	TST.W	50(A0)
	BEQ.S	L0DBC
	PEA	L1D04
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L0DBC:
	MOVE.L	(sp)+,D7
	UNLK	A6
	RTS
;
;
_SignTreaty:
	MOVE.L	D7,-(sp)
	MOVE.W	8(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)
	MOVE.L	L1C52,-(sp)
	JSR	_strcpy
	MOVE.W	_Player,D0
	EXT.L	D0
	MOVEQ	#$B,D1
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	MOVE.L	_To,-(sp)
	JSR	_strcpy
	MOVE.W	#$C,_Talking
	CLR.B	_XEB
	PEA	L1D05
	JSR	_KingTalk
	MOVE.W	#$8B,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$14,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_kMenu
	LEA	22(sp),sp
	MOVE.L	(sp)+,D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_MakePeace
	LINK	A6,#-$A
	MOVEM.L	D5-D7/D2,-(sp)
	MOVE.W	34(sp),D7
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	_Player,-(sp)
	JSR	_AddTreaty
	ADDQ.W	#6,sp
	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)
	TST.W	_Diff
	BNE	L0DC1
	MOVEQ	#0,D6
L0DBF:
	CMPI.W	#$80,D6
	BGE	L0DC1
	MOVE.L	D7,D0
	EXT.L	D0
	MOVE.L	#$600,D1
	JSR	__CXM22
	LEA	_un,A0
	MOV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,sp
	TST.W	D0
	BEQ.S	L0DDE
	MOVEQ	#9,D0
	BRA.S	L0DDF
;
L0DDE:
	MOVEQ	#0,D0
L0DDF:
	MOVE.L	D0,D6
	MOVEQ	#3,D0
	AND.W	_Talking,D0
	BNE.S	L0DE0
	MOVEQ	#8,D6
L0DE0:
	SUBQ.W	#1,_Talking
	MOVEQ	#4,D0
	MOVE.W	D0,L209B
L0DE1:
	TST.W	L209B
	BEQ.S	L0DE2
	SUBQ.W	#1,L209B
L0DE2:
	MOVE.W	_court,-(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_ShowKing
	MOVEQ	#$A,D0
	JSR	_WaitTicks
	ADDQ.W	#6,sp
	MOVEM.L	(sp)+,D5-D7/D2
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_LoadKing:
	LINK	A6,#-$16
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	D7,L20A2
	MOVEQ	#0,D0
	MOVE.W	D0,L20A4
	BTST	#3,L1FB8
	BNE	L0DE4
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_CheckForDisk
	ADDQ.W	#4,sp
	TST.W	D0
	BNE	L0DE5
	MOVE.W	#1,L20A4
	JSR	_hidemouse
	MOVEQ	#$48,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$140,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$80,D2
	MOVE.W	D2,-(sp)
	CLR.W	-(sp)
	JSR	_Marble
	MOVEQ	#8,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$F,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$47,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$13F,D3
	MOVE.W	D3,-(sp)
	MOVE.W	#$80,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	JSR	_Box2
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$E,D1
	JSR	__CXM22
	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VE.L	_Rp1,-(sp)
	JSR	_RectCopy
	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	L20AC
	MOVE.W	#1,L20A3
L0DF4:
	MOVEM.L	-46(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_ReDrawKing:
	LINK	A6,#-$1E
	MOVEM.L	D7/D2,-(sp)
	MOVE.W	8(A6),D7
	TST.W	L20A4
	BNE	L0DF9
	JSR	_hidemouse
	PEA	L1D12
	PEA	-16(A6)
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Politics,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.W	(A1),D0
	BPL.S	L0DF6
	ADDQ.W	#1,D0
L0DF6:
	ASR.W	#1,D0
	ADDI.W	#$30,D0
	MOVE.B	D0,-12(A6)
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVEQ	#3,D0
	CMP.W	(A0),D0
	BNE.S	L0DF7
	MOVE.B	#$33,-12(A6)
	BRA.S	L0DF8
;
L0DF7:
	TST.W	L20A5
	BEQ.S	L0DF8
	MOVE.B	#$6D,-11(A6)
L0DF8:
	PEA	-16(A6)
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	JSR	_LoadPicture
	MOVE.W	#3,_stsprite
	MOVEA.L	_RpBack,A0
	MOVE.W	(A0),L2135
	MOVEQ	#0,D0
	MOVE.W	D0,L2133
	MOVE.W	D0,L2134
	MOVE.W	#$140,L2138
	MOVE.W	#$C8,L2139
	MOVE.W	D0,L2136
	MOVE.W	D0,L2137
	MOVE.W	D0,L213A
	MOVE.W	D0,L213C
	MOVE.W	#$C7,L213B
	MOVE.W	#$13F,L213D
	PEA	_stsprite
	JSR	_CopySprite
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	MOVE.W	D0,L20A8
	JSR	_RectumFill
	MOVE.W	#1,_Blurbbodge
	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
	JSR	_showmouse
L0DF9:
	MOVEM.L	-38(A6),D7/D2
	UNLK	A6
	RTS
;
;
_UnLoadKing:
	MOVEQ	#$1A,D0
	MOVE.W	D0,-(sp)
	JSR	_DoSound
	ADDQ.W	#2,sp
	CLR.W	L20A3
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_ShowKing:
	LINK	A6,#-$E
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.W	12(A6),D5
	TST.W	L20A4
	BNE	L0E04
	JSR	_hidemouse
	MOVE.L	D5,D0
	MOVE.W	L20A2,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_Politics,A0
	MOVEA.L	A0,A1
	ADDA.L	D1,A1
	MOVE.W	(A1),D1
	BPL.S	L0DFC
	ADDQ.W	#1,D1
L0DFC:
	ASR.W	#1,D1
	EXT.L	D1
	MOVEQ	#3,D2
	DIVS	D2,D1
	SWAP	D1
	MOVE.W	L20A2,D3
	EXT.L	D3
	ADD.L	D3,D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
	MOVE.W	#$4E,L2138
	MOVE.W	#$63,L2139
	MOVE.W	D6,L2136
	MOVE.W	D5,L2137
	MOVEQ	#0,D0
	MOVE.W	D0,L213A
	MOVE.W	D0,L213C
	MOVE.W	#$C7,L213B
	MOVE.W	#$13F,L213D
	PEA	_stsprite
	JSR	_CopySprite
	ADDQ.W	#4,sp
	MOVEM.L	(sp)+,D4-D7
	RTS
;
;
	MOVEA.L	_Rp1,A0
	CLR.W	(A0)
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_BuildMap:
	LINK	A6,#-$E
	MOVEM.L	D2-D7,-(sp)
	MOVEQ	#1,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	D0,(A0)
	CLR.W	_WorldDone
	TST.W	_Earth
	BEQ.S	L0E09
	MOVE.W	D0,-(sp)
	PEA	L1D17
	JSR	_LoadPicGMem
	ADDQ.W	#6,sp
	BRA	L0E39
;
L0E09:
	JSR	_MapMessage
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
L0E0A:
	JSR	_Elevate
	JSR	_MapMessage
	MOVE.W	_World,D0
	ASL.W	#3,D0
	ADDI.W	#$10,D0
	MULS	#$28,D0
	MOVE.W	_pixels,D1
	CMP.W	D0,D1
	BLT.S	L0E0A
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$31,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$4F,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_Box
	CLR.W	(sp)
	MOVEQ	#$2F,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$4D,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#1,D2
	MOVE.W	D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#$B4,D0
	JSR	_WaitTicks
L0EED:
	MOVE.L	L20AD,-(sp)
	JSR	_fclose
	MOVEQ	#$1A,D0
	MOVE.W	D0,(sp)
	JSR	_DoSound
	ADDQ.W	#4,sp
	MOVE.W	#2,L1D19
L0EEE:
	CLR.W	-(sp)
	JSR	_ShowPage
	MOVEA.L	_Rp1,A0
	MOVE.W	#1,(A0)
	MOVEQ	#2,D1
	CMP.W	L1D19,D1
	SNE	D0
	ANDI.W	#1,D0
L0EEF:
	MOVEM.L	-46(A6),D6-D7/D2-D3
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_GlobalWarming
	LINK	A6,#-$A
	MOVEM.L	D4-D7,-(sp)
	MOVE.W	8(A6),D7
	PEA	global_warming_s
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#-1,D0
	MOVE.W	D0,(sp)
	JSR	_NewsPaper
	ADDQ.W	#8,sp
	MOVEQ	#0,D6
L0EF1:
	MOVEQ	#$50,D0
	CMP.W	D0,D6
	BGE	L0EFD
	MOVEQ	#0,D5
L0EF2:
	MOVEQ	#$32,D0
	CMP.W	D0,D5
	BGE	L0EFC
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	JSR	_TerAt
	ADDQ.W	#4,sp
	MOVE.L	D0,D4
	MOVEQ	#3,D0
	CMP.W	D0,D4
	BGT	L0EFB
	CLR.W	-8(A6)
	MOVE.W	#1,-10(A6)
L0EF3:
	MOVE.W	-10(A6),D0
	MOVEQ	#8,D1
	CMP.W	D1,D0
	BGT.S	L0EF5
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_MoveX,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	ADD.W	(A0),D0
	MOVE.W	-10(A6),D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_MoveY,A0
	ADDA.L	D1,A0
	MOVE.L	D5,D1
	ADD.W	(A0),D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_TerAt
	ADDQ.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	TST.W	D0
	BMI.S	L0F36
	MOVE.W	-12(A6),D1
	SUB.W	D7,D1
	MOVE.W	-14(A6),D2
	CMP.W	D1,D2
	BLT.S	L0F36
	MOVEQ	#0,D0
	BRA.S	L0F3C
;
L0F36:
	MOVE.W	-10(A6),D0
	TST.W	D0
	BMI.S	L0F38
	MOVEQ	#3,D0
	CMP.W	_TheDisk,D0
	BEQ.S	L0F37
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_CheckForDisk
	ADDQ.W	#4,sp
L0F37:
	MOVE.W	-14(A6),D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_items,A0
	ADDA.L	D0,A0
	MOVE.W	-14(A6),D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_types,A1
	ADDA.L	D0,A1
	MOVE.W	(A1),-(sp)
	MOVE.W	(A0),-(sp)
	JSR	_Blurb
	ADDQ.W	#4,sp
	BRA.S	L0F3B
;
L0F38:
	TST.W	-8(A6)
	BEQ.S	L0F39
	MOVEQ	#-2,D0
	BRA.S	L0F3A
;
L0F39:
	MOVEQ	#-1,D0
L0F3A:
	MOVE.W	D0,-14(A6)
L0F3B:
	JSR	_DeBounce
	MOVE.W	-14(A6),D0
L0F3C:
	MOVEM.L	(sp)+,A2/D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Blurb:
	LINK	A6,#-$38
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	MOVE.L	D6,D0
	ADDI.W	#$30,D0
	MOVE.B	D0,blurb_fnum_s
	JSR	_hidemouse
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	JSR	_RectumFill
	MOVE.W	#-1,-48(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	TST.B	(A0)
	BNE.S	L0FDA
	BRA.S	L0FDC
;
L0FDB:
	ADDQ.W	#1,D7
	BRA	L0FD7
;
L0FDC:
	ADDQ.W	#1,D6
	BRA	L0FD6
;
L0FDD:
	PEA	$52.w
	PEA	_XEB
	MOVE.W	L20C8,-(sp)
	JSR	_write
	LEA	10(sp),sp
	ADDQ.W	#1,D5
	BRA	L0FD1
;
L0FDE:
	MOVEM.L	(sp)+,D4-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Replay:
	LINK	A6,#-$28
	MOVEM.L	D5-D7/D2-D3,-(sp)
L0FE0:
	TST.W	L20CB		;called from _TopDog ?
	BNE.S	.L0FE1		;if so, go skip menu
	MOVEQ	#0,D0
	MOVE.W	D0,_DefaultItem
	MOVE.W	D0,_NoHi
	MOVEQ	#$50,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	replay_menu_s
	JSR	_sMenu
	ADDQ.W	#8,sp
	MOVE.W	D0,L20C9
	BRA.S	.L0FE2
;
.L0FE1:
	MOVEQ	#4,D0
	MOVE.W	D0,L20C9
.L0FE2:
	TST.W	D0
	BLE	exit_replay
	SUBQ.W	#3,D0		;menu choice 3 ( write replay to file ) ?
	BNE.S	.L0FE4
	MOVE.W	#$80,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$301,D1
	MOVE.W	D1,-(sp)
	PEA	L1D85
.new_replay_fix:
	JSR	_open		;patch to store replay file in folder
	ADDQ.W	#8,sp
	MOVE.W	D0,L20C8
	ADDQ.W	#1,D0
	BNE.S	.L0FE3
	PEA	file_error_1_s
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_sMenu
	BRA	exit_replay
;
.L0FE3:
	BSR	L0FD0
.L0FE4:
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#0,D7
.L0FE5:				;loop start to fill 128 words at L20C7 with -1
	CMPI.W	#$80,D7
	BGE.S	.L0FE6
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	L20C7,A0
	ADDA.L	D0,A0
	MOVE.W	#-1,(A0)
	ADDQ.W	#1,D7
	BRA.S	.L0FE5		;loop back
;
.L0FE6:
	MOVEQ	#1,D7
.L0FE7:				;loop start
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	.L0FE8
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_Leaders,A0
	ADDA.L	D1,A0
	MOVE.W	(A0),-36(A6,D0.L)
	ADDQ.W	#1,D7
	BRA.S	.L0FE7		;loop back
;
.L0FE8:
	MOVEQ	#1,D7		;d7 = 1  loop index, used as player index
.L0FE9:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	.L0FED		;exit loop to .L0FED when loop index >= 8
	MOVE.W	_Player,D1	;d1 = main player index
	CMP.W	D7,D1
	BEQ.S	.L0FEC		;skip loop work  if  loop index == main player
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_Leaders,A0
	ADDA.L	D1,A0
	MOVEQ	#1,D1
	ASL.W	D7,D1
	MOVE.W	_FirstKings,D2
	AND.W	D1,D2
	TST.W	D2
	BEQ.S	.L0FEA
	MOVE.L	D7,D0
	ADDQ.W	#8,D0
	BRA.S	.L0FEB
;
.L0FEA:
	MOVE.L	D7,D0
.L0FEB:
	MOVE.W	D0,(A0)
	MOVE.W	D7,-(sp)
	JSR	_AText
	ADDQ.W	#2,sp
.L0FEC:
	ADDQ.W	#1,D7
	BRA.S	.L0FE9		;loop back for each possible player index
;
.L0FED:
	MOVEQ	#4,D0
	CMP.W	L20C9,D0
	BEQ	.L0FF3		;Skip the following 2 level loop if word(L20C9)==4
;The instruction above branches when _Replay was called from _TopDog for parade
	MOVEQ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L	A0,-(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1D94
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$A,D0
	MOVE.W	D0,(sp)
	PEA	_ntmp
	MOVE.W	D6,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	rpl_cities_s
	PEA	_XEB
	JSR	_strcat
	MOVE.L	D5,D0
	ASL.W	#8,D0
	ADD.W	-8(A6),D0
	MOVE.W	D0,(sp)
	JSR	_PopString
	PEA	rpl_population_s
	PEA	_XEB
	JSR	_strcat
	JSR	_Rprint
	LEA	42(sp),sp
	BRA	.L1003
;
.ReplayFn_9:
	PEA	L1D97
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVEQ	#0,D6
.L0FFE:				;loop start  for( d6=0; d6<4; d6++ )
	MOVEQ	#4,D0
	CMP.W	D0,D6
	BGE	.L1001
	LEA	_ReplayData,A0
	ADDA.W	-20(A6),A0
	MOVEQ	#-$10,D0
	AND.B	(A0),D0
	BEQ	.L0FFF
	MOVE.L	D6,D0
	ADD.W	D0,D0
	ADDQ.W	#1,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	L1D98
	PEA	_XEB
	JSR	_strcat
	LEA	_ReplayData,A0
	ADDA.W	-20(A6),A0
	MOVEQ	#0,D0
	MOVE.B	(A0),D0
	ASR.W	#4,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	L1D99
	PEA	_XEB
	JSR	_strcat
	LEA	32(sp),sp
.L0FFF:
	LEA	_ReplayData,A0
	ADDA.W	-20(A6),A0
	MOVEQ	#$F,D0
	AND.B	(A0),D0
	BEQ	.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.slam_patch:
	BNE.S	.L1002		;patch: make this "BRA.S .L1002" to avoid SLAM-bug
	CMP.W	_Player,D6
	BNE.S	.L1002
	MOVE.W	-18(A6),-(sp)
	MOVE.W	L20CA,-(sp)
	BSR	_KillKing
	ADDQ.W	#4,sp
.L1002:
	MOVE.W	L20CA,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	BCHG	#3,1(A0)
	MOVE.W	L20CA,-(sp)
	JSR	_AText
	JSR	_Rprint
	ADDQ.W	#2,sp
.ReplayFn_B:
.L1003:
	MOVEQ	#2,D0
	CMP.W	L20C9,D0
	BNE	.L0FF4		;loop back (main) directly if word(L20C9) == 2
	JSR	_getch
	MOVEQ	#$1B,D1
	CMP.W	D1,D0
	BNE	.L0FF4		;loop back (main) unless key == Escape
.replay_loop_exit:
.L1004:
	MOVEQ	#1,D7
.L1005:				;loop start  for( d7=1; d7<8; d7++ )
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	.L1006
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	-36(A6,D0.L),(A0)
	ADDQ.W	#1,D7
	BRA.S	.L1005		;loop back for next d7
;
.L1006:
	MOVEQ	#1,D7
.L1007:				;loop start  for( d7=1; d7<8; d7++ )
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	.L1009
	MOVE.W	_Player,D0
	CMP.W	D7,D0
	BEQ.S	.L1008
	MOVE.W	D7,-(sp)
	JSR	_AText
	ADDQ.W	#2,sp
.L1008:
	ADDQ.W	#1,D7
	BRA.S	.L1007		;loop back for next d7
;
.L1009:
	JSR	_RestoreScreen
	JSR	_showmouse
	MOVEQ	#3,D0
	CMP.W	L20C9,D0
	BNE.S	.L100A
	MOVE.W	L20C8,-(sp)
.old_replay_fix:
	JSR	_close		;patch to store replay file in folder
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	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	CLR.W	(sp)
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#4,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	26(sp),sp
L100F:
	MOVEM.L	(sp)+,D7/D2-D3
	RTS
;
;
_WhichYear
	MOVE.L	D7,-(sp)
	MOVE.W	8(sp),D7
	CMPI.W	#$FA,D7
	BGT.S	L1011
	MOVE.L	D7,D0
	MULS	#$14,D0
	SUBI.W	#$FA0,D0
	BRA.S	L1015
;
L1011:
	SUBI.W	#$FA,D7
	MOVEQ	#$32,D0
	CMP.W	D0,D7
	BGT.S	L1012
	MOVE.L	D7,D1
	MULS	#$A,D1
	ADDI.W	#$3E8,D1
	MOVE.L	D1,D0
	BRA.S	L1015
;
L1012:
	SUBI.W	#$32,D7
	MOVEQ	#$32,D0
	CMP.W	D0,D7
	BGT.S	L1013
	MOVE.L	D7,D1
	LSL.W	#2,D1
	ADD.W	D7,D1
	ADDI.W	#$5DC,D1
	MOVE.L	D1,D0
	BRA.S	L1015
;
L1013:
	SUBI.W	#$32,D7
	MOVEQ	#$32,D0
	CMP.W	D0,D7
	BGT.S	L1014
	MOVE.L	D7,D1
	ADD.W	D1,D1
	ADDI.W	#$6D6,D1
	MOVE.L	D1,D0
	BRA.S	L1015
;
L1014:
	SUBI.W	#$32,D7
	MOVE.L	D7,D0
	ADDI.W	#$73A,D0
L1015:
	MOVE.L	(sp)+,D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_AText
	LINK	A6,#-$10
	MOVEM.L	A2/D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$B,D1
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	EXT.L	D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SR	_strcat
	MOVEQ	#7,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$A8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	LEA	72(sp),sp
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$A7,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	JSR	_DeBounce
	JSR	_WaitForIt
	MOVEQ	#$1A,D0
	MOVE.W	D0,(sp)
	JSR	_DoSound
	MOVEQ	#1,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	D0,16(A0)
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	JSR	_CheckForDisk
	JSR	_showmouse
	JSR	_ResetScreen
	LEA	12(sp),sp
	CLR.W	L20CB
	MOVEM.L	(sp)+,D7/D2-D3
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_KillKing:
	LINK	A6,#-$38
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	10(A6),D6
	JSR	_OpenSprite
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	LEA	_KingPix,A1
	ADDA.W	(A0),A1
	MOVE.B	(A1),D0
	EXT.W	D0
	PEA	king00_lbm_2_s
	PEA	-16(A6)
	MOVE.W	D0,-38(A6)
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVE.W	-38(A6),D0
	EXT.L	D0
	MOVEQ	#$A,D1
	DIVS	D1,D0
	SWAP	D0
	MOVE.B	-11(A6),D2
	EXT.W	D2
	ADD.W	D0,D2
	MOVE.B	D2,-11(A6)	;adjust filename KING0x.LBM
	MOVE.W	-38(A6),D0
	EXT.L	D0
	DIVS	D1,D0
	MOVE.B	-12(A6),D1
	EXT.W	D1
	ADD.W	D0,D1
	MOVE.B	D1,-12(A6)	;adjust filename KINGyx.LBM
	TST.W	_VGAMode
	BNE.S	L101D
	TST.W	-38(A6)
	BEQ.S	L101C
	MOVEQ	#3,D0
	CMP.W	-38(A6),D0
	BNE.S	L101D
L101C:
	MOVE.B	#$6B,-16(A6)
L101D:
	MOVEA.L	_Rp1,A0
	MOVE.W	16(A0),-50(A6)
	MOVEQ	#1,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	D0,16(A0)
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	JSR	_CheckForDisk
	MOVEA.L	_Rp1,A0
	MOVE.W	-50(A6),16(A0)
	PEA	-16(A6)		;filename KINGyx.LBM
	MOVEQ	#1,D0		;screen number (incorrect ???)
	MOVE.W	D0,-(sp)
kill_ldpic_fix_1:		;patch:	fix screen reference <> 1
	JSR	_LoadPicture	;Load big portraits of a leader
;NB: These erroneously appear om main screen, destroying background etc...
	MOVE.W	#$85,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$8B,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$43,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$B5,D3
	MOVE.W	D3,-(sp)
	MOVEQ	#1,D4
	MOVE.W	D4,-(sp)
kill_builds_fix_1:		;patch:	fix screen reference <> 1
	JSR	_BuildSprite	;build main leader sprite
	MOVEQ	#$31,D1
	MOVE.W	D1,(sp)
	MOVEQ	#$3B,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$33,D3
	MOVE.W	D3,-(sp)
	MOVEQ	#1,D4
	MOVE.W	D4,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-52(A6)
kill_builds_fix_2:		;patch:	fix screen reference <> 1
	JSR	_BuildSprite	;build happy face sprite
	MOVEQ	#$31,D1
	MOVE.W	D1,(sp)
	MOVEQ	#$3B,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$97,D3
	MOVE.W	D3,-(sp)
	MOVEQ	#1,D4
	MOVE.W	D4,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-54(A6)
kill_builds_fix_3:		;patch:	fix screen reference <> 1
	JSR	_BuildSprite	;build angry face sprite
	MOVE.W	D0,-56(A6)
	JSR	_CloseSprite
	PEA	slam1_lbm_1_s
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
kill_ldpic_fix_2:		;patch:	fix screen reference <> 1
	JSR	_LoadPicture	;Load Parade background
	MOVEQ	#0,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(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	_RpBack,-(sp)
kill_rcopy_fix_1:		;patch:	fix screen reference <> 1
	JSR	_RectCopy	;Show parade background
	PEA	slam2_lbm_s	;filename SLAM2.LBM (later forced to BBM !!!)
	PEA	-32(A6)
	JSR	_strcpy
	LEA	66(sp),sp
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	PEA	-32(A6)		;Filename SLAM2.LBM
	MOVE.W	#$85,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#1,D2
	MOVE.W	D2,-(sp)
kill_ldbrush_fix_1:		;patch:	fix screen reference <> 1
	JSR	_LoadBrush	;Load miniature portraits of all kings
	LEA	12(sp),sp
	MOVEQ	#0,D5		;d5 = civ index
L101E:
	MOVEQ	#$E,D0		;d0 = max civ index + 1
	CMP.W	D0,D5
	BGE	L1020		;exit loop after checking last possible civ
	LEA	_trophies,A0
	MOVEA.L	A0,A1
	ADDA.W	D5,A1
	CMPI.B	#-1,(A1)
	BEQ.S	L101F
	ADDA.W	D5,A0
	MOVE.B	(A0),D0
	EXT.W	D0
	MOVE.W	D0,-46(A6)
	EXT.L	D0
	MOVEQ	#7,D1
	DIVS	D1,D0
	SWAP	D0
	MULS	#$1C,D0
	ADDQ.W	#1,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
kill_ldpic_fix_3:		;patch:	fix screen reference <> 1
	JSR	_LoadPicture	;Load parade background
	MOVEQ	#0,D0
	MOVE.W	D0,(sp)
	PEA	-32(A6)		;Filename SLAM2.LBM
	MOVE.W	#$85,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#1,D2
	MOVE.W	D2,-(sp)
kill_ldbrush_fix_2:		;patch:	fix screen reference <> 1
	JSR	_LoadBrush	;Load miniature portraits of all kings
;NB: This damages part of the graphics in the buffer (exists also on screen)
	LEA	16(sp),sp
	MOVEQ	#0,D5
L1026:
	MOVEQ	#$E,D0
	CMP.W	D0,D5
	BGE	L1028
	LEA	_trophies,A0
	MOVEA.L	A0,A1
	ADDA.W	D5,A1
	CMPI.B	#-1,(A1)
	BEQ.S	L1027
	ADDA.W	D5,A0
	MOVE.B	(A0),D0
	EXT.W	D0
	MOVE.W	D0,-46(A6)
	EXT.L	D0
	MOVEQ	#7,D1
	DIVS	D1,D0
	SWAP	D0
	MULS	#$1C,D0
	ADDQ.W	#1,D0
	MOVE.W	-46(A6),D2
	EXT.L	D2
	DIVS	D1,D2
	MULS	#$22,D2
	ADDI.W	#$85,D2
	MOVE.L	D5,D3
	EXT.L	D3
	DIVS	D1,D3
	SWAP	D3
	MULS	#$2E,D3
	ADDQ.W	#8,D3
	MOVE.L	D5,D1
	EXT.L	D1
	DIVS	#7,D1
	NEG.W	D1
	MULS	#$2A,D1
	ADDI.W	#$31,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D3,-(sp)
	MOVEA.L	_RpBack,A0
	MOVE.L	A0,-(sp)
	MOVEQ	#$21,D4
	MOVE.W	D4,-(sp)
	MOVEQ	#$1B,D4
	MOVE.W	D4,-(sp)
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	A0,-(sp)
kill_rcopy_2fix:		;patch:	fix 2 screen references <> 1
	JSR	_RectCopy	;move portrait to right place in buffer
	LEA	20(sp),sp
L1027:
	ADDQ.W	#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
	PEA	_XEB
	JSR	_cPrint
	LEA	72(sp),sp
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$A7,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	MOVE.W	#$85,D0
	MOVE.W	D0,(sp)
	MOVEQ	#0,D1
	MOVE.W	D1,-(sp)
	MOVE.L	_RpBack,-(sp)
	MOVEQ	#$43,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$140,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D1,-(sp)
	MOVE.L	_Rp1,-(sp)
kill_rcopy_dfix:		;patch:	fix screen reference <> 1
	JSR	_RectCopy	;copy part of screen to damaged buffer
	MOVE.W	-42(A6),D0
	SUBQ.W	#2,D0
	MOVE.W	-56(A6),(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	-40(A6),-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_ShowSprite2	;show angry face sprite
	MOVE.W	-52(A6),(sp)
	JSR	_freemem	;release sprite RAM
	MOVEQ	#$1A,D0
	MOVE.W	D0,(sp)
	JSR	_DoSound
	MOVEQ	#$3C,D0
	JSR	_WaitTicks
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	EXT.L	D0
	MOVEQ	#$3A,D1
	JSR	__CXM22
	LEA	_ld,A0
	ADDA.L	D0,A0
	MOVEQ	#3,D0
	MOVE.W	D0,(sp)
	MOVE.W	56(A0),-(sp)
	JSR	_DoSound
	MOVEQ	#$1E,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	#200,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#320,D2
	MOVE.W	D2,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(sp)
kill_rcopy_fix_3:		;patch:	fix screen reference <> 1
	JSR	_RectCopy	;show Parade background with portraits
	CLR.W	(sp)
	JSR	_ShowPage
	MOVEQ	#$1A,D0
	MOVE.W	D0,(sp)
	JSR	_DoSound
	MOVEM.L	-80(A6),D2-D7
	UNLK	A6
	RTS
;
;
_Insight
	MOVEM.L	D6-D7,-(sp)
	PEA	q_which_army_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVEQ	#1,D7
L102C:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	L102D
	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	_strcat
	PEA	L1DAB
	PEA	_XEB
	JSR	_strcat
	LEA	16(sp),sp
	ADDQ.W	#1,D7
	BRA.S	L102C
;
L102D:
	MOVEQ	#$50,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_sMenu
	MOVE.L	D0,D6
	ADDQ.W	#1,D6
	JSR	_SaveScreen
	MOVE.W	D6,(sp)
stratshow:
	JSR	_StratMap	;patch: needs "JSR _WaitForIt" after displaying map
	JSR	_RestoreScreen
	ADDQ.W	#8,sp
	MOVEM.L	(sp)+,D6-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_StratMap:
	LINK	A6,#-$12
	MOVEM.L	D4-D7/D2,-(sp)
	MOVE.W	8(A6),D7
	JSR	_hidemouse
	MOVEQ	#0,D0
	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.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Q	L1051
	PEA	_XEB
	JSR	_strlen
	ADDQ.W	#4,sp
	CMPI.W	#$200,D0
	BGE	L1051
	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	3(A0),D0
	EXT.W	D0
	EXT.L	D0
	MOVEQ	#$22,D1
	JSR	__CXM22
	LEA	_tp,A0
	ADDA.L	D0,A0
	MOVE.L	A0,-(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DC4
	PEA	_XEB
	JSR	_strcat
	LEA	16(sp),sp
	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
	BRA	L1050
;
L1051:
	MOVEQ	#$A,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_sMenu
	ADDQ.W	#8,sp
	MOVEM.L	(sp)+,D5-D7
	RTS
;
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_LoadGameFile:
	LINK	A6,#-6
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	8(A6),D7	;Will be -1 as called from "_InitGraf"
	MOVE.W	#1,L20D4
	JSR	_hidemouse
load_drive_q:			;patch to allow mouse for drive selection
	JSR	_SaveDrive	;this sub has patch for effective selection
	MOVE.L	D0,D5
	MOVEQ	#-1,D0
	CMP.W	D0,D5
	BEQ	L1059
	CMP.W	D0,D7
	BNE	L1056
	PEA	select_load_file_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVEQ	#0,D0
	MOVE.W	D0,_GamesOK
	MOVE.L	D0,D6
L1053:
	MOVEQ	#10,D0		;max 10 games in this popup selection
	CMP.W	D0,D6
	BCC.S	L1055
	MOVE.L	D6,D0
	ADDI.W	#$30,D0
	MOVE.B	D0,game_number_digit_s
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)	;flag 1 to load info only
	PEA	_LoadFile
	JSR	_LoadGame	;load next games info to popup menu
	ADDQ.W	#6,sp
	TST.W	D0
	BEQ.S	L1054
	MOVEQ	#1,D0
	ASL.W	D6,D0
	OR.W	D0,_GamesOK
L1054:
	ADDQ.W	#1,D6
	BRA.S	L1053		;loop for up to 10 games in menu
;
L1055:
	JSR	_showmouse
	MOVEQ	#0,D0
	MOVE.W	D0,_DefaultItem
	MOVE.W	D0,_NoHi
	MOVEQ	#$41,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$30,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	MOVE.W	D0,_GameLoaded
	JSR	_hidemouse
	ADDQ.W	#8,sp
	MOVEQ	#1,D0
	MOVE.W	_GameLoaded,D1
	ASL.W	D1,D0
	MOVE.W	_GamesOK,D1
	AND.W	D0,D1
	BNE.S	L1057
	MOVEQ	#-1,D0
	MOVE.W	D0,_GameLoaded
	BRA.S	L1057
;
L1056:
	MOVE.L	D7,D0
	MOVE.W	D0,_GameLoaded
L1057:
	MOVE.W	_GameLoaded,D0
	MOVEQ	#-1,D1
	CMP.W	D1,D0
	BEQ.S	L1058
	ADDI.W	#$30,D0
	MOVE.B	D0,game_number_digit_s
	CLR.W	-(sp)			;flag 0 to load actual game
	PEA	_LoadFile
	JSR	_LoadGame
	ADDQ.W	#6,sp
	TST.W	D0
	BNE.S	L1058
	MOVE.W	#-1,_GameLoaded
L1058:
	PEA	_path
old_drive_fix_1:
	JSR	_ChangeDir		;patch: long 'jsr' to restore main drive/path
	MOVEQ	#1,D0
	MOVE.W	D0,(sp)
	CLR.W	-(sp)
	JSR	_CheckForDisk
	JSR	_showmouse
	MOVE.W	_GameLoaded,D0
	BRA.S	L105A
;
L1059:
	JSR	_showmouse
	MOVEQ	#-1,D0
L105A:
	MOVEM.L	-18(A6),D5-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_LoadGame:	;int	_LoadGame(char *fname,int flag)
;flag is 1 to load info only, but 0 to load actual game
	LINK	A6,#-$10
	MOVE.L	D7,-(sp)
	MOVE.W	12(A6),D7
	MOVEA.L	8(A6),A0
	ADDQ.W	#7,A0
	PEA	save_extension_1_s
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	ADDQ.W	#8,sp
	TST.W	D7
	BEQ	L1060
;Here we continue if called to load info only, otherwise branch to L1060
	CLR.W	-(sp)
	MOVE.L	8(A6),-(sp)
	JSR	_open
	ADDQ.W	#6,sp
	MOVE.W	D0,L20D3
	MOVEQ	#-1,D1
	CMP.W	D1,D0
	BEQ	L105E
	CLR.W	-(sp)
	PEA	2.w
	MOVE.W	D0,-(sp)
	JSR	_lseek
	PEA	2.w
	PEA	L20CF
	MOVE.W	L20D3,-(sp)
	JSR	_read
	CLR.W	(sp)
	PEA	8.w
	MOVE.W	L20D3,-(sp)
	JSR	_lseek
	PEA	2.w
	PEA	L20D0
	MOVE.W	L20D3,-(sp)
	JSR	_read
	PEA	L1DC9
	PEA	_XEB
	JSR	_strcat
	CLR.W	(sp)
	PEA	$A.w
	MOVE.W	L20D3,-(sp)
	JSR	_lseek
	PEA	2.w
	PEA	L20D1
	MOVE.W	L20D3,-(sp)
	JSR	_read
	MOVE.W	L20D1,D0
	EXT.L	D0
	ASL.L	#2,D0
_Diffs_ref_2:			;patch this ptr for a longer list
	LEA	_Diffs,A0
	ADDA.L	D0,A0
	MOVE.L	(A0),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DCA
	PEA	_XEB
	JSR	_strcat
	LEA	70(sp),sp
	MOVE.W	L20CF,D0
	MULS	#$E,D0
	EXT.L	D0
	MOVEQ	#$10,D1
	ADD.L	D1,D0
	CLR.W	-(sp)
	MOVE.L	D0,-(sp)
	MOVE.W	L20D3,-(sp)
	JSR	_lseek
	PEA	$E.w
	PEA	-16(A6)
	MOVE.W	L20D3,-(sp)
	JSR	_read
	PEA	-16(A6)
	PEA	_XEB
	JSR	_strcat
	MOVE.W	L20CF,D0
	MULS	#$C,D0
	EXT.L	D0
	MOVEQ	#$40,D1
	ADD.L	D1,D1
	ADD.L	D1,D0
	CLR.W	(sp)
	MOVE.L	D0,-(sp)
	MOVE.W	L20D3,-(sp)
	JSR	_lseek
	PEA	$C.w
	PEA	-16(A6)
	MOVE.W	L20D3,-(sp)
	JSR	_read
	PEA	L1DCB
	PEA	_XEB
	JSR	_strcat
	PEA	-16(A6)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DCC
	PEA	_XEB
	JSR	_strcat
	LEA	66(sp),sp
	MOVE.W	L20D0,-(sp)
	JSR	_abs
	MOVEQ	#$A,D1
	MOVE.W	D1,-(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	LEA	14(sp),sp
	MOVE.W	L20D0,D0
	TST.W	D0
	BPL.S	L105C
	LEA	BC_suffix_5_lf_s,A0
	BRA.S	L105D
;
L105C:
	LEA	AD_suffix_5_lf_s,A0
L105D:
	MOVE.L	A0,-(sp)
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
	BRA.S	L105F
;
L105E:
	PEA	empty_slot_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L105F:
	MOVE.W	L20D3,-(sp)
	JSR	_close
	MOVEQ	#-1,D1
	CMP.W	L20D3,D1
	SNE	D0
	ANDI.W	#1,D0
	BRA.S	L1065
;
L1060:
;Here we come to load an actual game to be restarted
	MOVE.L	8(A6),-(sp)
	JSR	_LoadWorld
	MOVEA.L	_Rp1,A0
	MOVE.W	#2,(A0)
	CLR.W	(sp)
	JSR	_SeaMoves
	ADDQ.W	#4,sp
	MOVEA.L	_Rp1,A0
	CLR.W	(A0)
	MOVE.W	#1,L20D2
L1061:
	CMPI.W	#8,L20D2
	BGE.S	L1062
	ADDQ.W	#1,L20D2
	BRA.S	L1061
;
L1062:
	CMPI.W	#4,_GameLoaded
	BGE.S	L1063
	MOVEQ	#1,D0
	BRA.S	L1064
;
L1063:
	MOVEQ	#2,D0
L1064:
	MOVE.W	D0,_Reload
	MOVE.W	#-3,_MaxFame
	BCLR	#0,L1ED4
	MOVEQ	#1,D0
L1065:
	MOVE.L	-20(A6),D7
	UNLK	A6
	RTS
;
;
_SaveGameFile:
	MOVEM.L	D5-D7/D2-D3,-(sp)
	MOVE.W	24(sp),D7
	MOVEQ	#0,D0
	MOVE.W	D0,L20D4
	MOVE.W	D0,L20D5
	JSR	_hidemouse
	JSR	_SaveScreen
save_drive_q:			;patch to allow mouse for drive selection
	JSR	_SaveDrive	;this routine has patch for effective selection
	MOVE.L	D0,D5
	MOVEQ	#-1,D0
	CMP.W	D0,D5
save_abort_fix_1:		;patch to avoid new path by above path
	BEQ	save_abort_fix_3		;patch to: 'BEQ save_abort_fix_2'
;;; simply 'ADD #(save_abort_fix_2-save_abort_fix_3),save_abort_fix_1+2
;;;   or   'SUB #14,save_abort_fix_1+2
	PEA	L1DD0
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	MOVEQ	#0,D6
L1067:
	MOVEQ	#10,D0		;max 10 games in this popup selection
;patch:
;  Original only allowed 4 games here, even though 10 games are allowed
;  when loading a game, so I changed to the same number here.
	CMP.W	D0,D6
	BGE.S	L1068
	MOVE.L	D6,D0
	ADDI.W	#$30,D0
	MOVE.B	D0,game_number_digit_s
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)	;flag 1 to load info only
	PEA	_LoadFile
	BSR	_LoadGame	;load next games info to popup menu
	ADDQ.W	#6,sp
	ADDQ.W	#1,D6
	BRA.S	L1067
;
L1068:
	MOVEQ	#3,D0
	MOVE.W	D0,-(sp)
	CLR.W	-(sp)
	MOVE.W	_GameLoaded,-(sp)
	JSR	_rng
	ADDQ.W	#6,sp
	MOVE.W	D0,_DefaultItem
	MOVEQ	#-1,D0
	CMP.W	D0,D7
	BNE.S	L1069
	JSR	_showmouse
	MOVEQ	#0,D0
	MOVE.W	D0,_DefaultItem
	MOVE.W	D0,_NoHi
	MOVEQ	#$21,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$30,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	MOVE.L	D0,D7
	JSR	_hidemouse
	ADDQ.W	#8,sp
L1069:
	MOVEQ	#-1,D0
	CMP.W	D0,D7
	BEQ	save_abort_fix_2
	MOVE.W	D7,_GameLoaded
	MOVE.L	D7,D0
	ADDI.W	#$30,D0
	MOVE.B	D0,game_number_digit_s
	PEA	_LoadFile
	JSR	_SaveGame
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ	save_abort_fix_2
	TST.W	L20D5
	BNE.S	L106A
	PEA	game_was_saved_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	BRA.S	L106B
;
L106A:
	PEA	game_NOT_saved_s
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	20(sp),sp
	MOVE.W	_errno,D0
	MOVE.W	D0,L20D5
L106B:
	MOVEQ	#$D,D0
	CMP.W	L20D5,D0
	BNE.S	L106C
	PEA	write_denied_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L106C:
	MOVEQ	#$1C,D0
	CMP.W	L20D5,D0
	BNE.S	L106D
	PEA	disk_full_s
	PEA	_XEB
	JSR	_strcat
	ADDQ.W	#8,sp
L106D:
	PEA	press_key_s
	PEA	_XEB
	JSR	_strcat
	MOVE.W	#1,_NoHi
	MOVEQ	#$7F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$40,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	LEA	14(sp),sp
L106E:
save_abort_fix_2:
	PEA	_path
old_drive_fix_2:
	JSR	_ChangeDir		;patch: long 'jsr' to restore main drive/path
	ADDQ.W	#4,sp
L106F:
save_abort_fix_3:			;patch above eliminates this as branch target
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	JSR	_CheckForDisk
	JSR	_RestoreScreen
	JSR	_showmouse
	ADDQ.W	#4,sp
	MOVEM.L	(sp)+,D5-D7/D2-D3
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_SaveGame:
	LINK	A6,#-$A
	MOVE.L	D7,-(sp)
	MOVE.W	#1,_NoWait
	PEA	L1DD6
	PEA	_XEB
	JSR	_strcpy
	MOVE.L	8(A6),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DD7
	PEA	_XEB
	JSR	_strcat
	MOVE.W	_Diff,D0
	EXT.L	D0
	ASL.L	#2,D0
_Diffs_ref_3:			;patch this ptr for a longer list
	LEA	_Diffs,A0
	ADDA.L	D0,A0
	MOVE.L	(A0),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DD8
	PEA	_XEB
	JSR	_strcat
	MOVE.W	_Player,D0
	EXT.L	D0
	MOVEQ	#$E,D1
	JSR	__CXM22
	LEA	_KingText,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DD9
	PEA	_XEB
	JSR	_strcat
	MOVE.W	_Player,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	L1DDA
	PEA	_XEB
	JSR	_strcat
	JSR	_TheYear
	PEA	L1DDB
	PEA	_XEB
	JSR	_strcat
	MOVE.W	#1,_NoHi
	MOVEQ	#$56,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$40,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	LEA	70(sp),sp
	MOVE.L	8(A6),-(sp)
	JSR	_SaveWorld
	MOVE.L	D0,D7
	MOVE.L	D7,D0
	MOVE.L	-14(A6),D7
	UNLK	A6
	RTS
;
;
	MOVEM.L	A5/D6-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVEA.L	18(sp),A5
	MOVE.W	22(sp),D6
	MOVE.L	D6,D0
	EXT.L	D0
	MOVE.L	D0,-(sp)
	MOVE.L	A5,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_write
	LEA	10(sp),sp
	ADDQ.L	#1,D0
	BNE.S	L1071
	MOVE.W	_errno,L20D5
	PEA	L1DDC
	JSR	__writes
	ADDQ.W	#4,sp
L1071:
	MOVEM.L	(sp)+,A5/D6-D7
	RTS
;
;
	MOVEM.L	A5/D6-D7,-(sp)
	MOVE.W	16(sp),D7
	MOVEA.L	18(sp),A5
	MOVE.W	22(sp),D6
	MOVE.L	D6,D0
	EXT.L	D0
	MOVE.L	D0,-(sp)
	MOVE.L	A5,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_read
	LEA	10(sp),sp
	ADDQ.L	#1,D0
	BNE.S	L1072
	MOVE.W	_errno,L20D5
	PEA	L1DDD
	JSR	__writes
	ADDQ.W	#4,sp
L1072:
	MOVEM.L	(sp)+,A5/D6-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_SaveDrive:
;Returns d0 = index for drive list
	LINK	A6,#-$C
	MOVEM.L	A5/D5-D7/D2-D3,-(sp)
	MOVEQ	#0,D0
	MOVE.W	D0,_ramload
	MOVEQ	#7,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#200,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#320,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
	TST.W	L20D4
	BNE.S	L1074
	JSR	_Border
L1074:
	PEA	L1DDE
	PEA	_stxt
	JSR	_strcpy
	ADDQ.W	#8,sp
	TST.W	L20D4
	BEQ.S	L1075
	PEA	q_saved_files_drive_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
	BRA.S	L1076
;
L1075:
	PEA	q_game_disk_drive_s
	PEA	_XEB
	JSR	_strcpy
	ADDQ.W	#8,sp
L1076:
	MOVEQ	#0,D6
	MOVEQ	#0,D5
L1077:
	CMP.W	_numdrive,D5
	BGE.S	L1078
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#20,D1
	JSR	__CXM22
	LEA	_ditem,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#20,D1
	JSR	__CXM22
	LEA	_drivelist,A1
	ADDA.L	D0,A1
	MOVE.L	A1,-(sp)
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#20,D1
	JSR	__CXM22
	LEA	_drivelist,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DE1
	PEA	_XEB
	JSR	_strcat
	LEA	20(sp),sp
	ADDQ.W	#1,D5
	BRA.S	L1077
;
L1078:
	PEA	_XEB
	JSR	_strlen
	MOVE.L	D0,D6
	LEA	L2127,A0
	ADDA.W	D6,A0
	MOVE.B	#10,(A0)	;LineFeed
	PEA	esc_to_cancel_s
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#0,D0
	MOVE.W	D0,_NoWait
	MOVE.W	D0,_NoHi
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
pre_drive_fix:			;patch _NoWait == 1 before _DoMenu
	JSR	_DoMenu
	MOVE.L	D0,D7
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#20,D1
	JSR	__CXM22
	LEA	_ditem,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_stxt
	JSR	_strcpy		;=> d0 -> dest start of copied string
new_drive_fix:
	EXT.L	D0		;\  Bug: d0 is a pointer, crashed by 'EXT.L'
	MOVEA.L	D0,A5		; > patch: fix drive/folder selection
	MOVEQ	#7,D0		;/  with a long "jsr" on these 3 words
;NB:	return d7 = drive number or -1 to escape
	MOVE.W	D0,(sp)
	MOVE.W	#200,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#320,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	MOVE.L	D7,D0		;d0 = d7,  drive code
	MOVEM.L	-36(A6),A5/D5-D7/D2-D3
	UNLK	A6
	RTS
;----------------------------------------------------------------------------
_LoadWorld:
	LINK	A6,#-4
	MOVE.L	D7,-(sp)
	MOVEA.L	8(A6),A0
	ADDQ.W	#7,A0
	PEA	save_extension_2_s
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	CLR.W	(sp)
	MOVE.W	#-$7FFE,D0
	MOVE.W	D0,-(sp)
	MOVE.L	8(A6),-(sp)
	JSR	_open
	LEA	14(sp),sp
	MOVE.W	D0,L20D3
	ADDQ.W	#1,D0
	BNE.S	L107A
	PEA	file_error_2_s
	PEA	_XEB
	JSR	_strcpy
	MOVE.L	8(A6),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DE5
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_sMenu
	MOVEQ	#0,D0
	BRA.S	L107B
;
L107A:
	MOVE.L	#80000,D7
	MOVE.L	D7,-(sp)
	MOVE.L	L2117,-(sp)
	MOVE.W	L20D3,-(sp)
	JSR	_read
	MOVE.W	L20D3,(sp)
	JSR	_close
	MOVE.W	#1,L20D4
	MOVE.L	L2117,_copy_pointer
	JSR	_RData
	JSR	_hidemouse
	MOVEA.L	8(A6),A0
	ADDQ.W	#7,A0
	PEA	map_extension_1_s
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	MOVE.L	8(A6),(sp)
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	JSR	_LoadRawPic
	JSR	_showmouse
	MOVEQ	#1,D0
L107B:
	MOVE.L	-8(A6),D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_SaveWorld
	LINK	A6,#-$A
	MOVEM.L	D6-D7,-(sp)
	MOVEA.L	8(A6),A0
	ADDQ.W	#7,A0
	PEA	map_extension_2_s
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	MOVE.L	8(A6),(sp)
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	JSR	_SaveRawPic
	LEA	10(sp),sp
	TST.W	D0
	BEQ.S	L107D
	PEA	L1DE8
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$40,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	MOVE.W	#1,L20D5
	MOVEQ	#0,D0
	BRA	L1080
;
L107D:
	MOVEA.L	8(A6),A0
	ADDQ.W	#7,A0
	PEA	save_extension_3_s
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	CLR.W	(sp)
	MOVE.W	#-$7CF6,D0
	MOVE.W	D0,-(sp)
	MOVE.L	8(A6),-(sp)
	JSR	_open
	LEA	14(sp),sp
	MOVE.W	D0,L20D3
	ADDQ.W	#1,D0
	BNE.S	L107E
	PEA	file_error_3_s
	PEA	_XEB
	JSR	_strcpy
	MOVE.L	8(A6),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DEB
	PEA	_XEB
	JSR	_strcat
	MOVE.W	#1,L20D5
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_DoMenu
	MOVEQ	#0,D0
	BRA.S	L1080
;
L107E:
	CLR.W	L20D4
	MOVE.L	L2117,D0
	MOVE.L	D0,_copy_pointer
	MOVE.L	D0,D7
	JSR	_WData
	MOVE.L	_copy_pointer,D0
	SUB.L	D7,D0
	MOVE.L	D0,D6
	MOVEA.L	D7,A0
	MOVE.L	D6,-(sp)
	MOVE.L	A0,-(sp)
	MOVE.W	L20D3,-(sp)
	JSR	_write
	MOVE.W	L20D3,(sp)
	JSR	_close
	LEA	10(sp),sp
	TST.W	L20D5
	BEQ.S	L107F
	MOVEQ	#0,D0
	BRA.S	L1080
;
L107F:
	MOVEQ	#1,D0
L1080:
	MOVEM.L	-18(A6),D6-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_WData
	LINK	A6,#-2
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	PEA	_Rtime
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Player
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Human
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_rseed
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Year
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Diff
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Players
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_NextCiv
	BSR	_WFile
	MOVEQ	#$70,D0
	MOVE.W	D0,(sp)
	PEA	_KingText
	BSR	_WFile
	MOVEQ	#$60,D0
	MOVE.W	D0,(sp)
	PEA	_ArmyTexts
	BSR	_WFile
	MOVEQ	#$58,D0
	MOVE.W	D0,(sp)
	PEA	_ArmyText
	BSR	_WFile
	MOVEQ	#$10,D0
	MOV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R	_WFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_Leaders
	BSR	_WFile
	LEA	66(sp),sp
	MOVE.W	#$100,D0
	MOVE.W	D0,-(sp)
	PEA	_Runits
	BSR	_WFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Rattack
	BSR	_WFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Rcity
	BSR	_WFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Regions
	BSR	_WFile
	MOVEQ	#$20,D0
	MOVE.W	D0,(sp)
	PEA	_Food
	BSR	_WFile
	MOVE.W	#$4B0,D0
	MOVE.W	D0,(sp)
	PEA	_histo
	BSR	_WFile
	MOVE.W	#$4B0,D0
	MOVE.W	D0,(sp)
	PEA	_hwars
	BSR	_WFile
	MOVE.W	#$E00,D0
	MOVE.W	D0,(sp)
	PEA	_ct
	BSR	_WFile
	MOVE.W	#$3B8,D0
	MOVE.W	D0,(sp)
	PEA	_tp
	BSR	_WFile
	MOVE.W	#$3000,D0
	MOVE.W	D0,(sp)
	PEA	_un
	BSR	_WFile
	MOVE.W	#$FA0,D0
	MOVE.W	D0,(sp)
	PEA	_seen
	BSR	_WFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestType
	BSR	_WFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestVal
	BSR	_WFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestX
	BSR	_WFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestY
	BSR	_WFile
	MOVE.W	#$90,D0
	MOVE.W	D0,(sp)
	PEA	_first
	BSR	_WFile
	LEA	66(sp),sp
	MOVE.W	#$80,D0
	MOVE.W	D0,-(sp)
	PEA	_killed
	BSR	_WFile
	MOVE.W	#$D00,D0
	MOVE.W	D0,(sp)
	PEA	_cNames
	BSR	_WFile
	MOVEQ	#2,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
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_Arrives
	BSR	_WFile
	MOVEQ	#$18,D0
	MOVE.W	D0,(sp)
	PEA	_palace
	BSR	_WFile
	MOVEQ	#$18,D0
	MOVE.W	D0,(sp)
	PEA	_style
	BSR	_WFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Xcity
	BSR	_WFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Ycity
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Nwives
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Peace
	BSR	_WFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Enemies
	BSR	_WFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_SpacePop
	BSR	_WFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_LaunchDate
	BSR	_WFile
	LEA	66(sp),sp
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	PEA	_FirstKings
	BSR	_WFile
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_RData
	LINK	A6,#-2
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	PEA	_Rtime
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Player
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Human
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_rseed
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Year
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Diff
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Players
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_NextCiv
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10,D0
	MOVE.W	D0,(sp)
	PEA	_Happy
	BSR	_RFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_Score
	BSR	_RFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_LastContact
	BSR	_RFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_FirstX
	BSR	_RFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_Leaders
	BSR	_RFile
	LEA	66(sp),sp
	MOVE.W	#$100,D0
	MOVE.W	D0,-(sp)
	PEA	_Runits
	BSR	_RFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Rattack
	BSR	_RFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Rcity
	BSR	_RFile
	MOVE.W	#$100,D0
	MOVE.W	D0,(sp)
	PEA	_Regions
	BSR	_RFile
	MOVEQ	#$20,D0
	MOVE.W	D0,(sp)
	PEA	_Food
	BSR	_RFile
	MOVE.W	#$4B0,D0
	MOVE.W	D0,(sp)
	PEA	_histo
	BSR	_RFile
	MOVE.W	#$4B0,D0
	MOVE.W	D0,(sp)
	PEA	_hwars
	BSR	_RFile
	MOVE.W	#$E00,D0
	MOVE.W	D0,(sp)
	PEA	_ct
	BSR	_RFile
	MOVE.W	#$3B8,D0
	MOVE.W	D0,(sp)
	PEA	_tp
	BSR	_RFile
	MOVE.W	#$3000,D0
	MOVE.W	D0,(sp)
	PEA	_un
	BSR	_RFile
	MOVE.W	#$FA0,D0
	MOVE.W	D0,(sp)
	PEA	_seen
	BSR	_RFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestType
	BSR	_RFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestVal
	BSR	_RFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestX
	BSR	_RFile
	MOVE.W	#$80,D0
	MOVE.W	D0,(sp)
	PEA	_SDestY
	BSR	_RFile
	MOVE.W	#$90,D0
	MOVE.W	D0,(sp)
	PEA	_first
	BSR	_RFile
	LEA	66(sp),sp
	MOVE.W	#$80,D0
	MOVE.W	D0,-(sp)
	PEA	_killed
	BSR	_RFile
	MOVE.W	#$D00,D0
	MOVE.W	D0,(sp)
	PEA	_cNames
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Rwilly
	BSR	_RFile
	MOVE.W	#$1000,D0
	MOVE.W	D0,(sp)
	PEA	_ReplayData
	BSR	_RFile
	MOVEQ	#$2C,D0
	MOVE.W	D0,(sp)
	PEA	_Wonders
	BSR	_RFile
	MOVE.W	#$1C0,D0
	MOVE.W	D0,(sp)
	PEA	_lost
	BSR	_RFile
	MOVE.W	#$240,D0
	MOVE.W	D0,(sp)
	PEA	_source
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Polluted
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Temp
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Warming
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Options
	BSR	_RFile
	MOVE.W	#$104,D0
	MOVE.W	D0,(sp)
	PEA	_LandMve
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_MaxTech
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_TechBonus
	BSR	_RFile
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	PEA	_Reality
	BSR	_RFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_Science
	BSR	_RFile
	LEA	66(sp),sp
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	PEA	_LastHist
	BSR	_RFile
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	PEA	_HRank
	BSR	_RFile
	MOVE.W	#$5A0,D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	MOVEA.L	12(sp),A5
	MOVE.W	16(sp),D7
	MOVE.W	D7,-(sp)
	MOVE.L	_copy_pointer,-(sp)
	MOVE.L	A5,-(sp)
	JSR	_CopyData
	LEA	10(sp),sp
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,_copy_pointer
	MOVEM.L	(sp)+,A5/D7
	RTS
;
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_GameMap
	LINK	A6,#-$2A
	MOVEM.L	D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	JSR	_hidemouse
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(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	_Rp1,-(sp)
	JSR	_RectCopy
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	32(sp),sp
	MOVEQ	#1,D0
	MOVE.W	_Player,D1
	ASL.W	D1,D0
	MOVE.W	#$3E7,D2
	MOVEQ	#0,D3
	MOVE.W	D1,-22(A6)
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_FirstX,A0
	ADDA.L	D1,A0
	MOVEQ	#$28,D1
	SUB.W	(A0),D1
	MOVE.W	D0,-12(A6)
	MOVE.W	D1,-18(A6)
	MOVE.W	D2,-26(A6)
	MOVE.W	D2,-30(A6)
	MOVE.W	D3,-28(A6)
	MOVE.W	D3,-32(A6)
	TST.W	_debug
	BEQ.S	L1086
	MOVE.W	D3,-18(A6)
	MOVE.W	D3,-20(A6)
	BRA	L1094
;
L1086:
	MOVE.W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Q.W	#1,D6
	BRA	L1096
;
L10A1:
	ADDQ.W	#1,D5
	BRA	L1095
;
L10A2:
	MOVEQ	#1,D0
	CMP.W	_MapView,D0
	BEQ.S	L10A3
	JSR	_WaitForIt
	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
	LEA	20(sp),sp
L10A3:
	JSR	_showmouse
	MOVEM.L	(sp)+,D5-D7/D2-D3
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Power
	LINK	A6,#-8
	MOVEM.L	D5-D7/D2-D3,-(sp)
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#4,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
	MOVEQ	#1,D7
L10A5:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	L10A6
	MOVE.L	D7,D1
	EXT.L	D1
	MOVEQ	#$B,D0
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	MULS	#$28,D0
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A1
	ADDA.L	D1,A1
	MOVE.W	(A1),-(sp)
	MOVEQ	#8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	A0,-(sp)
	JSR	_dPrint
	MOVE.L	D7,D0
	ASL.W	#5,D0
	ADDI.W	#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DA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVEQ	#$A,D0
	MOVE.W	D0,(sp)
	PEA	_ntmp
	MOVE.W	(A0),-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1DED
	PEA	_XEB
	JSR	_strcat
	MOVE.L	D7,D0
	EXT.L	D0
	ASL.L	#5,D0
	LEA	_Rcity,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVEQ	#$A,D0
	MOVE.W	D0,(sp)
	PEA	_ntmp
	MOVE.W	(A0),-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	MOVE.L	D7,D0
	MULS	#$28,D0
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A0
	ADDA.L	D1,A0
	MOVE.W	(A0),(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	56(sp),sp
L10A9:
	ADDQ.W	#1,D7
	BRA	L10A8
;
L10AA:
	ADDQ.W	#1,D6
	BRA	L10A7
;
L10AB:
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	MOVEM.L	(sp)+,D5-D7/D2-D3
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_HistoGraph:
	LINK	A6,#-$12
	MOVEM.L	D2-D7,-(sp)
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#8,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#200,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#320,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	MOVEQ	#$32,D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0,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	16(sp),sp
L10B2:
	ADDI.W	#$32,D4
	BRA	L10AD
;
L10B3:
	MOVEQ	#1,D0
	MOVEA.L	_Rp1,A0
	MOVE.W	D0,16(A0)		;word(long(_Rp1)+16) = 1
	MOVE.L	D0,D6			;d6 = 1  player index for loop
L10B4:					;outer loop to show each player civ-name
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGT	.L10BA			;if d6 > 8 goto .L10BA
	MOVEQ	#1,D1
	MOVE.L	D1,D2
	ASL.W	D6,D2			;d2 = 1<<d6  so  1..8 => 2..256  player bits
	MOVE.W	_Players,D3		;d3 = mask for human player bits
	AND.W	D2,D3
	BNE.S	.L10B5			;if current player human, goto .L10B5
	MOVE.W	_Enemies,D1
	ADDQ.W	#1,D1			;d1 = number of enemies + 1
	CMP.W	D1,D6
	BGT.S	.L10B9			;if player index illegal, goto .L10B9
.L10B5:					;Here d6 is index of human player or legal enemy
	MOVE.L	D6,D1
	EXT.L	D1
	MOVEQ	#$B,D0
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	D6,D0
	ASL.W	#3,D0
	ADDQ.W	#4,D0
	MOVE.L	D6,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A1
	ADDA.L	D1,A1
	MOVE.W	(A1),-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#8,D1
	MOVE.W	D1,-(sp)
	MOVE.L	A0,-(sp)
	JSR	_jPrint
	LEA	10(sp),sp
	MOVEQ	#0,D5
.L10B6:				;inner loop
	MOVE.W	_Rtime,D0
	BPL.S	.L10B7
	ADDQ.W	#3,D0
.L10B7:
	ASR.W	#2,D0
	CMP.W	D0,D5
	BGE.S	.L10B9
	MOVE.L	D5,D0
	EXT.L	D0
	ASL.L	#3,D0
	LEA	_histo,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	ADDA.W	D6,A1
	MOVEQ	#0,D0
	MOVE.B	(A1),D0
	CMP.W	D7,D0
	BLE.S	.L10B8
	MOVE.L	D5,D0
	EXT.L	D0
	ASL.L	#3,D0
	ADDA.L	D0,A0
	ADDA.W	D6,A0
	MOVEQ	#0,D7
	MOVE.B	(A0),D7
.L10B8:
	ADDQ.W	#1,D5
	BRA.S	.L10B6		;loop back (inner)
;
.L10B9:
	ADDQ.W	#1,D6
	BRA	L10B4		;loop back (outer)
;
;
.L10BA:
	MOVEQ	#$F,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#2,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$64,D2
	MOVE.W	D2,-(sp)
	PEA	civ_powergraph_s
	JSR	_dPrint
	LEA	10(sp),sp
	MOVEQ	#1,D6			;d6 = 1  player index
.L10BB:					;outer loop to plot curve for each player
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGE	L10C0			;if d6 >= 8, goto L10C0
	MOVEQ	#1,D0
	MOVE.L	D0,D1
	ASL.W	D6,D1			;d1 = 1<<d6  so  1..8 => 2..256  player bits
	MOVE.W	_Players,D2
	AND.W	D1,D2
	BNE.S	.L10BC			;if current player human, goto .L10BC
	MOVE.W	_Enemies,D0
	ADDQ.W	#1,D0			;d0 = number of enemies + 1
	CMP.W	D0,D6
	BGT	.L10BF			;if player index illegal, goto .L10BF
.L10BC:					;Here d6 is index of human player or legal enemy
	MOVEQ	#0,D4
	MOVEQ	#0,D0
	MOVE.L	D0,D5			;d5=position index (turns/4)
	MOVE.W	D0,-10(A6)
.L10BD:					;inner loop to plot lines
	MOVE.W	_Rtime,D0
	BPL.S	.L10BE
	ADDQ.W	#3,D0			;force -3..-1 to 0..2
.L10BE:
	ASR.W	#2,D0			;divide by 4
	CMP.W	D0,D5
	BGE.S	.L10BF			;if current time reached, goto .L10BF
	CMPI.W	#600/4,D5
	BGE.S	.L10BF			;if past 600 turns (2050 AD), goto .L10BF
	MOVE.L	D5,D0
	ADD.W	D0,D0
	MOVE.L	D5,D1
	EXT.L	D1
	ASL.L	#3,D1			;d1 *= 8 to index 8 histo bytes (1 per civ)
	LEA	_histo,A0
	ADDA.L	D1,A0
	ADDA.W	D6,A0
	MOVEQ	#0,D1
	MOVE.B	(A0),D1
	MULS	#180,D1
	EXT.L	D1
	DIVS	D7,D1
	MOVE.L	D4,D2
	ADDQ.W	#4,D2
	MOVE.W	#$C0,D3
	MOVE.W	D2,24(sp)
	MOVE.L	D3,D2
	SUB.W	-10(A6),D2
	MOVE.W	D0,-12(A6)
	ADDQ.W	#4,D0
	SUB.W	D1,D3
	MOVE.W	D1,-14(A6)
	MOVE.L	D6,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A0
	ADDA.L	D1,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D3,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	D2,-(sp)
	MOVE.W	32(sp),-(sp)
	JSR	_Line
	LEA	10(sp),sp
	MOVE.W	-12(A6),D4
	MOVE.W	-14(A6),-10(A6)
	ADDQ.W	#1,D5
	BRA	.L10BD			;loop back (inner)
;
.L10BF:
	ADDQ.W	#1,D6
	BRA	.L10BB			;loop back (outer)
;
L10C0:
	JSR	_WaitForIt
	JSR	_WarGraph
	JSR	_RestoreScreen
	JSR	_showmouse
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_WarGraph:
	LINK	A6,#-$C
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_TheWonders:
	LINK	A6,#-$C
	MOVEM.L	D2-D7,-(sp)
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVE.W	#$3E7,D5
	MOVEQ	#1,D7
L10C3:
	MOVEQ	#$15,D0
	CMP.W	D0,D7
	BGT	L10CC
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Wonders,A0
	ADDA.L	D0,A0
	MOVEQ	#-1,D0
	CMP.W	(A0),D0
	BEQ	L10CB
	CMPI.W	#$B4,D5
	BLE.S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+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_TheRanks:
	LINK	A6,#-$24
	MOVEM.L	D2-D7,-(sp)
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#5,D0
	MOVE.W	D0,-(sp)
	JSR	_rnd
	MOVEQ	#3,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$C8,D2
	MOVE.W	D2,-(sp)
	MOVE.W	#$140,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D0,-12(A6)
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	MOVEQ	#4,D0
	MOVE.W	D0,(sp)
	JSR	_rnd
	EXT.L	D0
	ASL.L	#2,D0
	LEA	_histText,A0
	ADDA.L	D0,A0
	MOVE.L	(A0),(sp)
	PEA	_XEB
	JSR	_strcpy
	PEA	L1E0B
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#4,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	PEA	L1E0C
	PEA	_XEB
	JSR	_strcpy
	MOVE.W	-12(A6),D0
	EXT.L	D0
	ASL.L	#2,D0
	LEA	_typeText,A0
	ADDA.L	D0,A0
	MOVE.L	(A0),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1E0D
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$C,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	LEA	64(sp),sp
	MOVEQ	#1,D7
L10CE:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	L10CF
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	CLR.W	-32(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:
	ADDQ.W	#1,_HRank
	JSR	_DeBounce
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Demographics:
	LINK	A6,#-$C0
	MOVEM.L	A2/D5-D7/D2-D3,-(sp)
	MOVE.W	8(A6),D7
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	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	Demographics_s
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#4,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	LEA	34(sp),sp
	MOVEQ	#0,D6
L10E5:
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGE.S	L10E6
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	#1,-40(A6,D0.L)
	LEA	-136(A6),A0
	ADDA.L	D0,A0
	LEA	-152(A6),A1
	ADDA.L	D0,A1
	MOVEQ	#0,D1
	MOVE.W	D1,(A1)
	MOVE.W	D1,(A0)
	MOVE.W	D1,-120(A6,D0.L)
	MOVE.W	D1,-104(A6,D0.L)
	MOVE.W	D1,-88(A6,D0.L)
	MOVE.W	D1,-72(A6,D0.L)
	MOVE.W	D1,-56(A6,D0.L)
	LEA	-168(A6),A0
	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SR	_jPrint
	LEA	20(sp),sp
L1121:
	ADDQ.W	#1,D6
	BRA.S	L1120
;
L1122:
	PEA	L1E37
	MOVE.W	-22(A6),-(sp)
	PEA	-16(A6)
	JSR	_RankMe
	MOVEQ	#$C,D0
	ADD.W	D0,-22(A6)
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	MOVEM.L	-216(A6),A2/D5-D7/D2-D3
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_RankMe:
	LINK	A6,#-$A
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	12(A6),D7
	MOVEQ	#1,D5
	MOVE.W	#-$270F,D4
	MOVE.W	_Player,-8(A6)
	MOVEQ	#1,D6
L1124:
	MOVEQ	#8,D0
	CMP.W	D0,D6
	BGE.S	L1128
	MOVEQ	#1,D0
	MOVE.L	D0,D1
	ASL.W	D6,D1
	MOVE.W	_Players,D2
	AND.W	D1,D2
	BEQ.S	L1127
	TST.W	D7
	BPL.S	L1125
	MOVE.L	D6,D1
	EXT.L	D1
	ADD.L	D1,D1
	MOVE.L	D6,D2
	EXT.L	D2
	ADD.L	D2,D2
	MOVEA.L	8(A6),A0
	MOVE.W	0(A0,D2.L),D3
	NEG.W	D3
	MOVE.W	D3,0(A0,D1.L)
L1125:
	MOVE.L	D6,D1
	EXT.L	D1
	ADD.L	D1,D1
	MOVE.W	_Player,D2
	EXT.L	D2
	ADD.L	D2,D2
	MOVEA.L	8(A6),A0
	MOVE.W	0(A0,D1.L),D3
	CMP.W	0(A0,D2.L),D3
	BLE.S	L1126
	ADDQ.W	#1,D5
L1126:
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	0(A0,D0.L),D1
	CMP.W	D4,D1
	BLE.S	L1127
	MOVE.L	D6,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	0(A0,D0.L),D4
	MOVE.W	D6,-8(A6)
L1127:
	ADDQ.W	#1,D6
	BRA.S	L1124
;
L1128:
	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.L	D0,A0
	BTST	#6,1(A0)
	BEQ	L112E
	PEA	L1E3C
	PEA	_XEB
	JSR	_strcpy
	MOVE.W	-8(A6),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	L1E3D
	PEA	_XEB
	JSR	_strcat
	MOVE.W	D4,(sp)
	JSR	_abs
	MOVEQ	#$A,D1
	MOVE.W	D1,(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	MOVE.L	14(A6),(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1E3E
	PEA	_XEB
	JSR	_strcat
	PEA	_XEB
	JSR	_pstrlen
	MOVE.W	#$13E,D1
	SUB.W	D0,D1
	MOVE.W	D7,(sp)
	MOVE.W	D1,70(sp)
	JSR	_abs
	MOVE.W	-8(A6),D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A0
	ADDA.L	D1,A0
	MOVE.W	(A0),(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	72(sp),-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	54(sp),sp
L112E:
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_MyStatus:
	LINK	A6,#-$A
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	JSR	_hidemouse
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(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	_Rp1,-(sp)
	JSR	_RectCopy
	MOVEQ	#1,D0
	MO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	CMPI.W	#$C0,D5
	BGT.S	L1142
L1141:
	ADDQ.W	#1,D6
	BRA	L113D
;
L1142:
	JSR	_WaitForIt
	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
	JSR	_showmouse
	MOVEM.L	-34(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_GameStatus:
	LINK	A6,#-$16
	MOVEM.L	D2-D7,-(sp)
	JSR	_hidemouse
	MOVEQ	#0,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(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	_Rp1,-(sp)
	JSR	_RectCopy
	MOVEQ	#1,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$C5,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$13D,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	JSR	_Window
	LEA	28(sp),sp
	MOVEQ	#0,D0
	MOVEQ	#$12,D4
	MOVE.L	D0,D5
	MOVE.W	D0,-12(A6)
L1144:
	MOVEQ	#$1C,D0
	CMP.W	D0,D5
	BGE	L114A
	CLR.W	-14(A6)
	MOVEQ	#1,D7
L1145:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE.S	L1148
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$38,D1
	JSR	__CXM22
	LEA	_units,A0
	ADDA.L	D0,A0
	MOVE.L	D5,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sp)
	MOVE.W	D4,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	44(sp),sp
L1156:
	ADDQ.W	#8,D4
L1157:
	ADDQ.W	#1,D5
	BRA	L1150
;
L1158:
	ADDQ.W	#1,D7
	BRA	L114D
;
L1159:
	JSR	_WaitForIt
	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
	JSR	_showmouse
	JSR	_Killers
	MOVEM.L	-46(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Killers:
	LINK	A6,#-8
	MOVEM.L	D6-D7/D2-D3,-(sp)
	JSR	_hidemouse
	JSR	_SaveScreen
	MOVEQ	#4,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$C8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$140,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#0,D3
	MOVE.W	D3,-(sp)
	MOVE.W	D3,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
	MOVEQ	#1,D7
L115B:
	MOVEQ	#8,D0
	CMP.W	D0,D7
	BGE	L115C
	MOVE.L	D7,D1
	EXT.L	D1
	MOVEQ	#$B,D0
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	D7,D0
	MULS	#$28,D0
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A1
	ADDA.L	D1,A1
	MOVE.W	(A1),-(sp)
	MOVEQ	#8,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	A0,-(sp)
	JSR	_d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EA	L1E5B
	PEA	_XEB
	JSR	_strcat
	JSR	_TheYear
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$12,D1
	MOVE.W	D1,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_cPrint
	LEA	52(sp),sp
	MOVEM.L	(sp)+,A5/D7/D2
	RTS
;
;
_EndReport
	JSR	_WaitForIt
	JSR	_RestoreScreen
	JSR	_showmouse
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_MrScience
	LINK	A6,#-$12
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	PEA	L1E5C
	BSR	_BeginReport
	ADDQ.W	#6,sp
	MOVEQ	#0,D6
	MOVE.W	_Diff,D0
	ADD.W	D0,D0
	ADD.W	_TechTime,D0
	ADDQ.W	#6,D0
	MOVE.L	D7,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_TechLevel,A0
	MOVEA.L	A0,A1
	ADDA.L	D1,A1
	MOVEQ	#$B,D1
	MOVE.L	D1,D2
	SUB.W	(A1),D2
	MOVE.W	D0,-18(A6)
	CMP.W	D0,D2
	BLE.S	L116C
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	SUB.W	(A1),D1
	MOVE.W	D1,-18(A6)
L116C:
	MOVE.L	D7,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVE.W	-18(A6),D0
	MULS	(A0),D0
	MOVE.W	_Year,D1
	TST.W	D1
	BPL.S	L116D
	MOVEQ	#1,D1
	BRA.S	L116E
;
L116D:
	MOVEQ	#2,D1
L116E:
	MULS	D1,D0
	MOVE.L	D0,D4
	MOVE.L	D4,D0
	ADDQ.W	#1,D0
	MOVE.W	#$980,D1
	EXT.L	D1
	DIVS	D0,D1
	MOVEQ	#$40,D0
	MOVE.W	D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.W	#8,D0
	MOVE.W	-12(A6),D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_first,A0
	ADDA.L	D1,A0
	MOVEQ	#7,D1
	AND.W	(A0),D1
	CMP.W	D7,D1
	BNE.S	L1175
	MOVEQ	#$F,D1
	BRA.S	L1176
;
L1175:
	MOVEQ	#$B,D1
L1176:
	MOVE.W	D1,-(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	10(sp),sp
	ADDQ.W	#1,-14(A6)
	MOVE.W	-14(A6),D0
	EXT.L	D0
	DIVS	#3,D0
	SWAP	D0
	TST.W	D0
	BNE.S	L1177
	ADDQ.W	#7,D5
L1177:
	CMPI.W	#$C0,D5
	BGT.S	L1179
L1178:
	ADDQ.W	#1,-12(A6)
	BRA	L1174
;
L1179:
	BSR	_EndReport
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_MrMilitary:
	LINK	A6,#-8
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	40(sp),D7
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	PEA	L1E5E
	BSR	_BeginReport
	ADDQ.W	#6,sp
	MOVEQ	#0,D4
	MOVEQ	#$20,D6
	MOVEQ	#0,D5
L117B:
	MOVEQ	#$1C,D0
	CMP.W	D0,D5
	BGE	L1180
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$38,D1
	JSR	__CXM22
	LEA	_units,A0
	ADDA.L	D0,A0
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A0
	MOVE.L	D0,28(sp)
	MOVE.W	(A0),D1
	TST.W	D1
	BGT.S	L117C
	MOVE.L	D7,D1
	EXT.L	D1
	MOVEQ	#$38,D0
	JSR	__CXM22
	LEA	_prod,A0
	ADDA.L	D0,A0
	MOVE.L	28(sp),D0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	TST.W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EXT.L	D0
	ADD.L	D0,D0
	ADDA.L	D0,A1
	MOVE.L	D0,28(sp)
	MOVE.W	(A1),D1
	TST.W	D1
	BLE.S	L117E
	CLR.B	_XEB
	MOVE.L	D7,D1
	EXT.L	D1
	MOVEQ	#$38,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.L	28(sp),D0
	ADDA.L	D0,A0
	MOVEQ	#$A,D0
	MOVE.W	D0,-(sp)
	PEA	_ntmp
	MOVE.W	(A0),-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1E64
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$B,D0
	MOVE.W	D0,(sp)
	MOVE.W	D6,-(sp)
	MOVE.W	#$E8,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	28(sp),sp
L117E:
	ADDI.W	#9,D6
L117F:
	ADDQ.W	#1,D5
	BRA	L117B
;
L1180:
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$116,D1
	MOVE.W	D1,-(sp)
	MOVE.L	_Rp1,-(sp)
	MOVEQ	#$3C,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$28,D3
	MOVE.W	D3,-(sp)
	MOVE.W	#$8C,D0
	MOVE.W	D0,-(sp)
	MOVE.W	#$A0,D1
	MOVE.W	D1,-(sp)
	MOVE.L	_RpMap,-(sp)
	JSR	_RectCopy
	BSR	_EndReport
	MOVE.W	D7,(sp)
	JSR	_MrLosses
	MOVEM.L	-32(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_MrLosses:
	LINK	A6,#-$14
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#4,D0
	MOVE.W	D0,-(sp)
	PEA	L1E65
	BSR	_BeginReport
	ADDQ.W	#6,sp
	MOVEQ	#0,D0
	MOVEQ	#$1C,D5
	MOVE.L	D0,D4
	MOVE.W	D0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	MOVE.W	(A0),(sp)
	MOVE.W	D5,-(sp)
	MOVE.W	D6,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	20(sp),sp
L1188:
	ADDQ.W	#1,-8(A6)
	BRA	L1187
;
L1189:
	ADDQ.W	#7,D5
L118A:
	ADDQ.W	#1,D4
	BRA	L1182
;
L118B:
	MOVE.L	D5,D0
	SUBI.W	#$19,D0
	MOVE.W	_Player,D1
	EXT.L	D1
	ADD.L	D1,D1
	LEA	_armycolor,A0
	ADDA.L	D1,A0
	MOVE.W	(A0),-(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#$12,D1
	MOVE.W	D1,-(sp)
	MOVEQ	#$19,D2
	MOVE.W	D2,-(sp)
	MOVEQ	#$64,D3
	MOVE.W	D3,-(sp)
	JSR	_Box
	BSR	_EndReport
	MOVEM.L	-44(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Financial
	LINK	A6,#-$48
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVE.W	_Diff,D0
	BPL.S	L118D
	ADDQ.W	#1,D0
L118D:
	ASR.W	#1,D0
	MOVEQ	#$22,D1
	MOVE.W	D1,-(sp)
	MOVE.W	D7,-(sp)
	MOVE.W	D0,-64(A6)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L118E
	ADDQ.W	#1,-64(A6)
L118E:
	MOVEQ	#$25,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L118F
	ADDQ.W	#1,-64(A6)
L118F:
	MOVEQ	#2,D0
	MOVE.W	D0,-(sp)
	PEA	L1E66
	BSR	_BeginReport
	MOVEQ	#2,D0
	MOVE.W	D0,(sp)
	MOVE.W	#$116,D1
	MOVE.W	D1,-(sp)
	MOVE.L	_Rp1,-(sp)
	MOVEQ	#$3C,D2
	MOVE.W	D2,-(sp)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.W	#$B4,D4
	BGE.S	L11A6
	MOVEQ	#$E,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	MOVE.W	#$A0,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	10(sp),sp
	ADDQ.W	#8,D4
L11A6:
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	MOVE.W	-62(A6,D0.L),D1
	ADD.W	D1,-12(A6)
L11A7:
	ADDQ.W	#1,D5
	BRA	L11A3
;
L11A8:
	PEA	L1E76
	PEA	_XEB
	JSR	_strcpy
	MOVEQ	#$A,D0
	MOVE.W	D0,(sp)
	PEA	_ntmp
	MOVE.W	-12(A6),-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1E77
	PEA	_XEB
	JSR	_strcat
	MOVE.L	D4,D0
	ADDQ.W	#4,D0
	MOVEQ	#$E,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVE.W	#$A0,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_jPrint
	ADDI.W	#$C,D4
	BSR	_EndReport
	MOVEM.L	-96(A6),D2-D7
	UNLK	A6
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Intelligence:
	LINK	A6,#-$24
	MOVEM.L	D5-D7/D2-D3,-(sp)
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	PEA	L1E78
	BSR	_BeginReport
	ADDQ.W	#6,sp
	MOVEQ	#$20,D6
	MOVEQ	#0,D0
	MOVEQ	#1,D5
	MOVE.W	D0,-32(A6)
	MOVE.W	D0,-34(A6)
L11AA:
	MOVEQ	#8,D0
	CMP.W	D0,D5
	BGE	L11B8
	MOVEQ	#1,D0
	ASL.W	D5,D0
	MOVE.W	_Players,D1
	AND.W	D0,D1
	BEQ	L11B7
	MOVE.W	-32(A6),D0
	MULS	#$18,D0
	MOVE.L	D0,D6
	ADDI.W	#$20,D6
	MOV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	D0,D0
	ADDA.L	D0,A0
	BTST	#0,1(A0)
	BEQ.S	L11CE
	PEA	L1E96
	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
	PEA	L1E97
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#7,D0
	MOVE.W	D0,(sp)
	MOVE.W	D5,-(sp)
	MOVEQ	#$18,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_jPrint
	LEA	28(sp),sp
	ADDQ.W	#8,D5
L11CE:
	ADDQ.W	#1,D6
	BRA	L11CB
;
L11CF:
	ADDQ.W	#4,D5
	MOVEQ	#9,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D5,-(sp)
	MOVEQ	#$10,D1
	MOVE.W	D1,-(sp)
	PEA	L1E98
	JSR	_jPrint
	LEA	10(sp),sp
	ADDQ.W	#8,D5
	MOVEQ	#$47,D6
L11D0:
	TST.W	D6
	BMI.S	L11D2
	MOVE.W	D6,-(sp)
	MOVE.W	D7,-(sp)
	JSR	_IsCivilized
	ADDQ.W	#4,sp
	TST.W	D0
	BEQ.S	L11D1
	MOVE.L	D6,D0
	EXT.L	D0
	MOVEQ	#$16,D1
	JSR	__CXM22
	LEA	_cv,A0
	ADDA.L	D0,A0
	MOVEQ	#7,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D5,-(sp)
	MOVEQ	#$18,D1
	MOVE.W	D1,-(sp)
	MOVE.L	A0,-(sp)
	JSR	_jPrint
	LEA	10(sp),sp
	ADDQ.W	#8,D5
	CMPI.W	#$C0,D5
	BGE.S	L11D2
L11D1:
	SUBQ.W	#1,D6
	BRA.S	L11D0
;
L11D2:
	BSR	_EndReport
	MOVEM.L	(sp)+,D4-D7
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Attitude:
	LINK	A6,#-$14
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#9,D0
	MOVE.W	D0,-(sp)
	PEA	atti_survey_1_s
	BSR	_BeginReport
	ADDQ.W	#6,sp
	MOVEQ	#$20,D5
	MOVEQ	#0,D0
	MOVE.W	D0,-14(A6)
	MOVE.W	D0,-16(A6)
	MOVE.W	D0,-18(A6)
	MOVE.L	D0,D4		;d4 = 0,  city index
	MOVE.W	D0,-12(A6)
L11D4:
	CMPI.W	#$80,D4		;max city passed ?
	BGE	L11DA
	MOVE.L	D4,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22		;d0 = d4 * 28
	LEA	_ct,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1		;a1 = _ct + (d4 * 28)
	CMPI.B	#-1,6(A1)	;inhuman city mark ?
	BEQ	L11D9		;skip past inhuman cities
	MOVE.L	D4,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.B	11(A0),D0
	EXT.W	D0
	CMP.W	D7,D0
	BNE	L11D9
	CMPI.W	#190,D5		;pixel Y <= 190 ?
	BLE.S	L11D5
	JSR	_WaitForIt
	MOVEQ	#9,D0
	MOVE.W	D0,-(sp)
	PEA	atti_survey_2_s
	BSR	_ContinueReport
	ADDQ.W	#6,sp
	MOVEQ	#$20,D5
L11D5:
	MOVEQ	#-1,D0
	MOVE.W	D0,-(sp)
	MOVE.W	D4,-(sp)
	JSR	_CityEcon
	CLR.B	_XEB
	MOVE.W	D4,(sp)
	JSR	_CityName
	PEA	L1E9B
	PEA	_XEB
	JSR	_strcat
	MOVEQ	#$F,D0
	MOVE.W	D0,(sp)
	MOVE.W	D5,-(sp)
	MOVEQ	#$10,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_jPrint
	MOVEQ	#7,D0
	AND.W	-12(A6),D0
	MOVE.L	D0,D6
	ADDI.W	#$50,D6
	MOVE.L	D5,D0
	SUBQ.W	#3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DA:
	TST.W	-18(A6)
	BNE.S	L11DB
	ADDQ.W	#1,-18(A6)
L11DB:
attitude_fix_1:
;patch is needed here to ensure valid screen addresses, since original code
;bombs when the number of cities is a precise multiple of 16.
;;;nu_attitude_fix_1:
;;;	cmp	#190,d5
;;;	bls.s	.not_full
;;;	JSR	_WaitForIt
;;;	MOVEQ	#9,D0
;;;	MOVE.W	D0,-(sp)
;;;	PEA	atti_survey_2_s
;;;	BSR	_ContinueReport
;;;	ADDQ.W	#6,sp
;;;	MOVEQ	#$20,D5
;;;.not_full:
;;;	move.l	(sp)+,d0
;;;	PEA	atti_population_s
;;;	move.l	d0,-(sp)
;;;	rts
;;;
	PEA	atti_population_s	;patch to 'jsr nu_attitude_fix_1'
	PEA	_XEB
	JSR	_strcpy
	MOVE.W	D7,(sp)
	JSR	_PopSize
	PEA	L1E9D
	PEA	_XEB
	JSR	_strcat
	MOVE.W	-18(A6),(sp)
	MOVE.W	-16(A6),-(sp)
	JSR	_AXN
	PEA	L1E9E
	PEA	_XEB
	JSR	_strcat
	MOVE.W	-18(A6),D0
	MOVE.L	D0,D1
	SUB.W	-16(A6),D1
	SUB.W	-14(A6),D1
	MOVE.W	D0,(sp)
	MOVE.W	D1,-(sp)
	JSR	_AXN
	PEA	L1E9F
	PEA	_XEB
	JSR	_strcat
	MOVE.W	-18(A6),(sp)
	MOVE.W	-14(A6),-(sp)
	JSR	_AXN
	PEA	L1EA0
	PEA	_XEB
	JSR	_strcat
	MOVE.L	D5,D0
	ADDQ.W	#8,D0
	MOVEQ	#$F,D1
	MOVE.W	D1,(sp)
	MOVE.W	D0,-(sp)
	MOVEQ	#$10,D2
	MOVE.W	D2,-(sp)
	PEA	_XEB
	JSR	_jPrint
	BSR	_EndReport
	MOVEM.L	-44(A6),D2-D7
	UNLK	A6
	RTS
;
;
_AXN
	MOVEM.L	D6-D7/D2,-(sp)
	MOVE.W	16(sp),D7
	MOVE.W	18(sp),D6
	CMPI.W	#$12C,D7
	BGE.S	L11DD
	MOVE.L	D7,D0
	MULS	#$64,D0
	EXT.L	D0
	DIVS	D6,D0
	MOVEQ	#$A,D1
	MOVE.W	D1,-(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	LEA	12(sp),sp
	BRA.S	L11DE
;
L11DD:
	MOVE.L	D7,D0
	MOVEQ	#$A,D1
	MULS	D1,D0
	MOVE.L	D6,D2
	EXT.L	D2
	DIVS	D1,D2
	EXT.L	D0
	DIVS	D2,D0
	MOVE.W	D1,-(sp)
	PEA	_ntmp
	MOVE.W	D0,-(sp)
	JSR	_itoa
	MOVE.L	D0,(sp)
	PEA	_XEB
	JSR	_strcat
	LEA	12(sp),sp
L11DE:
	MOVEM.L	(sp)+,D6-D7/D2
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Cities:
	LINK	A6,#-8
	MOVEM.L	D5-D7,-(sp)
	MOVE.W	8(A6),D7
	MOVEQ	#8,D0
	MOVE.W	D0,-(sp)
	PEA	L1EA1
	BSR	_BeginReport
	ADDQ.W	#6,sp
	MOVEQ	#$20,D6
	MOVEQ	#0,D5
L11E0:
	CMPI.W	#$80,D5
	BGE	L11E5
	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	L11E4
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$1C,D1
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVE.B	11(A0),D0
	EXT.W	D0
	CMP.W	D7,D0
	BNE	L11E4
	CMPI.W	#$C0,D6
	BLT.S	L11E1
	JSR	_WaitForIt
	MOVEQ	#8,D0
	MOVE.W	D0,-(sp)
	PEA	L1EA2
	BSR	_ContinueReport
	ADDQ.W	#6,sp
	MOVEQ	#$20,D6
L11E1:
	MOVEQ	#-1,D0
	MOVE.W	D0,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py
	MOVE.L	D5,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	EXT.L	D0
	MOVEQ	#$3A,D1
	JSR	__CXM22
	LEA	_ld,A0
	ADDA.L	D0,A0
	LEA	16(A0),A1
	MOVE.L	A1,(sp)
	PEA	_XEB
	JSR	_strcpy
	LEA	16(sp),sp
	MOVE.B	_XEB,D0
	BNE.S	L11F8
	MOVE.L	D5,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	L1EAD
	PEA	_XEB
	JSR	_strcat
	LEA	16(sp),sp
L11F8:
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$C,D1
	JSR	__CXM22
	LEA	_ArmyTexts,A0
	ADDA.L	D0,A0
	PEA	_XEB
	MOVE.L	A0,-(sp)
	JSR	_strcpy
	CLR.B	_XEB
	MOVE.L	D7,D0
	EXT.L	D0
	MOVEQ	#$B,D1
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	MOVE.L	_To,-(sp)
	JSR	_strcpy
	MOVE.L	D5,D0
	EXT.L	D0
	MOVEQ	#$B,D1
	JSR	__CXM22
	LEA	_ArmyText,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	MOVE.L	L1C50,-(sp)
	JSR	_strcpy
	LEA	16(sp),sp
	CMP.W	_Player,D7		;Human player ?
	BNE.S	L11F9
	LEA	star_schism_s,A0	;schism splits own nation
	BRA.S	L11FA
;
L11F9:
	LEA	star_eschism_s,A0	;schism splits enemy nation
L11FA:
	MOVE.L	A0,-(sp)
	JSR	_KingTalk
	MOVE.W	#5,_MSource
	MOVEQ	#$50,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	PEA	_XEB
	JSR	_sMenu
	LEA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C,D0
	JSR	__CXM22
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVEQ	#0,D0
	MOVE.B	5(A1),D0
	MOVE.L	D5,D1
	EXT.L	D1
	MOVE.W	D0,20(sp)
	MOVEQ	#$1C,D0
	JSR	__CXM22
	ADDA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.B	5(A0),D0
	MOVE.W	D0,-(sp)
	MOVE.W	22(sp),-(sp)
	MOVE.W	22(sp),-(sp)
	MOVE.W	22(sp),-(sp)
	JSR	_mapdist
	ADDQ.W	#8,sp
	ADD.W	D0,-10(A6)
L121D:
	ADDQ.W	#1,D5
	BRA	L121C
;
L121E:
	MOVE.W	-10(A6),D0
	MOVE.L	D0,D1
	CMP.W	D4,D1
	BGE.S	L121F
	MOVE.L	D0,D4
	MOVE.W	D6,-8(A6)
L121F:
	ADDQ.W	#1,D6
	BRA	L121B
;
L1220:
	MOVE.W	-8(A6),D0
	MOVEM.L	(sp)+,D4-D7
	UNLK	A6
	RTS
;
;
_Protect:
;
;AR:	An older patch replaced this with: "RTS" plus "dc.l CycleOff"
;AR:	but then some game variables were not initialized !
;AR:	A better patch is included further on (in "_Protecto").
;
	JSR	_CycleOff
	MOVEQ	#1,D0
	MOVE.W	D0,-(sp)
	JSR	_Protecto
	ADDQ.W	#2,sp
	TST.W	D0
	BNE.S	L1222
	CLR.W	-(sp)
	JSR	_Protecto
	ADDQ.W	#2,sp
L1222:
	JSR	_ResetScreen
	JSR	_CycleOn
	RTS
;
;
;
;----------------------------------------------------------------------------
;
_Protecto:
	LINK	A6,#-$5E
	MOVEM.L	D2-D7,-(sp)
	MOVE.W	8(A6),D7
	JSR	_hidemouse
L1224:
	MOVEQ	#$48,D0
	MOVE.W	D0,-(sp)
	JSR	_rnd
	ADDQ.W	#2,sp
	MOVE.W	D0,-70(A6)
	EXT.L	D0
	MOVEQ	#$16,D1
	JSR	__CXM22
	LEA	_cv,A0
	MOVEA.L	A0,A1
	ADDA.L	D0,A1
	MOVE.B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__CXM22
	LEA	_cv,A0
	ADDA.L	D0,A0
	MOVE.L	A0,(sp)
	PEA	_XEB
	JSR	_strcat
	PEA	L1EBD
	PEA	_XEB
	JSR	_strcat
	LEA	28(sp),sp
	ADDQ.W	#1,-94(A6)
L1232:
	LEA	-32(A6),A0
	LEA	-64(A6),A1
L1233:
	MOVE.B	(A0)+,(A1)+
	BNE.S	L1233
	MOVEQ	#-1,D0
	CMP.W	-76(A6),D0
	BEQ.S	L1234
	CMPI.W	#$C,-94(A6)
	BLT	L122A
L1234:
	JSR	_showmouse
	MOVE.W	-92(A6),-(sp)
	MOVEQ	#$40,D0
	MOVE.W	D0,-(sp)
	MOVEQ	#$20,D1
	MOVE.W	D1,-(sp)
	MOVE.W	-82(A6),-(sp)
	MOVEQ	#$64,D2
	MOVE.W	D2,-(sp)
	MOVE.L	_Rp1,-(sp)
	JSR	_RectumFill
	MOVEQ	#0,D0
	MOVE.W	D0,_NoHi
	MOVE.W	D0,_DefaultItem
	MOVEQ	#1,D0
	OR.W	-82(A6),D0
	MOVE.W	D0,(sp)
	MOVEQ	#$64,D1
	MOVE.W	D1,-(sp)
	PEA	_XEB
	JSR	_Menu
;
;AR:	Patch to make QUIZ succeed with any answer
;This patch is made here in source, not by loader !
;Original code was (4 lines below):
;;;;
;;;	MOVE.W	D0,-78(A6)	;store users QUIZ answer code
;;;	JSR	_hidemouse	;hide mouse
;;;	LEA	20(sp),sp	;clean 20 bytes off stack
;;;	MOVE.W	-78(A6),D0	;d0 = users QUIZ answer code for testing
;;;;
;
;New code is (4 lines below):
	jsr	_hidemouse	;hide mouse
	lea	20(sp),sp	;clean 20 bytes off stack
	move.w	-80(a6),d0	;d0 = correct QUIZ answer code
	move	d0,-78(a6)	;store as if users QUIZ answer code
;
;This completes the QUIZ patch.
;
	CMP.W	-80(A6),D0	;test if d0 = true QUIZ answer
	BNE.S	L1235
	CLR.B	_XEB
	PEA	L1EBE
	JSR	_KingTalk
	MOVE.W	-92(A6),(sp)
	MOVEQ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_showmouse
	MOVE.W	-78(A6),D1
	CMP.W	-80(A6),D1
	SEQ	D0
	ANDI.W	#1,D0
	MOVEM.L	(sp)+,D2-D7
	UNLK	A6
	RTS
;
;
	dc.b	$00,$00
;
;----------------------------------------------------------------------------
;
_BuildPalace
	LINK	A6,#-$110
	MOVEM.L	A2/D2-D7,-(sp)
	JSR	_hidemouse
	CLR.B	_XEB
	PEA	L1EC5
	JSR	_KingTalk
	PEA	_XEB
	PEA	-272(A6)
	JSR	_strcpy
	MOVEQ	#1,D0
	MOVE.W	D0,(sp)
	CLR.W	-(sp)
	JSR	_CheckForDisk
	MOVEA.L	_Rp1,A0
	MOVE.W	#1,(A0)
	CLR.W	(sp)
	JSR	_ShowPalace
	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	A0,-(sp)
	JSR	_RectumFill
	JSR	_CycleOff
	MOVE.W	_Player,D0
	EXT.L	D0
	ADD.L	D0,D0
	LEA	_Leaders,A0
	ADDA.L	D0,A0
	MOVE.W	(A0),D0
	EXT.L	D0
	MOVEQ	#$3A,D1
	JSR	__CXM22
	LEA	_ld,A0
	ADDA.L	D0,A0
	MOVEQ	#3,D0
	MOVE.W	D0,(sp)
	MOVE.W	56(A0),-(sp)
	JSR	_DoSound
	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
	MOVEQ	#$10,D0
	MOVE.W	D0,(sp)
	MOVEQ	#$14,D1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.W	D0,-(sp)
	MOVE.W	D0,-(sp)
	MOVE.L	_RpBack,-(sp)
	JSR	_RectCopy
	LEA	20(sp),sp
L1267:
	JSR	_DeBounce
	JSR	_WaitForIt
L1268:
	CLR.W	-(sp)
	JSR	_ShowPage
	MOVEQ	#$1A,D0
	MOVE.W	D0,-(sp)
	JSR	_DoSound
	MOVEQ	#1,D0
	MOVE.W	D0,(sp)
	MOVE.W	D0,-(sp)
	JSR	_CheckForDisk
	ADDQ.W	#6,sp
	TST.W	_VGAMode
	BNE.S	L1269
	MOVEQ	#0,D0
	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	_Rp1,-(sp)
	JSR	_RectumFill
	LEA	14(sp),sp
L1269:
	JSR	_ResetScreen
	JSR	_showmouse
	MOVEM.L	(sp)+,A2/D2-D7
	UNLK	A6
	RTS
;
;
;----------------------------------------------------------------------------
;End of file:	CIV_3.S
;----------------------------------------------------------------------------
