; IRA V2.04 (20.12.09) (c)1993-95 Tim Ruehsen, (c)2009 Frank Wille

ABSEXECBASE	EQU	$4
CIAA_PRA	EQU	$BFE001
CIAA_SDR	EQU	$BFEC01
EXT_0003	EQU	$DFF005
VHPOSR		EQU	$DFF006
EXT_0005	EQU	$DFF007
DMACON		EQU	$DFF096


	INCLUDE "exec/types.i"

	INCLUDE "rtgmaster/rtgmaster_lib.i"
	INCLUDE "rtgmaster/rtgmaster.i"
	INCLUDE "rtgmaster/rtgsublibs.i"

	INCLUDE "libraries/gadtools.i"


	SECTION S_0,CODE

start:
	JMP	entry
	DC.B	10,10,10,10
	DC.B	" $VER: NAPALM  V0.278 - CodeName AE/AMI98/DIV/ABLAZE ",10
	DC.B	"  The Crimson Crisis edition developed by ae/cb/pxl  ",10,10,10,0
	DC.B	10,10,10

;LAB_0000:
;	MOVE.L	A7,stackpointer
;	MOVEQ	#6,D0
;	CMPI.B	#$4c,(A0)
;	BNE.S	LAB_0001
;	MOVEQ	#0,D1
;	MOVE.B	1(A0),D1
;	SUBI.B	#$30,D1
;	CMPI.B	#$0a,D1
;	BCC.S	LAB_0001
;	MOVEQ	#9,D0
;	SUB.B	D1,D0

entry:
	MOVE.L	A7,stackpointer
	MOVE.W	D0,entry_d0

;	JSR	doramlib
	JSR	open_libraries

	LEA	rtg_more_stuff,A4
	MOVE.L	#$ed700004,160(A4)

	JSR	init1
	JSR	rtg_init
	JSR	rtg_openfonts
	JSR	load_some_files

	MOVE.W	#$0001,336(A4)
	TST.W	LAB_08A3
	BEQ.S	LAB_0002
	MOVE.W	LAB_08A3,336(A4)
LAB_0002:
	MOVE.W	#$0001,336(A4)
	MOVE.W	#$0001,LAB_08A3
	CLR.W	LAB_08A5
	CLR.W	LAB_08A7
	CLR.W	LAB_08A6
	MOVE.W	#$0000,LAB_08AC
	MOVE.W	#$0001,LAB_08AD

	JSR	intro1

	MOVE.W	LAB_08A6,D0
	CMPI.W	#$0003,D0
	BEQ.W	exit_pretty
LAB_0003:
	JSR	LAB_0007
	MOVE.W	LAB_08A7,D0
	BEQ.S	LAB_0002
	CMPI.W	#$0003,D0
	BEQ.S	exit_pretty
	CLR.W	LAB_08A5
	CMPI.W	#$0002,D0
	BNE.S	LAB_0003
	ADDQ.W	#1,336(A4)
	CMPI.W	#$0010,336(A4)
	BNE.S	LAB_0003
	JSR	LAB_0908
	BRA.W	LAB_0002

exit_pretty:
	JSR	fade_out_rtg
	JSR	LAB_0298
	JSR	LAB_0A52
	MOVEQ	#-2,D0
	JSR	LAB_017E
	JSR	LAB_0289
	JSR	alloc_and_free_mem
	MOVE.L	#$00000000,D1
	JSR	free_mem
	JSR	alloc_and_free_mem
	JSR	close_libraries
	MOVEA.L	stackpointer,A7   ; exit gracefully
	RTS


exit_fail:
	MOVE.L	D0,-(A7)
	JSR	done_intuition_window
	JSR	LAB_0298
	JSR	LAB_0A52
	MOVEQ	#-2,D0
	JSR	LAB_017E
	JSR	LAB_0289
	MOVE.L	#$00000000,D1
	JSR	free_mem
	MOVE.L	(A7)+,D0
	BEQ.S	LAB_0006
	JSR	intui_display_alert
LAB_0006:
	JSR	alloc_and_free_mem
	JSR	close_libraries
	MOVEA.L	stackpointer,A7
	RTS

	DC.B	10
	DC.B	" Red hair of Godness?",10,0


LAB_0007:
	CLR.L	LAB_0375
	MOVE.W	#$0001,LAB_08A8
	JSR	LAB_031D
	CMPI.W	#$0001,LAB_08A7
	BEQ.W	LAB_000B
	CMPI.W	#$0002,LAB_08A6
	BNE.S	LAB_0008
	MOVEQ	#72,D0
	JSR	do_prefs
	BMI.W	exit_fail
	MOVE.W	D0,336(A4)
	MOVE.W	D0,LAB_08A3
	MOVEQ	#73,D0
	JSR	do_prefs
	BMI.W	exit_fail
	SUBQ.W	#1,D0
	ANDI.W	#$0001,D0
	MOVE.W	D0,360(A4)
	BRA.S	LAB_0009
LAB_0008:
	CMPI.W	#$0001,336(A4)
	BNE.W	LAB_000B
LAB_0009:
	MOVEQ	#0,D0
	MOVE.W	LAB_08A5,D0
	BEQ.S	LAB_000A
	JSR	LAB_05F0
	MOVE.W	D0,LAB_08A3
	MOVE.W	D0,336(A4)
	MOVE.W	D1,360(A4)
	MOVE.W	#$0001,LAB_08A6
	TST.B	D2
	BPL.W	LAB_000B
	CLR.W	LAB_08AC
	CLR.W	LAB_08AD
	BSET	#7,162(A4)
	MOVE.W	#$0002,LAB_08A6
	MOVE.L	#$00000001,net_nodenr
	BTST	#6,D2
	BEQ.W	LAB_000B
	MOVE.L	#$00000002,net_nodenr
	BRA.W	LAB_000B
LAB_000A:
	JSR	LAB_08D5
	BMI.W	LAB_001D
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	JSR	fade_out_rtg
	MOVE.W	360(A4),124(A4)
	MOVEQ	#2,D0
	JSR	LAB_08C9
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	JSR	LAB_0276
	MOVE.L	#$00000096,D0
	JSR	dos_delay
	BRA.S	LAB_000C
LAB_000B:
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	JSR	fade_out_rtg
	MOVEQ	#2,D0
	JSR	LAB_08C8
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
LAB_000C:
	MOVE.L	#$ffffffff,156(A4)
	BSR.W	LAB_0097
	MOVE.L	#$00000001,LAB_00B2
	LEA	rtg_stuff,A5
	JSR	rtg_screen_to_front
	JSR	LAB_0A52
	CLR.L	272(A4)
	CLR.L	268(A4)
	MOVEQ	#0,D0
	MOVE.W	LAB_08A5,D0
	BEQ.S	LAB_000D
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	fade_out_rtg
	JSR	clear_buffer
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_0398
LAB_000D:
	MOVE.L	#$ffffffff,156(A4)
	CLR.L	LAB_08B5
	JSR	LAB_0A4C
	BNE.S	LAB_000E
	JSR	LAB_0A52
	MOVE.L	cd_level,LAB_08B5
	SUBQ.L	#1,LAB_08B5
LAB_000E:
	MOVEQ	#0,D0
	JSR	load_rgb_and_pointer
	JSR	LAB_0312
	CLR.B	358(A4)
	TST.B	162(A4)
	BPL.W	LAB_000F
	JSR	LAB_00D1
	JSR	LAB_0312
	JSR	LAB_031D
LAB_000F:
	MOVE.W	#$0400,DMACON
	LEA	rtg_more_stuff,A4
	ADDQ.L	#1,156(A4)
	MOVE.W	158(A4),D0
	ANDI.W	#$00ff,D0
	BNE.S	LAB_0012
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	LAB_0A4C
	BNE.S	LAB_0011
	MOVE.L	LAB_08B5,D0
	ADDQ.W	#1,D0
	MOVE.L	cd_levelnr,D1
	ADD.L	cd_level,D1
	CMP.L	D1,D0
	BCS.S	LAB_0010
	MOVE.L	cd_level,D0
LAB_0010:
	JSR	LAB_0A4A
LAB_0011:
	MOVEM.L	(A7)+,D0-D7/A0-A6
LAB_0012:
	LEA	LAB_08BE,A0
	MOVE.L	0(A0,D0.W),180(A4)
	MOVE.L	156(A4),D0
	ADD.L	D0,180(A4)
	BCLR	#2,163(A4)
	BEQ.S	LAB_0013
	JSR	LAB_0809
	JSR	LAB_0819
LAB_0013:
	JSR	LAB_0837
	JSR	LAB_083B
	MOVE.B	D7,LAB_084B
	BSR.W	LAB_0312
	JSR	LAB_046F
	JSR	LAB_0020
	JSR	LAB_060E
	JSR	LAB_0644
	JSR	LAB_066E
	JSR	LAB_081C
	JSR	LAB_02F9
	JSR	LAB_0302
	JSR	LAB_076E
	JSR	LAB_07D8
	JSR	LAB_0453
	ADDQ.B	#1,264(A4)
	MOVE.B	264(A4),D0
	CMP.B	265(A4),D0
	BCS.S	LAB_0014
	ADDQ.L	#1,268(A4)
	CLR.B	264(A4)
LAB_0014:
	BSR.W	LAB_001E
	BMI.S	LAB_0015
	TST.L	LAB_0375
	BEQ.W	LAB_000F
LAB_0015:
	JSR	clear_buffer
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	LAB_0237
	MOVE.L	LAB_0375,D0
	BNE.S	LAB_0017
	TST.B	162(A4)
	BMI.S	LAB_0016
	CMPI.W	#$0032,90(A3)
	BNE.S	LAB_001A
	ADDQ.W	#1,338(A4)
LAB_0016:
	JSR	LAB_0096
	JSR	LAB_0954
	MOVE.W	#$0002,LAB_08A7
	BRA.W	LAB_001C
LAB_0017:
	CMPI.W	#$0003,D0
	BEQ.S	LAB_0019
	CMPI.W	#$0002,D0
	BEQ.S	LAB_0018
	CLR.W	LAB_08A7
	BRA.S	LAB_001B
LAB_0018:
	MOVE.W	#$0001,LAB_08A7
	BRA.S	LAB_001B
LAB_0019:
	MOVE.W	#$0003,LAB_08A7
	BRA.S	LAB_001B
LAB_001A:
	JSR	LAB_08F5
LAB_001B:
	JSR	LAB_0096
LAB_001C:
	JSR	alloc_and_free_mem
	RTS
LAB_001D:
	CLR.W	LAB_08A7
	RTS
LAB_001E:
	JSR	LAB_0237
	TST.W	90(A3)
	BEQ.S	LAB_001F
	MOVE.W	88(A3),D0
	BPL.S	LAB_001F
	CMPI.W	#$ffc4,D0
	BCC.S	LAB_001F
	JSR	dim_colors_rtg
	JSR	dim_colors_rtg
	JSR	dim_colors_rtg
	JSR	dim_colors_rtg
	TST.W	D7
	BNE.S	LAB_001F
	MOVEQ	#-1,D0
	RTS
LAB_001F:
	MOVEQ	#0,D0
	RTS
LAB_0020:
	TST.B	358(A4)
	BPL.S	LAB_0021
	LEA	LAB_0022,A2
	MOVE.L	232(A4),D7
	MOVE.L	D7,-(A7)
	MOVEQ	#0,D1
	MOVE.B	359(A4),D1
	DC.W	$3032
	MOVE.B	D0,D1
	BSR.W	LAB_0237
	MOVE.L	32(A3),D6
	MOVE.L	D6,-(A7)
	MOVE.L	#$00030000,32(A3)
	MOVE.W	D0,232(A4)
	CLR.W	234(A4)
	JSR	LAB_0122
	MOVE.L	(A7)+,D6
	BSR.W	LAB_0237
	MOVE.L	D6,32(A3)
	MOVE.L	(A7)+,D7
	MOVE.L	D7,232(A4)
	SUBQ.B	#1,359(A4)
	BNE.S	LAB_0021
	BCLR	#7,358(A4)
LAB_0021:
	RTS
LAB_0022:
	DC.L	$00030002,$00040002,$00040001,$00050001
	DC.L	$00050000,$00060000,$00060000,$00060000
LAB_0023:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEQ	#0,D7
	MOVE.B	296(A4),D7
	BEQ.W	LAB_002C
	SUBQ.W	#1,D7
	BNE.S	LAB_0024
	MOVE.B	298(A4),D2
	JSR	LAB_0235
	MOVE.W	#$0001,64(A3)
	MOVE.W	#$002b,68(A3)
	MOVEQ	#12,D0
	MOVE.W	D0,66(A3)
	BRA.W	LAB_002C
LAB_0024:
	SUBQ.W	#1,D7
	BNE.S	LAB_0027
	TST.B	297(A4)
	BEQ.S	LAB_0025
	CLR.B	297(A4)
	MOVEQ	#16,D0
	JSR	LAB_0271
LAB_0025:
	SUBQ.B	#1,299(A4)
	MOVEQ	#0,D0
	MOVE.B	298(A4),D0
	MOVEQ	#0,D1
	MOVE.B	300(A4),D1
	SWAP	D1
	MOVE.B	301(A4),D1
	MOVEQ	#66,D2
	ADDQ.B	#1,304(A4)
	TST.B	299(A4)
	BNE.S	LAB_0026
	MOVEQ	#11,D2
	SUBQ.B	#1,304(A4)
LAB_0026:
	JSR	LAB_0586
	MOVEQ	#0,D2
	MOVEQ	#0,D1
	MOVE.B	302(A4),D1
	SWAP	D1
	MOVE.B	303(A4),D1
	MOVEQ	#2,D0
	BSR.W	LAB_0180
	BSET	#1,29(A0)
	MOVE.L	268(A4),D0
	ADDQ.W	#4,D0
	MOVE.L	D0,292(A4)
	TST.B	299(A4)
	BNE.W	LAB_002C
	CLR.L	292(A4)
	BRA.W	LAB_002C
LAB_0027:
	SUBQ.W	#1,D7
	BNE.W	LAB_0029
	SUBQ.B	#1,299(A4)
	MOVEQ	#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	LAB_0231
	BCHG	#0,10(A0)
	BSR.W	LAB_006A
	BCHG	#0,10(A0)
	MOVEQ	#3,D1
	TST.W	D0
	BPL.S	LAB_0060
LAB_005F:
	JSR	LAB_041B
	MOVEQ	#2,D1
LAB_0060:
	MOVEM.L	(A7)+,D2-D7/A0-A6
	RTS
LAB_0061:
	DC.L	$02050608,$02040508,$02040508,$02040508
	DC.L	$01030408,$01020408,$01020408,$00010308
LAB_0062:
	DC.L	$000d0208,$0e0f0c00
LAB_0063:
	BTST	#5,31(A0)
	BNE.S	LAB_0064
	BTST	#3,31(A0)
	BNE.S	LAB_0064
	BRA.S	LAB_0065
LAB_0064:
	BSET	#3,14(A3)
	BNE.S	LAB_0065
	MOVE.B	180(A4),D0
	ANDI.B	#$03,D0
	BNE.S	LAB_0065
	MOVE.B	8(A0),53(A3)
LAB_0065:
	RTS
LAB_0066:
	MOVE.L	A3,-(A7)
	MOVEA.L	176(A4),A2
	LEA	16(A2),A2
	BTST	#0,10(A0)
	BEQ.S	LAB_0067
	LEA	4096(A2),A2
LAB_0067:
	MOVE.W	#$00fe,D7
LAB_0068:
	TST.W	10(A2)
	BEQ.S	LAB_0069
	TST.B	12(A2)
	BEQ.S	LAB_0069
	MOVE.W	10(A2),D6
	BMI.W	LAB_006F
LAB_0069:
	LEA	16(A2),A2
	DBF	D7,LAB_0068
	MOVEQ	#0,D6
	MOVEQ	#-1,D0
	MOVEA.L	(A7)+,A3
	RTS
LAB_006A:
	MOVE.L	A3,-(A7)
	BSR.W	LAB_0233
	MOVE.W	8(A3),D1
	BMI.W	LAB_0070
	BEQ.W	LAB_0070
	MOVEQ	#0,D2
	MOVE.B	183(A4),D2
LAB_006B:
	CMP.B	D1,D2
	BCS.W	LAB_006C
	LSR.B	#1,D2
	BNE.S	LAB_006B
LAB_006C:
	MOVE.W	10(A0),D0
	MOVE.B	D2,D0
	BEQ.S	LAB_0070
LAB_006D:
	MOVE.W	D0,D4
	BSR.W	LAB_022D
	MOVE.W	D4,D0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0898,A5
	LEA	rtg_more_stuff,A4
	MOVE.W	10(A4),D7
	MOVEQ	#64,D7
	SUBQ.W	#1,D7
LAB_008B:
	MOVE.W	8(A4),D6
	MOVEQ	#64,D6
	SUBQ.W	#1,D6
	MOVEA.L	LAB_008F,A1
LAB_008C:
	MOVE.L	D5,D0
	MOVEA.L	LAB_0898,A0
	LSL.L	#8,D0
	LSL.L	#2,D0
	ADDA.L	D0,A0
	MOVEA.L	A1,A2
	MOVEQ	#31,D0
LAB_008D:
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	MOVE.L	(A0)+,(A1)+
	LEA	2016(A1),A1
	DBF	D0,LAB_008D
	LEA	32(A2),A1
	ADDQ.W	#1,D5
	DBF	D6,LAB_008C
	MOVEA.L	LAB_008F,A1
	MOVE.W	#$3fff,D0
LAB_008E:
	MOVE.L	(A1)+,(A5)+
	DBF	D0,LAB_008E
	DBF	D7,LAB_008B
	MOVE.L	#$544d5021,D1
	JSR	free_mem
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_008F:
	DS.L	1


load_some_files:
	LEA	rtg_more_stuff,A4		;rtg_more_stuff

	MOVEA.L	#blackfog_name,A0
	MOVE.L	#$464f4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_089A

	MOVEA.L	#build_name,A0
	MOVE.L	#$424c5321,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,244(A4)

	MOVEA.L	#buildings_name,A0
	MOVE.L	#$424c4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_0899

	BSR.W	LAB_0082

	MOVEA.L	#buildanim_name,A0
	MOVE.L	#$414e4d21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,196(A4)

	MOVEA.L	#buildshad_name,A0
	MOVE.L	#$42534821,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,280(A4)

	JSR	LAB_07BF
	JSR	LAB_028F
	RTS


LAB_0091:
	MOVEQ	#58,D0
	BSR.W	LAB_00AC
	MOVEQ	#0,D0
	MOVE.W	336(A4),D0
	LEA	humans_mission_name,A5
	TST.W	360(A4)
	BEQ.S	LAB_0092
	LEA	robots_mission_name,A5
LAB_0092:
	MOVEA.L	A5,A0
	JSR	swap_stuff
	MOVE.L	A5,LAB_0095
	MOVEA.L	A5,A0
	MOVE.L	#$4d495321,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,252(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEQ	#12,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVEA.L	D0,A3
	MOVEA.L	A5,A0
	MOVE.L	#$4d495321,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,252(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVE.L	#$41414141,(A3)
	MOVE.L	#$1e1e1e1e,D0
	MOVE.L	#$0f0f0f0f,D6
	ADD.L	D0,D0
	ORI.L	#$01010101,D0
	MOVEQ	#0,D5
LAB_0093:
	CMP.L	(A0),D0
	BEQ.S	LAB_0094
	ADD.L	D5,D5
	ADD.L	D5,D5
	ROR.L	#8,D5
	ADD.L	D5,D5
	ROR.L	#4,D5
	ADD.L	D5,D5
	ADD.B	(A0)+,D5
	NEG.L	D5
	BRA.S	LAB_0093


_LVOAssignPath		EQU -624

LAB_0094:
	MOVEA.L	LAB_0095,A5
	MOVEA.L	A5,A0
	MOVE.L	#$4d495321,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,252(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEQ	#6,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVEA.L	D0,A0
	LEA	LAB_0855,A1
	MOVE.L	(A0),(A1)
	MOVE.W	4(A0),4(A1)
	MOVEA.L	DosBase,A6

	MOVE.L	#napalm_l_name,D1
	MOVE.L	#napalm_g_name,D2
	JSR	_LVOAssignPath(A6)

	MOVEQ	#5,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVE.W	D0,LAB_08A2
	LEA	warzone_name,A5
	MOVEA.L	A5,A0
	JSR	swap_stuff
	MOVEA.L	A5,A0
	MOVE.L	#$5a4f4e21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_0896
	LEA	16(A0),A0
	MOVE.L	A0,LAB_0897
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	CLR.W	LAB_08A1
	MOVEQ	#0,D0
	MOVE.W	LAB_08A2,D0
	LEA	chunkyg_name,A0
	JSR	swap_stuff
	MOVEA.L	#chunkyg_name,A0
	MOVE.L	#$54494c21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_0898
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	BSR.W	LAB_008A
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#pxicons_name,A0
	MOVE.L	#$49434f21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,248(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#pxboard_name,A0
	MOVE.L	#$42524421,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,224(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#sxother_name,A0
	MOVE.L	#$53584f21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,168(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#sxcrash_name,A0
	MOVE.L	#$53584321,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,312(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#sxfires_name,A0
	MOVE.L	#$53584621,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,316(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#sxfogge_name,A0
	MOVE.L	#$5a464721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,320(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#sxfoton_name,A0
	MOVE.L	#$5a504821,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,324(A4)
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#vxshade_name,A0
	MOVE.L	#$53484421,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_089C
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#vxcamuf_name,A0
	MOVE.L	#$434d4621,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_089E
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	MOVEA.L	#vxtable_name,A0
	MOVE.L	#$4d524721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	exit_fail
	MOVE.L	A0,LAB_089D
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	JSR	LAB_08BF
	LEA	rtg_more_stuff,A4
	CLR.L	104(A4)
	CLR.L	108(A4)
	CLR.L	128(A4)
	CLR.L	132(A4)
	CLR.L	136(A4)
	CLR.L	228(A4)
	CLR.L	236(A4)
	CLR.L	240(A4)
	CLR.L	256(A4)
	CLR.L	272(A4)
	MOVE.B	#$ff,108(A4)
	CLR.W	LAB_079F
	RTS
LAB_0095:
	DS.L	1
LAB_0096:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.L	#$4d495321,D1
	JSR	free_mem
	MOVE.L	#$5a4f4e21,D1
	JSR	free_mem
	JSR	alloc_and_free_mem
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0097:
	MOVE.L	#$00000014,LAB_00B1
	CLR.L	LAB_00B2
	LEA	rtg_more_stuff,A4
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	alloc_and_free_mem
	MOVE.L	#$42475321,D1
	MOVE.L	#$00008000,D0
	JSR	alloc_mem
	MOVE.L	A0,96(A4)
	MOVE.L	#$ffffffff,(A0)
	MOVE.L	#$42415321,D1
	MOVE.L	#$00000800,D0
	JSR	alloc_mem
	MOVE.L	A0,184(A4)
	LEA	1024(A0),A0
	MOVE.L	A0,188(A4)
	MOVE.L	#$53514421,D1
	MOVE.L	#$00000400,D0
	JSR	alloc_mem
	MOVE.L	A0,140(A4)
	LEA	512(A0),A0
	MOVE.L	A0,144(A4)
	MOVE.L	#$424c4621,D1
	MOVE.L	#$00000080,D0
	JSR	alloc_mem
	MOVE.L	A0,276(A4)
	MOVE.L	#$424c4421,D1
	MOVE.L	#$00002000,D0
	JSR	alloc_mem
	MOVE.L	A0,176(A4)
	MOVE.L	#$53525421,D1
	MOVE.L	#$00001000,D0
	JSR	alloc_mem
	MOVE.L	A0,200(A4)
	MOVE.L	#$49505321,D1
	MOVE.L	#$00000400,D0
	JSR	alloc_mem
	MOVE.L	A0,204(A4)
	LEA	64(A0),A0
	MOVE.L	A0,208(A4)
	MOVE.L	#$45585421,D1
	MOVE.L	#$00004000,D0
	JSR	alloc_mem
	MOVE.L	A0,164(A4)
	MOVE.W	#$0fff,D0
LAB_0098:
	MOVE.L	#$ffffffff,(A0)+
	DBF	D0,LAB_0098
	MOVE.L	blit_height,D7
	MULU	#$0040,D7
	MOVE.L	#$50414e21,D1
	MOVE.L	D7,D0
	JSR	alloc_mem
	MOVE.L	A0,LAB_089B
	MOVEA.L	112(A4),A2
	MOVE.W	#$1fff,D0
LAB_0099:
	MOVE.L	#$ffffffff,(A2)+
	DBF	D0,LAB_0099
	BSR.W	LAB_0091
	MOVEQ	#2,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVE.W	D0,LAB_08A4
	MOVEQ	#4,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVE.L	D0,LAB_08A0
	MOVEQ	#12,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	AND.L	D6,D5
	ADD.L	D6,D6
	ADD.L	D6,D6
	ADDI.L	#$05050505,D6
	ADD.L	D6,D5
	MOVE.B	D5,D4
	LSR.L	#8,D5
	LSL.L	#8,D4
	MOVE.B	D5,D4
	LSR.L	#8,D5
	LSL.L	#8,D4
	MOVE.B	D5,D4
	LSR.L	#8,D5
	LSL.L	#8,D4
	MOVE.B	D5,D4
	MOVEA.L	D0,A0
	CMP.L	(A0),D4
	BNE.W	LAB_00AB
	CLR.L	LAB_08B5
	TST.L	LAB_02D3
	BNE.S	LAB_009A
	MOVEQ	#12,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVE.L	D0,LAB_08B5
LAB_009A:
	MOVEQ	#10,D0
	JSR	LAB_0341
	BMI.W	exit_fail
	MOVEA.L	D0,A0
	BSR.W	LAB_00B4
	BSR.W	LAB_00B3
	BSET	#7,160(A4)
	BTST	#5,343(A4)
	BEQ.S	LAB_009B
	BCLR	#7,160(A4)
LAB_009B:
	MOVEQ	#32,D0
	BSR.W	LAB_00AC
	CMPI.W	#$0002,LAB_08A6
	BNE.S	LAB_009C
	MOVEQ	#71,D0
	JSR	do_prefs
	BMI.W	exit_fail
	MOVE.W	D0,LAB_08A4
	MOVEQ	#70,D0
	JSR	do_prefs
	BMI.W	exit_fail
	MOVE.L	D0,LAB_08A0
LAB_009C:
	MOVEA.L	184(A4),A3
	MOVE.W	336(A4),D0
	MOVE.W	D0,72(A3)
	BCLR	#0,14(A3)
	MOVE.L	LAB_089F,D2
	MOVE.L	LAB_08A0,D0
	MOVEQ	#0,D1
	MOVE.W	LAB_08A4,D1
	TST.W	LAB_08AC
	BEQ.S	LAB_009F
	CMPI.L	#$44424141,D2
	BEQ.S	LAB_009E
	ANDI.L	#$00ffffff,D2
	CMPI.B	#$50,LAB_089F
	BEQ.S	LAB_009D
	ORI.L	#$50000000,D2
	BRA.S	LAB_009E
LAB_009D:
	ORI.L	#$44000000,D2
LAB_009E:
	LSL.L	#5,D0
	BSET	#0,14(A3)
	ADDQ.W	#1,D1
	MOVE.W	#$0001,124(A4)
LAB_009F:
	MOVE.L	D0,4(A3)
	MOVE.L	D2,74(A3)
	BTST	#6,343(A4)
	BEQ.S	LAB_00A0
	MOVE.W	VHPOSR,D0
	ANDI.W	#$01ff,D0
	ADDI.W	#$012c,D0
	BRA.W	LAB_00A1
LAB_00A0:
	MOVE.W	VHPOSR,D0
	ANDI.W	#$1fff,D0
	ADDI.W	#$1000,D0
LAB_00A1:
	MOVE.W	D0,54(A3)
	MOVE.L	D1,D0
	JSR	LAB_033B
	MOVEA.L	188(A4),A3
	MOVE.W	336(A4),D0
	MOVE.W	D0,72(A3)
	BCLR	#0,14(A3)
	MOVE.L	LAB_089F,D2
	MOVE.L	LAB_08A0,D0
	MOVEQ	#0,D1
	MOVE.W	LAB_08A4,D1
	TST.W	LAB_08AD
	BEQ.S	LAB_00A4
	CMPI.L	#$44424141,D2
	BEQ.S	LAB_00A3
	ANDI.L	#$00ffffff,D2
	CMPI.B	#$50,LAB_089F
	BEQ.S	LAB_00A2
	ORI.L	#$50000000,D2
	BRA.S	LAB_00A3
LAB_00A2:
	ORI.L	#$44000000,D2
LAB_00A3:
	LSL.L	#5,D0
	BSET	#0,14(A3)
	ADDQ.W	#1,D1
	MOVE.W	#$0000,124(A4)
LAB_00A4:
	MOVE.L	D0,4(A3)
	MOVE.L	D2,74(A3)
	BTST	#6,343(A4)
	BEQ.S	LAB_00A5
	MOVE.W	VHPO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W	#1,D1
	BEQ.S	LAB_00C4
	MOVE.W	10(A4),D3
	SUBQ.W	#2,D3
	SUBQ.W	#1,D1
	BEQ.S	LAB_00C4
	MOVEQ	#1,D2
LAB_00C4:
	MOVEQ	#0,D1
	MOVE.B	D2,D1
	LSL.W	#8,D1
	MOVE.B	D3,D1
	RTS
LAB_00C5:
	TST.B	162(A4)
	BMI.S	LAB_00C7
	MOVEQ	#0,D1
	MOVEA.L	184(A4),A3
	BTST	#0,14(A3)
	BEQ.S	LAB_00C6
	MOVEQ	#1,D1
	MOVEA.L	188(A4),A3
	BTST	#0,14(A3)
	BEQ.S	LAB_00C6
	MOVEQ	#-1,D1
LAB_00C6:
	MOVE.W	D1,124(A4)
	RTS
LAB_00C7:
	MOVEQ	#0,D1
	BTST	#6,162(A4)
	BEQ.S	LAB_00C6
	MOVEQ	#1,D1
	BRA.S	LAB_00C6
LAB_00C8:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	TST.B	162(A4)
	BPL.W	LAB_00CC
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	JSR	fade_out_rtg
	MOVE.L	net_nodenr,D0
	SUBQ.L	#1,D0
	ANDI.L	#$00000001,D0
	MOVE.W	D0,124(A4)
	MOVEQ	#2,D0
	JSR	LAB_08C9
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B

	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	MOVEA.L	LAB_02B0,A1
	JSR	_LVORtgSetFont(A6)

	MOVEM.L	(A7)+,D0-D7/A0-A6
	MOVE.L	#$00000064,D0
	MOVE.L	#$000000be,D1
	BSR.W	LAB_00CD
	MOVE.L	#$00000066,D0
	MOVE.L	#$000000c0,D1
	BSR.W	LAB_00CD
	MOVE.L	#$00000068,D0
	MOVE.L	#$000000c2,D1
	BSR.W	LAB_00CD
	JSR	LAB_07E0
	MOVEQ	#90,D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EM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_00D1:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.L	net_nodenr,D1
	MOVEQ	#8,D7
	JSR	call_net_device
	MOVEQ	#20,D1
	JSR	dos_delay
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_00D2:
	BSR.W	LAB_023A
	BNE.W	LAB_00D3
	TST.W	LAB_079F
	BMI.W	LAB_00D3
	TST.B	LAB_084B
	BNE.W	LAB_00D3
	MOVEQ	#0,D7
	MOVE.B	LAB_084A,D7
	BMI.S	LAB_00D3
	CMPI.B	#$40,D7
	BEQ.W	LAB_00D8
	CMPI.B	#$19,D7
	BEQ.W	LAB_00D5
	CMPI.B	#$14,D7
	BEQ.S	LAB_00D4
LAB_00D3:
	RTS
LAB_00D4:
	MOVE.W	#$ffff,LAB_079C
	CLR.W	LAB_079F
	CLR.W	LAB_07A0
	RTS
LAB_00D5:
	TST.B	162(A4)
	BMI.S	LAB_00D7
	MOVE.W	#$0059,LAB_079C
LAB_00D6:
	JSR	LAB_0780
	MOVE.B	#$ff,108(A4)
	JSR	LAB_07D8
	JSR	LAB_0837
	CMPI.B	#$19,LAB_084A
	BNE.S	LAB_00D6
	MOVE.W	#$0008,LAB_079D
LAB_00D7:
	RTS
LAB_00D8:
	MOVE.B	#$ff,108(A4)
	BCLR	#7,163(A4)
	BCLR	#6,163(A4)
	BCLR	#5,163(A4)
	BSET	#2,163(A4)
	BCHG	#3,160(A4)
	BEQ.S	LAB_00D9
	MOVE.W	104(A4),D0
	CMP.W	62(A4),D0
	BCS.S	LAB_00D9
	MOVE.W	62(A4),104(A4)
	CLR.L	344(A4)
LAB_00D9:
	RTS
LAB_00DA:
	LEA	rtg_more_stuff,A4
	BSR.W	LAB_0231
	CLR.L	36(A3)
	CLR.L	40(A3)
	MOVEQ	#0,D0
	BTST	#0,14(A3)
	BNE.W	LAB_0175
	MOVE.B	162(A4),D0
	BPL.S	LAB_00DD
	ANDI.W	#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D1,D2
	LSR.W	#8,D2
	ANDI.W	#$0001,D2
	CMP.W	126(A4),D2
	BEQ.S	LAB_010D
	TST.W	D1
	BMI.W	LAB_010C
	MOVE.W	#$4043,D1
	BRA.S	LAB_010D
LAB_010C:
	MOVE.W	#$4042,D1
LAB_010D:
	CMP.W	236(A4),D1
	BEQ.S	LAB_010E
	MOVE.W	#$0008,238(A4)
	MOVE.W	D1,236(A4)
LAB_010E:
	MOVEQ	#1,D0
	BRA.S	LAB_0111
LAB_010F:
	CMPI.B	#$02,D0
	BNE.S	LAB_0110
	BSR.W	LAB_022E
	TST.W	(A0)
	BNE.S	LAB_0110
	CLR.W	78(A3)
LAB_0110:
	BTST	#7,163(A4)
	BNE.W	LAB_0111
	CLR.W	236(A4)
LAB_0111:
	JSR	load_rgb_and_pointer
LAB_0112:
	BTST	#0,358(A4)
	BNE.W	LAB_012F
	BCLR	#0,162(A4)
	CMPI.W	#$0002,130(A4)
	BEQ.W	LAB_0116
	CLR.L	132(A4)
	CLR.L	136(A4)
	BTST	#4,163(A4)
	BEQ.S	LAB_0113
	BSR.W	LAB_0227
	BRA.W	LAB_0113
LAB_0113:
	BTST	#1,358(A4)
	BNE.W	LAB_011F
	BCLR	#4,162(A4)
	BEQ.S	LAB_0115
	CMPI.L	#$00000008,328(A4)
	BCC.S	LAB_0114
	BSR.W	LAB_0129
LAB_0114:
	CLR.L	328(A4)
LAB_0115:
	BCLR	#3,163(A4)
	BCLR	#5,163(A4)
	MOVEQ	#-1,D4
	BCLR	#1,163(A4)
	BTST	#7,163(A4)
	BNE.W	LAB_0208
	CMPI.W	#$0002,130(A4)
	BNE.W	LAB_0128
LAB_0116:
	MOVEQ	#1,D6
	MOVE.W	132(A4),D0
	MOVE.W	134(A4),D1
	MOVE.W	136(A4),D2
	MOVE.W	138(A4),D3
	BEQ.S	LAB_011E
LAB_0117:
	MOVEQ	#0,D5
	BTST	#4,D0
	BEQ.S	LAB_0118
	ADD.W	D5,D0
LAB_0118:
	LSR.W	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1,328(A4)
	CMPI.L	#$00000004,328(A4)
	BCS.W	LAB_0128
	MOVEQ	#0,D0
	JSR	load_rgb_and_pointer
LAB_0122:
	MOVEQ	#32,D5
	SUB.L	D4,D4
	MOVE.W	104(A4),D4
	LSL.W	#5,D4
	ADD.W	344(A4),D4
	MOVE.W	34(A3),D0
	MOVE.W	234(A4),D1
	SUB.W	D1,D0
	LSL.W	#2,D0
	ADD.W	D0,D4
	BMI.S	LAB_0123
	DIVU	D5,D4
	MOVE.W	8(A4),D3
	SUB.W	40(A4),D3
	CMP.W	D3,D4
	BCS.W	LAB_0124
	SUB.L	D4,D4
	MOVE.W	D3,D4
	BRA.S	LAB_0124
LAB_0123:
	SUB.L	D4,D4
LAB_0124:
	MOVE.W	D4,104(A4)
	SWAP	D4
	MOVE.W	D4,344(A4)
	SUB.L	D4,D4
	MOVE.W	106(A4),D4
	LSL.W	#5,D4
	ADD.W	346(A4),D4
	MOVE.W	32(A3),D0
	MOVE.W	232(A4),D1
	SUB.W	D1,D0
	LSL.W	#2,D0
	ADD.W	D0,D4
	BMI.S	LAB_0125
	DIVU	D5,D4
	MOVE.W	10(A4),D3
	SUB.W	42(A4),D3
	CMP.W	D3,D4
	BCS.W	LAB_0126
	SUB.L	D4,D4
	MOVE.W	D3,D4
	BRA.S	LAB_0126
LAB_0125:
	SUB.L	D4,D4
LAB_0126:
	MOVE.W	D4,106(A4)
	SWAP	D4
	MOVE.W	D4,346(A4)
	MOVE.B	#$ff,108(A4)
	BRA.S	LAB_0128
LAB_0127:
	BSR.W	LAB_0129
LAB_0128:
	RTS
LAB_0129:
	MOVEA.L	276(A4),A2
	CLR.L	8(A2)
	MOVEA.L	176(A4),A2
	CLR.L	8(A2)
	CLR.W	78(A3)
	CLR.L	132(A4)
	CLR.L	136(A4)
	CLR.L	152(A4)
	CLR.W	(A3)
	MOVEQ	#1,D0
	MOVEQ	#0,D1
	MOVEQ	#0,D2
	BSR.W	LAB_0179
	RTS
LAB_012A:
	BSET	#3,163(A4)
	BNE.W	LAB_0132
	MOVE.W	4(A5),D0
	BPL.S	LAB_0128
	TST.B	D0
	BEQ.S	LAB_0128
	MOVE.W	#$0004,78(A3)
	BRA.W	LAB_0132
LAB_012B:
	BRA.S	LAB_012C
	DC.L	$08ec0003,$00a36600,$0172302d,$00046aa0
	DC.L	$4a00679c,$610015ae,$4a2a000c,$6700ff92
	DC.L	$082a0005,$000e6788,$377c0008,$004e6000
	DC.W	$014a
LAB_012C:
	BSET	#3,163(A4)
	BNE.W	LAB_0132
	MOVEQ	#4,D0
	JSR	LAB_0592
	TST.W	D6
	BEQ.W	LAB_012E
	MOVE.W	4(A5),D0
	BPL.W	LAB_0128
	TST.B	D0
	BEQ.W	LAB_0128
	BSR.W	LAB_022D
	TST.B	12(A2)
	BEQ.W	LAB_0128
	BTST	#5,14(A2)
	BEQ.W	LAB_0128
	CMPI.B	#$0c,3(A2)
	BEQ.W	LAB_012D
	CMPI.B	#$02,3(A2)
	BNE.W	LAB_0128
LAB_012D:
	BTST	#5,15(A2)
	BNE.W	LAB_0128
	MOVEQ	#0,D0
	MOVE.B	8(A2),D0
	SUBQ.W	#1,D0
	MOVEA.L	244(A4),A2
	LSL.W	#7,D0
	ADDA.W	D0,A2
	MOVEQ	#0,D0
	MOVE.B	79(A2),D0
	MOVEQ	#0,D1
	MOVE.B	80(A3),D1
	LEA	LAB_0340,A1
	SUBQ.W	#1,D1
	BMI.W	LAB_0128
	DC.W	$43f1
	MOVE.B	D0,D3
	ADDA.W	D0,A1
	MOVE.B	(A1),D1
	CMP.B	80(A3,D0.W),D1
	BCS.W	LAB_0128
	BEQ.W	LAB_0128
	MOVE.W	#$0005,78(A3)
	BRA.W	LAB_0132
LAB_012E:
	BSET	#3,163(A4)
	BNE.W	LAB_0132
	MOVE.W	#$0000,78(A3)
	BRA.W	LAB_0132
LAB_012F:
	MOVEQ	#0,D4
	BTST	#4,163(A4)
	BNE.W	LAB_0208
	BTST	#6,163(A4)
	BEQ.S	LAB_0130
	T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W	#$0006,D1
	BCS.S	LAB_0137
	MOVE.W	#$0002,78(A3)
	CLR.W	128(A4)
LAB_0137:
	BRA.S	LAB_0132
LAB_0138:
	BSET	#0,162(A4)
	BNE.S	LAB_013A
	MOVE.L	148(A4),D1
	MOVE.L	D1,152(A4)
	BTST	#4,D4
	BEQ.S	LAB_0139
	BSET	#31,D1
LAB_0139:
	MOVEQ	#0,D2
	MOVEQ	#1,D0
	BSR.W	LAB_0179
	RTS
LAB_013A:
	BRA.W	LAB_0133
LAB_013B:
	BSET	#0,162(A4)
	BNE.S	LAB_013D
	MOVE.L	148(A4),D1
	MOVE.L	D1,152(A4)
	MOVE.L	D1,256(A4)
	BTST	#5,D4
	BEQ.S	LAB_013C
	BSET	#30,D1
LAB_013C:
	BSET	#15,D1
	MOVEQ	#0,D2
	MOVEQ	#2,D0
	BSR.W	LAB_0179
	MOVEQ	#2,D0
	BSR.W	LAB_026E
LAB_013D:
	RTS
LAB_013E:
	BSET	#0,162(A4)
	BNE.S	LAB_0141
	MOVE.L	148(A4),D1
	MOVE.L	D1,152(A4)
	MOVE.L	D1,256(A4)
	BTST	#5,D4
	BEQ.S	LAB_013F
	BSET	#30,D1
LAB_013F:
	BTST	#7,D4
	BEQ.S	LAB_0140
	BSET	#31,D1
LAB_0140:
	BSET	#15,D1
	MOVEQ	#0,D2
	MOVEQ	#3,D0
	BSR.W	LAB_0179
	MOVEQ	#2,D0
	BSR.W	LAB_026E
LAB_0141:
	RTS
LAB_0142:
	BTST	#7,14(A3)
	BNE.W	LAB_0144
	MOVEQ	#0,D2
	MOVEA.L	276(A4),A0
	MOVE.L	(A0),D1
	LSR.L	#5,D1
	MOVE.B	10(A0),D2
	MOVEQ	#4,D0
	BSR.W	LAB_0179
LAB_0143:
	CLR.W	78(A3)
LAB_0144:
	RTS
LAB_0145:
	BSET	#0,162(A4)
	BNE.S	LAB_0146
	MOVE.L	148(A4),D1
	MOVE.L	D1,152(A4)
	MOVE.L	D1,256(A4)
	MOVE.W	4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1
	BSR.W	LAB_0117
	RTS
LAB_016C:
	MOVE.W	(A3),D0
	BEQ.S	LAB_016E
	BSR.W	LAB_022D
	TST.W	10(A2)
	BEQ.S	LAB_016E
	TST.B	12(A2)
	BEQ.S	LAB_016E
	CMPI.B	#$02,3(A2)
	BEQ.S	LAB_016D
	CMPI.B	#$0c,3(A2)
	BNE.S	LAB_016E
LAB_016D:
	MOVE.W	#$0009,78(A3)
LAB_016E:
	RTS
LAB_016F:
	BSET	#0,162(A4)
	BNE.S	LAB_0170
	MOVE.L	148(A4),D1
	MOVEQ	#26,D0
	MOVEQ	#0,D2
	BSR.W	LAB_0179
LAB_0170:
	RTS
LAB_0171:
	MOVE.W	(A3),D0
	BEQ.S	LAB_0172
	BSR.W	LAB_022D
	MOVE.W	10(A2),D0
	BEQ.S	LAB_0172
	BTST	#5,14(A2)
	BEQ.S	LAB_0172
	LSR.W	#8,D0
	ANDI.W	#$0001,D0
	CMP.W	126(A4),D0
	BNE.W	LAB_0172
	MOVEQ	#0,D1
	MOVE.W	(A3),D1
	MOVEQ	#27,D0
	MOVEQ	#0,D2
	BSR.W	LAB_0179
LAB_0172:
	RTS
LAB_0173:
	MOVEQ	#28,D0
	MOVEQ	#0,D2
	BSR.W	LAB_0179
	RTS
LAB_0174:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	36(A3),A0
	MOVEQ	#8,D0
	MOVEQ	#4,D7
	MOVE.L	net_nodenr,D1
	JSR	call_net_device
	TST.W	D0
	BNE.S	LAB_0176
	CMPI.L	#$44495645,36(A3)
	BEQ.S	LAB_0178
	MOVE.B	36(A3),D0
	CMPI.B	#$ff,D0
	BEQ.S	LAB_0178
	CMPI.B	#$fe,D0
	BEQ.S	LAB_0177
	CMPI.B	#$fd,D0
	BEQ.S	LAB_0176
	MOVE.L	272(A4),D0
	ADD.L	40(A3),D0
	ADD.W	36(A3),D0
	ADD.B	39(A3),D0
	ADD.L	156(A4),D0
	MOVE.W	D0,D1
	SWAP	D0
	ADD.W	D0,D1
	CMP.B	38(A3),D1
	BNE.S	LAB_0178
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0175:
	BRA.W	LAB_0132
LAB_0176:
	MOVE.W	#$0047,LAB_079C
	MOVEQ	#-3,D0
	JSR	LAB_017E
	BCLR	#7,162(A4)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0177:
	MOVE.W	#$0046,LAB_079C
	MOVEQ	#-2,D0
	JSR	LAB_017E
	BCLR	#7,162(A4)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0178:
	MOVE.W	#$0048,LAB_079C
	MOVEQ	#-1,D0
	JSR	LAB_017E
	BCLR	#7,162(A4)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0179:
	TST.B	D0
	BEQ.S	LAB_017A
	BSR.W	LAB_0231
	MOVE.B	D0,36(A3)
	MOVE.B	D2,39(A3)
	MOVE.L	D1,40(A3)
LAB_017A:
	RTS
LAB_017B:
	TST.B	162(A4)
	BPL.W	LAB_017D
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_0231
	MOVE.B	162(A4),D0
	ANDI.W	#$0040,D0
	LSR.W	#6,D0
	CMP.W	126(A4),D0
	BNE.W	LAB_017C
	MOVE.L	272(A4),D0
	ADD.L	40(A3),D0
	ADD.W	36(A3),D0
	ADD.B	39(A3),D0
	ADD.L	156(A4),D0
	MOVE.W	D0,D1
	SWAP	D0
	ADD.W	D0,D1
	MOVE.B	D1,38(A3)
	LEA	36(A3),A0
	MOVEQ	#8,D0
	MOVEQ	#5,D7
	MOVE.L	net_nodenr,D1
	JSR	call_net_device
LAB_017C:
	MOVEM.L	(A7)+,D0-D7/A0-A6
LAB_017D:
	RTS
LAB_017E:
	TST.B	162(A4)
	BPL.W	LAB_017F
	MOVE.B	D0,36(A3)
	LEA	36(A3),A0
	MOVEQ	#8,D0
	MOVEQ	#5,D7
	MOVE.L	net_nodenr,D1
	JSR	call_net_device
LAB_017F:
	RTS
LAB_0180:
	BSET	#0,163(A4)
	CLR.B	22(A0)
	BSR.W	LAB_0233
	BSR.W	LAB_0187
	BSR.W	LAB_04A0
LAB_0181:
	RTS
LAB_0182:
	BSR.W	LAB_023A
	BEQ.S	LAB_0183
	TST.W	90(A3)
	BNE.S	LAB_0183
	ADDQ.W	#1,338(A4)
LAB_0183:
	JMP	LAB_0833
LAB_0184:
	BCLR	#0,163(A4)
	BSR.W	LAB_0231
	TST.L	8(A3)
	BNE.S	LAB_0185
	TST.B	162(A4)
	BPL.S	LAB_0182
	ADDQ.W	#1,96(A3)
	CMPI.W	#$012c,96(A3)
	BCC.S	LAB_0182
	BRA.S	LAB_0186
LAB_0185:
	CLR.W	96(A3)
LAB_0186:
	BTST	#0,14(A3)
	BNE.S	LAB_0181
	MOVEQ	#0,D0
	MOVE.B	36(A3),D0
	BEQ.S	LAB_0181
	MOVEQ	#0,D2
	MOVE.L	40(A3),D1
	MOVE.B	39(A3),D2
LAB_0187:
	SUBQ.W	#1,D0
	BNE.W	LAB_01A7
	MOVE.L	D1,D5
	BCLR	#31,D1
	BNE.W	LAB_0188
	JSR	LAB_05A7
LAB_0188:
	TST.L	D1
	BEQ.S	LAB_018E
	TST.B	D2
	BNE.W	LAB_0197
	MOVE.L	D1,D0
	BSR.W	LAB_022A
	BTST	#0,159(A4)
	BEQ.S	LAB_0189
	MOVE.W	4(A5),D0
	BEQ.S	LAB_0189
	BPL.S	LAB_018A
LAB_0189:
	MOVE.W	12(A5),D0
	BMI.S	LAB_018A
	BEQ.S	LAB_018A
	BRA.S	LAB_018B
LAB_018A:
	MOVE.W	4(A5),D0
	BMI.S	LAB_018F
	BEQ.S	LAB_018E
LAB_018B:
	MOVE.L	D0,D7
	BSR.W	LAB_022C
	MOVE.L	D7,D0
	JSR	LAB_05A3
	BMI.S	LAB_018C
	TST.L	D5
	BPL.S	LAB_018C
	MOVE.L	D7,D0
	JSR	LAB_05B2
	BRA.S	LAB_018E
LAB_018C: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
	MOVE.L	D1,104(A3)
	BSR.W	LAB_023B
	MOVEQ	#0,D0
	LSL.L	#5,D1
	JSR	LAB_0555
	RTS
LAB_01FB:
	SUBQ.W	#1,D0
	BNE.S	LAB_01FD
	BSR.W	LAB_0231
	MOVE.L	104(A3),D1
	BEQ.S	LAB_01FC
	MOVEQ	#2,D0
	JSR	LAB_05B8
LAB_01FC:
	RTS
LAB_01FD:
	SUBQ.W	#1,D0
	BNE.S	LAB_01FE
	BSR.W	LAB_0231
	MOVE.L	D1,100(A3)
	BSR.W	LAB_023B
	MOVEQ	#0,D0
	LSL.L	#5,D1
	JSR	LAB_0555
	CLR.W	78(A3)
	RTS
LAB_01FE:
	SUBQ.W	#1,D0
	BNE.S	LAB_0200
	MOVE.W	D1,D0
	BEQ.S	LAB_01FF
	BSR.W	LAB_022D
	CLR.B	12(A2)
LAB_01FF:
	RTS
LAB_0200:
	SUBQ.W	#1,D0
	BNE.S	LAB_0202
	BTST	#0,14(A3)
	BNE.S	LAB_0201
	MOVE.L	268(A4),288(A4)
	JSR	LAB_0352
	MOVE.L	288(A4),268(A4)
	TST.B	162(A4)
	BPL.S	LAB_0201
	BSR.W	LAB_03A6
	MOVEA.L	192(A4),A5
	MOVEQ	#0,D0
	MOVE.W	40(A5),D0
	ADDI.W	#$006c,D0
	MOVEQ	#0,D1
	MOVE.W	42(A5),D1
	ADDI.W	#$0050,D1
	LEA	LAB_0376,A0
	BSR.W	LAB_0357
	JSR	rtg_display_stuff
	JSR	LAB_00D1
	JSR	LAB_0312
	JSR	LAB_031D
	MOVE.B	#$ff,108(A4)
LAB_0201:
	RTS
LAB_0202:
	RTS
LAB_0203:
	BSR.W	LAB_0237
	BSET	#4,163(A4)
	MOVEQ	#0,D4
	MOVEA.L	192(A4),A5
	MOVE.W	2(A5),D1
	ADDI.W	#$0010,D1
	BSR.W	LAB_0209
	CLR.B	LAB_084C
	TST.W	LAB_0228
	BNE.S	LAB_0204
	BCLR	#4,163(A4)
LAB_0204:
	RTS
LAB_0205:
	BSR.W	LAB_0237
	BSET	#4,163(A4)
	MOVEQ	#0,D4
	MOVEA.L	192(A4),A5
	MOVE.W	2(A5),D1
	ADDI.W	#$0030,D1
	BSR.W	LAB_0209
	CLR.B	LAB_084C
	TST.W	LAB_0228
	BNE.S	LAB_0206
	BCLR	#4,163(A4)
LAB_0206:
	RTS
LAB_0207:
	BSET	#4,163(A4)
	MOVEQ	#1,D4
	BSR.W	LAB_0208
	BCLR	#4,163(A4)
	RTS
LAB_0208:
	BSR.W	LAB_0237
	MOVEA.L	192(A4),A5
	MOVE.W	32(A3),D0
	SUB.W	26(A5),D0
	MOVE.W	34(A3),D1
	SUB.W	28(A5),D1
LAB_0209:
	BCLR	#1,162(A4)
	MOVE.W	D1,D7
	SUB.W	2(A5),D7
	BMI.S	LAB_020C
	CMP.W	22(A5),D7
	BCS.S	LAB_020A
	BSET	#1,162(A4)
LAB_020A:
	CLR.W	236(A4)
	BTST	#4,163(A4)
	BNE.W	LAB_021D
	BTST	#5,163(A4)
	BNE.S	LAB_020E
	CMP.W	10(A5),D0
	BCS.W	LAB_020D
	CMP.W	12(A5),D0
	BCS.S	LAB_020E
	CMP.W	14(A5),D0
	BCS.W	LAB_021D
	MOVE.W	24(A5),D7
	SUBQ.W	#1,D7
	MOVE.W	14(A5),D2
	ADD.W	18(A5),D2
	MOVEQ	#0,D3
LAB_020B:
	CMP.W	D2,D0
	BCS.W	LAB_0219
	ADD.W	18(A5),D2
	ADDQ.W	#1,D3
	DBF	D7,LAB_020B
LAB_020C:
	RTS
LAB_020D:
	TST.W	D4
	BMI.S	LAB_020C
	BRA.W	LAB_00D8
LAB_020E:
	TST.B	D4
	BMI.W	LAB_0218
	BEQ.S	LAB_0213
	MOVE.W	8(A4),D5
	SUBI.W	#$0040,D5
	MOVE.W	10(A4),D6
	SUBI.W	#$0040,D6
	MOVE.W	232(A4),D2
	SUB.W	26(A5),D2
	MOVE.W	234(A4),D3
	SUB.W	28(A5),D3
	SUB.W	D0,D2
	ADD.W	D2,D2
	ADD.W	D2,230(A4)
	BPL.S	LAB_020F
	CLR.W	230(A4)
LAB_020F:
	CMP.W	230(A4),D6
	BCC.S	LAB_0210
	MOVE.W	D6,230(A4)
LAB_0210:
	SUB.W	D1,D3
	ADD.W	D3,D3
	ADD.W	D3,228(A4)
	BPL.S	LAB_0211
	CLR.W	228(A4)
LAB_0211:
	CMP.W	228(A4),D5
	BCC.S	LAB_0212
	MOVE.W	D5,228(A4)
LAB_0212:
	RTS
LAB_0213:
	MOVE.W	10(A5),D2
	ADDI.W	#$0003,D2
	MOVE.W	38(A5),D3
	SUB.W	D2,D0
	BPL.S	LAB_0214
	MOVEQ	#0,D0
LAB_0214:
	CMP.W	D3,D0
	BCS.S	LAB_0215
	MOVE.W	D3,D0
LAB_0215:
	MOVE.W	2(A5),D2
	ADDQ.W	#2,D2
	MOVE.W	36(A5),D3
	SUB.W	D2,D1
	BPL.S	LAB_0216
	MOVEQ	#0,D1
LAB_0216:
	CMP.W	D3,D1
	BCS.S	LAB_0217
	MOVE.W	D3,D1
LAB_0217:
	ADD.W	228(A4),D1
	SWAP	D1
	MOVE.W	D0,D1
	ADD.W	230(A4),D1
	CMP.L	104(A4),D1
	BEQ.S	LAB_0218
	MOVE.L	D1,104(A4)
	CLR.L	344(A4)
	MOVE.B	#$ff,108(A4)
LAB_0218:
	RTS
LAB_0219:
	LEA	12(A3),A2
	LEA	256(A3),A1
	TST.B	15(A3)
	BEQ.S	LAB_021A
	ADDQ.W	#1,A2
	LEA	512(A3),A1
LAB_021A:
	MOVEQ	#0,D2
	MOVE.B	(A2),D2
	TST.B	D4
	BMI.S	LAB_021B
	BSET	#3,163(A4)
	BNE.S	LAB_0218
	MOVE.W	D4,D1
	SWAP	D1
	MOVE.B	D3,D1
	LSL.W	#8,D1
	MOVE.B	15(A3),D1
	MOVEQ	#14,D0
	BSR.W	LAB_0179
	RTS
LAB_021B:
	ADD.W	D2,D2
	ADD.W	D2,D2
	ADD.W	D3,D3
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.W	20(A5),D1
	MOVE.W	D1,LAB_0229
	SWAP	D1
	JSR	LAB_0811
	BSET	#4,163(A4)
	SUBQ.B	#1,(A2)
LAB_0223:
	BSET	#2,163(A4)
	RTS
LAB_0224:
	BSET	#1,163(A4)
	BNE.S	LAB_0225
	ADDQ.B	#1,15(A3)
	ANDI.B	#$01,15(A3)
	BSET	#2,163(A4)
LAB_0225:
	RTS
LAB_0226:
	MOVE.W	#$0001,238(A4)
	ORI.W	#$6000,D2
	MOVE.W	D2,236(A4)
	RTS
LAB_0227:
	MOVEM.L	D0/A5,-(A7)
	MOVEQ	#0,D0
	MOVE.W	LAB_0228(PC),D0
	SUBQ.W	#1,D0
	MOVEA.L	192(A4),A5
	MOVE.W	12(A5),D1
	ADDQ.W	#2,D1
	SWAP	D1
	MOVE.W	LAB_0229(PC),D1
	SWAP	D1
	JSR	LAB_0811
	BSET	#2,163(A4)
	CLR.W	LAB_0228
	MOVEM.L	(A7)+,D0/A5
	BCLR	#4,163(A4)
	RTS
LAB_0228:
	DS.W	1
LAB_0229:
	DS.W	1
LAB_022A:
	MOVEA.L	(A4),A5
	SWAP	D0
	MOVE.W	D0,D1
	LSL.W	#4,D1
	ADDA.W	D1,A5
	SWAP	D0
	MULU	6(A4),D0
	CMP.L	260(A4),D0
	BCC.S	LAB_022B
	ADDA.L	D0,A5
	RTS
LAB_022B:
	LEA	LAB_08BC,A5
	RTS
LAB_022C:
	ANDI.W	#$01ff,D0
	MOVEA.L	112(A4),A2
	LSL.W	#6,D0
	ADDA.W	D0,A2
	RTS
LAB_022D:
	ANDI.W	#$01ff,D0
	MOVEA.L	176(A4),A2
	LSL.W	#4,D0
	ADDA.W	D0,A2
	RTS
LAB_022E:
	TST.W	126(A4)
	BEQ.S	LAB_022F
	MOVEA.L	144(A4),A0
	BRA.W	LAB_0230
LAB_022F:
	MOVEA.L	140(A4),A0
LAB_0230:
	RTS
LAB_0231:
	MOVEA.L	184(A4),A3
	TST.W	126(A4)
	BEQ.W	LAB_0232
	MOVEA.L	188(A4),A3
LAB_0232:
	RTS
LAB_0233:
	MOVEA.L	184(A4),A3
	BTST	#0,10(A0)
	BEQ.W	LAB_0234
	MOVEA.L	188(A4),A3
LAB_0234:
	RTS
LAB_0235:
	MOVEA.L	184(A4),A3
	TST.B	D2
	BEQ.W	LAB_0236
	MOVEA.L	188(A4),A3
LAB_0236:
	RTS
LAB_0237:
	MOVEA.L	184(A4),A3
	TST.W	124(A4)
	BEQ.W	LAB_0238
	MOVEA.L	188(A4),A3
LAB_0238:
	RTS
LAB_0239:
	MOVEA.L	32(A4),A3
	MOVE.L	36(A4),D2
	ADDI.W	#$0020,D2
	MULU	D2,D1
	ADD.L	D0,D1
	ADDA.L	D1,A3
	RTS
LAB_023A:
	MOVE.W	124(A4),D2
	CMP.W	126(A4),D2
	RTS
LAB_023B:
	MOVE.W	124(A4),D2
	SUB.W	126(A4),D2
	RTS
LAB_023C:
	LEA	rtg_more_stuff,A4
	MOVEA.L	LAB_0896,A0
	LEA	16(A0),A0
	MOVE.L	A0,(A4)
	LEA	-16(A0),A0
	MOVE.L	4(A0),D0
	MOVE.L	D0,8(A4)
	MOVEQ	#0,D1
	SWAP	D0
	MOVE.W	D0,D1
	SWAP	D0
	LSL.W	#4,D1
	MOVE.L	D1,4(A4)
	MOVE.L	D1,D2
	MOVE.L	D1,D3
	MOVEQ	#0,D1
	MOVE.W	D0,D1
	SWAP	D0
	MULU	D0,D1
	SWAP	D0
	MOVE.L	D1,12(A4)
	LSL.L	#4,D1
	MOVE.L	D1,260(A4)
	MOVE.W	D2,24(A4)
	SUBI.W	#$0010,D2
	MOVE.W	D2,26(A4)
	ADDI.W	#$0020,D2
	MOVE.W	D2,22(A4)
	NEG.W	D3
	MOVE.W	D3,16(A4)
	SUBI.W	#$0010,D3
	MOVE.W	D3,30(A4)
	ADDI.W	#$0020,D3
	MOVE.W	D3,18(A4)
	MOVE.W	#$fff0,28(A4)
	MOVE.W	#$0010,20(A4)
	MOVE.L	render_buffer,32(A4)
	MOVE.L	LAB_02E3,88(A4)
	MOVE.L	rtg_buffer0,64(A4)
	MOVE.L	rtg_buffer1,68(A4)
	MOVE.L	rtg_buffer1copy,100(A4)
	MOVE.L	blit_height,D0
	LSR.W	#5,D0
	MOVE.W	D0,42(A4)
	MOVE.L	blit_width,D0
	LSR.W	#5,D0
	MOVE.W	D0,40(A4)
	MOVE.L	blit_width,D0
	SUBI.W	#$0020,D0
	MOVE.L	D0,36(A4)
	MOVE.L	blit_width,D0
	LSL.W	#5,D0
	MOVE.L	D0,44(A4)
	MOVEQ	#8,D0
	SWAP	D0
	MOVE.W	blit_height_low,D0
	SUBI.W	#$0008,D0
	MOVE.L	D0,48(A4)
	MOVEQ	#8,D0
	SWAP	D0
	MOVE.W	blit_width_low,D0
	SUBI.W	#$0008,D0
	MOVE.L	D0,52(A4)
	MOVE.W	8(A4),D0
	SUB.W	40(A4),D0
	BPL.S	LAB_023D
	CLR.W	D0
LAB_023D:
	CLR.W	60(A4)
	MOVE.W	D0,62(A4)
	MOVE.W	10(A4),D0
	SUB.W	42(A4),D0
	BPL.S	LAB_023E
	CLR.W	D0
LAB_023E:
	CLR.W	56(A4)
	MOVE.W	D0,58(A4)
	MOVEA.L	192(A4),A5
	MOVE.L	blit_height,D0
	MOVE.W	D0,4(A5)
	SUBI.W	#$0020,D0
	MOVE.W	D0,34(A5)
	MOVE.L	blit_width,D0
	MOVE.W	44(A5),D1
	SUB.W	D1,D0
	BPL.S	LAB_023F
	MOVE.W	blit_width_low,44(A5)
LAB_023F:
	LSR.W	#1,D0
	SUBQ.W	#8,D0
	TST.W	D0
	BPL.S	LAB_0240
	CLR.W	D0
LAB_0240:
	MOVE.W	D0,40(A5)
	MOVE.L	blit_height,D0
	MOVE.W	46(A5),D1
	SUB.W	D1,D0
	BPL.S	LAB_0241
	MOVE.W	blit_height_low,46(A5)
LAB_0241:
	LSR.W	#1,D0
	ADDQ.W	#4,D0
	TST.W	D0
	BPL.S	LAB_0242
	CLR.W	D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	#0,D4
	MOVEQ	#0,D1
	MOVEQ	#4,D7
	BSR.W	call_audio_driver
	BRA.W	LAB_0273
LAB_026E:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.L	LAB_08B3,D5
	MOVEQ	#100,D4
	MOVEQ	#0,D1
	MOVEQ	#4,D7
	BSR.W	call_audio_driver
	BRA.W	LAB_0273
LAB_026F:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_023A
	BNE.W	LAB_0273
	MOVE.L	LAB_08B3,D5
	MOVEQ	#100,D4
	MOVEQ	#0,D1
	MOVEQ	#4,D7
	BSR.W	call_audio_driver
	BRA.W	LAB_0273
LAB_0270:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.L	LAB_08B4,D5
	MOVEQ	#100,D4
	MOVEQ	#0,D1
	MOVEQ	#4,D7
	BSR.W	call_audio_driver
	BRA.W	LAB_0273
LAB_0271:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_023A
	BNE.W	LAB_0273
	MOVE.L	LAB_08B4,D5
	MOVEQ	#100,D4
	MOVEQ	#0,D1
	MOVEQ	#4,D7
	BSR.W	call_audio_driver
	BRA.W	LAB_0273
LAB_0272:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_023A
	BNE.W	LAB_0273
	MOVE.L	LAB_08B4,D5
	MOVE.W	#$00c8,D4
	MOVE.W	#$00c8,D1
	MOVEQ	#4,D7
	BSR.W	call_audio_driver
LAB_0273:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0274:
	JSR	LAB_031D
	LEA	LAB_087C,A0
	TST.W	124(A4)
	BEQ.S	LAB_0275
	LEA	LAB_087D,A0
LAB_0275:
	MOVEA.L	A0,A5
	MOVEQ	#0,D0
	MOVE.W	336(A4),D0
	JSR	swap_stuff
	MOVEA.L	A5,A0
	BSR.W	LAB_027E
	RTS
LAB_0276:
	JSR	LAB_031D
	LEA	LAB_087E,A0
	TST.W	360(A4)
	BEQ.S	LAB_0277
	LEA	LAB_087F,A0
LAB_0277:
	BSR.W	LAB_0279
	RTS

LAB_0278:
	JSR	LAB_031D
	LEA	LAB_0880,A0
	TST.W	124(A4)
	BEQ.S	LAB_0279
	LEA	LAB_0881,A0
LAB_0279:
	MOVE.L	A0,-(A7)
	MOVEQ	#51,D0
	JSR	do_prefs
	BMI.W	exit_fail
	LEA	LAB_027D,A2
	MOVEA.L	D0,A0
LAB_027A:
	MOVE.B	(A0)+,(A2)+
	BNE.S	LAB_027A
	SUBQ.W	#1,A2
	MOVE.B	#$20,(A2)+
	MOVE.L	#$504c4159,(A2)+
	MOVE.B	#$20,(A2)+
	MOVEA.L	(A7)+,A0

_LVOExecute		EQU -222

LAB_027B:
	MOVE.B	(A0)+,(A2)+
	BNE.S	LAB_027B
	CLR.B	(A2)+
	MOVEA.L	DosBase,A6
	LEA	execute_string,A0
	MOVE.L	A0,D1
	MOVEQ	#0,D2
	MOVEQ	#0,D3
	JSR	_LVOExecute(A6)
	RTS

execute_string:
	DC.B	"run >nil: <nil: "
LAB_027D:
	DS.L	65

	DC.L	$ffffffff,$70002839
	DC.L	RTGMasterBase
	DC.W	$2a39
	DC.L	rtg_screen
	DC.L	$7e066100,$002c4e75

LAB_027E:
	MOVEQ	#1,D0
	MOVE.L	RTGMasterBase,D4
	MOVE.L	rtg_screen,D5
	MOVEQ	#6,D7
	BSR.W	call_audio_driver
	RTS

call_net_device:
	MOVE.L	net_segment_ptr,D6
	BEQ.S	LAB_0280
	MOVEA.L	D6,A5
	MOVEA.L	12(A5),A5
	JSR	(A5)
LAB_0280:
	RTS

call_audio_driver:
	MOVE.L	audio_segment_ptr,D6
	BEQ.S	LAB_0282
	MOVEA.L	D6,A5
	MOVEA.L	12(A5),A5
	JSR	(A5)
LAB_0282:
	RTS



_LVOLoadSeg		EQU -150

dos_load_segment:
	MOVE.L	D1,D7		;D7 = memtag
	JSR	do_prefs
	MOVE.L	D0,D1
	CLR.L	D6
	MOVEA.L	DosBase,A6
	JSR	_LVOLoadSeg(A6)
	MOVE.L	D0,D5		;store BPTR in D5
	BEQ.S	LAB_0284
	BMI.S	LAB_0284

	LSL.L	#2,D0		;translate to APTR
	ADDQ.W	#8,D0		;add 8 bytes
	MOVE.L	D0,D6		;store in D6
	MOVEA.L	D0,A0
	CMP.L	(A0),D7		;check for tag
	BEQ.S	LAB_0285
LAB_0284:
	MOVEQ	#-8,D0
	JMP	exit_fail
LAB_0285:
	RTS

interrupt_code:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	rtg_more_stuff,A4
	MOVEQ	#5,D7
	JSR	call_audio_driver
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS

;interrupt_code:
;	DC.L	$48e7fffe
;	DC.W	$49f9
;	DC.L	rtg_more_stuff
;	DC.L	$7e054eb9
;	DC.L	call_audio_driver
;	DC.L	$4cdf7fff
;	DC.W	$4e75


_LVOAddIntServer		EQU -168
_LVOSetTaskPri			EQU -300

_LVOPutStr				EQU -948

_LVOText				EQU -60

debug_text:
	DC.B	"Boh!\n",0
	;DC.B	0

debug_putstr:
	MOVEM.L D0-D7/A0-A6, -(A7)

	MOVEA.L	DosBase, A6
	MOVE.L	#debug_text,D1
	JSR	_LVOPutStr(A6)

	MOVEM.L (A7)+, D0-D7/A0-A6
	RTS

debug_text_out:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	GraphicsBase, A6
	MOVEA.L	rastport,A1

	LEA		debug_text,A0
	MOVEQ	#4, d0
	JSR		_LVOText(A6)

	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS

draw_some_debug_stuff:
	MOVEM.L	D0-D7/A0-A6,-(A7)

	MOVEA.L	rastport,A3

	MOVE.L	#$00000003,D0		;SetAPen(rastport, 3)
	MOVEA.L	A3,A1
	MOVEA.L	GraphicsBase,A6
	JSR	_LVOSetAPen(A6)

	MOVEQ	#50,D0
	MOVEQ	#50,D1
	MOVEA.L	A3,A1
	JSR	_LVOMove(A6)

	MOVEQ	#60,D0
	MOVE.W	#50,D1
	MOVEA.L	A3,A1
	JSR	_LVODraw(A6)

	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS

init1:
;	BSET	#1,CIAA_PRA			;LED on maybe?

	MOVEA.L	ABSEXECBASE.W,A6	;what this interrupt does is a mystery...
;	LEA	interrupt_struct,A1
;	MOVEQ	#5,D0
;	JSR	_LVOAddIntServer(A6)

	NOT.L	LAB_02E1

	SUBA.L	A1,A1
	JSR	_LVOFindTask(A6) ;self_task = FindTask(NULL)
	MOVE.L	D0,self_task

	MOVE.L	D0,D7

	MOVEA.L	D0,A1
	MOVEQ	#0,D0
	JSR	_LVOSetTaskPri(A6) ;SetTaskPri(self_task, 0)

	BSR.W	alloc_chp_mem

	MOVE.L	#$234e554c,D1		;'#NUL'
	MOVE.L	#$00000010,D0
	JSR	alloc_mem
	MOVE.L	A0,nul_mem_ptr

	MOVE.L	#$23424621,D1		;'#BF!'
	MOVE.L	#$00000200,D0
	JSR	alloc_mem
	MOVE.L	A0,bf_mem_ptr

	LEA	rtg_more_stuff,A4

	MOVEA.L	#pointers_name,A0
	MOVE.L	#$43555221,D0		;'CUR!'
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_0288
	MOVE.L	A0,220(A4)

	MOVEA.L	#prefs_name,A0
	MOVE.L	#$53545821,D0		;'STX!'
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_0288
	MOVE.L	A0,prefs_mem_ptr

	MOVEQ	#26,D0				;language
	JSR	do_prefs
	MOVE.L	D0,language_str

	MOVEQ	#25,D0									;30%
	JSR	draw_to_rastport

	;MOVEQ	#32,D0				;net_driver	
	;MOVE.L	#$4e455421,D1		;'NES!'
	;BSR.W	dos_load_segment
	;MOVE.L	D6,net_segment_ptr
	;MOVE.L	D5,net_segment_bptr

	MOVEQ	#25,D0									;40%
	JSR	draw_to_rastport

	MOVEQ	#51,D0				;audio_driver
	MOVE.L	#$41554421,D1		;'AUD!'
	BSR.W	dos_load_segment
	MOVE.L	D6,audio_segment_ptr
	MOVE.L	D5,audio_segment_bptr

	MOVEQ	#25,D0									;50%
	JSR	draw_to_rastport

	MOVEQ	#33,D0				;net_device
	JSR	do_prefs
	MOVE.L	D0,D7

	MOVEQ	#34,D0				;net_unit
	JSR	do_prefs
	MOVE.L	D0,D6

	MOVEQ	#35,D0				;net_bauds
	JSR	do_prefs
	MOVE.L	D0,D5

	MOVEQ	#38,D0				;net_port
	JSR	do_prefs
	MOVE.L	D0,D4

	MOVEA.L	D7,A0				;A0 = self_task
	MOVE.L	D6,D0				;D0 = net_unit
	MOVE.L	D5,D1				;D1 = net_bauds
	MOVE.L	D4,D2				;D2 = net_port
	MOVEQ	#3,D7				;D7 = #3 = 'init_stuff'
	BSR.W	call_net_device

	MOVEQ	#1,D7				;#1 = 'open_libs'
	BSR.W	call_net_device

	MOVEQ	#36,D0				;net_nodenr
	JSR	do_prefs
	MOVE.L	D0,net_nodenr

	MOVEQ	#25,D0									;60%
	JSR	draw_to_rastport

	MOVEQ	#52,D0				;audio_device
	JSR	do_prefs
	MOVE.L	D0,D4

	MOVEQ	#53,D0				;audio_audioid
	JSR	do_prefs
	MOVE.L	D0,D5

	MOVEQ	#54,D0				;audio_channels
	JSR	do_prefs
	MOVE.L	D0,D6

	MOVEQ	#55,D0				;audio_mixfreq
	JSR	do_prefs
	MOVE.L	D0,D7

	MOVE.L	nul_mem_ptr,D0
	MOVE.L	chp_mem_ptr,D1
	MOVE.L	D4,D2
	MOVE.L	D5,D3
	MOVE.L	D6,D4
	MOVE.L	D7,D5
	MOVEQ	#3,D7
	BSR.W	call_audio_driver
	MOVEQ	#1,D7
	BSR.W	call_audio_driver

	MOVEQ	#25,D0									;70%
	JSR	draw_to_rastport

	MOVE.L	LocaleBase,D0
	BEQ.W	LAB_0288
	MOVEA.L	D0,A6
	SUBA.L	A0,A0
	LEA	LAB_02C1(PC),A1
	LEA	LAB_08B9,A2
	JSR	-150(A6)
	MOVE.L	D0,LAB_08B8
	TST.L	D0
	BEQ.W	LAB_0288

	MOVEQ	#25,D0									;80%
	JSR	draw_to_rastport

	MOVEQ	#30,D1			;Delay(30)
	JSR	dos_delay

	MOVEQ	#64,D0			;cd_level
	JSR	do_prefs
	MOVE.L	D0,cd_level

	MOVEQ	#65,D0			;cd_levelnr
	JSR	do_prefs
	MOVE.L	D0,cd_levelnr

	MOVEQ	#20,D0			;cd_device
	JSR	do_prefs
	MOVE.L	D0,cd_device_str

	MOVEQ	#21,D0			;cd_unit
	JSR	do_prefs
	MOVE.L	D0,cd_unit_no

	MOVEQ	#25,D0									;90%
	JSR	draw_to_rastport

	MOVEA.L	cd_device_str,A0
	MOVE.L	cd_unit_no,D0
	JSR	open_device
	MOVE.L	D7,LAB_02D2
	MOVE.L	D6,LAB_02D1
	MOVE.L	D0,LAB_02D3

	MOVEQ	#25,D0									;100%
	JSR	draw_to_rastport

	MOVEA.L	#keyboard_name,A0
	MOVE.L	#$00000000,D0
	JSR	open_device
	MOVE.L	D7,LAB_02CC
	MOVE.L	D6,LAB_02CB
	MOVE.L	D0,LAB_02CD

	MOVEQ	#25,D0									;110%
	JSR	draw_to_rastport

	MOVEA.L	#timer_name,A0
	MOVE.L	#$00000000,D0
	JSR	open_device
	MOVE.L	D7,LAB_02CF
	MOVE.L	D6,LAB_02CE
	MOVE.L	D0,LAB_02D0
	MOVEA.L	LAB_02CE,A1
	MOVE.L	20(A1),LAB_0889

	MOVEQ	#25,D0									;120%
	JSR	draw_to_rastport

	JSR	LAB_0A4E

	MOVEQ	#25,D0									;130%
	JSR	draw_to_rastport

	MOVEQ	#20,D1
	JSR	dos_delay

	JSR	done_intuition_window

	LEA	rtg_more_stuff,A4
	MOVEA.L	ABSEXECBASE.W,A6
	MOVE.B	530(A6),D0
	LSR.B	#1,D0
	MOVE.B	D0,265(A4)
	MOVE.W	296(A6),D0
	MOVE.W	D0,356(A4)
	RTS


LAB_0288:
	MOVEQ	#-1,D0
	JMP	exit_fail
	DC.L	$70f34ef9
	DC.L	exit_fail

_LVORemIntServer		EQU -174
_LVOUnloadSeg			EQU -156

LAB_0289:
	TST.L	LAB_02E1
	BEQ.W	LAB_028D
	MOVEA.L	ABSEXECBASE.W,A6

	;LEA	interrupt_struct,A1
	;MOVEQ	#5,D0
	;JSR	_LVORemIntServer(A6)

	MOVEQ	#2,D7
	BSR.W	call_net_device
	MOVEQ	#2,D7
	BSR.W	call_audio_driver
	MOVE.L	LocaleBase,D0
	BEQ.S	LAB_028A
	MOVEA.L	D0,A6
	MOVEA.L	LAB_08B8,A0
	JSR	-36(A6)
LAB_028A:
	MOVE.L	net_segment_bptr,D1
	BEQ.S	LAB_028B
	MOVEA.L	DosBase,A6
	JSR	_LVOUnloadSeg(A6)
LAB_028B:
	MOVE.L	audio_segment_bptr,D1
	BEQ.S	LAB_028C
	MOVEA.L	DosBase,A6
	JSR	_LVOUnloadSeg(A6)
LAB_028C:
	MOVE.L	LAB_02CF,D7
	MOVE.L	LAB_02CE,D6
	MOVE.L	LAB_02D0,D0
	JSR	close_device
	MOVE.L	LAB_02D2,D7
	MOVE.L	LAB_02D1,D6
	MOVE.L	LAB_02D3,D0
	JSR	close_device
	MOVE.L	LAB_02CC,D7
	MOVE.L	LAB_02CB,D6
	MOVE.L	LAB_02CD,D0
	JSR	close_device
	MOVE.W	#$000f,DMACON
LAB_028D:
	RTS


alloc_chp_mem:
;	MOVE.W	#$000f,DMACON
	MOVE.L	#$23434850,D1		;'#CHP'
	MOVE.L	#$00040000,D0
	JSR	alloc_mem
	MOVE.L	A0,chp_mem_ptr
	RTS

	DC.L	$223c2343,$48504eb9
	DC.L	free_mem
	DC.W	$4e75
LAB_028F:
	MOVEA.L	#LAB_0879,A0
	MOVE.L	#$534e3121,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_0291
	MOVE.L	A0,LAB_08B2
	MOVEA.L	#LAB_087A,A0
	MOVE.L	#$534e3221,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_0291
	MOVE.L	A0,LAB_08B3
	MOVEA.L	#LAB_087B,A0
	MOVE.L	#$534e3321,D0
	JSR	load_stuff1
	TST.L	D0
	BPL.S	LAB_0290
	SUBA.L	A0,A0
LAB_0290:
	MOVE.L	A0,LAB_08B4
	RTS
LAB_0291:
	JMP	exit_fail

	DC.L	$33fc000f,$00dff096
	DC.W	$4ab9
	DC.L	LAB_08B2
	DC.L	$6712223c,$534e3153
	DC.W	$4eb9
	DC.L	free_mem
	DC.W	$42b9
	DC.L	LAB_08B2
	DC.W	$4ab9
	DC.L	LAB_08B3
	DC.L	$6712223c,$534e3221
	DC.W	$4eb9
	DC.L	free_mem
	DC.W	$42b9
	DC.L	LAB_08B3
	DC.W	$4ab9
	DC.L	LAB_08B4
	DC.L	$6712223c,$534e3321
	DC.W	$4eb9
	DC.L	free_mem
	DC.W	$42b9
	DC.L	LAB_08B4
	DC.W	$4e75

rtg_init:
	MOVEQ	#27,D0
	JSR	do_prefs
	MOVE.L	D0,LAB_07F2
	LSR.L	#1,D0
	MOVE.L	D0,LAB_07F0
	MOVEQ	#28,D0
	JSR	do_prefs
	MOVE.W	D0,LAB_08A9
	MOVEQ	#24,D0
	JSR	do_prefs
	MOVEA.L	D0,A0
	MOVE.B	(A0),D0
	MOVE.W	#$2d48,D1
	CMPI.B	#$48,D0
	BEQ.S	LAB_0293
	MOVE.W	#$2d4c,D1
	CMPI.B	#$4c,D0
	BEQ.S	LAB_0293
	MOVE.W	#$2d53,D1
	MOVE.L	#$000000c8,LAB_07F0
LAB_0293:
	MOVE.W	D1,D0

	LEA	rtg_stuff,A5			;A5 = rtg_stuff

	MOVE.L	#$5343524d,D1
	CMPI.W	#$2d53,D0
	BEQ.S	LAB_0294
	MOVE.L	#$48494748,D1
	CMPI.W	#$2d48,D0
	BEQ.S	LAB_0294
	MOVE.L	#$4c4f5752,D1
LAB_0294:
	MOVE.L	D1,LAB_02C8
	MOVE.L	D1,12(A5)
	MOVEQ	#2,D0
	MOVE.L	D0,rtg_nobuffers
	MOVE.L	D0,8(A5)
	BSR.W	rtg_initialize
	JSR	LAB_07E8
	BTST	#2,160(A4)
	BNE.S	copy_rtg_stuff

	LEA	rtg_stuff2,A5				;A5 = rtg_stuff2

	MOVE.L	#$48494748,D1
	MOVE.L	D1,LAB_02C8
	MOVE.L	D1,12(A5)
	MOVEQ	#2,D0
	MOVE.L	D0,rtg_nobuffers
	MOVE.L	D0,8(A5)
	BSR.W	rtg_initialize
LAB_0295:
	TST.L	LAB_07FB
	BEQ.S	LAB_0296
	LEA	LAB_0805,A5
	MOVE.W	LAB_08A9,30(A5)
LAB_0296:
	RTS


copy_rtg_stuff:
	LEA	rtg_stuff2,A0
	MOVE.L	(A5),(A0)
	MOVE.L	4(A5),4(A0)
	MOVE.L	8(A5),8(A0)
	MOVE.L	24(A5),24(A0)
	MOVE.L	28(A5),28(A0)
	MOVE.L	32(A5),32(A0)
	MOVE.L	36(A5),36(A0)
	MOVE.L	40(A5),40(A0)
	MOVE.L	48(A5),48(A0)
	MOVE.L	52(A5),52(A0)
	MOVE.L	56(A5),56(A0)
	MOVE.L	60(A5),60(A0)
	BRA.S	LAB_0295

LAB_0298:
	JSR	rtg_closefonts
	MOVEA.L	RTGMasterBase,A6
	LEA	rtg_stuff,A5
	BSR.W	rtg_cleanup
	MOVE.L	(A5),D0
	MOVEA.L	RTGMasterBase,A6
	LEA	rtg_stuff2,A5
	CMP.L	(A5),D0
	BEQ.S	LAB_0299
	BSR.W	rtg_cleanup
LAB_0299:
	RTS

rtg_cleanup:
	MOVE.L	4(A5),D0
	BEQ.S	LAB_029B
	MOVEA.L	D0,A0
	JSR	_LVOFreeRtgScreenModeReq(A6)
LAB_029B:
	MOVE.L	(A5),D7
	BEQ.S	LAB_029C
	MOVE.L	D7,rtg_screen
	MOVEA.L	D7,A0
	JSR	LAB_07E7
	MOVE.L	(A5),D0
	BEQ.S	LAB_029C
	MOVEA.L	D0,A0
	JSR	_LVOUnlockRtgScreen(A6)
	MOVE.L	(A5),D0
	BEQ.S	LAB_029C
	MOVEA.L	D0,A0
	JSR	_LVOCloseRtgScreen(A6)
LAB_029C:
	RTS

rtg_initialize:					;rtg_stuff in A5
	MOVEA.L	RTGMasterBase,A6
	MOVE.L	rtg_nobuffers,D1
	LEA	rtg_screen_tags,A0
	MOVE.L	LAB_02C8,D0
	CMPI.L	#$5343524d,D0
	BEQ.S	LAB_029E

	CMPI.L	#$48494748,D0
	BNE.S	LAB_029F
	LEA	rtg_screen_tags2,A0
	BRA.S	LAB_029F
LAB_029E:
	MOVE.L	D1,4(A0)
	JSR	_LVORtgScreenModeReq(A6)
	BRA.S	LAB_02A0
LAB_029F:
	MOVE.L	D1,4(A0)
	JSR	_LVORtgBestSR(A6)
LAB_02A0:
	TST.L	D0
	BEQ.W	LAB_02A3

	MOVE.L	D0,4(A5)			;ScreenReq
	MOVEA.L	RTGMasterBase,A6
	MOVE.L	4(A5),rtg_screenreq
	MOVE.L	8(A5),rtg_nobuffers	;nobuffers
	MOVE.L	12(A5),LAB_02C8		;??
	MOVEA.L	rtg_screenreq,A0
	LEA	openscreen_tags,A1
	MOVE.L	rtg_nobuffers,4(A1)
	JSR	_LVOOpenRtgScreen(A6)
	MOVE.L	D0,(A5)
	MOVE.L	D0,rtg_screen
	BEQ.W	LAB_02A3

	MOVEA.L	(A5),A0
	LEA	screendata_tags,A1
	JSR	_LVOGetRtgScreenData(A6)

	MOVEA.L	(A5),A0
	JSR	_LVOLockRtgScreen(A6)
	MOVE.L	D0,24(A5)

	MOVEA.L	(A5),A0
	MOVEQ	#0,D0
	JSR	_LVOGetBufAdr(A6)
	MOVE.L	D0,28(A5)
	BEQ.W	LAB_02A3

	CMPI.L	#$00000002,rtg_nobuffers
	BNE.S	LAB_02A1

	MOVEA.L	(A5),A0
	MOVEQ	#1,D0
	JSR	_LVOGetBufAdr(A6)
LAB_02A1:
	MOVE.L	D0,32(A5)
	MOVE.L	D0,36(A5)
	BEQ.W	LAB_02A3

	MOVEA.L	(A5),A0
	JSR	_LVORtgInitRDCMP(A6)
	MOVE.L	D0,40(A5)

	CLR.W	LAB_02E7
	MOVE.W	#$ffff,128(A4)
	MOVEQ	#0,D0
	JSR	load_rgb_and_pointer
	LEA	rtg_more_stuff,A4
	MOVE.L	blit_width,D7
	MOVE.L	blit_height,D6
	MULU	D6,D7
	MOVE.L	16(A5),D5
	MOVE.L	D5,D1
	MOVE.L	D7,D0
	JSR	alloc_mem
	MOVE.L	A0,render_buffer
	MOVE.L	A0,LAB_02E3
	MOVE.L	A0,48(A5)
	MOVE.L	A0,52(A5)
	CMPI.L	#$00000002,rtg_nobuffers
	BNE.S	LAB_02A2
	MOVE.L	20(A5),D5
	MOVE.L	D5,D1
	MOVE.L	D7,D0
	JSR	alloc_mem
	MOVE.L	A0,LAB_02E3
	MOVE.L	A0,52(A5)
LAB_02A2:
	LSR.L	#8,D7
	LSR.L	#2,D7
	MOVE.L	D7,92(A4)
	MOVE.L	D7,44(A5)
	JSR	fade_out_rtg
	RTS

	DC.L	$70fd4ef9
	DC.L	exit_fail
LAB_02A3:
	MOVEQ	#-4,D0
	JMP	exit_fail

rtg_screen_to_front:
	BSR.W	rtg_fetch_data
	MOVEA.L	(A5),A0
	JSR	_LVORtgScreenAtFront(A6)
	RTS

rtg_fetch_data:
	LEA	rtg_more_stuff,A4
	MOVEA.L	RTGMasterBase,A6
	MOVE.L	(A5),rtg_screen
	MOVE.L	24(A5),LAB_02C5
	MOVE.L	28(A5),rtg_buffer0
	MOVE.L	32(A5),rtg_buffer1
	MOVE.L	36(A5),rtg_buffer1copy
	MOVE.L	40(A5),LAB_02C6
	MOVE.L	44(A5),92(A4)
	MOVE.L	48(A5),render_buffer
	MOVE.L	48(A5),32(A4)
	MOVE.L	52(A5),LAB_02E3
	MOVEA.L	(A5),A0
	LEA	screendata_tags,A1
	JSR	_LVOGetRtgScreenData(A6)
	MOVE.L	blit_width,D0
	MOVE.L	blit_height,D1
	MOVEQ	#0,D2
	MOVEQ	#0,D3
	JSR	LAB_0607
	MOVE.L	blit_width,D0
	SUBI.L	#$00000020,D0
	MOVE.L	D0,36(A4)
	JSR	LAB_07E8
	LEA	rtg_more_stuff,A4
	MOVE.L	#LAB_0805,192(A4)
	JSR	LAB_07FF
	CLR.W	LAB_02E7
	RTS



;_LVORtgOpenFont		EQU -300

rtg_openfonts:
	MOVEA.L	RTGMasterBase,A6

	MOVEA.L	rtg_screen,A0
	LEA	LAB_02AA(PC),A1
	JSR	_LVORtgOpenFont(A6)
	MOVE.L	D0,LAB_02B0
	BEQ.S	LAB_02A7

	MOVEA.L	rtg_screen,A0
	LEA	LAB_02AC(PC),A1
	JSR	_LVORtgOpenFont(A6)
	MOVE.L	D0,LAB_02B1
	BEQ.S	LAB_02A7

	MOVEA.L	rtg_screen,A0
	LEA	LAB_02AE(PC),A1
	JSR	_LVORtgOpenFont(A6)
	MOVE.L	D0,LAB_02B2
	BEQ.S	LAB_02A7
	RTS

LAB_02A7:
	MOVEQ	#-1,D0
	JMP	exit_fail



rtg_closefonts:
	MOVEA.L	RTGMasterBase,A6
	MOVE.L	rtg_screen,D0
	BEQ.S	LAB_02A9
	MOVEA.L	D0,A0
	MOVE.L	LAB_02B0,D0
	BEQ.S	LAB_02A9
	MOVEA.L	D0,A1
	JSR	_LVORtgCloseFont(A6)
	MOVE.L	rtg_screen,D0
	BEQ.S	LAB_02A9
	MOVEA.L	D0,A0
	MOVE.L	LAB_02B1,D0
	BEQ.S	LAB_02A9
	MOVEA.L	D0,A1
	JSR	_LVORtgCloseFont(A6)
	MOVE.L	rtg_screen,D0
	BEQ.S	LAB_02A9
	MOVEA.L	D0,A0
	MOVE.L	LAB_02B2,D0
	BEQ.S	LAB_02A9
	MOVEA.L	D0,A1
	JSR	_LVORtgCloseFont(A6)
LAB_02A9:
	RTS


LAB_02AA:
	DC.L	LAB_02AB
	DC.L	$00140000
LAB_02AB:
	DC.B	"Napalm:Fonts/NapalmB.font",0,0
	DC.B	"n"
LAB_02AC:
	DC.L	LAB_02AD
	DC.L	$003c0000
LAB_02AD:
	DC.B	"Napalm:Fonts/NapalmT.font",0,0
	DC.B	"n"
LAB_02AE:
	DC.L	LAB_02AF
	DC.L	$003c0000
LAB_02AF:
	DC.B	"Napalm:Fonts/NapalmZ.font",0,0
	DC.B	"n"
LAB_02B0:
	DS.L	1
LAB_02B1:
	DS.L	1
LAB_02B2:
	DS.L	1



_LVOOpenLibrary			EQU -552
_LVOCloseLibrary		EQU -414

open_libraries:
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#39,D0
	LEA	graphics_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,GraphicsBase
	BEQ.W	openlibs_fail2

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#39,D0
	LEA	dos_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,DosBase
	BEQ.W	openlibs_fail2

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#39,D0
	LEA	intuition_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,IntuiBase
	BEQ.W	openlibs_fail2

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#39,D0
	LEA	gadtools_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,GadtoolsBase
	BEQ.W	openlibs_fail2

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#38,D0
	LEA	locale_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,LocaleBase
	BEQ.W	openlibs_fail2

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#37,D0
	LEA	cdplayer_name,A1
	JSR _LVOOpenLibrary(A6)
	MOVE.L	D0,CDPlayerBase
	BEQ.W	openlibs_fail2

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#39,D0
	LEA	utility_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,UtilityBase
	BEQ.W	openlibs_fail2

	JSR	do_intuition_window1

	MOVE.W	#$0019,D0
	JSR	draw_to_rastport

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#40,D0
	LEA	rtgmaster_name,A1
	JSR	_LVOOpenLibrary(A6)
	MOVE.L	D0,RTGMasterBase
	BEQ.W	openlibs_fail1

	MOVEQ	#25,D0
	JSR	draw_to_rastport
	RTS

openlibs_fail1:
	MOVEQ	#-3,D0
	JMP	exit_fail
openlibs_fail2:
	MOVEQ	#-10,D0
	JMP	exit_fail


close_libraries:
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	RTGMasterBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	UtilityBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	CDPlayerBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	LocaleBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	GadtoolsBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	IntuiBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	DosBase,A1
	JSR	_LVOCloseLibrary(A6)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	GraphicsBase,A1
	JSR	_LVOCloseLibrary(A6)
	RTS

rtgmaster_name:
	DC.B	"rtgmaster.library",0
cdplayer_name:
	DC.B	"napalm:libs/cdplayer.library",0
dos_name:
	DC.B	"dos.library",0
graphics_name:
	DC.B	"graphics.library",0
intuition_name:
	DC.B	"intuition.library",0
gadtools_name:
	DC.B	"gadtools.library",0
locale_name:
	DC.B	"locale.library",0
utility_name:
	DC.B	"utility.library",0
keyboard_name:
	DC.B	"keyboard.device",0
timer_name:
	DC.B	"timer.device",0
	DC.B	"serial.device",0
	DC.B	"input.device",0
LAB_02C1:
	DC.B	"napalm.catalog",0
	DC.B	"MCP",0
LAB_02C2:
	DC.B	"0000=CREDITS",0
	DC.B	"IT"
RTGMasterBase:
	DS.L	4
rtg_screenreq:
	DS.L	1
LAB_02C5:
	DS.L	1
LAB_02C6:
	DS.L	1

rtg_nobuffers:
	DC.L	$00000002
LAB_02C8:
	DC.L	$4c4f5752

rtg_stuff:				;SIZE = 64
	DC.L	0			;struct RtgScreen *
	DC.L	0			;struct ScreenReq *
	DC.L	$00000002	;nobuffers
	DC.L	$5343524d
	DC.L	$47533121
	DC.L	$47533221
	DC.L	0			;buf 0
	DC.L	0			;buf 1
	DC.L	0			;buf 1
	DS.L	7

rtg_stuff2:				;SIZE = 64
	DC.L	0			;struct RtgScreen *
	DC.L	0			;struct ScreenReq *
	DC.L	$00000001	;nobuffers
	DC.L	$48494748,$4d533121,$4d533221
	DC.L	0			;buf 0
	DC.L	0			;buf 1
	DC.L	0			;buf 1
	DS.L	7

LAB_02CB:
	DS.L	1
LAB_02CC:
	DS.L	1
LAB_02CD:
	DC.L	$ffffffff
LAB_02CE:
	DS.L	1
LAB_02CF:
	DS.L	1
LAB_02D0:
	DC.L	$ffffffff
LAB_02D1:
	DS.L	1
LAB_02D2:
	DS.L	1
LAB_02D3:
	DC.L	$ffffffff
cd_device_str:
	DS.L	1
cd_unit_no:
	DS.L	1
LAB_02D6:
	DS.L	4
net_nodenr:
	DS.L	1
rtg_screen:
	DS.L	2
LAB_02D9:
	DS.L	4
LAB_02DA:
	DS.L	128
LAB_02DB:
	DS.L	64
LAB_02DC:
	DS.L	192


load_rtg_rgb_table:
	DC.W	256			;no colors to load
	DC.W	0			;first color no
	;DC.L	$01000000
load_rtg_colors:
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.W	0	;end (count = 0)

rgb_table:
	DC.L	$00030011,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff,$ffffffff,$ffffffff
	DC.L	$ffffffff,$ffffffff
	DS.W	1
rgb_byte_table:
	DS.L	1
	DC.L	$00b0b0b0,$00ffffff
	DS.L	2
	DC.L	$00b0b0b0,$00ffffff
	DS.L	1
	DC.L	$0000f000,$00b0b0b0,$00ffffff
	DS.L	1
	DC.L	$00ff0000,$00c70000,$00930000
	DS.L	1
	DC.L	$005c5c00,$00b0b000,$00ffff00
	DS.L	2
	DC.L	$00b0b0b0,$00ffffff
	DS.L	1
	DC.L	$00cccc00,$00909000,$00ffffff
	DS.L	2
	DC.L	$0000b000,$0000ff00
	DS.L	2
	DC.L	$0000baba,$00ffffff
	DS.L	1
	DC.L	$000000ff,$000000c7,$00000093
	DS.L	2
	DC.L	$0000baba,$0000ffff
	DS.L	1
	DC.L	$00ff0000,$00b0b0b0,$00ffffff
	DS.L	2
	DC.L	$00009900,$0000c600
	DS.L	2
	DC.L	$00b0b000,$00ffff00
	DS.L	1
	DC.L	$00f000f0,$00e0b0e0,$00ffffff
	DS.L	2
	DC.L	$00b00000,$00ff0000
	DS.L	2
	DC.L	$005050a0,$006868c8
	DS.L	2
	DC.L	$005050a0,$006868c8
	DS.L	2
	DC.L	$005050a0,$006868c8
	DS.L	2
	DC.L	$005050a0,$006868c8
	DS.L	2
	DC.L	$005050a0,$006868c8
	DS.L	2
	DC.L	$005050a0,$006868c8
	DS.L	2
	DC.L	$005050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BEQ.S	LAB_031A
	CMPI.W	#$00e8,D0
	BEQ.S	LAB_0319
	CMPI.W	#$0069,D0
	BEQ.S	LAB_0318
	CMPI.W	#$00e9,D0
	BEQ.S	LAB_0317
LAB_0316:
	BTST	#6,CIAA_PRA
	BNE.S	LAB_0319
	DC.W	$0839
	DC.W	$000a
	DC.W	$00df
	DC.W	$f016
	BEQ.S	LAB_031B
LAB_0317:
	BCLR	#1,358(A4)
	BRA.S	LAB_031B
LAB_0318:
	BSET	#1,358(A4)
	BRA.S	LAB_031B
LAB_0319:
	BCLR	#0,358(A4)
	DC.W	$0839
	DC.W	$000a
	DC.W	$00df
	DC.W	$f016
	BNE.S	LAB_0317
	BRA.S	LAB_031B
LAB_031A:
	BSET	#0,358(A4)
LAB_031B:
	TST.W	D0
	RTS
LAB_031C:
	MOVEM.L	(A7)+,D1-D7/A0-A6
	MOVEQ	#0,D0
	BRA.W	LAB_0316
LAB_031D:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	RTGMasterBase,A6
LAB_031E:
	MOVEA.L	rtg_screen,A0
	JSR	_LVORtgGetMsg(A6)
	TST.L	D0
	BEQ.W	LAB_031F
	MOVEA.L	D0,A1
	MOVEA.L	rtg_screen,A0
	JSR	_LVORtgReplyMsg(A6)
	BRA.S	LAB_031E
LAB_031F:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0320:
	MOVE.W	106(A4),D0
	CMP.W	58(A4),D0
	BCS.S	LAB_0321
	MOVE.W	58(A4),106(A4)
LAB_0321:
	MOVE.W	104(A4),D0
	CMP.W	62(A4),D0
	BCS.S	LAB_0322
	MOVE.W	62(A4),104(A4)
LAB_0322:
	RTS
LAB_0323:
	DC.L	$48e7fffe
	DC.W	$2c79
	DC.L	LAB_0889
	DC.W	$41f9
	DC.L	LAB_02D9
	DC.L	$4eaeffbe
	DC.W	$49f9
	DC.L	rtg_more_stuff
	DC.L	$2950014c,$4cdf7fff
	DC.W	$4e75
LAB_0324:
	M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6
	LSL.W	#5,D6
	MOVEQ	#0,D4
	TST.W	D7
	BEQ.S	LAB_0338
	BPL.S	LAB_0337
	SUB.W	D6,D3
	MOVE.W	D2,D4
	NEG.W	D4
	BRA.S	LAB_0338
LAB_0337:
	ADD.W	D6,D3
	MOVE.W	D2,D4
LAB_0338:
	SWAP	D7
	SWAP	D3
	SWAP	D4
	TST.W	D7
	BEQ.S	LAB_033A
	BPL.S	LAB_0339
	SUB.W	D6,D3
	MOVE.W	D2,D4
	NEG.W	D4
	BRA.S	LAB_033A
LAB_0339:
	ADD.W	D6,D3
	ADD.W	D2,D4
LAB_033A:
	SWAP	D3
	MOVE.L	D3,D0
	MOVE.B	D5,D1
	MOVE.W	D4,D3
	SWAP	D4
	MOVE.W	D4,D2
	ANDI.W	#$00ff,D2
	LSL.W	#8,D3
	OR.W	D3,D2
	RTS
LAB_033B:
	TST.W	D0
	BEQ.S	LAB_033F
	LEA	LAB_0340(PC),A0
	SUBQ.W	#1,D0
	CMPI.W	#$0010,D0
	BCS.S	LAB_033C
	MOVEQ	#15,D0
LAB_033C:
	MOVE.W	D0,16(A3)
	DC.W	$41f0
	DC.W	$0600
	MOVE.L	(A0)+,80(A3)
	MOVE.L	(A0)+,84(A3)
	LEA	81(A3),A5
	MOVEQ	#6,D0
LAB_033D:
	TST.B	(A5)
	BEQ.S	LAB_033E
	MOVE.B	#$01,(A5)
LAB_033E:
	ADDQ.W	#1,A5
	DBF	D0,LAB_033D
LAB_033F:
	RTS
LAB_0340:
	DC.L	$01010000
	DS.L	1
	DC.L	$02010000
	DS.L	1
	DC.L	$03010100
	DS.L	1
	DC.L	$04020200
	DS.L	1
	DC.L	$05030300
	DS.L	1
	DC.L	$06030301
	DS.L	1
	DC.L	$07030302
	DS.L	1
	DC.L	$08030303
	DS.L	1
	DC.L	$09030303,$00010000,$0a030303,$01020000
	DC.L	$0b030303,$02030000,$0c030303,$03030100
	DC.L	$0d030303,$03030200,$0e030303,$03030300
	DC.L	$0f030303,$03030300,$10030303,$03030300
	DC.W	$0303
LAB_0341:
	MOVEA.L	252(A4),A1
	BRA.S	LAB_0343


do_prefs:
	MOVEA.L	prefs_mem_ptr,A1
LAB_0343:
	MOVEM.L	D1-D7/A0-A6,-(A7)

	LEA	prefs_strings,A0
	SUBQ.W	#1,D0
LAB_0344:
	TST.B	(A0)+
	BNE.S	LAB_0344
	DBF	D0,LAB_0344		;find the correct string in prefs strings

	MOVEA.L	A0,A2		;move pointer to A2
	MOVEQ	#0,D7
LAB_0345:
	MOVEA.L	A2,A0				;A2 = prefs_strings pointer
								;A1 = prefs_mem_ptr
								;D0 = byte in prefs_strings
								;D1 = byte int prefs_mem
LAB_0346:
	MOVE.B	(A0),D0
	BEQ.S	LAB_0347
	BSET	#5,D0				;to lower case

	CMPI.L	#$3d3d3d3d,(A1)		;if '====' then end (fail)
	BEQ.S	LAB_034C

	MOVE.B	(A1)+,D1			
	BSET	#5,D1				;to lower case
	CMP.B	D1,D0
	BNE.S	LAB_0345
	ADDQ.W	#1,A0
	BRA.S	LAB_0346

LAB_0347:
	CMPI.B	#$3d,(A1)+			;check for '=' sign
	BNE.S	LAB_0347
LAB_0348:
	CMPI.B	#$22,(A1)+			;check for '"' sign
	BNE.S	LAB_0348

	CMPI.B	#$22,(A1)			;check for an additional '"' sign
	BEQ.S	no_string

	MOVE.B	(A1),D0				;check for number
	CMPI.B	#$3a,D0		
	BCS.W	LAB_034B			;if number then branch

	MOVE.L	A1,D0
LAB_0349:
	TST.B	(A1)
	BEQ.S	LAB_034A
	CMPI.B	#$22,(A1)+			;check for '"' sign
	BNE.S	LAB_0349
	CLR.B	-1(A1)
LAB_034A:
	MOVEM.L	(A7)+,D1-D7/A0-A6
	TST.L	D0
	RTS

no_string:
	MOVEQ	#0, D0
	MOVEM.L	(A7)+,D1-D7/A0-A6
	RTS
LAB_034B:
	BSR.W	prefs_do_number
	MOVE.L	D1,D0
	MOVEM.L	(A7)+,D1-D7/A0-A6
	RTS
LAB_034C:
	MOVEQ	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	JSR	LAB_0239
	MOVEQ	#0,D5
	MOVEA.L	LAB_0370,A2
	MOVE.W	46(A5),D7
	MOVE.W	LAB_0371,D1
	SUB.W	42(A5),D1
	SUB.W	D1,D7
	MOVEQ	#0,D1
LAB_036B:
	MOVE.W	44(A5),D6
	MOVEA.L	A3,A1
LAB_036C:
	CMPI.B	#$73,(A3)
	BEQ.S	LAB_036D
	CMPI.B	#$13,(A3)
	BNE.S	LAB_036F
LAB_036D:
	MOVE.W	D5,D3
	ANDI.W	#$00f0,D3
	CMP.W	D4,D3
	BEQ.S	LAB_036E
	MOVE.B	#$73,(A3)
	BRA.S	LAB_036F
LAB_036E:
	MOVE.W	D3,D0
	LSR.W	#4,D0
	DC.W	$4ab2
	DC.W	$0604
	BEQ.S	LAB_036F
	MOVE.B	#$13,(A3)
	ADDQ.L	#1,D1
LAB_036F:
	ADDQ.W	#1,A3
	DBF	D6,LAB_036C
	MOVEA.L	A1,A3
	ADDA.L	D2,A3
	ADDQ.W	#1,D5
	DBF	D7,LAB_036B
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	rtg_display_stuff
	MOVEM.L	(A7)+,D0-D7/A0-A6
	TST.L	D1
	BEQ.W	LAB_036A
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.W	LAB_036A
	MOVE.W	D4,D0
	LSR.W	#4,D0
	MOVE.L	D0,D1
	DC.W	$2032
	DC.W	$0604
	BEQ.W	LAB_036A
	MOVEA.L	D0,A2
	JMP	(A2)
LAB_0370:
	DS.L	1
	DS.W	1
LAB_0371:
	DS.W	1
LAB_0372:
	DS.L	1
LAB_0373:
	DS.L	1
LAB_0374:
	DS.L	1
LAB_0375:
	DS.L	1
LAB_0376:
	DC.L	$00000049
	DS.L	1
	DC.L	$0000004a
	DS.L	3
LAB_0377:
	DC.L	$00000001
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$00000003
	DC.L	LAB_038A
	DC.L	$00000004
	DC.L	LAB_038B
	DC.L	$00000005
	DC.L	LAB_0389
	DC.L	$00000006
	DC.L	LAB_0391
	DC.L	$00000007
	DC.L	LAB_0390
	DC.L	$00000008
	DC.L	LAB_038F
	DC.L	$00000009
	DC.L	LAB_038C
	DS.L	2
LAB_0378:
	DC.L	$00000003
	DS.L	1
LAB_0379:
	DC.L	$00000002
LAB_037A:
	DS.L	1
LAB_037B:
	DC.L	$00000010
	DS.L	1
	DC.L	$00000010
	DS.L	1
	DC.L	$00000010
	DS.L	1
	DC.L	$00000010
	DS.L	1
	DC.L	$00000010
	DS.L	1
LAB_037C:
	DC.L	$00000002
LAB_037D:
	DS.L	1
LAB_037E:
	DC.L	$0000000c
	DC.L	LAB_038D
	DS.L	2
LAB_037F:
	DC.L	$00000008
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$0000000e
	DC.L	LAB_0392
	DC.L	$0000000d
	DC.L	LAB_0393
	DC.L	$0000000f
	DC.L	LAB_0394
	DC.L	$00000002
	DS.L	1
	DC.L	$00000009
	DC.L	LAB_038D
	DS.L	2
LAB_0380:
	DC.L	$00000011
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$0000000a
	DC.L	LAB_038C
	DC.L	$0000000b
	DC.L	LAB_038D
	DS.L	2
LAB_0381:
	DC.L	$00000007
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$0000001c
	DC.L	LAB_0384
	DC.L	$0000001d
	DC.L	LAB_0385
	DC.L	$0000001e
	DC.L	LAB_0386
	DC.L	$0000001f
	DC.L	LAB_0387
	DC.L	$00000020
	DC.L	LAB_0388
	DC.L	$00000002
	DS.L	1
	DC.L	$00000009
	DC.L	LAB_038E
	DS.L	2
LAB_0382:
	DS.L	4
	DC.L	$00000007,$0014001c
	DS.L	1
	DC.L	$0013001c
LAB_0383:
	DS.L	1
	DC.L	$00210022,$00000001,$00120014
	DS.L	1
	DC.L	$00120014
	DS.L	4
LAB_0384:
	DC.L	$61000064,$122c00a1,$0201000f,$e9088200
	DC.L	$194100a1,$600000d8
LAB_0385:
	DC.L	$6100004c,$122c00a1,$020100f0,$82001941
	DC.L	$00a16000
	DC.W	$00c2
LAB_0386:
	DC.L	$61000036,$600000ba
LAB_0387:
	DC.L	$6100002e,$660808ec,$000100a0,$600608ac
	DC.L	$000100a0,$600000a2
LAB_0388:
	DC.L	$61000016,$660808ec,$000000a0,$600608ac
	DC.L	$000000a0,$6000008a,$200145f9
	DC.L	LAB_0382
	DC.L	$45f20600,$7000302a,$00045292,$d092b06a
	DC.L	$00066502,$42922012
	DC.W	$4e75
LAB_0389:
	DC.L	$610003ea,$23fc0000
	DC.W	$0005
	DC.L	LAB_0378
	DC.L	$60000022
LAB_038A:
	DC.L	$610003d8,$23fc0000
	DC.W	$0003
	DC.L	LAB_0378
	DC.L	$60000010
LAB_038B:
	DC.L	$610003c6,$23fc0000
	DC.W	$0004
	DC.L	LAB_0378
	DC.L	$61000482,$2a6c00c0,$7000302d,$00280640
	DC.L	$006c7200,$322d002a,$06410024
	DC.W	$41f9
	DC.L	LAB_0378
	DC.L	$6100fb50
LAB_038C:
	CLR.B	LAB_084A
	RTS
LAB_038D:
	DC.L	$201f6000,$fa8a201f,$610003b4,$60000056
	DC.L	$201f6100,$03aa6000
	DC.W	$ffba
LAB_038E:
	DC.L	$201f2039
	DC.L	LAB_0383
	DC.W	$b0b9
	DC.L	LAB_0372
	DC.L	$6700fa64,$52404eb9
	DC.L	LAB_0A4A
	DC.L	$6000fa58
LAB_038F:
	DC.L	$61000352,$2a6c00c0,$7000302d,$00280640
	DC.L	$006c7200,$322d002a,$06410034
	DC.W	$41f9
	DC.L	LAB_037F
	DC.L	$6100faea
	DC.W	$4e75
LAB_0390:
	DC.L	$6100032a,$2a6c00c0,$7000302d,$00280640
	DC.L	$006c7200,$322d002a,$06410020
	DC.W	$45f9
	DC.L	LAB_0382
	DC.W	$41f9
	DC.L	LAB_0381
	DC.L	$6100fabc
	DC.W	$4e75
LAB_0391:
	DC.W	$4eb9
	DC.L	LAB_08F0
	DC.L	$201f6000
	DC.W	$fa66
LAB_0392:
	DC.L	$23fc0000
	DC.W	$0001
	DC.L	LAB_0375
	DC.L	$6000001a
LAB_0393:
	DC.L	$23fc0000
	DC.W	$0002
	DC.L	LAB_0375
	DC.L	$6000000c
LAB_0394:
	DC.L	$23fc0000
	DC.W	$0003
	DC.L	LAB_0375
	DC.L	$610002ca,$2a6c00c0,$7000302d,$00280640
	DC.L	$006c7200,$322d002a,$06410040
	DC.W	$41f9
	DC.L	LAB_0380
	DC.L	$6100fa62
	DC.W	$4e75
LAB_0395:
	DC.W	$2039
	DC.L	LAB_0373
	DC.L	$67085340
	DC.W	$23c0
	DC.L	LAB_0373
	DC.L	$6000ff16
LAB_0396:
	DC.W	$2039
	DC.L	LAB_0373
	DC.L	$0c00000b,$64085240
	DC.W	$23c0
	DC.L	LAB_0373
	DC.L	$6000fefe
LAB_0397:
	DC.W	$d2b9
	DC.L	LAB_0373
	DC.L	$20015340
LAB_0398:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	LAB_05F0
	MOVE.W	360(A4),D2
	MOVE.W	D1,360(A4)
	CMP.W	D1,D2
	BNE.S	LAB_0399
	CMP.W	336(A4),D0
	BEQ.S	LAB_039A
LAB_0399:
	MOVE.W	D0,LAB_08A3
	MOVE.W	D0,336(A4)
	JSR	LAB_0096
	JSR	LAB_0091
	JSR	LAB_076B
LAB_039A:
	JSR	LAB_0627
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_05F1
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	rtg_stuff,A5
	JSR	rtg_fetch_data
	JSR	LAB_023C
	JSR	LAB_0806
	MOVEM.L	(A7)+,D0-D7/A0-A6
	CMPI.W	#$0003,130(A4)
	BNE.S	LAB_039B
	MOVEA.L	184(A4),A3
	CLR.W	78(A3)
	MOVEA.L	188(A4),A3
	CLR.W	78(A3)
	CLR.L	128(A4)
LAB_039B:
	MOVEA.L	276(A4),A2
	CLR.L	(A2)
	CLR.L	4(A2)
	CLR.L	8(A2)
	BSET	#2,163(A4)
	LEA	LAB_0382,A2
	MOVEQ	#0,D0
	MOVE.B	161(A4),D0
	LSR.B	#4,D0
	MOVE.L	D0,16(A2)
	MOVEQ	#0,D0
	MOVE.B	161(A4),D0
	ANDI.B	#$0f,D0
	MOVE.L	D0,24(A2)
	CLR.L	32(A2)
	CLR.L	40(A2)
	CLR.L	48(A2)
	BTST	#2,160(A4)
	BNE.S	LAB_039C
	MOVE.L	#$00000001,32(A2)
LAB_039C:
	BTST	#1,160(A4)
	BNE.S	LAB_039D
	MOVE.L	#$00000001,40(A2)
LAB_039D:
	BTST	#0,160(A4)
	BNE.S	LAB_039E
	MOVE.L	#$00000001,48(A2)
LAB_039E:
	MOVE.W	106(A4),D0
	CMP.W	58(A4),D0
	BCS.S	LAB_039F
	MOVE.W	58(A4),106(A4)
LAB_039F:
	MOVE.W	104(A4),D0
	CMP.W	62(A4),D0
	BCS.S	LAB_03A0
	MOVE.W	62(A4),104(A4)
	CLR.L	344(A4)
LAB_03A0:
	TST.B	162(A4)
	BPL.S	LAB_03A1
	JSR	LAB_031D
LAB_03A1:
	JSR	LAB_062A
	MOVE.B	#$ff,108(A4)
	MOVE.W	#$0010,128(A4)
	BRA.W	LAB_038C
LAB_03A2:
	DC.W	$d2b9
	DC.L	LAB_0373
	DC.L	$20015340
	DC.W	$4eb9
	DC.L	LAB_05EF
	DC.L	$6000fd96
LAB_03A3:
	DC.W	$42b9
	DC.L	LAB_037E
	DC.W	$d2b9
	DC.L	LAB_0373
	DC.L	$20015340
	DC.W	$41f9
	DC.L	LAB_08BB
	DC.W	$2e39
	DC.L	LAB_0373
	DC.L	$cefc0020,$d0c72200,$534192b9
	DC.L	LAB_0373
	DC.W	$45f9
	DC.L	LAB_037B
	DC.L	$c2fc0008,$d4c1c2fc,$0004d0c1,$280008c4
	DC.L	$001f2484,$26482248,$26007800,$61000102
	DC.W	$36b9
	DC.L	LAB_03A4
	DC.L	$2a6c00c0,$7000302d,$00280640,$006c7200
	DC.L	$322d002a,$06410024,$48e7fffe
	DC.W	$41f9
	DC.L	LAB_0378
	DC.L	$6100f866
	DC.W	$4eb9
	DC.L	rtg_display_stuff
	DC.L	$4cdf7fff,$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_0837
	DC.L	$4cdf7fff,$70001039
	DC.L	LAB_084A
	DC.L	$6a1a5379
	DC.L	LAB_03A5
	DC.L	$66e033fc
	DC.W	$1000
	DC.L	LAB_03A5
	DC.L	$0a39003f
	DC.L	LAB_03A4
	DC.L	$609441f9
	DC.L	LAB_0415
	DC.L	$10300000,$0c000078,$673e0c00,$00656726
	DC.L	$0c000062,$66104a04,$6700ff74,$4213534b
	DC.L	$53446000,$ff6a0c04,$00106400,$ff625244
	DC.L	$16c06000,$ff5a4a04,$6700000e,$42532049
	DC.L	$20034eb9
	DC.L	LAB_05F7
	DC.L	$23fc0000
	DC.W	$000c
	DC.L	LAB_037E
	DC.W	$4239
	DC.L	LAB_084A
	DC.L	$6000fc7a
LAB_03A4:
	DC.W	$1f00
LAB_03A5:
	DC.W	$0032
LAB_03A6:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	clear_buffer
	MOVE.B	#$ff,108(A4)
	JSR	LAB_0644
	JSR	LAB_066E
	BSR.W	LAB_03A7
	JSR	LAB_0819
	JSR	rtg_display_stuff
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
	DC.L	$48e7fffe,$197c00ff,$006c4eb9
	DC.L	LAB_0644
	DC.W	$4eb9
	DC.L	LAB_066E
	DC.L	$61000008,$4cdf7fff
	DC.W	$4e75
LAB_03A7:
	MOVEA.L	192(A4),A5
	MOVEQ	#0,D0
	MOVE.W	40(A5),D0
	MOVEQ	#0,D1
	MOVE.W	42(A5),D1
	JSR	LAB_0239
	MOVEA.L	LAB_089C,A0
	MOVEQ	#0,D0
	MOVE.W	46(A5),D7
LAB_03A8:
	MOVE.W	44(A5),D6
	MOVEA.L	A3,A1
LAB_03A9:
	MOVE.B	(A3),D0
	MOVE.B	0(A0,D0.W),(A3)+
	DBF	D6,LAB_03A9
	MOVEA.L	A1,A3
	ADDA.L	D2,A3
	DBF	D7,LAB_03A8
	MOVEA.L	96(A4),A6
	MOVEA.L	112(A4),A0
	MOVE.L	104(A4),D0
	LSL.L	#5,D0
	ADD.W	346(A4),D0
	SWAP	D0
	ADD.W	344(A4),D0
	SWAP	D0
	MOVE.L	D0,(A0)
	MOVE.B	124(A4),10(A0)
	MOVEQ	#49,D0
	MOVEA.L	224(A4),A3
	MOVE.L	40(A5),D6
	TST.W	D6
	BEQ.S	LAB_03AA
	ADDI.L	#$00060008,D6
LAB_03AA:
	JSR	LAB_06BD
	RTS
	DC.L	$48e7fffe
	DC.W	$4ab9
	DC.L	LAB_0374
	DC.L	$66104eb9
	DC.L	LAB_05EB
	DC.L	$23fc0000
	DC.W	$0001
	DC.L	LAB_0374
	DC.W	$45f9
	DC.L	LAB_037B
	DC.W	$4bf9
	DC.L	LAB_08BB
	DC.W	$2e39
	DC.L	LAB_0373
	DC.L	$2c07cefc,$0020dac7,$78007a02,$4a066708
	DC.W	$283c
	DC.L	LAB_0395
	DC.L	$7a3e23c5
	DC.L	LAB_0379
	DC.W	$23c4
	DC.L	LAB_037A
	DC.L	$78007a02,$0c06000b,$6408283c
	DC.L	LAB_0396
	DC.L	$7a3f23c5
	DC.L	LAB_037C
	DC.W	$23c4
	DC.L	LAB_037D
	DC.L	$7e04202d,$00146730,$08c0001f,$24802039
	DC.L	LAB_0378
	DC.W	$223c
	DC.L	LAB_0397
	DC.L	$57406714
	DC.W	$223c
	DC.L	LAB_03A3
	DC.B	"S@g",10
	DC.B	"""<"
	DC.L	LAB_03A2
	DC.L	$53406606,$25410004,$601e24bc,$00000010
	DC.L	$42aa0004,$0cb90000
	DC.W	$0004
	DC.L	LAB_0378
	DC.L	$6608223c
	DC.L	LAB_03A3
	DC.L	$60dc504a,$4bed0020,$51cfffa4,$4cdf7fff
	DC.W	$4e75
LAB_03AB:
	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/A0-A6,-(A7)
	MOVEQ	#18,D0
	JSR	LAB_0271
	MOVEM.L	(A7)+,D0-D7/A0-A6
LAB_03D4:
	SUBQ.B	#1,1(A1)
	BNE.S	LAB_03D5
	ADDQ.B	#1,9(A0)
	TST.B	D2
	BMI.S	LAB_03D1
LAB_03D5:
	MOVEQ	#0,D0
	MOVEQ	#12,D0
	MOVEQ	#4,D1
	JSR	LAB_059F
	CMP.W	16(A0),D6
	BEQ.S	LAB_03D1
	CLR.B	5(A2)
	CLR.B	9(A2)
	BRA.S	LAB_03D7
LAB_03D6:
	BCLR	#3,14(A2)
LAB_03D7:
	ADDQ.B	#1,35(A0)
LAB_03D8:
	CMPI.B	#$5f,35(A0)
	BCS.S	LAB_03D9
	MOVE.B	35(A0),D0
	MOVEQ	#100,D1
	SUB.B	D0,D1
	MOVE.B	D1,6(A0)
LAB_03D9:
	MOVE.W	#$1000,38(A0)
	MOVE.B	#$ff,9(A0)
	RTS
LAB_03DA:
	DC.L	$100f0e0e,$0d0d0c0c,$0b0b0a0a,$0a090909
	DC.L	$08080808,$07070707,$06060606,$05050505
	DC.L	$04040404,$03030303,$03020202,$02020201
	DC.L	$01010101
	DC.W	$0100
LAB_03DB:
	LEA	LAB_03E0,A5
	BRA.W	LAB_03E5
LAB_03DC:
	LEA	LAB_03E2,A5
	BRA.W	LAB_03E5
LAB_03DD:
	LEA	LAB_03E1,A5
	BRA.W	LAB_03E5
LAB_03DE:
	LEA	LAB_03E3,A5
	BRA.W	LAB_03E5
LAB_03DF:
	LEA	LAB_03E4,A5
	BRA.W	LAB_03E5
LAB_03E0:
	DC.L	$0000020c,$00080008,$01d00008,$020a0008
	DC.L	$01300018,$020b01f0,$0008ffff
LAB_03E1:
	DC.L	$00000305,$00080305,$000801d0,$00080305
	DC.L	$00080130,$00180305,$01f00008
	DC.W	$ffff
LAB_03E2:
	DC.L	$00000401,$0008ffff
LAB_03E3:
	DC.L	$00000201,$01f80020,$01100008
	DC.W	$ffff
LAB_03E4:
	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DFGHJKL;""! 456*ZXCVBNM,.? >"
	DC.B	"789 b eexb         1234567890                                "
	DC.B	"      =1234567890-=   QWERTYUIOP() 123ASDFGHJKL;""! 456*ZXCVBN"
	DC.B	"M,.? >789 b eexb         1234567890                          "
	DC.B	"              "
LAB_0416:
	DC.L	$3628000a,$67000254,$4a280025,$6700024c
	DC.L	$4a68001e,$67000242,$02430100,$08a80001
	DC.L	$00197800,$18280024
	DC.W	$33c4
	DC.L	LAB_0418
	DC.L	$78004eb9
	DC.L	LAB_05A2
	DC.L	$6b063800,$48443801,$70001028,$000c4840
	DC.L	$1028000d
	DC.W	$45f9
	DC.L	LAB_097F
	DC.L	$2e003a2c,$00083c2c,$000a43f9
	DC.L	LAB_0419
	DC.L	$70001028,$001eec08,$44405740
	DC.W	$33c0
	DC.L	LAB_0417
	DC.L	$303a036a,$b06a0002,$6700017c,$2007d06a
	DC.L	$00026b00,$014cb046,$64000146,$4840d052
	DC.L	$6b00013e,$b0456400,$01384840,$b8806606
	DC.L	$08e80001,$00192640
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$08280006,$001b6712,$342d000c,$670c6b00
	DC.L	$01124a02,$6700010c,$6012342d,$00046b00
	DC.L	$01986700,$00fe4a02,$6700018e,$024201ff
	DC.L	$3002264a
	DC.W	$4eb9
	DC.L	LAB_022C
	DC.L	$c54b4a6b,$000a6700,$00e07000,$102b0024
	DC.L	$7200122b,$0025d041,$32020241,$0100b641
	DC.L	$67000026,$08ab0006,$001d4440,$082b0003
	DC.L	$001c6714,$4a2b001f,$6a0e082b,$0000000a
	DC.L	$660608eb,$0002001c,$08280002,$001a6708
	DC.L	$082b0006,$001b6706
	DC.W	$d179
	DC.L	LAB_0418
	DC.L	$08280001,$001f6700,$00823202,$08280006
	DC.L	$0019674e,$08280005,$00186720,$b2680010
	DC.L	$661a0828,$00050019,$670a08a8,$00040019
	DC.L	$6000003a,$08e80004,$00196030,$08280004
	DC.L	$001a6608,$08280005,$00186716,$08280004
	DC.L	$00186736,$b2680012,$66300828,$00050019
	DC.L	$66280242,$0100b642,$67000026,$31410012
	DC.L	$08e80004,$001808e8,$00060019,$08e80002
	DC.L	$00190828,$00050019,$6626584a,$6000fe9c
	DC.L	$08280004,$00186700,$fff20828,$0004001a
	DC.L	$67e8302b,$000ab068,$00126600,$ffde60bc
	DC.L	$08a80002,$001d0679
	DC.W	$0096
	DC.L	LAB_0418
	DC.L	$6a0608e8,$0002001d,$08a80002,$00196642
	DC.L	$42680026,$08a80006,$001908a8,$00050019
	DC.L	$08a80004,$00196700,$000808e8,$00020018
	DC.L	$08280001,$001f671a,$31680010,$001208a8
	DC.L	$00040018,$08280005,$00186706,$08e80004
	DC.L	$00184e75,$08a80006,$001908a8,$00000019
	DC.L	$4e750242,$01ff4a02,$6700ff62,$2a4b3002
	DC.L	$264a4eb9
	DC.L	LAB_022D
	DC.L	$c54b4a6b,$000a6700,$ff4c0242,$0100b642
	DC.L	$6700003c,$08ab0003,$000f177c,$00030005
	DC.L	$08280000,$001d6626,$4a2b000c,$6720142c
	DC.L	$00b40202,$00036600,$00163413,$2f0b6100
	DC.L	$b6fc377c,$ffff003a,$37420038,$265f0828
	DC.L	$0001001f,$6700fefe,$34137200,$122b0002
	DC.L	$e8095341,$e5497000,$102b0002,$0200000f
	DC.L	$5340d200,$d4711200,$3202342b,$000a0828
	DC.L	$00060019,$67000070,$08280005,$00186654
	DC.L	$4a28001d,$67340828,$0004001a,$662c0828
	DC.L	$00040018,$67243028,$0012b068,$0026661a
	DC.L	$08280005,$00196700,$fe9c3168,$00120010
	DC.L	$08e80005,$00186000,$fe8cb268,$00106614
	DC.L	$08e80004,$00194a2b,$000c661a,$42680010
	DC.L	$6000fe72,$08280004,$00186600,$fe68b268
	DC.L	$00126600,$fe600242,$0100b642,$6700002e
	DC.L	$4a2b000c,$6700fe4e,$31410012,$08a80004
	DC.L	$001808e8,$00060019,$08e80002,$00190828
	DC.L	$00050019,$6600fe54,$6000fe2a,$08280004
	DC.L	$00186600,$fe200828,$0004001a,$6700fe16
	DC.L	$200db028,$00136600,$fe0c4840,$b0280012
	DC.L	$6600fe02,$4a28001d,$6b00fdfa,$6000ffaa
LAB_0417:
	DS.L	1
LAB_0418:
	DS.L	1
LAB_0419:
	DC.L	$00000100,$01000200,$00010101,$01010201
	DC.L	$00010101,$01010201,$00020102,$01020202
LAB_041A:
	DC.L	$48e7fffe,$74001428,$000c7600,$1628000d
	DC.L	$48a73000
	DC.W	$4eb9
	DC.L	LAB_0767
	DC.L	$38003e01,$55456b00,$01020c05,$00066400
	DC.L	$00ee0828,$0002001a,$660000f0,$4a28001c
	DC.L	$6b0000e8,$264545f9
	DC.L	LAB_0978
	DC.L	$70001028,$00050200,$000f45f2,$04003a1a
	DC.L	$3c1a4c9f,$00034a03,$675a260b,$d8426f04
	DC.L	$d0459847,$d24648a7,$c0004840,$30014eb9
	DC.L	LAB_022A
	DC.L	$08280004,$0018670c,$102d0009,$0c000003
	DC.L	$6700008c,$08280003,$001b671a,$4a6d0004
	DC.L	$67141028,$000a0200,$0001122d,$00040201
	DC.L	$0001b200,$67684c9f,$000351cb,$ffac6056
	DC.L	$260bd842,$6f04d246,$9847d045,$48a7c000
	DC.L	$48403001
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$08280004,$0018670a,$102d0009,$0c000003
	DC.L	$67320828,$0003001b,$671a4a6d,$00046714
	DC.L	$1028000a,$02000001,$122d0004,$02010001
	DC.L	$b2006710,$4c9f0003,$51cbffae,$4cdf7fff
	DC.L	$76004e75,$4c9f0003,$4cdf7fff,$76ff4e75
	DC.L	$4c9f0003,$4cdf7fff,$76004e75
LAB_041B:
	MOVEM.L	A0-A6,-(A7)
	MOVEQ	#0,D0
	MOVE.B	12(A0),D0
	SWAP	D0
	MOVE.B	13(A0),D0
	LEA	LAB_0980,A2
	MOVE.L	D0,D7
	MOVE.W	8(A4),D5
	MOVE.W	10(A4),D6
LAB_041C:
	CMPI.B	#$aa,(A2)
	BEQ.W	LAB_041E
	MO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
	TST.W	D6
	BEQ.S	LAB_046E
LAB_0465:
	MOVEQ	#12,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_0466:
	MOVEQ	#15,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_0467:
	MOVEQ	#14,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_0468:
	MOVEQ	#8,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_0469:
	MOVEQ	#2,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_046A:
	BTST	#3,243(A4)
	BNE.S	LAB_046B
	MOVEQ	#17,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_046B:
	MOVEQ	#1,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_046C:
	BTST	#3,243(A4)
	BNE.S	LAB_046D
	MOVEQ	#18,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
LAB_046D:
	MOVEQ	#19,D7
	MOVE.L	D7,D0
	BSR.W	LAB_0592
	TST.W	D6
	BEQ.S	LAB_046E
	RTS
LAB_046E:
	ORI.B	#$80,D7
	MOVE.B	D7,53(A3)
	RTS
LAB_046F:
	LEA	rtg_more_stuff,A4
	CLR.W	126(A4)
	JSR	LAB_0032
	JSR	LAB_00D2
	JSR	LAB_00DA
	JSR	LAB_017B
	JSR	LAB_0184
	JSR	LAB_02EA
	MOVEA.L	116(A4),A0
LAB_0470:
	TST.B	8(A0)
	BMI.S	LAB_0471
	BSR.W	LAB_047A
	LEA	64(A0),A0
	BRA.S	LAB_0470
LAB_0471:
	MOVE.W	#$0001,126(A4)
	JSR	LAB_0032
	JSR	LAB_00D2
	JSR	LAB_00DA
	JSR	LAB_017B
	JSR	LAB_0184
	JSR	LAB_02EA
	MOVEA.L	120(A4),A0
LAB_0472:
	TST.B	8(A0)
	BMI.S	LAB_0473
	BSR.W	LAB_047A
	LEA	64(A0),A0
	BRA.S	LAB_0472
LAB_0473:
	MOVEA.L	164(A4),A0
LAB_0474:
	TST.B	8(A0)
	BMI.S	LAB_0475
	BSR.W	LAB_04AB
	LEA	32(A0),A0
	BRA.S	LAB_0474
LAB_0475:
	CLR.W	126(A4)
	BSR.W	LAB_04B2
	MOVEA.L	176(A4),A0
	LEA	16(A0),A0
LAB_0476:
	TST.L	(A0)
	BEQ.S	LAB_0477
	BSR.W	LAB_04B7
	LEA	16(A0),A0
	BRA.S	LAB_0476
LAB_0477:
	MOVE.W	#$0001,126(A4)
	BSR.W	LAB_04B2
	MOVEA.L	176(A4),A0
	LEA	4112(A0),A0
LAB_0478:
	TST.L	(A0)
	BEQ.S	LAB_0479
	BSR.W	LAB_04B7
	LEA	16(A0),A0
	BRA.S	LAB_0478
LAB_0479:
	RTS
LAB_047A:
	LEA	rtg_more_stuff,A4
	TST.W	10(A0)
	BEQ.W	LAB_048B
	MOVE.L	(A0),D0
	ADD.L	D0,272(A4)
	MOVE.W	10(A0),D0
	ADD.W	D0,272(A4)
	MOVE.B	37(A0),D0
	ADD.B	D0,272(A4)
	TST.W	30(A0)
	BNE.S	LAB_047B
	JSR	LAB_03AB
	BSET	#0,26(A0)
	BRA.W	LAB_048A
LAB_047B:
	BCLR	#2,28(A0)
	BEQ.W	LAB_047C
LAB_047C:
	BRA.W	LAB_047D
	DC.L	$08280003,$001c6642,$4a28001f,$6a3c0828
	DC.L	$0000000a,$6734102c,$00b6d02c,$009f0200
	DC.L	$007f6626,$08680000,$000a4eb9
	DC.L	LAB_006A
	DC.L	$08680000,$000a4a00,$6b102200,$70064eb9
	DC.L	LAB_0180
	DC.W	$4eb9
	DC.L	LAB_057F
LAB_047D:
	MOVE.W	8(A4),D1
	LSL.W	#5,D1
	MOVE.W	(A0),D0
	BMI.W	LAB_0483
	CMP.W	D1,D0
	BCC.W	LAB_0483
	MOVE.W	10(A4),D1
	LSL.W	#5,D1
	MOVE.W	2(A0),D0
	BMI.W	LAB_0483
	CMP.W	D1,D0
	BCC.W	LAB_0483
	MOVEQ	#0,D0
	MOVE.B	12(A0),D0
	SWAP	D0
	MOVE.B	13(A0),D0
	JSR	LAB_022A
	MOVE.W	4(A5),D0
	BPL.S	LAB_047E
	TST.B	35(A0)
	BNE.S	LAB_047E
	TST.B	D0
	BEQ.S	LAB_047E
	JSR	LAB_022D
	TST.B	12(A2)
	BEQ.W	LAB_0482
LAB_047E:
	BTST	#5,28(A0)
	BEQ.S	LAB_047F
	CMPI.B	#$1a,35(A0)
	BCS.S	LAB_047F
	MOVEQ	#0,D0
	MOVE.B	6(A0),D0
	ANDI.B	#$0f,D0
	LEA	LAB_098F,A2
	MOVE.B	0(A2,D0.W),35(A0)
	ADDQ.B	#1,6(A0)
LAB_047F:
	BTST	#7,31(A0)
	BEQ.W	LAB_0485
	MOVE.W	4(A5),D0
	BMI.W	LAB_0485
	BNE.S	LAB_0480
	CMPI.B	#$0f,21(A0)
	BNE.W	LAB_0482
LAB_0480:
	CMP.W	10(A0),D0
	BEQ.W	LAB_0485
	JSR	LAB_022C
	BTST	#5,27(A2)
	BEQ.W	LAB_0485
	BTST	#0,26(A0)
	BNE.W	LAB_0485
	CMPI.B	#$0e,21(A0)
	BNE.S	LAB_0481
	BTST	#4,28(A2)
	BEQ.S	LAB_0481
	MOVE.W	12(A2),D0
	CMP.W	16(A0),D0
	BNE.S	LAB_0481
	MOVE.B	9(A2),D0
	CMPI.B	#$05,D0
	BCC.W	LAB_0481
	TST.B	35(A2)
	BNE.S	LAB_0485
	TST.B	23(A0)
	BNE.S	LAB_0485
	BSET	#0,26(A0)
	BSET	#0,24(A0)
	BRA.S	LAB_0485
LAB_0481:
	BTST	#0,24(A0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	#6,24(A0)
LAB_048B:
	BTST	#0,26(A0)
	BNE.W	LAB_0490
	BCLR	#2,29(A0)
	BEQ.W	LAB_048D
	TST.B	29(A0)
	BPL.S	LAB_048D
	BTST	#6,343(A4)
	BNE.S	LAB_048D
	BTST	#0,29(A0)
	BEQ.S	LAB_048D
	BTST	#1,29(A0)
	BNE.S	LAB_048D
	BTST	#4,31(A0)
	BNE.S	LAB_048D
	BTST	#5,31(A0)
	BNE.S	LAB_048D
LAB_048C:
	CMPI.B	#$0b,21(A0)
	BEQ.S	LAB_0490
	MOVEQ	#11,D0
	BSR.W	LAB_0180
	BRA.S	LAB_0490
LAB_048D:
	BCLR	#3,29(A0)
	BEQ.S	LAB_0490
	TST.B	29(A0)
	BPL.S	LAB_048F
	BTST	#4,31(A0)
	BNE.S	LAB_048F
	BTST	#1,31(A0)
	BNE.S	LAB_048E
	CMPI.B	#$0b,21(A0)
	BEQ.S	LAB_0490
	MOVE.W	38(A0),56(A3)
	MOVE.W	#$0001,58(A3)
	TST.B	23(A0)
	BNE.S	LAB_0490
LAB_048E:
	MOVE.W	12(A0),D0
	CMP.W	14(A0),D0
	BNE.S	LAB_048C
LAB_048F:
	TST.B	23(A0)
	BNE.S	LAB_0490
	MOVEA.L	A0,A2
	BSR.W	LAB_04A3
LAB_0490:
	RTS
LAB_0491:
	DC.L	$00400052,$04b004be,$0518103c,$10380f1c
	DC.L	$080c004c,$113c120c,$1210132c,$13a21478
	DC.L	$16060040,$00400040,$00400040,$00400040
	DC.L	$00400040,$00400040,$00400040,$00400040
	DC.L	$08a80007,$00196100,$165a4e75,$61000462
	DC.L	$4e7508a8,$00070019,$61001648,$08280006
	DC.L	$001f6770,$08280006,$00196668,$0c28001a
	DC.L	$00236514,$10280007,$d0280001,$d0280003
	DC.L	$6652117c,$001a0023,$4a280023,$67467000
	DC.L	$1028000c,$48401028,$000d4eb9
	DC.L	LAB_022A
	DC.L	$4a6d0002,$662e4a2d,$00096628,$302d0004
	DC.L	$67186b20,$024081ff,$b068000a,$670c4eb9
	DC.L	LAB_022C
	DC.L	$6100229e,$600a3b68,$000a0004,$53280023
	DC.L	$08280000,$001f660a
	DC.W	$4eb9
	DC.L	LAB_0233
	DC.L	$61001a14,$1e280007,$0207007f,$66480828
	DC.L	$00040019,$66400828,$00030019,$67386100
	DC.L	$4d306b32,$b028000c,$6608b228,$000d6700
	DC.L	$002608e8,$00020018,$08a80003,$00194a28
	DC.L	$001d6712,$0c280003,$0015660a,$08e80001
	DC.L	$001c6000,$1e660207,$001f660e,$08280001
	DC.L	$001f672c
	DC.W	$4eb9
	DC.L	LAB_0416
	DC.L	$08280006,$00196720
	DC.W	$4eb9
	DC.L	LAB_0766
	DC.L	$6b127000,$10280005,$0200000f,$e90f8007
	DC.L	$11400005,$61001fe8,$4e750828,$0000001f
	DC.L	$67f20828,$0003001a,$670000c4,$102800b7
	DC.L	$d0280005,$d028000b,$d0280007,$6618122c
	DC.L	$00b60201,$000fe909,$10280005,$0200000f
	DC.L	$80011140,$00057000,$1028000e,$48401028
	DC.L	$000f4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a000148,$4a006700,$01424eb9
	DC.L	LAB_022D
	DC.L	$302a0006,$676c426a,$00063200,$e0490241
	DC.L	$0001b26c,$007e675a,$602a4a6b,$003a6a24
	DC.L	$7200122b,$00386714,$0c010001,$670e4841
	DC.L	$122b0039,$42ab0038,$70026024,$42ab0038
	DC.L	$6000ff56
	DC.W	$4eb9
	DC.L	LAB_022C
	DC.L	$4a2a0008,$670000ea,$7200122a,$000c4841
	DC.L	$122a000d,$70034eb9
	DC.L	LAB_0233
	DC.L	$6100973c,$08a80004,$001a4e75,$08280007
	DC.L	$001f6700,$001e1028,$00070200,$003f6600
	DC.L	$0012142c,$00b7d428,$000b0202,$000f6100
	DC.L	$20cc4a28,$001d6a00,$fefa4eb9
	DC.L	LAB_0233
	DC.L	$08280001,$001f6700,$00cc0828,$0000001d
	DC.L	$6700008a,$4a6b0036,$66384a28,$00176632
	DC.L	$082c0006,$0157670c,$103900df,$f0070200
	DC.L	$0003661e,$7003222b,$00306b00,$feb66100
	DC.L	$96be08e8,$0001001d,$08e80004,$001d6000
	DC.L	$fea2302b,$00386700,$007c4a6b,$003a672c
	DC.L	$6b00ff12,$082b0001,$000e670a,$08280006
	DC.L	$001b6700,$fe7e7200,$12280024,$936b003a
	DC.L	$6400fef2,$426b003a,$6000feea,$42ab0038
	DC.L	$6000fe60,$08ac0003,$001a4e75,$0c280009
	DC.L	$001567ae,$103900df,$f00766a6,$082c0000
	DC.L	$00b4669e,$082c0000,$00b56696
	DC.W	$4eb9
	DC.L	LAB_006A
	DC.L	$4a006b8c,$22007006
	DC.W	$4eb9
	DC.L	LAB_0180
	DC.L	$6000ff80,$10280007,$53406600,$fe160828
	DC.L	$0007001a,$6600011a,$08280001,$001f6730
	DC.L	$08280004,$001d6700,$fdfa0868,$0000000a
	DC.W	$4eb9
	DC.L	LAB_0066
	DC.L	$08680000,$000a720b,$4a006b00,$00047203
	DC.L	$c1416100,$95e46000,$fdd41028,$001f0800
	DC.L	$00076610,$08000005,$66300800,$00036676
	DC.L	$6000fdba,$08680000,$000a4eb9
	DC.L	LAB_006A
	DC.L	$08680000,$000a7200,$32066700,$fda07007
	DC.L	$74016100,$95a46000,$fd947006,$4a280009
	DC.L	$66027007,$61004942,$30066700,$00127200
	DC.L	$32007007,$74006100,$95806000,$fd704a28
	DC.L	$00096614,$08eb0003,$000e6600,$fd60700f
	DC.L	$17400035,$6000fd56,$700608c0,$00071740
	DC.L	$00356000,$fd4848e7,$fffe226c,$00d07e0f
	DC.L	$2019673e,$24004eb9
	DC.L	LAB_022A
	DC.L	$4a2d000b,$6706302d,$00046a06,$51cfffe6
	DC.L	$60247200,$32024842,$e14a8242,$74007007
	DC.L	$2f016100,$9518221f,$06410100,$37410038
	DC.L	$377cffff,$003a4cdf,$7fff6000,$fcf4082b
	DC.L	$0002000e,$6600fcea,$70056100,$48a03006
	DC.L	$67000012,$72003200,$70077400,$610094de
	DC.L	$6000fcce,$700508c0,$00071740,$00356000
	DC.L	$fcc00828,$0006001f,$67001238,$600016e0
	DC.L	$6100fff0,$08280003,$001a6732,$70001028
	DC.L	$000e7200,$1228000c,$92006a02,$44010c01
	DC.L	$000a6400,$001c4840,$1028000f,$1228000d
	DC.L	$92006a02,$44010c01,$000a6400,$00044e75
	DC.L	$72001228,$000e4841,$1228000f
	DC.W	$4eb9
	DC.L	LAB_0233
	DC.L	$70066100,$94664e75,$08a80007,$001a0228
	DC.L	$00fc001f,$4a280023,$67185328,$00235228
	DC.L	$00040228,$000f0004,$42280025,$4268000e
	DC.L	$4e75317c,$04040014,$08e80000,$001a0828
	DC.L	$0007001f,$660000d4,$6100019a,$70184eb9
	DC.L	LAB_023A
	DC.L	$6602701c
	DC.W	$4eb9
	DC.L	LAB_0270
	DC.L	$eb4a4842,$eb4a4842,$22020828,$0007001f
	DC.L	$67242210,$0681fffe,$00007005,$74001439
	DC.L	LAB_0492
	DC.L	$4a026a06,$0202007f,$700c6100,$3dfc6000
	DC.L	$00860828,$0004001f,$67364a28,$00246730
	DC.L	$08280006,$001f6628,$48e7fffe,$22107007
	DC.L	$74550481,$00400040,$61001e40,$117c0001
	DC.L	$000908e8,$0004000e,$610034b4,$4cdf7fff
	DC.L	$22107000,$102c00b4,$02000003,$50406100
	DC.L	$349e7012,$22107400,$61003d9e,$76000828
	DC.L	$0005001f,$671a4a28,$00096714,$70040441
	DC.L	$00104841,$04410010,$48416100,$34724e75
	DC.L	$70036100,$346a4e75,$5228000e,$72001228
	DC.L	$000e4a28,$000f6b06,$0c010001,$667a7037
	DC.W	$4bf9
	DC.L	LAB_0993
	DC.L	$08280003,$001c6708,$703c4bf9
	DC.L	LAB_0994
	DC.L	$11400008,$70001028,$000f6b06,$02000003
	DC.L	$60107000,$102c00b7,$02000003,$53406a02
	DC.L	$70000200,$00031140,$000f117c,$0001000e
	DC.W	$45f9
	DC.L	LAB_0992
	DC.L	$11720000,$00093032,$0204dac0,$214d0010
	DC.L	$7000102c,$00b70200,$00037020,$08280003
	DC.L	$001c6702,$70214eb9
	DC.L	LAB_026D
	DC.L	$24680010,$70000241,$001f670c,$10321000
	DC.L	$6a105241,$10321000
	DC.W	$13c0
	DC.L	LAB_0492
	DC.L	$6000fe7e,$d0280009,$11400004,$42280025
	DC.L	$08e80000,$001a4e75
LAB_0492:
	DS.L	1
LAB_0493:
	BSR.W	LAB_0233
	CMPI.B	#$55,75(A3)
	BNE.W	LAB_0494
	CMPI.B	#$50,74(A3)
	BNE.W	LAB_0494
	CMPI.B	#$43,77(A3)
	BNE.W	LAB_0494
	CMPI.B	#$42,8(A0)
	BNE.W	LAB_0494
	TST.B	37(A0)
	BNE.S	LAB_0494
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	LAB_0833
	MOVEM.L	(A7)+,D0-D7/A0-A6
LAB_0494:
	MOVEQ	#0,D0
	MOVE.B	12(A0),D0
	SWAP	D0
	MOVE.B	13(A0),D0
	MOVE.L	D0,D2
	JSR	LAB_022A
	MOVEQ	#0,D0
	MOVE.W	30(A4),D0
	ADDA.W	D0,A5
	MOVE.W	10(A0),D0
	MOVEQ	#2,D7
LAB_0495:
	MOVEA.L	A5,A3
	MOVEQ	#2,D6
LAB_0496:
	MOVE.W	12(A5),D1
	ANDI.W	#$81ff,D1
	CMP.W	D1,D0
	BNE.S	LAB_0497
	CLR.W	12(A5)
LAB_0497:
	MOVE.W	4(A5),D1
	ANDI.W	#$81ff,D1
	CMP.W	D1,D0
	BNE.S	LAB_0498
	CLR.W	4(A5)
LAB_0498:
	LEA	16(A5),A5
	DBF	D6,LAB_0496
	MOVEA.L	A3,A5
	ADDA.L	4(A4),A5
	DBF	D7,LAB_0495
	JSR	LAB_0233
	TST.B	29(A0)
	BPL.S	LAB_0499
	JSR	LAB_0063
LAB_0499:
	MOVEQ	#0,D3
	MOVE.W	10(A0),D3
	MOVE.W	D3,D0
	BSR.W	LAB_05AF
	MOVEQ	#0,D0
	MOVE.B	36(A0),D0
	SUB.L	D0,60(A3)
	BPL.S	LAB_049A
	CLR.L	60(A3)
LAB_049A:
	TST.B	31(A0)
	BMI.S	LAB_049B
	ADDQ.W	#1,24(A3)
	BRA.S	LAB_049C
LAB_049B:
	ADDQ.W	#1,92(A3)
LAB_049C:
	MOVE.W	38(A0),D0
	BEQ.S	LAB_049E
	MOVE.W	D0,10(A0)
	ANDI.W	#$0100,D0
	MOVE.W	D3,D1
	ANDI.W	#$0100,D1
	CMP.W	D0,D1
	BEQ.S	LAB_049E
	MOVEA.L	A3,A2
	JSR	LAB_0233
	EXG	A3,A2
	TST.B	31(A0)
	BMI.S	LAB_049D
	ADDQ.W	#1,26(A2)
	BRA.S	LAB_049E
LAB_049D:
	ADDQ.W	#1,94(A2)
LAB_049E:
	CLR.L	8(A0)
	TST.W	10(A3)
	BEQ.S	LAB_049F
	SUBQ.W	#1,10(A3)
LAB_049F:
	RTS
	DC.W	$4eb9
	DC.L	LAB_0233
	DC.W	$4bf9
	DC.L	LAB_0981
	DC.L	$0c280007,$00166764
	DC.W	$4bf9
	DC.L	LAB_0982
	DC.L	$0c280006,$00166756
	DC.W	$4bf9
	DC.L	LAB_0983
	DC.L	$0c280005,$00166748
	DC.W	$4bf9
	DC.L	LAB_0985
	DC.L	$0c280004,$0016673a
	DC.W	$4bf9
	DC.L	LAB_0984
	DC.L	$0c280009,$0016672c
	DC.W	$4bf9
	DC.L	LAB_0984
	DC.L	$0c28000a,$0016671e,$0c28000b,$00166600
	DC.L	$05604bf9
	DC.L	LAB_0987
	DC.L	$08280007,$001f6606
	DC.W	$4bf9
	DC.L	LAB_0986
	DC.L	$70001028,$00176700,$054208e8,$00070019
	DC.L	$08e80000,$001a4bf5,$04001415,$6a000468
	DC.L	$0c28000b,$00166700,$039c0828,$0007001f
	DC.L	$6600013a,$0c280009,$00166700,$00d00c28
	DC.L	$000a0016,$670000c6,$4a280014,$6600042e
	DC.L	$70001028,$000c4840,$1028000d,$5340244d
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$2a4a4a40,$6a00040c,$4a006700
	DC.L	$04064eb9
	DC.L	LAB_022D
	DC.L	$4a2a0008,$670003f8,$4a2a000c,$670003f0
	DC.L	$0c280005,$00166600,$02621028,$00070200
	DC.L	$00076600,$04a64a68,$000e6b32,$0c280040
	DC.L	$00256400,$03ca4aab,$00046700,$03c26b00
	DC.L	$03be70fd
	DC.W	$4eb9
	DC.L	LAB_02FD
	DC.L	$52280025,$08a80007,$001a08ea,$0006000e
	DC.L	$6000046e,$70001028,$0008226c,$00542271
	DC.L	$0c004a28,$00076600,$04587000,$1029002c
	DC.L	$e9484eb9
	DC.L	LAB_02FD
	DC.L	$70144eb9
	DC.L	LAB_0271
	DC.L	$6000005a,$0c1500fe,$67527000,$1028000c
	DC.L	$53404840,$1028000d,$74003428,$000ae04a
	DC.L	$02420001,$0c280009,$0016671a,$55404840
	DC.L	$53404840,$72010828,$0006001c,$670c4840
	DC.L	$4840720a,$60045540,$720748e7,$fffe4eb9
	DC.L	LAB_0437
	DC.L	$4cdf7fff,$600003dc,$6100fd0a,$600003de
	DC.L	$70001028,$000c4840,$1028000d,$52404eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6ade4a00,$67da4eb9
	DC.L	LAB_022D
	DC.L	$1028000a,$02000001,$122a000a,$02010001
	DC.L	$b2006700,$01300c28,$000a0008,$672e0c28
	DC.L	$00410008,$664c0cab,$43425341,$004a660e
	DC.L	$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_0835
	DC.L	$4cdf7fff,$48e7fffe,$6100fc9c,$4cdf7fff
	DC.L	$60420cab,$44425341,$004a6616,$0c2a0001
	DC.L	$0003660e,$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_0835
	DC.L	$4cdf7fff,$422a000c,$601c4a2a,$000c6716
	DC.L	$0c2a0040,$000c6520,$042a0020,$000c7011
	DC.W	$4eb9
	DC.L	LAB_0271
	DC.L	$42280025,$117c0004,$00154268,$000e6000
	DC.L	$031a48e7,$fffe0c2a,$00060003,$67080c2a
	DC.L	$00080003,$660e7400,$142a0009,$c4fc0028
	DC.L	$d5ab0004,$74001400,$7200122a,$0008302d
	DC.L	$00042f0a
	DC.W	$4eb9
	DC.L	LAB_0437
	DC.L	$245f204a,$3028000a,$61002e36,$48e7fffe
	DC.L	$0c2b0042,$004b662e,$c74d4eb9
	DC.L	LAB_0233
	DC.L	$c74d4a6d,$00086718,$0c2b0043,$004a6616
	DC.L	$102b004d,$04000040,$122a0003,$b2006606
	DC.W	$4eb9
	DC.L	LAB_0835
	DC.L	$4cdf7fff,$42aa0008
	DC.W	$4eb9
	DC.L	LAB_023A
	DC.L	$670a701d
	DC.W	$4eb9
	DC.L	LAB_0270
	DC.L	$60087002
	DC.W	$4eb9
	DC.L	LAB_0270
	DC.L	$4cdf7fff,$0c28000a,$00086700,$fe880c28
	DC.L	$00410008,$6700fe7e,$08ea0007,$000f08ea
	DC.L	$0002000f,$6000fe6e,$4a2a0009,$6700017e
	DC.L	$08a80007,$001a1028,$00070c28,$00070016
	DC.L	$66445228,$00090c28,$00a00009,$6400015e
	DC.L	$0200001f,$66000222,$70001028,$000c5240
	DC.L	$48401028,$000d5340
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$532d000b,$532a0009,$66000200,$70164eb9
	DC.L	LAB_0271
	DC.L	$60000128,$4a280009,$67000120,$53280009
	DC.L	$0200000f,$6650522a,$00090c2a,$00b00009
	DC.L	$654448e7,$7ffe7010,$6100412a,$30066710
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$062a0046,$00093006,$600a700d
	DC.W	$4eb9
	DC.L	LAB_0271
	DC.L	$70004cdf,$7ffe4a40,$660e157c,$00b00009
	DC.L	$42280009,$60000198,$042a0046,$00097006
	DC.W	$4eb9
	DC.L	LAB_02FD
	DC.L	$60000186,$70001028,$000c4840,$1028000d
	DC.L	$53404eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$4a406a00,$009c4a00,$67000096
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$4a2a0008,$67000088,$4a2a000c,$67000080
	DC.L	$48e77ffe,$700a6100,$40a03006,$4cdf7ffe
	DC.L	$4a40676a,$3c002a4a
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$4a2a0008,$675a4a2a,$000c6754,$70001015
	DC.L	$7200122d,$00017400,$14127600,$162a0001
	DC.W	$4eb9
	DC.L	LAB_0767
	DC.L	$70003005,$e9483140,$0012317c,$000f0014
	DC.L	$70001028,$000c4840,$1028000d
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$024081ff,$b068000a,$66000006
	DC.L	$426d0004,$600000ce,$08680005,$001a6000
	DC.L	$00b24a2d,$00036678,$4a280023,$67347000
	DC.L	$1028000c,$48401028,$000d4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$670e6b12,$024081ff,$b068000a
	DC.L	$66000094,$3b68000a,$00045328,$00236000
	DC.L	$00840828,$00040004,$67041155,$00041228
	DC.L	$00049401,$6700002a,$6a000010,$44020c02
	DC.L	$00086400,$000c6000,$000c0c02,$00086404
	DC.L	$52416002,$53410201,$000f1141,$00046044
	DC.L	$08a80007,$001a122d,$00036602,$12151141
	DC.L	$0004102d,$00014880,$122d0002,$48810828
	DC.L	$0005001a,$67000006,$44404441,$d150d368
	DC.L	$00020828,$0005001a,$66065228,$00176004
	DC.L	$53280017,$4e754eb9
	DC.L	LAB_0233
	DC.L	$08a80007,$001908a8,$0000001a,$0c280005
	DC.L	$00166700,$00b60c28,$00060016,$66000020
	DC.L	$1228000e,$67000070,$1028000f,$317c0700
	DC.L	$00143428,$000cb468,$000e675a,$601c1228
	DC.L	$00126700,$00221028,$0013317c,$06000014
	DC.L	$3428000c,$b4680012,$670c1141,$00101140
	DC.L	$00116000,$00a87006,$61003eec,$30066700
	DC.L	$00184eb9
	DC.L	LAB_022D
	DC.L	$7200322a,$000a7007,$74006100,$8b224e75
	DC.L	$700608c0,$00071740,$00356000,$11347007
	DC.L	$61003ebc,$30066716
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$7200322a,$000a7007,$74006100,$8af44e75
	DC.L	$08eb0003,$000e6600,$110a177c,$000f0035
	DC.L	$60001100,$08e80002,$001808a8,$00010018
	DC.L	$117c0001,$002008a8,$00050018,$08a80004
	DC.L	$00184268,$0016117c,$00010015,$08a80007
	DC.L	$001908a8,$00030019,$08a80000,$001a08a8
	DC.L	$0005001a,$4e7508e8,$00020018,$08a80001
	DC.L	$0018117c,$00010020,$08a80005,$001808a8
	DC.L	$00040018,$08a80007,$001908a8,$00030019
	DC.L	$08a80000,$001a08a8,$0005001a,$42680016
	DC.L	$4e7508a8,$00010019,$6100f58c,$08280005
	DC.L	$001f6700,$00da0c28,$00020015,$640000d0
	DC.L	$70001028,$000c4840,$1028000d,$53404eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a0000b6
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$7000102a,$00086700,$00a65340,$226c00f4
	DC.L	$ef48d2c0,$0c2a0006,$00036700,$00140c2a
	DC.L	$00070003,$66000098,$4a2a0009,$67000090
	DC.L	$4a2a000c,$67000088,$0c2a00c8,$00096400
	DC.L	$007e1028,$000a0200,$0001122a,$000a0201
	DC.L	$0001b200,$66681012,$d0290028,$b028000c
	DC.L	$664a102a,$0001d029,$0029b028,$000d663c
	DC.L	$117c0008,$0015116a,$00030016,$117c0001
	DC.L	$001708a8,$0005001a,$0c280007,$00166600
	DC.L	$00101168,$000c000e,$1168000d,$000f600c
	DC.L	$1168000c,$00121168,$000d0013,$4e75116a
	DC.L	$00030016,$08280000,$00166710,$6016116a
	DC.L	$00030016,$08680000,$00166708,$4268000e
	DC.L	$6000fda0,$42680012,$6000fd98,$6000fee2
	DC.L	$08a80001,$00196100,$f46c0c28,$00020015
	DC.L	$64000082,$08280007,$001f6600,$007a7000
	DC.L	$1028000c,$48401028,$000d5340
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a00005c
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$7000102a,$00086700,$004c5340,$226c00f4
	DC.L	$ef48d2c0,$0c2a0005,$00036638,$4a2a000c
	DC.L	$67321012,$d0290028,$b028000c,$6626102a
	DC.L	$0001d029,$0029b028,$000d6618,$117c0008
	DC.L	$0015116a,$00030016,$117c0001,$001708a8
	DC.L	$0005001a,$4e750828,$0002001f,$67f67000
	DC.L	$1028000c,$48401028,$000d5240
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a00ffdc,$08280005,$001866d2
	DC.L	$3228000c,$b2680010,$66c84eb9
	DC.L	LAB_022D
	DC.L	$4a2a000c,$67bc082a,$0005000e,$67b44a28
	DC.L	$001766ae,$117c0008,$0015117c,$00040016
	DC.L	$117c0001,$001708a8,$0005001a,$4e7508a8
	DC.L	$00010019,$6100f36c,$0c280002,$00156400
	DC.L	$00aa0828,$0003001f,$670000a0,$70001028
	DC.L	$000c4840,$1028000d,$24004eb9
	DC.L	LAB_022A
	DC.L	$082d0007,$00096700,$00822c0d,$20024840
	DC.L	$53404840,$55404eb9
	DC.L	LAB_022A
	DC.L	$7e034a6d,$00026666,$4bed0010,$4a6d0002
	DC.L	$665c4bed,$fff0dbec,$000451cf,$ffe62a46
	DC.L	$244d4bed,$fff04a6d,$00046644,$224d4bed
	DC.L	$0010202c,$0004dac0,$4a6d0004,$66323b7c
	DC.L	$80000004,$337c8000,$0004357c,$80000004
	DC.L	$117c0008,$0015117c,$00090016,$117c0001
	DC.L	$001708a8,$0005001a,$08a80007,$00184e75
	DC.L	$302d0004,$6bf84eb9
	DC.L	LAB_022C
	DC.L	$6100115c,$4e756000,$f2a208a8,$00010019
	DC.L	$6100f298,$08280007,$001f6600,$00fe0c28
	DC.L	$00020015,$640000f4,$08280004,$001f6700
	DC.L	$00ea0828,$0004001c,$660000cc,$4a280024
	DC.L	$660000cc,$70001028,$000c5540,$48401028
	DC.L	$000d5540
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$70010828,$0006001c,$6702700a,$72001228
	DC.L	$000a0201,$0001eb49,$d0415340,$246c00f4
	DC.L	$ef48d4c0,$76001612,$53437800,$182a0001
	DC.L	$5344584a,$224a2a0d,$3e043c03,$264d4a6d
	DC.L	$0002667e,$4a1a670c,$322d0004,$6706b268
	DC.L	$000a666e,$4bed0010,$51ceffe4,$2a4bdbec
	DC.L	$000451cf,$ffd62449,$2a453e04,$3c03264d
	DC.L	$4a1a6706,$3b7c8000,$00044bed,$001051ce
	DC.L	$fff02a4b,$dbec0004,$51cfffe2,$117c0008
	DC.L	$0015117c,$000a0016,$117c0001,$001708a8
	DC.L	$0005001a,$08a80007,$00184e75,$08a80000
	DC.L	$00184e75,$70074eb9
	DC.L	LAB_0271
	DC.L	$42280025,$4e757019
	DC.W	$4eb9
	DC.L	LAB_0271
	DC.L	$4e7508a8,$00010019,$6100f17c,$0c280002
	DC.L	$00156400,$00627000,$1028000c,$48401028
	DC.L	$000d5340
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a000046,$08280005,$0018663c
	DC.L	$3228000c,$b2680010,$66324eb9
	DC.L	LAB_022D
	DC.L	$4a2a000c,$6726082a,$0005000e,$671e4a28
	DC.L	$00176618,$117c0008,$0015116a,$00030016
	DC.L	$117c0001,$001708a8,$0005001a,$4e7508a8
	DC.L	$00010019,$6100f106,$0c280002,$00156400
	DC.L	$007c08a8,$0000001a,$67747000,$1028000c
	DC.L	$48401028,$000d4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$675c6b00,$005a4eb9
	DC.L	LAB_022C
	DC.L	$082a0004,$001c674a,$4a2a0023,$6644322a
	DC.L	$000cb268,$0010663a,$122a0009,$0c010005
	DC.L	$6430522a,$000908e8,$00070019,$08e80006
	DC.L	$001a317c,$000f0014,$316a000a,$0010317c
	DC.L	$ffff0012,$08e80000,$001808ea,$00000018
	DC.L	$4e757000,$1028000c,$48401028,$000d4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$671a0240,$81ffb068,$000a6710
	DC.L	$42280025,$4268000e,$317c0004,$001460cc
	DC.L	$3b68000a,$000408a8,$00000018,$08a80000
	DC.L	$001a4e75,$08e80006,$001808e8,$00070019
	DC.L	$117c0032,$000708e8,$0000001a,$30280012
	DC.L	$670000cc,$0c40ffff,$67065368,$00124e75
	DC.L	$30280010
	DC.W	$4eb9
	DC.L	LAB_022C
	DC.L	$4a6a000a,$6700012e,$4a2a0009,$67000126
	DC.L	$4a2a0023,$6600009c,$4a2a0025,$67000116
	DC.L	$4a2a0017,$6600008c,$082a0000,$00186600
	DC.L	$0082102c,$009f902a,$00090200,$000f6672
	DC.L	$4a2a0009,$670000ee,$317c0001,$001408a8
	DC.L	$0000001a,$316a000c,$000c2092,$42680012
	DC.L	$08a80006,$001808a8,$00070019,$42280017
	DC.L	$08e80000,$0018c14a,$61000e3c,$c14a4a00
	DC.L	$672c08e8,$00070019,$08e80006,$001a08e8
	DC.L	$00060018,$317c000f,$0014316a,$000a0010
	DC.L	$317cffff,$001208ea,$00000018,$6004532a
	DC.L	$00094e75
	DC.W	$4eb9
	DC.L	LAB_0233
	DC.L	$700a6100,$37be3006,$67000084
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$7000102a,$00085340,$226c00f4,$ef48d2c0
	DC.L	$72001212,$4841122a,$0001d2a9,$003c1141
	DC.L	$000d4841,$1141000c,$4841eb89,$208108a8
	DC.L	$0000001a,$08a80006,$001808a8,$00070019
	DC.L	$42280017
	DC.W	$4eb9
	DC.L	LAB_041B
	DC.L	$08e80000,$001c4a40,$6b287202,$c1417400
	DC.L	$117c0001,$00156100,$839e7000,$4e75316a
	DC.L	$000c000c,$209208a8,$00060018,$08a80000
	DC.L	$001a4228,$0025317c,$00040014,$4268000e
	DC.L	$4e7508a8,$00010019,$6100eea2,$0c280002
	DC.L	$00156400,$00880828,$0007001f,$6600007e
	DC.L	$70001028,$000c4840,$1028000d,$53404eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a000062
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$7000102a,$00086700,$00525340,$226c00f4
	DC.L	$ef48d2c0,$0c2a0005,$0003663e,$4a2a000c
	DC.L	$67381012,$d0290028,$b028000c,$662c102a
	DC.L	$0001d029,$0029b028,$000d661e,$117c0008
	DC.L	$0015116a,$00030016,$117c0001,$0017317c
	DC.L	$ffff000e,$08a80005,$001a4e75
LAB_04A0:
	CMPI.B	#$04,21(A0)
	BEQ.S	LAB_04A2
	TST.B	20(A0)
	BEQ.S	LAB_04A2
	BTST	#7,25(A0)
	BNE.S	LAB_04A2
	BTST	#0,26(A0)
	BNE.S	LAB_04A2
	TST.B	23(A0)
	BNE.S	LAB_04A2
	CMPI.B	#$04,20(A0)
	BEQ.S	LAB_04A1
	BTST	#0,31(A0)
	BNE.S	LAB_04A1
	MOVE.B	#$01,20(A0)
LAB_04A1:
	MOVE.B	20(A0),21(A0)
	CLR.B	20(A0)
	CLR.B	22(A0)
	CLR.W	32(A0)
LAB_04A2:
	RTS
	DC.L	$08280000,$001f6700,$e94808a8,$00070019
	DC.L	$4a280017,$6600029e,$4a280014,$66000cf8
	DC.L	$4a280020,$66000050,$4a280016,$67000868
	DC.L	$43e80028,$74001428,$0021d2c2,$14110202
	DC.L	$0007e30a,$11420022,$61000bfe,$670e08e8
	DC.L	$00070019,$08e80006,$001a4e75,$52280021
	DC.L	$53280016,$1411e60a,$0202001f,$52421142
	DC.L	$00206000,$ffac08a8,$0006001a,$08280003
	DC.L	$00196600,$e8de08a8,$00020018,$673a48e7
	DC.L	$fffe08a8,$00010018,$67047000,$60027001
	DC.W	$4eb9
	DC.L	LAB_0603
	DC.L	$4cdf7fff,$4a280016,$66aa0c28,$000f0008
	DC.L	$660a08e8,$0005001d,$660007ec,$08e80003
	DC.L	$00190828,$00040019,$6600e892,$70001028
	DC.L	$000c4840,$1028000d,$24004eb9
	DC.L	LAB_022A
	DC.L	$4a6d0004,$6a0608a8,$00010019,$47ec0010
	DC.L	$70001028,$00220880,$00003233,$00003035
	DC.L	$10046700,$01846b00,$01424eb9
	DC.L	LAB_022C
	DC.L	$4a6a000a,$67000172,$4a28001d,$6a304a2a
	DC.L	$001d6a2a,$0c28000b,$00156622,$0c2a0003
	DC.L	$0015661a,$082a0005,$00186612,$7200122a
	DC.L	$00104841,$122a0011,$70036100,$81380c28
	DC.L	$000e0015,$662c0828,$0007001f,$6724082a
	DC.L	$0004001c,$671c4a2a,$00236616,$302a000c
	DC.L	$b0680010,$660c102a,$00090c00,$00056500
	DC.L	$0108082a,$0007001f,$671e0828,$0005001b
	DC.L	$67161028,$000a0200,$0001142a,$000a0202
	DC.L	$0001b400,$660000e2,$082a0007,$00196600
	DC.L	$00ac0828,$00030019,$66000080,$082a0004
	DC.L	$00196600,$0080082a,$00030019,$66000076
	DC.L	$082a0003,$00186700,$006c1028,$00221600
	DC.L	$02000008,$142a0022,$1802b803,$67565204
	DC.L	$0204000f,$b8036700,$004c1802,$53040204
	DC.L	$000fb803,$6700003e,$18020202,$0008b400
	DC.L	$67000040,$02030007,$02040007,$b8036600
	DC.L	$0032082a,$00030019,$660808a8,$00030018
	DC.L	$4e7508aa,$00030018,$4e756100,$0a324a40
	DC.L	$6b024e75,$08e80001,$001808e8,$00020018
	DC.L	$4e7508e8,$00030018,$6000e702,$10280022
	DC.L	$b02a0022,$66ec1028,$001e0200,$0003142a
	DC.L	$001e0202,$0003b400,$64d808ea,$00030019
	DC.L	$157c0028,$000760bc,$08280007,$001f6706
	DC.L	$4a751004,$66063ba8,$000a1004,$53280020
	DC.L	$08280001,$00196706,$08a80001,$001d08e8
	DC.L	$00070019,$610007ac,$14280022,$b4280004
	DC.L	$67046100,$097e0828,$0007001b,$67104a28
	DC.L	$0017670a,$08280000,$00196600,$012408a8
	DC.L	$00030018,$52280017,$70001028,$0017743f
	DC.L	$72001228,$001e0201,$00030828,$0001001d
	DC.L	$67027201,$2a010c01,$00036600,$00047a04
	DC.L	$e22ac002,$6600000a,$42280017,$6000009c
	DC.L	$e20ac002,$66000094,$2f057000,$1028000c
	DC.L	$48401028,$000d2400
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6b0e0240,$81ffb068,$000a6604
	DC.L	$426d0004
	DC.W	$45f9
	DC.L	LAB_0979
	DC.L	$70001028,$00222632,$0200d443,$1142000d
	DC.L	$48434842,$d4431142,$000c4eb9
	DC.L	LAB_075B
	DC.W	$4eb9
	DC.L	LAB_0416
	DC.L	$08280001,$001f671a
	DC.W	$4eb9
	DC.L	LAB_0766
	DC.L	$6b000012,$10280005,$0200000f,$e90f8007
	DC.L	$11400005,$2a1f4a28,$00256612,$117c0004
	DC.L	$00154228,$000e117c,$00ff000f,$604645f9
	DC.L	LAB_0977
	DC.L	$70001028,$002245f2,$04001428,$00070202
	DC.L	$0001301a,$67123200,$02410007,$66064a02
	DC.L	$6706e640,$c1c5d150,$30126714,$32000241
	DC.L	$00076606,$4a026708,$e640c1c5,$d1680002
	DC.L	$4e757000,$1028000c,$48401028,$000d4eb9
	DC.L	LAB_022A
	DC.L	$302d0004,$6a000086
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$4a2a0008,$67000078,$4a2a000c,$67000070
	DC.L	$082a0003,$000f6708,$08e80006,$001d6006
	DC.L	$08a80006,$001d0c28,$00380008,$660c5228
	DC.L	$00040228,$000f0004,$602e0828,$00060019
	DC.L	$663a1028,$0007d010,$d0280001,$d02c00b4
	DC.L	$0200003f,$66000026,$142c00b7,$d4280007
	DC.L	$0202000f,$610007ba,$10280004,$0200000f
	DC.L	$e9080228,$000f0005,$81280005,$4e754228
	DC.L	$00254e75,$08a80006,$001d0828,$0000001f
	DC.L	$6700e496,$0c28000c,$00156700,$03e80c28
	DC.L	$001a0023,$64467000,$1028000c,$48401028
	DC.L	$000d4eb9
	DC.L	LAB_022A
	DC.L	$302d000c,$024081ff,$b068000a,$671c302d
	DC.L	$00046b00,$00120240,$81ffb068,$000a6600
	DC.L	$000a426d,$00043b40,$000c5228,$00234228
	DC.L	$00064e75,$08e80002,$001a08a8,$00070019
	DC.L	$4a280017,$66000242,$4a280014,$660007e8
	DC.L	$4a280020,$66000050,$4a280016,$67000358
	DC.L	$43e80028,$74001428,$0021d2c2,$14110202
	DC.L	$0007e30a,$11420022,$610006ee,$670e08e8
	DC.L	$00070019,$08e80006,$001a4e75,$52280021
	DC.L	$53280016,$1411e60a,$0202001f,$52421142
	DC.L	$00206000,$ffac08a8,$0006001a,$08280003
	DC.L	$00196600,$e3ce08a8,$00020018,$673648e7
	DC.L	$fffe08a8,$00010018,$67047000,$60027001
	DC.W	$4eb9
	DC.L	LAB_0603
	DC.L	$4cdf7fff,$4a280016,$66aa0828,$00010019
	DC.L	$660002e4,$08e80003,$00196000,$ff980828
	DC.L	$00040019,$6600e386,$70001028,$000c4840
	DC.L	$1028000d,$24004eb9
	DC.L	LAB_022A
	DC.L	$47ec0010,$70001028,$00220880,$00003233
	DC.L	$00003035,$100c6700,$01546b00,$01124eb9
	DC.L	LAB_022C
	DC.L	$4a6a000a,$67000142,$082a0007,$00196600
	DC.L	$010c0828,$00030019,$66000082,$082a0004
	DC.L	$00196600,$00e0082a,$00030019,$660000d6
	DC.L	$082a0003,$00186700,$00cc1028,$00221600
	DC.L	$02000008,$142a0022,$1802b803,$670000b6
	DC.L	$52040204,$000fb803,$670000aa,$18025304
	DC.L	$0204000f,$b8036700,$009c1802,$02020008
	DC.L	$b4006700,$009e0203,$00070204,$0007b803
	DC.L	$66000090,$082a0003,$00196608,$08a80003
	DC.L	$00184e75,$08aa0003,$00184e75,$4a6a0016
	DC.L	$66000062,$0c2a0001,$00156658,$082a0000
	DC.L	$001a6650,$7000102a,$000c4840,$102a000d
	DC.L	$24004eb9
	DC.L	LAB_022A
	DC.L	$47ec0010,$7e077c00,$321b3035,$100c670a
	DC.L	$544651cf,$fff46000,$fe7447f9
	DC.L	LAB_0978
	DC.L	$47f36400,$d49348e7,$fffe204a,$70022202
	DC.W	$4eb9
	DC.L	LAB_0180
	DC.L	$4cdf7fff,$4e7508e8,$00010018,$08e80002
	DC.L	$00184e75,$08e80003,$00186000,$e2321028
	DC.L	$0022b02a,$002266ec,$1028001e,$02000003
	DC.L	$142a001e,$02020003,$b40064d8,$08ea0003
	DC.L	$0019157c,$00280007,$60bc3ba8,$000a100c
	DC.L	$53280020,$08e80007,$00196100,$02f81428
	DC.L	$0022b428,$00046704,$610004ca,$08a80003
	DC.L	$00185228,$00177000,$10280017,$743f7200
	DC.L	$1228001e,$02010003,$08280001,$001d6702
	DC.L	$72012a01,$0c010003,$66000004,$7a04e22a
	DC.L	$c0026600,$000a4228,$00176000,$008ee20a
	DC.L	$c0026600,$00862f05,$70001028,$000c4840
	DC.L	$1028000d,$24004eb9
	DC.L	LAB_022A
	DC.L	$4a6d000c,$6b04426d,$000c302d,$00046b0e
	DC.L	$024081ff,$b068000a,$6604426d,$000445f9
	DC.L	LAB_0979
	DC.L	$70001028,$00222632,$0200d443,$1142000d
	DC.L	$48434842,$d4431142,$000c4eb9
	DC.L	LAB_075B
	DC.W	$4eb9
	DC.L	LAB_0416
	DC.L	$08280001,$001f671a
	DC.W	$4eb9
	DC.L	LAB_0766
	DC.L	$6b000012,$10280005,$0200000f,$e90f8007
	DC.L	$11400005,$2a1f45f9
	DC.L	LAB_0977
	DC.L	$70001028,$002245f2,$04001428,$00070202
	DC.L	$0001301a,$67123200,$02410007,$66064a02
	DC.L	$6706e640,$c1c5d150,$30126714,$32000241
	DC.L	$00076606,$4a026708,$e640c1c5,$d1680002
	DC.L	$4e756100,$2eaa6b10,$b028000c,$66000106
	DC.L	$b228000d,$660000fe
	DC.W	$4eb9
	DC.L	LAB_0233
	DC.L	$08a80001,$001c6708,$4a28001d,$660000fc
	DC.L	$42280014,$42280016,$42680020,$08a80007
	DC.L	$001908a8,$00030018,$08a80002,$001808a8
	DC.L	$00010018,$08a80003,$001908a8,$00040019
	DC.L	$08a80005,$001d0828,$0007001f,$670608a8
	DC.L	$00000018,$0c280042,$0008665c,$7000102c
	DC.L	$012e7200,$122c012f,$b028000c,$66000032
	DC.L	$b228000d,$6600002a,$532c0130,$661c6100
	DC.L	$88760cab,$50555843,$004a660e,$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_0835
	DC.L	$4cdf7fff,$6100e6b6,$60547400,$7200122c
	DC.L	$012e4841,$122c012f,$70024eb9
	DC.L	LAB_0180
	DC.L	$603e1028,$0015117c,$00010015,$0c000002
	DC.L	$662c08a8,$0000001c,$67244a28,$001f6b12
	DC.L	$4a28001c,$6a080828,$0001001f,$6708701e
	DC.L	$6006701b,$6002701f
	DC.W	$4eb9
	DC.L	LAB_0271
	DC.L	$4e75117c,$00010020,$08a80001,$001808e8
	DC.L	$00020018,$4e75082b,$0000000e,$673a7e00
	DC.L	$1e2c00f2,$4a6b0008,$6730522c,$00f2be2c
	DC.L	$00f26760,$61000028,$4a4067ee
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.W	$4eb9
	DC.L	LAB_0071
	DC.L	$4a806b0e,$7203c141,$74004eb9
	DC.L	LAB_0180
	DC.L	$4e756000,$feaa7000,$1028000a,$08400000
	DC.L	$e148102c,$00f26720
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$4a6a000a,$67144a2a,$000c670e,$0c2a000d
	DC.L	$00036606,$302a000a,$4e757000,$4e757000
	DC.L	$102c00b7,$0200000f,$226c00cc,$43f10400
	DC.L	$10114840,$10290001,$4a806700,$fe547202
	DC.L	$c1417400
	DC.W	$4eb9
	DC.L	LAB_0180
	DC.L	$4e750828,$0001001f,$670001c2,$12280005
	DC.L	$14010202,$00f01002,$0201000f,$e80a9401
	DC.L	$67766a00,$00104402,$0c020008,$6400000c
	DC.L	$6000000c,$0c020008,$64045241,$60025341
	DC.L	$0201000f,$80011140,$00050828,$0007001b
	DC.L	$67440828,$00070019,$663c0828,$00060019
	DC.L	$67340200,$000f1400,$12280004,$94016740
	DC.L	$6a000010,$44020c02,$00086400,$000c6000
	DC.L	$000c0c02,$00086404,$52416002,$53410201
	DC.L	$000f1141,$00044e75,$08280007,$001b6710
	DC.L	$10280005,$0200000f,$b0280004,$6600ffa4
	DC.L	$08280006,$00196700,$01140828,$0006001f
	DC.L	$670c4a28,$00236606,$117c0003,$00144a28
	DC.L	$00096600,$00f46100,$2c666b00,$00f04eb9
	DC.L	LAB_041A
	DC.L	$6b0000e8,$4a280025,$670000e0,$08a80005
	DC.L	$00197000,$10280008,$226c0054,$22710c00
	DC.L	$1429002b,$6700002c,$6b000028,$1028001b
	DC.L	$12000200,$00036608,$82021141,$001b6012
	DC.L	$53400201,$00fc8200,$1141001b,$06000004
	DC.L	$6018102c,$00b71228,$000bb300,$0200001f
	DC.L	$12290028,$66027004,$d0011140,$00090828
	DC.L	$0007001a,$67060628,$00140009,$08e80000
	DC.L	$001908a8,$00050019,$72001228,$001ee809
	DC.L	$02010003,$70001029,$00297400,$08280007
	DC.L	$001f6708,$14280004,$e20a6004,$14280005
	DC.L	$0202000f,$34312260,$76001629,$003b7e00
	DC.L	$1e29002b,$6a064407,$72ff6002,$7e006100
	DC.L	$1d6c2c2c,$00b4ddac,$00b451cf,$fff208a8
	DC.L	$0006001d,$53280009,$4e7508e8,$00050019
	DC.L	$08a80006,$001908a8,$00040019,$4e751228
	DC.L	$00049401,$67226a0a,$44020c02,$00086408
	DC.L	$600a0c02,$00086404,$52416002,$53410201
	DC.L	$000f1141,$00047401
	DC.W	$4e75
LAB_04A3:
	MOVEM.L	D1-D7/A0-A6,-(A7)
	LEA	rtg_more_stuff,A4
	TST.B	22(A2)
	BNE.W	LAB_04A7
	CMPI.B	#$09,21(A2)
	BEQ.S	LAB_04A4
	CMPI.B	#$01,21(A2)
	BNE.S	LAB_04A7
LAB_04A4:
	BTST	#0,26(A2)
	BNE.S	LAB_04A7
	BTST	#0,31(A2)
	BEQ.S	LAB_04A7
	MOVEQ	#0,D0
	MOVE.B	12(A2),D0
	SWAP	D0
	MOVE.B	13(A2),D0
	MOVE.L	D0,D2
	JSR	LAB_022A
	MOVEQ	#0,D6
	M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$05400540,$05400540
	DC.L	$01020752,$077007c2,$094e0aa0,$07520994
	DC.L	$0a6c0914,$0a4609d0,$01020102,$01020102
	DC.L	$06760624,$04720b00,$06360588,$05c40612
	DC.L	$079e03c0,$06120612,$05ac0340,$010202f0
	DC.L	$0242020a,$01a001ca,$05ee05ee,$014e013c
	DC.L	$01240108,$01020102,$01020102,$01020102
	DC.L	$05ca0612,$05ee0600,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01020102,$01020102,$01020102,$01020102
	DC.L	$01024228,$00084e75,$52680002,$103900df
	DC.L	$f007d128,$000d0228,$0003000d,$317cffff
	DC.L	$00144e75,$103900df,$f007d128,$000d0228
	DC.L	$0003000d,$317cffff,$00144e75,$5228000d
	DC.L	$02280007,$000d317c,$ffff0014,$4e755228
	DC.L	$000d0228,$001f000d,$50680002,$317cffff
	DC.L	$001408e8,$00040009,$0c68000f,$000a6702
	DC.L	$4e7545f9
	DC.L	LAB_098D
	DC.L	$2a1a6716,$70132210,$d2850481,$00100010
	DC.L	$36280010,$6100149c,$60e608ec,$00070166
	DC.L	$197c000e,$01674e75,$4228000d,$317cffff
	DC.L	$00163228,$000a0241,$00036614,$74000828
	DC.L	$00040009,$67027401,$70132210,$61001d6e
	DC.L	$4e753228,$000a0241,$00016604,$5228000d
	DC.L	$52280013
	DC.W	$45f9
	DC.L	LAB_0988
	DC.L	$72001228,$0012ed49,$d4c17200,$12280013
	DC.L	$45f21400,$3212d350,$322a0002,$d3680002
	DC.L	$317cffff,$00164e75,$70001028,$00133228
	DC.L	$00149240,$31410002,$70001028,$00124228
	DC.L	$000d5428,$00125528,$00136b04,$6600018e
	DC.L	$70042210,$36280010,$610013ee,$6000017a
	DC.L	$70001028,$00136742,$32280014,$92403141
	DC.L	$00027000,$10280012,$4228000d,$0c280032
	DC.L	$00136414,$48e7fffe,$70052210,$36280010
	DC.L	$610013b6,$4cdf7fff,$54280012,$55280013
	DC.L	$6b046600,$01384228,$00137012,$22103628
	DC.L	$00106100,$1394242c,$00b40282,$00030003
	DC.L	$2210d282,$70077411,$36280010,$6100137a
	DC.L	$242c00b4,$0282000f,$000f700d,$2210d282
	DC.L	$06810008,$00087410,$6100135e,$242c00b4
	DC.L	$46820282,$000f000f,$700d2210,$d2820681
	DC.L	$0002000c,$74106100,$13406000,$00cc7000
	DC.L	$10280013,$32280014,$92403141,$00027000
	DC.L	$10280012,$4228000d,$54280012,$55280013
	DC.L	$6b046600,$00a87007,$22100481,$00400040
	DC.L	$6100fc82,$117c0001,$000908e8,$0004000e
	DC.L	$74553628,$00106100,$12f06000,$007c7000
	DC.L	$10280013,$32280014,$92403141,$00027000
	DC.L	$10280012
	DC.W	$45f9
	DC.L	LAB_0989
	DC.L	$11720000,$000d5228,$00125328,$00136652
	DC.L	$48e7fffe,$30100640,$0010ea48,$32004841
	DC.L	$30280014,$06400014,$06400010,$ea483200
	DC.L	$28012001
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$0c6da000,$00046618,$426d0004,$22047000
	DC.L	$30280016,$e0480240,$00017405,$6100237c
	DC.L	$4cdf7fff,$4268000a,$4e753168,$0006000a
	DC.L	$08a80007,$000a08e8,$0006000a,$08e80007
	DC.L	$00090828,$00050009,$677e3028,$00066700
	DC.L	$00864eb9
	DC.L	LAB_022D
	DC.L	$302a000a,$67000078,$082a0003,$000f670c
	DC.L	$e0480240,$0001b06c,$007c6666,$0c2a0005
	DC.L	$0004645a,$0c2a0003,$00046708,$0c2a0004
	DC.L	$0004664e,$4a280013,$660a08aa,$0006000e
	DC.L	$6700000c,$52280013,$0228001f,$001308a8
	DC.L	$00070009,$7000102a,$00085340,$eb48d028
	DC.L	$001345f9
	DC.L	LAB_098E
	DC.L	$d4c01152,$000d4e75,$08a80007,$00091168
	DC.L	$0013000d,$4e754268,$000a4e75,$31680006
	DC.L	$000a08a8,$0007000a,$08e80006,$000a5228
	DC.L	$00130228,$001f0013,$08e80007,$00090828
	DC.L	$00050009,$67623028,$0006676a
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$302a000a,$6700005e,$082a0003,$000f670c
	DC.L	$e0480240,$0001b06c,$007c664c,$0c2a0005
	DC.L	$00046440,$0c2a0003,$00046708,$0c2a0004
	DC.L	$00046634,$08a80007,$00097000,$102a0008
	DC.L	$5340eb48,$d0280013
	DC.W	$45f9
	DC.L	LAB_098E
	DC.L	$d4c01152,$000d4e75,$08a80007,$00091168
	DC.L	$0013000d,$4e754268,$000a4e75,$4a68000a
	DC.L	$6612700d,$22100681,$00080008,$74106100
	DC.L	$11044e75,$3028000a,$02000001,$660a5228
	DC.L	$000d0228,$0007000d,$4e753028,$000a0200
	DC.L	$0001660a,$5228000d,$02280007,$000d0828
	DC.L	$00050009,$672a3028,$000667aa
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$4a6a000a,$67000014,$0c2a0004,$0004670e
	DC.L	$0c2a0005,$00046700,$00064268,$000a4e75
	DC.L	$10280012,$d0280013,$1140000d,$3028000a
	DC.L	$0240003f,$6600000c,$52280013,$02280003
	DC.L	$00134e75,$10280012,$d0280013,$1140000d
	DC.L	$52280013,$02280007,$00134e75,$3028000a
	DC.L	$4e754228,$000d317c,$ffff0014,$4e755228
	DC.L	$000d0228,$001f000d,$4e755228,$000d0228
	DC.L	$000f000d,$4e755228,$000d0228,$001f000d
	DC.L	$317cffff,$00144e75,$5428000d,$0228001f
	DC.L	$000d317c,$ffff0014,$4e755228,$000d0228
	DC.L	$000f000d,$317cffff,$00144e75,$5228000d
	DC.L	$02280007,$000d317c,$ffff0014,$4e7508e8
	DC.L	$0006000a,$20280004
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$244d4a6a,$00026700,$00066000,$ff30082a
	DC.L	$00070009,$6700ff26,$4a2a000b,$660608aa
	DC.L	$00070009,$3028000a,$02000003,$6600ff12
	DC.L	$5228000d,$02280007,$000d4e75,$122c00b6
	DC.L	$02010003,$102c00b5,$c0016600,$00a07000
	DC.L	$10280004,$eb487200,$122c00b4,$d2280001
	DC.L	$b2006500,$000a0241,$001fe248,$d2400441
	DC.L	$0010d250,$48417000,$10280005,$eb48122c
	DC.L	$00b5d228,$0003b200,$65080241,$001fe248
	DC.L	$d2400441,$0010d268,$00027000,$08280003
	DC.L	$0009670e,$70010441,$00104841,$04410010
	DC.L	$48415640,$76006100,$0f2c4a68,$0010672c
	DC.L	$102c00b6,$02000001,$2401203c,$00600060
	DC.L	$082c0001,$00b76702,$4240082c,$000000b5
	DC.L	$67024840,$d2807003,$61001804,$4e757207
	DC.L	$61000436,$4a68000a,$67046b02,$4e757001
	DC.L	$22103628,$00106100,$0edc4e75,$720f6100
	DC.L	$04184a68,$000a6704,$6b024e75,$70012210
	DC.L	$36280010,$61000ebe,$4e7548e7,$fffe7001
	DC.L	$22106100,$17ba4cdf,$7fff7207,$610003ea
	DC.L	$4a68000a,$67046b02,$4e757002,$22103628
	DC.L	$00106100,$0e904e75,$3028000a,$14280013
	DC.L	$122c00b7,$02010003,$03006704,$0602000c
	DC.L	$1142000d,$317cffff,$00144e75,$2010ea88
	DC.L	$028000ff,$00ff2140,$001c721f,$6100039a
	DC.L	$2010ea88,$028000ff,$00ff4840
	DC.W	$45f9
	DC.L	LAB_098A
	DC.L	$9068001c,$5240e548,$d4c04840,$9068001e
	DC.L	$5240d4c0,$7e001e12,$6b000110,$22075807
	DC.L	$02070007,$0c68ffff,$0012663a,$70001028
	DC.L	$000de748,$d04145f9
	DC.L	LAB_098C
	DC.L	$31720200,$00127000,$30280010,$671c4eb9
	DC.L	LAB_022C
	DC.L	$30120240,$001fd128,$0012302a,$00020240
	DC.L	$001fd128,$00132010,$ea880280,$00ff00ff
	DC.L	$2140001c,$721f2810,$3a280004,$3c28000a
	DC.L	$48e70e00,$61000300,$4cdf0070,$20103146
	DC.L	$000a3145,$00042084,$ea880280,$00ff00ff
	DC.L	$484045f9
	DC.L	LAB_098A
	DC.L	$9068001c,$5240e548,$d4c04840,$9068001e
	DC.L	$5240d4c0,$70001012,$6b68e748,$d04745f9
	DC.L	LAB_098B
	DC.L	$d4c01e12,$6b583628,$00102407,$2210ea89
	DC.L	$028100ff,$00ffeb89,$48417000,$10280012
	DC.L	$4880d240,$48417000,$10280013,$4880d240
	DC.L	$04410014,$2f017008,$61001646,$221f7006
	DC.L	$36280010,$61000d30,$70062210,$ea890281
	DC.L	$00ff00ff,$eb893628,$00106100,$0d1a4e75
	DC.L	$5228000d,$02280001,$000d1168,$000d0012
	DC.L	$11680013,$000d720f,$61000240,$11680012
	DC.L	$000d4a68,$000a6704,$6b024e75,$70032210
	DC.L	$36280010,$61000ce0,$4e7548e7,$fffe7005
	DC.L	$22103628,$00106100,$0cce4cdf,$7fff317c
	DC.L	$ffff0014,$72076100,$02024a68,$000a6704
	DC.L	$6b024e75,$70112210,$42436100,$0caa700d
	DC.L	$22100681,$00080008,$74106100,$0c9a4e75
	DC.L	$48e7fffe,$700b082c,$000000b6,$6602700a
	DC.L	$22103628,$00106100,$15884cdf,$7fff7207
	DC.L	$610001b8,$4a68000a,$67046b02,$4e757011
	DC.L	$22103628,$00106100,$0c5e4e75,$11680013
	DC.L	$000d720f,$4a280009,$6a02720f,$6100018c
	DC.L	$4228000d,$4a68000a,$67046b02,$4e752210
	DC.L	$4a280009,$6a3c4841,$302c00b4
	DC.W	$3c39
	DC.L	LAB_04B0
	DC.L	$bd4033c0
	DC.L	LAB_04B0
	DC.L	$02400007,$04400004,$d2404841,$302c00b6
	DC.W	$3c39
	DC.L	LAB_04B1
	DC.L	$bd4033c0
	DC.L	LAB_04B1
	DC.L	$02400007,$04400004,$d2407001,$36280010
	DC.L	$61000bec
	DC.W	$4e75
LAB_04B0:
	DS.W	1
LAB_04B1:
	DC.L	$000048e7,$fffe7010,$22101428,$000d3628
	DC.L	$00106100,$0bd24cdf,$7fff317c,$ffff0014
	DC.L	$72056100,$01064e75,$48e7fffe,$700a2210
	DC.L	$76006100,$14bc4cdf,$7fff7203,$610000ec
	DC.L	$3228000a,$67046b02,$4e757012,$22103228
	DC.L	$00143628,$00106100,$0b8e4e75,$08280001
	DC.L	$0009663e,$72070828,$00030009,$67027207
	DC.L	$610000b8,$4228000d,$08280003,$00096706
	DC.L	$117c0001,$000d3228,$000a6704,$6b024e75
	DC.L	$70032210,$32280014,$36280010,$61000b48
	DC.L	$4e7508e8,$00070009,$53280012,$660c08a8
	DC.L	$00010009,$08a80007,$00094e75,$4a280009
	DC.L	$6a000014,$48e7fffe,$70072210,$76006100
	DC.L	$14204cdf,$7fff1028,$000d5200,$02000007
	DC.L	$11400011,$11680010,$000d7200,$12280012
	DC.L	$61000038,$11680011,$000d4a68,$000a6704
	DC.L	$6b024e75,$70012210,$76006100,$0ada102c
	DC.L	$00b60200,$00036610,$700d2210,$06810006
	DC.L	$00067410,$61000ac0,$4e750828,$00020009
	DC.L	$673a3168,$00140002,$11680013,$000d6100
	DC.L	$002c3168,$00020014,$34280016,$671c3228
	DC.L	$000a3001,$c2c182c2,$90410828,$00030009
	DC.L	$67000004,$e2489168,$00024e75
	DC.W	$45f9
	DC.L	LAB_097A
	DC.L	$70001028,$000d2a32,$04003c05,$48453028
	DC.L	$00043428,$000e0828,$00060009,$66163801
	DC.L	$d0426f06,$db509068,$0006dd68,$000251c9
	DC.L	$fff06014,$3801d042,$6f08dd68,$00029068
	DC.L	$0006db50,$51c9fff0,$9968000a,$31400004
	DC.W	$4e75
LAB_04B2:
	JSR	LAB_0231
	MOVE.W	22(A3),D0
	LSR.W	#4,D0
	MOVE.W	20(A3),D1
	LSR.W	#4,D1
	SUB.W	D1,D0
	ASR.W	#2,D0
	BCLR	#6,14(A3)
	TST.B	D0
	BPL.W	LAB_04B6
	BSET	#6,14(A3)
	BSET	#4,14(A3)
	BNE.S	LAB_04B3
	MOVEM.L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B_0502:
	MOVE.L	A1,-(A7)
	MOVEA.L	A5,A1
LAB_0503:
	MOVEQ	#0,D0
	MOVE.B	(A2)+,D0
	BEQ.S	LAB_0508
	MOVE.L	D6,D5
LAB_0504:
	MOVE.W	(A5),D1
	BEQ.W	LAB_0506
	ADDQ.W	#4,A5
	CMP.B	D0,D1
	BEQ.S	LAB_0505
	DBF	D5,LAB_0504
	BRA.S	LAB_0508
LAB_0505:
	MOVEA.L	A1,A5
	BRA.S	LAB_0503
LAB_0506:
	MOVE.W	D0,(A5)
	MOVE.B	8(A0),2(A5)
	CLR.B	3(A5)
	CMPI.B	#$02,D7
	BEQ.S	LAB_0507
	CMPI.B	#$0c,D7
	BEQ.S	LAB_0507
	CMPI.B	#$01,D7
	BNE.S	LAB_0505
	JSR	LAB_0420
	TST.L	(A5)
	BEQ.S	LAB_0505
	MOVE.L	#$0000000e,LAB_050F
	BRA.S	LAB_0505
LAB_0507:
	JSR	LAB_0426
	TST.L	(A5)
	BEQ.S	LAB_0505
	MOVE.L	#$0000000f,LAB_050F
	BRA.S	LAB_0505
LAB_0508:
	BSET	#2,163(A4)
	MOVEA.L	(A7)+,A1
LAB_0509:
	MOVE.L	LAB_050F,D0
	BEQ.S	LAB_050A
	JSR	LAB_0271
LAB_050A:
	BTST	#5,14(A0)
	BNE.S	LAB_050E
	JSR	LAB_0233
	LEA	80(A1),A2
	TST.B	(A2)
	BEQ.S	LAB_050B
	BSR.W	LAB_0520
LAB_050B:
	LEA	84(A1),A2
	TST.B	(A2)
	BEQ.S	LAB_050C
	BSR.W	LAB_0520
LAB_050C:
	MOVEQ	#0,D0
	MOVE.B	38(A1),D0
	CMPI.B	#$09,3(A0)
	BEQ.S	LAB_050D
	ADD.W	D0,20(A3)
	RTS
LAB_050D:
	ADD.W	D0,22(A3)
LAB_050E:
	RTS
LAB_050F:
	DS.L	1
LAB_0510:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	176(A4),A3
	CLR.W	8(A3)
	MOV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:
	BCLR	#7,26(A2)
	CMPI.B	#$20,37(A2)
	BCC.S	LAB_0545
	BSET	#7,26(A2)
LAB_0545:
	BCLR	#6,29(A0)
	BTST	#7,31(A2)
	BEQ.W	LAB_0546
	LSL.B	#1,D0
	BRA.S	LAB_0547
LAB_0546:
	MOVE.B	30(A2),D1
	LSR.B	#2,D1
	ANDI.B	#$03,D1
	BEQ.S	LAB_0547
	LSR.B	D1,D0
LAB_0547:
	TST.B	D0
	BNE.S	LAB_0548
	MOVEQ	#1,D0
LAB_0548:
	SUB.B	D0,37(A2)
	BEQ.S	LAB_0549
	BCC.S	LAB_054D
LAB_0549:
	CMPI.B	#$04,21(A2)
	BEQ.S	LAB_054C
	TST.W	D3
	BEQ.S	LAB_054B
	MOVE.B	#$ff,15(A2)
	MOVEQ	#0,D0
	MOVE.B	8(A1),D0
	MOVEA.L	84(A4),A1
	DC.W	$2271
	DC.W	$0c00
	CMPI.B	#$04,41(A1)
	BEQ.S	LAB_054A
	CMPI.B	#$08,41(A1)
	BEQ.S	LAB_054A
	CMPI.B	#$03,41(A1)
	BEQ.S	LAB_054A
	CMPI.B	#$07,41(A1)
	BEQ.S	LAB_054A
	CMPI.B	#$05,41(A1)
	BNE.S	LAB_054B
	MOVE.B	#$02,15(A2)
	BRA.S	LAB_054B
LAB_054A:
	MOVE.B	#$03,15(A2)
LAB_054B:
	CLR.B	14(A2)
LAB_054C:
	CLR.B	37(A2)
LAB_054D:
	RTS
LAB_054E:
	TST.B	D1
	BEQ.S	LAB_054D
	TST.W	6(A2)
	BNE.S	LAB_054F
	MOVE.W	D3,6(A2)
LAB_054F:
	MOVE.B	14(A2),D1
	ANDI.B	#$03,D1
	BEQ.S	LAB_0550
	LSR.B	D1,D0
	LSR.B	#1,D0
LAB_0550:
	TST.B	D0
	BMI.S	LAB_0551
	BNE.S	LAB_0552
LAB_0551:
	MOVEQ	#1,D0
LAB_0552:
	SUB.B	D0,12(A2)
	BEQ.S	LAB_0553
	BCS.S	LAB_0553
	CMPI.B	#$20,12(A2)
	BCC.S	LAB_0554
	CMPI.B	#$1e,12(A2)
	BCS.S	LAB_0554
	MOVE.W	10(A2),D0
	LSR.W	#8,D0
	ANDI.W	#$0001,D0
	CMP.W	124(A4),D0
	BNE.S	LAB_0554
	MOVEQ	#21,D0
	JSR	LAB_0271
	BRA.S	LAB_0554
LAB_0553:
	CLR.B	12(A2)
LAB_0554:
	RTS
	DC.L	$48e7fffe,$28012a43,$26486100,$09744a46
	DC.L	$6700030c,$3e004228,$00093142,$00044228
	DC.L	$000d4228,$001342a8,$0014317c,$013c0018
	DC.L	$c14b6100,$0dea6b00,$02e6c14b,$b02b000c
	DC.L	$6608b22b,$000d6700,$02d63400,$3601302c
	DC.L	$00b4322c,$00b6eb4a,$eb4b082b,$0006001c
	DC.L	$6616082b,$0007001a,$665a4a04,$6b406754
	DC.L	$53446728,$53446712,$02400003,$55400241
	DC.L	$00035541,$d440d641,$604e0240,$00075940
	DC.L	$02410007,$5941d440,$d641603c,$0240000f
	DC.L	$51400241,$000f5141,$d440d641,$602a0240
	DC.L	$003f0440,$00200241,$003f0441,$0020d440
	DC.L	$d6416014,$0240001f,$04400010,$0241001f
	DC.L	$04410010,$d440d641,$3013322b,$00027800
	DC.L	$182b0023,$92440c07,$00036616,$78001828
	DC.L	$00044884,$48441828,$00054884,$42680004
	DC.L	$60147800,$18280004,$4884d044,$48441828
	DC.L	$00054884,$d2442f04,$30803141,$00024eb9
	DC.L	LAB_0767
	DC.L	$6b0608e8,$00060009,$31400004,$31410006
	DC.L	$3142000e,$59453145,$000a1147,$00080628
	DC.L	$00100008,$102b0005,$0200000f,$1140000d
	DC.L	$316b000a,$0010281f,$53476618,$4228000c
	DC.L	$08e80007,$0009204b,$200d4eb9
	DC.L	LAB_026D
	DC.L	$600001a8,$5347661c,$117c0000,$000c2210
	DC.L	$70176100,$019c204b,$200d4eb9
	DC.L	LAB_026D
	DC.L	$60000188,$53476624,$4228000c,$08e80007
	DC.L	$0009317c,$ffff0012,$06680030,$000a204b
	DC.L	$200d4eb9
	DC.L	LAB_026D
	DC.L	$60000160,$53476600,$001a4228,$000c08e8
	DC.L	$00070009,$204b200d
	DC.W	$4eb9
	DC.L	LAB_026D
	DC.L	$60000142,$53476600,$00583028,$000a3140
	DC.L	$00163168,$00020014,$08e80002,$0009117c
	DC.L	$001a000c,$1168000d,$00134228,$000d082b
	DC.L	$0007001f,$671c08e8,$00030009,$08e80001
	DC.L	$0009117c,$000a0012,$117c0001,$000d6000
	DC.L	$00f4204b,$200d4eb9
	DC.L	LAB_026D
	DC.L	$600000e6,$5347661c,$117c0034,$000c2210
	DC.L	$70176100,$00da204b,$200d4eb9
	DC.L	LAB_026D
	DC.L	$600000c6,$53476618,$4228000c,$08e80007
	DC.L	$0009204b,$200d4eb9
	DC.L	LAB_026D
	DC.L	$600000aa,$53476600,$00343028,$000a3140
	DC.L	$00163168,$00020014,$08e80002,$000908e8
	DC.L	$00070009,$4228000c,$1168000d,$0013204b
	DC.L	$200d4eb9
	DC.L	LAB_026D
	DC.L	$60000072,$53476622,$117c0018,$000c1168
	DC.L	$000d0013,$22107017,$61000060,$204b200d
	DC.W	$4eb9
	DC.L	LAB_026D
	DC.L	$6000004c,$53476600,$001a4228,$000c08e8
	DC.L	$00070009,$204b200d
	DC.W	$4eb9
	DC.L	LAB_026D
	DC.L	$6000002e,$53476628,$117c0010,$000c1168
	DC.L	$000d0013,$082b0006,$001c6706,$08e80007
	DC.L	$0009204b,$200d4eb9
	DC.L	LAB_026D
	DC.L	$60000002,$4cdf7fff
	DC.W	$4e75
LAB_0555:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	A0,A6
	BSR.W	LAB_057A
	TST.W	D6
	BEQ.W	LAB_0578
	BSR.W	LAB_057D
	BMI.W	LAB_0578
	MOVE.L	D1,(A0)
	MOVE.W	D0,D7
	CLR.B	9(A0)
	CLR.B	13(A0)
	CLR.L	20(A0)
	MOVE.W	#$00a8,24(A0)
	MOVE.B	D7,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ffff,20(A0)
	MOVE.W	#$0138,24(A0)
	BRA.W	LAB_0578
LAB_0561:
	SUBQ.W	#1,D7
	BNE.S	LAB_0563
	MOVE.B	#$1c,12(A0)
	MOVE.B	D2,13(A0)
	MOVE.B	D2,19(A0)
	MOVEQ	#10,D0
	TST.W	D3
	BEQ.S	LAB_0562
	BMI.S	LAB_0562
	MOVE.W	D3,D0
	JSR	LAB_022C
	MOVEQ	#10,D0
	CMPI.B	#$96,36(A2)
	BCS.S	LAB_0562
	MOVEQ	#5,D0
LAB_0562:
	MOVE.W	D0,10(A0)
	MOVE.W	#$ffff,20(A0)
	MOVE.W	#$013c,24(A0)
	BRA.W	LAB_0578
LAB_0563:
	SUBQ.W	#1,D7
	BNE.S	LAB_0564
	BSET	#0,9(A0)
	BSET	#5,9(A0)
	MOVE.L	8(A6),4(A0)
	MOVE.B	D2,12(A0)
	MOVE.W	#$7777,10(A0)
	CLR.B	19(A0)
	BSET	#4,9(A0)
	MOVE.W	#$00c4,24(A0)
	BRA.W	LAB_0578
LAB_0564:
	SUBQ.W	#1,D7
	BNE.S	LAB_0566
	TST.B	D6
	BEQ.W	LAB_0578
	MOVE.B	#$0b,12(A0)
	BTST	#0,181(A4)
	BNE.S	LAB_0565
	MOVE.B	#$01,12(A0)
	BTST	#0,183(A4)
	BNE.S	LAB_0565
	MOVE.B	#$22,12(A0)
LAB_0565:
	MOVE.W	#$0006,10(A0)
	MOVE.W	#$ffff,20(A0)
	MOVE.W	#$0138,24(A0)
	BRA.W	LAB_0578
LAB_0566:
	SUBQ.W	#1,D7
	BNE.S	LAB_0567
	MOVE.B	#$44,12(A0)
	MOVE.W	#$0007,10(A0)
	MOVE.W	#$ffff,20(A0)
	MOVE.W	#$013c,24(A0)
	BRA.W	LAB_0578
LAB_0567:
	SUBQ.W	#1,D7
	BNE.S	LAB_0568
	MOVE.B	#$60,12(A0)
	MOVE.B	D2,18(A0)
	CLR.B	19(A0)
	MOVE.W	#$0100,10(A0)
	BSET	#4,9(A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A0)
	MOVE.W	#$000f,10(A0)
	MOVE.W	#$ffff,22(A0)
	TST.B	D2
	BEQ.W	LAB_0578
	BSET	#4,9(A0)
	BRA.W	LAB_0578
LAB_0572:
	SUBQ.W	#1,D7
	BNE.S	LAB_0573
	TST.B	D6
	BEQ.W	LAB_0578
	CLR.W	12(A0)
	MOVE.W	#$0140,24(A0)
	MOVE.W	#$001f,10(A0)
	MOVE.W	#$ffff,20(A0)
	BRA.W	LAB_0578
LAB_0573:
	SUBQ.W	#1,D7
	BNE.S	LAB_0574
	TST.B	D6
	BEQ.W	LAB_0578
	CLR.W	12(A0)
	MOVE.W	#$0144,24(A0)
	MOVE.W	#$001f,10(A0)
	MOVE.W	#$ffff,20(A0)
	BRA.W	LAB_0578
LAB_0574:
	SUBQ.W	#1,D7
	BNE.S	LAB_0575
	TST.B	D6
	BEQ.W	LAB_0578
	CLR.W	12(A0)
	MOVE.W	#$0144,24(A0)
	MOVE.W	#$001f,10(A0)
	MOVE.W	#$ffff,20(A0)
	BRA.W	LAB_0578
LAB_0575:
	SUBQ.W	#1,D7
	BNE.S	LAB_0576
	TST.B	D6
	BEQ.W	LAB_0578
	MOVE.B	#$12,12(A0)
	CLR.B	13(A0)
	MOVE.W	#$013c,24(A0)
	MOVE.W	#$0004,10(A0)
	MOVE.W	#$ffff,20(A0)
	BRA.W	LAB_0578
LAB_0576:
	SUBQ.W	#1,D7
	BNE.S	LAB_0577
	TST.B	D6
	BEQ.W	LAB_0578
	MOVE.B	#$13,12(A0)
	CLR.B	13(A0)
	MOVE.W	#$013c,24(A0)
	MOVE.W	#$000a,10(A0)
	MOVE.W	#$ffff,20(A0)
	BRA.W	LAB_0578
LAB_0577:
	SUBQ.W	#1,D7
	BNE.S	LAB_0578
	TST.B	D6
	BEQ.W	LAB_0578
	MOVE.B	#$13,12(A0)
	CLR.B	13(A0)
	MOVE.W	#$013c,24(A0)
	MOVE.W	#$0006,10(A0)
	MOVE.W	#$ffff,20(A0)
	BRA.W	LAB_0578
LAB_0578:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0579:
	DS.L	1
LAB_057A:
	MOVE.W	#$013f,D7
	MOVEA.L	164(A4),A0
	MOVEQ	#1,D6
LAB_057B:
	TST.B	8(A0)
	BEQ.S	LAB_057C
	BMI.S	LAB_057C
	LEA	32(A0),A0
	ADDQ.W	#1,D6
	DBF	D7,LAB_057B
	MOVEQ	#0,D6
LAB_057C:
	RTS
LAB_057D:
	TST.W	D1
	BMI.S	LAB_057E
	MOVE.W	10(A4),D7
	LSL.W	#5,D7
	CMP.W	D7,D1
	BCC.S	LAB_057E
	SWAP	D1
	TST.W	D1
	BMI.S	LAB_057E
	MOVE.W	8(A4),D7
	LSL.W	#5,D7
	CMP.W	D7,D1
	BCC.S	LAB_057E
	SWAP	D1
	MOVEQ	#0,D7
	RTS
LAB_057E:
	MOVEQ	#-1,D7
	RTS
LAB_057F:
	DC.L	$48e7fffe,$26484a68,$000a6700,$00ea7000
	DC.L	$1028000c,$48401028,$000d2400
	DC.W	$4eb9
	DC.L	LAB_022A
	DC.L	$426d0004,$2a4b2202,$74017000,$1028000a
	DC.L	$02000001,$08400000,$2f0d6100,$011a2a5f
	DC.L	$4a406b00,$00b63a28,$000a142d,$000a4eb9
	DC.L	LAB_0235
	DC.L	$4a6b000a,$6704536b,$000a7600,$362d000a
	DC.L	$30036100,$04c67000,$102d0024,$91ab003c
	DC.L	$6a0442ab,$003c2095,$216d0004,$0004216d
	DC.L	$00080008,$216d000c,$000c216d,$00100010
	DC.L	$216d0014,$0014216d,$00180018,$216d001c
	DC.L	$001c216d,$00200020,$216d0024,$0024216d
	DC.L	$00280028,$216d002c,$002c216d,$00300030
	DC.L	$216d0034,$0034216d,$00380038,$216d003c
	DC.L	$003c3145,$000a08e8,$0000001d,$42a80010
	DC.L	$08a80004,$001808a8,$00050018,$42ad0008
	DC.L	$4cdf7fff,$4e753b68,$000a0004,$4cdf7fff
	DC.W	$4e75
LAB_0580:
	BSR.W	LA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AB_059C
	BTST	#5,14(A3)
	BEQ.S	LAB_059C
	CMPI.B	#$06,D0
	BEQ.S	LAB_059D
	CMPI.B	#$07,D0
	BEQ.S	LAB_059E
	CMPI.B	#$10,D0
	BEQ.S	LAB_059D
LAB_059B:
	MOVEQ	#1,D1
	RTS
LAB_059C:
	MOVEQ	#0,D1
	RTS
LAB_059D:
	CMPI.B	#$c8,9(A3)
	BCC.S	LAB_059C
	BRA.S	LAB_059B
LAB_059E:
	TST.B	9(A3)
	BEQ.S	LAB_059C
	BRA.S	LAB_059B
LAB_059F:
	MOVEM.L	D1-D2/A3,-(A7)
	BSR.W	LAB_0592
	MOVEM.L	(A7)+,D1-D2/A3
	MOVE.W	D6,D0
	BMI.S	LAB_05A0
	MOVEQ	#-1,D0
	RTS
LAB_05A0:
	JSR	LAB_022D
	MOVE.B	D1,5(A2)
	TST.B	D2
	BEQ.S	LAB_05A1
	MOVE.B	D2,9(A2)
LAB_05A1:
	MOVEQ	#0,D0
	RTS
LAB_05A2:
	DC.L	$30280010,$673c0828,$00050018,$67464eb9
	DC.L	LAB_022C
	DC.L	$4a6a000a,$662c4268,$0010117c,$00010014
	DC.L	$4a28001d,$6a180828,$00060019,$66100c28
	DC.L	$000b0015,$6708700b
	DC.W	$4eb9
	DC.L	LAB_0180
	DC.L	$70ff4e75,$7000102a,$000c7200,$122a000d
	DC.L	$4e757000,$10280010,$72001228,$00114e75
	DC.L	$30280012,$671e0828,$00040018,$67304eb9
	DC.L	LAB_022C
	DC.L	$4a6a000a,$660e4268,$001208a8,$00060019
	DC.L	$70ff4e75,$7000102a,$000c7200,$122a000d
	DC.L	$4a2a0023,$67025341,$4e757000,$10280012
	DC.L	$72001228,$00134e75
LAB_05A3:
	MOVEM.L	D1-D7/A0-A6,-(A7)
	MOVE.W	D0,D6
	JSR	LAB_022E
	MOVEQ	#15,D7
LAB_05A4:
	MOVE.W	(A0)+,D0
	BEQ.S	LAB_05A5
	CMP.W	D0,D6
	BEQ.S	LAB_05A6
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05E4:
	MOVE.L	D0,D5
	BEQ.S	LAB_05E6
	MOVEA.L	DosBase(PC),A6
	MOVE.L	D6,D1
	MOVE.L	#$000003ed,D2
	JSR	_LVOOpen(A6)
	MOVE.L	D0,D7
	BEQ.S	LAB_05E7

	MOVE.L	D7,D1
	MOVE.L	D5,D2
	MOVE.L	D4,D3
	JSR	_LVORead(A6)
	CMPI.L	#$ffffffff,D0
	BEQ.S	LAB_05E8

	MOVE.L	D7,D1
	JSR	_LVOClose(A6)

	MOVEQ	#0,D0
	MOVEA.L	D5,A0
LAB_05E5:
	MOVE.L	(A7)+,D1
	MOVEM.L	(A7)+,D1-D7/A1-A6
	TST.L	D0
	RTS

LAB_05E6:
	MOVEQ	#-2,D0
	BRA.S	LAB_05E5
LAB_05E7:
	MOVEQ	#-1,D0
	BRA.S	LAB_05E5
LAB_05E8:
	MOVEQ	#-7,D0
	BRA.S	LAB_05E5
LAB_05E9:
	MOVEM.L	(A7)+,D0-D7/A0-A5
	MOVEQ	#-5,D0
	BRA.S	LAB_05E5
	DC.L	$48e77ffe,$2c7a5dd0,$2c084eb9
	DC.L	do_mem_table
	DC.L	$4a806736,$04800000,$00102a09,$28002c7a
	DC.L	$5db62206,$243c0000,$03ec4eae,$ffe22e00
	DC.L	$67182207,$24052604,$4eaeffd0,$4a806b0a
	DC.L	$22074eae,$ffdc7000,$60027007,$4cdf7ffe
	DC.L	$4e7570ff,$6000fff6

swap_stuff:
	CMPI.B	#$2e,(A0)+
	BNE.W	swap_stuff
	MOVE.L	D0,D7
	SUBQ.W	#3,A0
	DIVU	#$000a,D0
	ADDI.B	#$30,D0
	MOVE.B	D0,(A0)+
	SWAP	D0
	ADDI.B	#$30,D0
	MOVE.B	D0,(A0)+
	MOVEQ	#0,D1
	MOVE.W	-2(A0),D1
	SWAP	D1
	MOVE.L	D7,D0
	RTS

LAB_05EB:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	DosBase(PC),A6
	LEA	LAB_08BB,A5
	MO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,LAB_05FC

	LEA	LAB_05FD,A0
	MOVE.L	#$000000a0,D0
	MOVE.L	LAB_05FC,D1
	MOVE.L	A0,D2
	MOVE.L	A0,D4
	MOVE.L	D0,D3
	MOVE.L	D0,D5
	JSR	_LVORead(A6)

	MOVEA.L	D4,A0
	CMPI.L	#$53415645,(A0)
	BNE.W	LAB_05FB

	MOVE.L	LAB_05FC,D1
	JSR	_LVOClose(A6)

	MOVEA.L	D4,A0
	MOVEQ	#0,D0
	MOVE.W	8(A0),D0
	MOVEQ	#0,D1
	MOVE.W	10(A0),D1
	MOVEQ	#0,D2
	MOVE.B	42(A0),D2
	MOVEM.L	(A7)+,D3-D7/A0-A6
	RTS
LAB_05F1:
	MOVEM.L	D1-D7/A0-A6,-(A7)
	CLR.L	LAB_0601
	LEA	LAB_0882,A0
	MOVE.L	A0,D6
	BSR.W	swap_stuff
	MOVEA.L	DosBase(PC),A6
	MOVE.L	D6,D1
	MOVE.L	#$000003ed,D2
	JSR	_LVOOpen(A6)
	MOVE.L	D0,D7
	BEQ.W	LAB_05F4
	MOVE.L	D7,LAB_05FC
	LEA	LAB_05FD,A0
	MOVE.L	#$000000a0,D0
	BSR.W	LAB_05F6
	MOVE.W	8(A0),LAB_08A3
	MOVE.W	8(A0),336(A4)
	MOVE.W	10(A0),360(A4)
	MOVE.L	16(A0),104(A4)
	MOVE.L	20(A0),124(A4)
	MOVE.L	24(A0),128(A4)
	MOVE.L	28(A0),132(A4)
	MOVE.L	32(A0),136(A4)
	MOVE.L	36(A0),156(A4)
	MOVE.L	40(A0),160(A4)
	MOVE.L	44(A0),180(A4)
	MOVE.L	48(A0),228(A4)
	MOVE.L	52(A0),232(A4)
	MOVE.L	56(A0),236(A4)
	MOVE.L	60(A0),240(A4)
	MOVE.L	64(A0),256(A4)
	MOVE.L	68(A0),268(A4)
	MOVE.L	68(A0),288(A4)
	MOVE.L	72(A0),284(A4)
	MOVE.L	76(A0),LAB_08AC
	MOVE.L	80(A0),264(A4)
	MOVE.L	84(A0),292(A4)
	MOVE.L	88(A0),296(A4)
	MOVE.L	92(A0),300(A4)
	MOVE.L	96(A0),332(A4)
	MOVE.L	100(A0),304(A4)
	MOVE.L	104(A0),336(A4)
	MOVE.L	108(A0),340(A4)
	MOVE.L	112(A0),344(A4)
	MOVE.L	116(A0),360(A4)
LAB_05F2:
	LEA	LAB_05FE,A0
	MOVEQ	#8,D0
	BSR.W	LAB_05F6
	BMI.S	LAB_05F4
	MOVE.L	(A0),D7
	CMPI.L	#$53555a59,D7
	BEQ.W	LAB_05F3
	MOVE.L	4(A0),D6
	MOVE.L	D7,D1
	MOVE.L	D6,D0
	JSR	alloc_mem
	MOVEA.L	A0,A0
	MOVEA.L	DosBase(PC),A6
	MOVE.L	D6,D0
	BSR.W	LAB_05F6
	BPL.S	LAB_05F2
	BRA.S	LAB_05F4
LAB_05F3:
	MOVE.L	LAB_05FC,D1
	JSR	_LVOClose(A6)
	MOVE.L	LAB_05FF,D0
	CMP.L	LAB_0601,D0
	BNE.W	LAB_05FB
	MOVEQ	#0,D0
	BRA.S	LAB_05F5
LAB_05F4:
	MOVEQ	#1,D0
LAB_05F5:
	MOVEM.L	(A7)+,D1-D7/A0-A6
	RTS
LAB_05F6:
	MOVE.L	LAB_05FC,D1
	MOVE.L	A0,D2
	MOVE.L	A0,D4
	MOVE.L	D0,D3
	MOVE.L	D0,D5
	JSR	_LVORead(A6)
	MOVEA.L	D4,A0
	BSR.W	LAB_05F8
	TST.L	D0
	RTS
LAB_05F7:
	DC.L	$48e77ffe
	DC.W	$4eb9
	DC.L	LAB_0323
	DC.W	$42b9
	DC.L	LAB_0601
	DC.L	$43fa0274,$24497e0f,$14d851cf,$fffc6100
	DC.L	$fdd241f9
	DC.L	LAB_0882
	DC.L	$2c086100,$fce82c7a,$5a622206,$243c0000
	DC.L	$03ec4eae,$ffe22e00,$6700012e
	DC.W	$23c7
	DC.L	LAB_05FC
	DC.W	$41f9
	DC.L	LAB_05FD
	DC.L	$316c0150,$0008316c,$0168000a,$217c0000
	DC.L	$0004000c,$216c0068,$0010216c,$007c0014
	DC.L	$216c0080,$0018216c,$0084001c,$216c0088
	DC.L	$0020216c,$009c0024,$216c00a0,$0028216c
	DC.L	$00b4002c,$216c00e4,$0030216c,$00e80034
	DC.L	$216c00ec,$0038216c,$00f0003c,$216c0100
	DC.L	$0040216c,$01200044,$216c011c,$00482179
	DC.L	LAB_08AC
	DC.L	$004c216c,$01080050,$216c0124,$0054216c
	DC.L	$01280058,$216c012c,$005c216c,$014c0060
	DC.L	$216c0130,$0064216c,$01500068,$216c0154
	DC.L	$006c216c,$01580070,$216c0168,$0074203c
	DC.L	$000000a0,$6100009a,$203c4558,$54216100
	DC.L	$0064203c,$424c4421,$6100005a,$203c4950
	DC.L	$53216100,$0050203c,$5a4f4e21,$61000046
	DC.L	$203c4445,$46216100,$003c203c,$42415321
	DC.L	$61000032,$203c5351,$44216100,$002841f9
	DC.L	LAB_0600
	DC.L	$70086100,$00482c7a,$59322239
	DC.L	LAB_05FC
	DC.L	$4eaeffdc,$70006002,$70074cdf,$7ffe4e75
	DC.L	$47fa011c,$26802c08
	DC.W	$4eb9
	DC.L	do_mem_table
	DC.L	$4a806732,$04800000,$00102740,$00042a49
	DC.L	$204b7008,$61000008,$204d202b,$00042239
	DC.L	LAB_05FC
	DC.L	$24082600,$2a006100,$000c2c7a,$58dc4eae
	DC.L	$ffd04e75
LAB_05F8:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	CMPI.L	#$53555a59,(A0)
	BEQ.S	LAB_05FA
	MOVE.L	LAB_0601,D7
	MOVE.L	D5,D0
LAB_05F9:
	MOVEQ	#0,D6
	MOVE.B	(A0)+,D6
	ADD.L	D6,D7
	ADD.L	D0,D7
	SUBQ.L	#1,D0
	BNE.S	LAB_05F9
	MOVE.L	D7,LAB_0601
LAB_05FA:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_05FB:
	MOVEQ	#-11,D0
	JMP	exit_fail
LAB_05FC:
	DS.L	1
LAB_05FD:
	DC.L	$53415645
	DS.L	39
LAB_05FE:
	DS.L	1
LAB_05FF:
	DS.L	1
LAB_0600:
	DC.L	$53555a59
LAB_0601:
	DS.L	1
LAB_0602:
	DS.L	40
	DC.L	$610000f0,$2654382c,$00064a6c,$007e6706
	DC.L	$206c0090,$6004206c,$008c7e0f,$74002f08
	DC.L	$3018673c
	DC.W	$4eb9
	DC.L	LAB_022C
	DC.L	$082a0002,$001a662a,$7000102a,$000c4840
	DC.L	$102a000d,$2a4b3200,$c2c44bf5,$18004840
	DC.L	$e9484bf5,$0000426d,$000608ed,$00060004
	DC.L	$524251cf,$ffc25342,$6b000030,$202c0098
	DC.L	$61000168,$7e0f2c5f,$301e671c
	DC.W	$4eb9
	DC.L	LAB_022C
	DC.L	$082a0002,$001a660a,$204a2f07,$610002f0
	DC.L	$2e1f51cf,$ffe24e75,$245f4e75
LAB_0603:
	DC.L	$2448082a,$0002001a,$67000004,$54406100
	DC.L	$004a2654,$382c0006,$7000102a,$000c4840
	DC.L	$102a000d,$2a4b3200,$c2c44bf5,$18004840
	DC.L	$e9484bf5,$0000426d,$00062f0a,$204a6100
	DC.L	$f29c6b0e,$48403001,$08ed0006,$00046100
	DC.L	$00ec205f,$6100028c,$4e754a00,$663449f9
	DC.L	rtg_more_stuff
	DC.L	$20542e2c,$000c5347,$7c007aff,$4a680004
	DC.L	$670e3145,$000641e8,$001051cf,$fff0600c
	DC.L	$31460006,$41e80010,$51cfffe2,$4e755340
	DC.L	$663449f9
	DC.L	rtg_more_stuff
	DC.L	$20542e2c,$000c5347,$7c007aff,$4a680004
	DC.L	$6a0e3145,$000641e8,$001051cf,$fff0600c
	DC.L	$31460006,$41e80010,$51cfffe2,$4e755340
	DC.L	$663449f9
	DC.L	rtg_more_stuff
	DC.L	$20542e2c,$000c5347,$7c007aff,$4a68000c
	DC.L	$670e3145,$000641e8,$001051cf,$fff0600c
	DC.L	$31460006,$41e80010,$51cfffe2,$4e755340
	DC.L	$663449f9
	DC.L	rtg_more_stuff
	DC.L	$20542e2c,$000c5347,$7c007aff,$4a68000c
	DC.L	$6a0e3145,$000641e8,$001051cf,$fff0600c
	DC.L	$31460006,$41e80010,$51cfffe2,$4e754e75
	DC.W	$23c0
	DC.L	LAB_0604
	DC.L	$2a4b3200,$c2c44bf5,$18004840,$e9484bf5
	DC.L	$00004a6d,$00066600,$00087c01,$3b460006
	DC.L	$43fa02a6,$7e0145fa,$0aa02f09,$2f0a5246
	DC.L	$7a005347,$20192a4b,$32003604,$c2c34bf5
	DC.L	$18004840,$3200e949,$4bf51000,$48404a6d
	DC.L	$00046700,$000c08ad,$00060004,$66000138
	DC.L	$2c42740f,$4a6d0016,$66125245,$3b460016
	DC.L	$22000681,$00010000,$24c16006,$4a6d0014
	DC.L	$66040882,$00014a6d,$fff66612,$52453b46
	DC.L	$fff62200,$04810001,$000024c1,$60064a6d
	DC.L	$fff46604,$08820003,$4a753006,$660e5245
	DC.L	$3b863006,$22005241,$24c16006,$4a753004
	DC.L	$66040882,$00024443,$4a753006,$660e5245
	DC.L	$3b863006,$22005341,$24c16006,$4a753004
	DC.L	$66040882,$00004a02,$660a240e,$51cfff46
	DC.L	$60000098,$08020000,$67200802,$0001671a
	DC.L	$4a753016,$66145245,$3b863016,$22000441
	DC.L	$00014841,$52414841,$24c10802,$0000671c
	DC.L	$08020003,$67164a75,$30f66610,$52453b86
	DC.L	$30f62200,$04810001,$000124c1,$44430802
	DC.L	$0001671c,$08020002,$67164a75,$30166610
	DC.L	$52453b86,$30162200,$06810001,$000124c1
	DC.L	$08020002,$671e0802,$00036718,$4a7530f6
	DC.L	$66125245,$3b8630f6,$22004841,$53414841
	DC.L	$524124c1,$240e51cf,$feac225f,$245f3e05
	DC.L	$6600fe98,$4e7551ca,$fec8225f,$245f4e75
	DC.L	$43e80028,$08280000,$001a6600,$00847000
	DC.L	$1028000c,$48401028,$000d47fa,$6de47a00
	DC.L	$6100007c,$4a016b00,$00647e00,$24331400
	DC.L	$60025207,$d0424840,$4842d042,$48404842
	DC.L	$1c016100,$005ab206,$67e83607,$0243ffe0
	DC.L	$ea4b5343,$6b120006,$00f812c6,$52050c05
	DC.L	$0018641e,$51cbfff4,$02060007,$0207001f
	DC.L	$e70f8c07,$12c65205,$0c050018,$64044a01
	DC.L	$6aa81145,$00164268,$00204e75,$11450016
	DC.L	$42680020,$42994299,$42994299,$4e7548e7
	DC.L	$3ff02a54,$32003604,$c2c34bf5,$18004840
	DC.L	$3200e949,$4bf51000,$484072ff,$24013c2d
	DC.L	$0006673e,$5346673a,$47ec0010,$7e077200
	DC.L	$3a065345,$6732361b,$4a753004,$660e3835
	DC.L	$3006ba44,$671cbc44,$66021401,$524151cf
	DC.L	$ffe61202,$6a0c47ec,$00107e07,$72005246
	DC.L	$60064cdf,$0ffc4e75,$361b3835,$3006670a
	DC.L	$6b08bc44,$65043401,$3c045241,$51cfffea
	DC.L	$12024cdf,$0ffc4e75
LAB_0604:
	DS.L	817
LAB_0605:
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	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	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0
	ORI.B	#$00,D0

;rtg_copyblit:						;A0 = Array
;	MOVEM.L	D2-D7/A2-A6,-(A7)		;A1 = BufferAdr
;	MOVEA.L	A0,A2
;	MOVEA.L	rtg_screen,A0
;	MOVEQ	#0,D0					;Left = 0x0
;	MOVEQ	#0,D1					;Top = 0x0
;	MOVE.L	blit_width,D2
;	MOVE.L	blit_height,D3
;	MOVE.L	D2,D4					;WidthSrc = Width
;	MOVE.L	D3,D5					;HeightSrc = Height
;	MOVE.L	#$00000000,D6			;SrcX = 0
;	MOVE.L	#$00000000,D7			;SrcY = 0
;	SUBA.L	A3,A3					;Masked = 0x0
;	MOVEA.L	RTGMasterBase,A6
;	JSR	_LVOCopyRtgBlit(A6)
;	MOVEM.L	(A7)+,D2-D7/A2-A6
;	RTS

rtg_copyblit:						;A0 = Array
	MOVEM.L	D2-D7/A2-A6,-(A7)		;A1 = BufferAdr
	MOVEA.L	A0,A2
	MOVEA.L	rtg_screen,A0
	MOVEQ	#0,D0					;Left = 0x0
	MOVEQ	#0,D1					;Top = 0x0
	MOVE.L	blit_width,D2
	MOVE.L	blit_height,D3
	MOVE.L	D2,D4					;WidthSrc = Width
	MOVE.L	D3,D5					;HeightSrc = Height
	MOVE.L	#$00000000,D6			;SrcX = 0
	MOVE.L	#$00000000,D7			;SrcY = 0
	SUBA.L	A3,A3					;Masked = 0x0
	MOVEA.L	RT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_0619
	BTST	#2,D4
	BNE.S	LAB_0619
	MOVE.W	6(A4),D1
	SUBI.W	#$0038,D1
	CMP.W	D1,D0
	BCS.S	LAB_0616
	BSET	#7,115(A4)
LAB_0616:
	MOVEQ	#2,D2
	ADD.W	14(A4),D2
	CMP.W	D2,D7
	BNE.S	LAB_0617
	TST.B	115(A4)
	BMI.S	LAB_0618
	BRA.S	LAB_061D
LAB_0617:
	BTST	#0,D4
	BNE.S	LAB_061B
	CMP.W	D1,D0
	BCS.S	LAB_061D
	ADDI.W	#$0038,D1
	CMP.W	D1,D0
	BCC.S	LAB_061B
LAB_0618:
	LEA	-48(A4),A4
	BTST	#6,163(A4)
	BNE.W	LAB_0625
	MOVEQ	#0,D0
	BRA.W	LAB_0624
LAB_0619:
	MOVEQ	#0,D2
	BTST	#3,112(A4)
	BEQ.S	LAB_061A
	MOVEQ	#2,D2
LAB_061A:
	ADD.W	14(A4),D2
	CMP.W	D2,D7
	BEQ.S	LAB_061D
	BTST	#0,D4
	BNE.S	LAB_061B
	CMP.W	6(A4),D0
	BCS.S	LAB_061D
LAB_061B:
	BTST	#1,D4
	BNE.S	LAB_061D
	ADDQ.W	#1,D7
	TST.B	D5
	BEQ.S	LAB_061C
	ADDQ.W	#4,D5
	BRA.S	LAB_061D
LAB_061C:
	MOVEQ	#17,D5
LAB_061D:
	LEA	-48(A4),A4
	ANDI.B	#$0f,D4
	BNE.S	LAB_061F
	TST.B	D5
	BEQ.S	LAB_061F
	MOVE.B	161(A4),D0
	ANDI.W	#$000f,D0
	BNE.S	LAB_061E
	BTST	#1,358(A4)
	BNE.S	LAB_061F
	BRA.W	LAB_0622
LAB_061E:
	MOVEQ	#9,D1
	SUB.W	D0,D1
	BMI.W	LAB_0622
	CMP.W	LAB_0626,D1
	BCS.S	LAB_061F
	ADDQ.W	#1,LAB_0626
	BRA.S	LAB_0622
LAB_061F:
	CMP.W	104(A4),D7
	BNE.S	LAB_0620
	CMP.W	106(A4),D6
	BEQ.S	LAB_0621
LAB_0620:
	MOVE.B	D7,108(A3)
	MOVE.B	D6,109(A3)
	CLR.L	344(A4)
LAB_0621:
	MOVE.W	D7,104(A4)
	MOVE.W	D6,106(A4)
	MOVE.W	D7,44(A3)
	MOVE.W	D6,46(A3)
LAB_0622:
	MOVE.L	D5,D0
	BNE.S	LAB_0624
	CLR.W	LAB_0626
	TST.B	163(A4)
	BEQ.S	LAB_0623
	MOVEQ	#0,D0
LAB_0623:
	CMPI.W	#$0010,128(A4)
	BCS.S	LAB_0625
LAB_0624:
	BSR.W	load_rgb_and_pointer
LAB_0625:
	RTS
LAB_0626:
	DS.L	1
LAB_0627:
	MOVEA.L	#palette_name,A0
	MOVE.L	#$50414c21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_0629
	LEA	load_rtg_colors,A1
	LEA	LAB_02DC,A2
	MOVE.W	#$02ff,D0
LAB_0628:
	MOVE.B	(A0),(A2)+
	MOVE.B	(A0)+,(A1)+
	MOVE.B	#$ff,(A1)+
	MOVE.W	#$ffff,(A1)+
	DBF	D0,LAB_0628
	MOVE.L	#$50414c21,D1
	JSR	free_mem
	RTS
LAB_0629:
	JMP	exit_fail
LAB_062A:
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	LEA	load_rtg_rgb_table,A1
	JSR	_LVOLoadRGBRtg(A6)
	RTS

	DC.W	$43f9
	DC.L	load_rtg_colors
	DC.L	$303c00ff,$524812d8,$12fc00ff,$32fcffff
	DC.L	$12d812fc,$00ff32fc,$ffff12d8,$12fc00ff
	DC.L	$32fcffff,$51c8ffde
	DC.W	$2c79
	DC.L	RTGMasterBase
	DC.W	$2079
	DC.L	rtg_screen
	DC.W	$43f9
	DC.L	load_rtg_rgb_table
	DC.L	$4eaeffd0
	DC.W	$4e75
LAB_062B:
	LEA	load_rtg_colors,A1
	MOVE.W	#$00ff,D0
LAB_062C:
	ADDQ.W	#1,A0
	MOVE.B	#$00,(A1)+
	MOVE.B	#$ff,(A1)+
	MOVE.W	#$ffff,(A1)+
	MOVE.B	#$00,(A1)+
	MOVE.B	#$ff,(A1)+
	MOVE.W	#$ffff,(A1)+
	MOVE.B	#$00,(A1)+
	MOVE.B	#$ff,(A1)+
	MOVE.W	#$ffff,(A1)+
	DBF	D0,LAB_062C
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	LEA	load_rtg_rgb_table,A1
	JSR	_LVOLoadRGBRtg(A6)
	RTS
LAB_062D:
	LEA	load_rtg_colors,A1
	LEA	LAB_02DC,A2
	MOVE.W	#$00ff,D0
LAB_062E:
	ADDQ.W	#1,A0
	MOVE.B	(A0)+,(A2)+
	MOVE.B	(A0)+,(A2)+
	MOVE.B	(A0)+,(A2)+
	DBF	D0,LAB_062E
	RTS


fade_out_rtg:
	BSR.W	dim_colors_rtg
	TST.W	D7
	BNE.S	fade_out_rtg
	RTS


dim_colors_rtg:
	LEA	load_rtg_colors,A1
	MOVE.W	#$00ff,D0		;D0 = 255
	MOVEQ	#0,D7
LAB_0631:
	TST.B	(A1)			;R
	BEQ.S	LAB_0632
	ADDQ.W	#1,D7
	SUBQ.B	#2,(A1)
	BCC.S	LAB_0632
	CLR.B	(A1)
LAB_0632:
	ADDQ.W	#4,A1			;G
	TST.B	(A1)
	BEQ.S	LAB_0633
	ADDQ.W	#1,D7
	SUBQ.B	#2,(A1)
	BCC.S	LAB_0633
	CLR.B	(A1)
LAB_0633:
	ADDQ.W	#4,A1			;B
	TST.B	(A1)
	BEQ.S	LAB_0634
	ADDQ.W	#1,D7
	SUBQ.B	#2,(A1)
	BCC.S	LAB_0634
	CLR.B	(A1)
LAB_0634:
	ADDQ.W	#4,A1
	DBF	D0,LAB_0631
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	LEA	load_rtg_rgb_table,A1
	JSR	_LVOLoadRGBRtg(A6)
	RTS



LAB_0635:
	BSR.W	LAB_0636
	TST.W	D7
	BNE.S	LAB_0635
	RTS
LAB_0636:
	LEA	load_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.S	LAB_0672
LAB_0673:
	MOVEA.L	120(A4),A0
LAB_0674:
	TST.B	8(A0)
	BMI.S	LAB_0675
	BSR.W	LAB_0684
	LEA	64(A0),A0
	BRA.S	LAB_0674
LAB_0675:
	MOVEA.L	LAB_066C(PC),A1
	CLR.L	4(A1)
	BSR.W	LAB_067C
	MOVEA.L	200(A4),A5
LAB_0676:
	MOVE.L	4(A5),D0
	BEQ.S	LAB_0678
	MOVEA.L	D0,A0
	BTST	#1,26(A0)
	BEQ.S	LAB_0677
	MOVE.L	A5,-(A7)
	BSR.W	LAB_0684
	MOVEA.L	(A7)+,A5
	BCLR	#1,26(A0)
LAB_0677:
	LEA	8(A5),A5
	BRA.S	LAB_0676
LAB_0678:
	MOVEA.L	164(A4),A0
LAB_0679:
	TST.B	8(A0)
	BMI.S	LAB_067B
	BTST	#4,9(A0)
	BNE.S	LAB_067A
	BSR.W	LAB_06A7
LAB_067A:
	LEA	32(A0),A0
	BRA.S	LAB_0679
LAB_067B:
	BSR.W	LAB_06F2
	JSR	LAB_0780
	BSR.W	LAB_070E
	JSR	LAB_07AF
	BSR.W	LAB_0681
	MOVE.L	#$ffffffff,(A6)
	RTS
LAB_067C:
	MOVEA.L	200(A4),A3
	MOVE.W	LAB_066D(PC),D5
	SUBQ.W	#2,D5
	BMI.S	LAB_0680
	MOVE.W	D5,D4
LAB_067D:
	MOVE.W	D4,D5
	MOVEA.L	A3,A5
LAB_067E:
	MOVE.W	(A5),D7
	MOVE.W	8(A5),D6
	CMP.W	D7,D6
	BCC.S	LAB_067F
	MOVE.W	D7,8(A5)
	MOVE.W	D6,(A5)
	MOVE.L	4(A5),D0
	MOVE.L	12(A5),4(A5)
	MOVE.L	D0,12(A5)
LAB_067F:
	ADDQ.W	#8,A5
	DBF	D5,LAB_067E
	DBF	D4,LAB_067D
LAB_0680:
	RTS
LAB_0681:
	JSR	LAB_0237
	TST.W	90(A3)
	BEQ.S	LAB_0682
	TST.W	88(A3)
	BEQ.S	LAB_0683
	BMI.S	LAB_0683
	SUBQ.W	#1,88(A3)
	BNE.S	LAB_0682
	MOVEQ	#0,D0
	MOVE.W	90(A3),D0
	ANDI.W	#$0001,D0
	ADDQ.W	#5,D0
	JSR	LAB_0270
LAB_0682:
	RTS
LAB_0683:
	SUBQ.W	#1,88(A3)
	MOVEA.L	112(A4),A0
	MOVE.L	104(A4),D0
	LSL.L	#5,D0
	ADD.W	346(A4),D0
	SWAP	D0
	ADD.W	344(A4),D0
	SWAP	D0
	MOVE.L	D0,(A0)
	MOVE.B	124(A4),10(A0)
	MOVEQ	#0,D0
	MOVE.W	90(A3),D0
	MOVEA.L	224(A4),A3
	MOVEA.L	192(A4),A5
	MOVE.L	40(A5),D6
	ADDI.L	#$00000020,D6
	MOVEM.L	D0-D7/A0-A5,-(A7)
	JSR	LAB_06C9
	MOVEM.L	(A7)+,D0-D7/A0-A5
	SUBI.L	#$000c000c,D6
	JSR	LAB_06B0
	RTS
LAB_0684:
	TST.W	10(A0)
	BEQ.W	LAB_069B
	BTST	#6,29(A0)
	BEQ.S	LAB_0685
	MOVE.B	10(A0),D0
	ANDI.W	#$0001,D0
	CMP.W	124(A4),D0
	BNE.W	LAB_069B
LAB_0685:
	BTST	#6,24(A0)
	BEQ.S	LAB_0686
	BTST	#0,7(A0)
	BNE.W	LAB_069B
LAB_0686:
	BCLR	#1,26(A0)
	BNE.S	LAB_0688
	MOVE.W	106(A4),D1
	LSL.W	#5,D1
	ADD.W	346(A4),D1
	MOVE.W	2(A0),D0
	MOVE.W	D0,D7
	SUB.W	D1,D0
	BCS.S	LAB_0688
	MOVE.W	42(A4),D2
	LSL.W	#5,D2
	SUB.W	D0,D2
	BCS.W	LAB_0688
	MOVE.W	(A0),D0
	MOVE.W	104(A4),D1
	LSL.W	#5,D1
	ADD.W	344(A4),D1
	SUB.W	D1,D0
	BCS.S	LAB_0688
	MOVE.W	40(A4),D1
	BTST	#3,160(A4)
	BEQ.S	LAB_0687
	SUBQ.W	#2,D1
LAB_0687:
	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001,D0
	CMP.W	124(A4),D0
	BNE.S	LAB_069F
	MOVEA.L	224(A4),A3
	MOVEQ	#30,D0
	MOVE.L	#$00020002,D6
	BSR.W	LAB_06C3
	MOVEA.L	224(A4),A3
	MOVEQ	#31,D0
	MOVE.L	#$001e0002,D6
	BSR.W	LAB_06C3
	MOVEA.L	224(A4),A3
	MOVEQ	#32,D0
	MOVE.L	#$0002001e,D6
	BSR.W	LAB_06C3
	MOVEA.L	224(A4),A3
	MOVEQ	#33,D0
	MOVE.L	#$001e001e,D6
	BSR.W	LAB_06C3
	BSR.W	LAB_0718
	MOVEA.L	224(A4),A3
	MOVEQ	#38,D0
	BTST	#4,28(A0)
	BNE.S	LAB_069D
	BTST	#5,31(A0)
	BEQ.S	LAB_069E
LAB_069D:
	MOVEQ	#40,D0
LAB_069E:
	MOVE.L	#$00090000,D6
	BSR.W	LAB_06C3
	RTS
LAB_069F:
	MOVEA.L	224(A4),A3
	MOVEQ	#34,D0
	MOVE.L	#$00020002,D6
	BSR.W	LAB_06C3
	MOVEA.L	224(A4),A3
	MOVEQ	#35,D0
	MOVE.L	#$001e0002,D6
	BSR.W	LAB_06C3
	MOVEA.L	224(A4),A3
	MOVEQ	#36,D0
	MOVE.L	#$0002001e,D6
	BSR.W	LAB_06C3
	MOVEA.L	224(A4),A3
	MOVEQ	#37,D0
	MOVE.L	#$001e001e,D6
	BSR.W	LAB_06C3
	BSR.W	LAB_0718
	MOVEA.L	224(A4),A3
	MOVEQ	#38,D0
	BTST	#4,28(A0)
	BNE.S	LAB_06A0
	BTST	#5,31(A0)
	BEQ.S	LAB_06A1
LAB_06A0:
	MOVEQ	#40,D0
LAB_06A1:
	MOVE.L	#$00090000,D6
	BSR.W	LAB_06C3
	RTS
LAB_06A2:
	TST.B	8(A0)
	BEQ.W	LAB_06A4
	BTST	#7,9(A0)
	BNE.S	LAB_06A4
	MOVE.W	24(A0),D0
	MOVEA.L	0(A4,D0.W),A3
	BTST	#0,9(A0)
	BEQ.S	LAB_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.S	LAB_075D
	MOVE.L	(A0),D0
	LSR.L	#5,D0
	ANDI.L	#$00ff00ff,D0
	MOVEQ	#1,D7
	BRA.S	LAB_075E
LAB_075D:
	MOVE.B	12(A0),D0
	SWAP	D0
	MOVE.B	13(A0),D0
	MOVEQ	#0,D7
	MOVE.B	30(A0),D7
	LSR.B	#6,D7
LAB_075E:
	SUBQ.W	#1,D7
	BEQ.S	LAB_0760
	SUBQ.W	#1,D7
	BEQ.S	LAB_075F
	LEA	LAB_097E(PC),A2
	BRA.S	LAB_0761
LAB_075F:
	LEA	LAB_097D(PC),A2
	BRA.S	LAB_0761
LAB_0760:
	LEA	LAB_097C(PC),A2
LAB_0761:
	MOVE.L	D0,D7
	MOVE.W	8(A4),D5
	MOVE.W	10(A4),D6
LAB_0762:
	CMPI.B	#$aa,(A2)
	BEQ.W	LAB_0764
	MOVE.L	D7,D0
	ADD.W	2(A2),D0
	BMI.S	LAB_0763
	CMP.W	D6,D0
	BCC.S	LAB_0763
	SWAP	D0
	ADD.W	(A2),D0
	BMI.S	LAB_0763
	CMP.W	D5,D0
	BCC.S	LAB_0763
	SWAP	D0
	MOVE.L	D0,D2
	JSR	LAB_022A
	TST.B	10(A5)
	BEQ.S	LAB_0763
	MOVE.B	5(A2),D3
	AND.B	D3,10(A5)
LAB_0763:
	ADDQ.W	#8,A2
	BRA.W	LAB_0762
LAB_0764:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	MOVE.B	#$ff,108(A4)
LAB_0765:
	RTS
LAB_0766:
	DC.L	$6100c0b4,$6b0000b6,$74001428,$000c7600
	DC.L	$1628000d,$48a7f000,$7cff7eff,$b4406c04
	DC.L	$4446c142,$94403002,$3a02e248,$44403403
	DC.L	$94416a06,$c3434442,$44473802,$3205b242
	DC.L	$6c10c541,$3001e248,$4440d042,$6e0a7c00
	DC.L	$6006d042,$6e027e00,$84016602,$7c004c9f
	DC.L	$000f4a44,$67444a45,$6740ba44,$673cb243
	DC.L	$641cb042,$650cba44,$65047e03,$603c7e01
	DC.L	$6038ba44,$65047e0d,$60307e0f,$602cb042
	DC.L	$650cba44,$65047e05,$60207e07,$601cba44
	DC.L	$65047e0b,$60147e09,$60105246,$5247e54f
	DC.L	$dc4745fa,$000c1e32,$60004e75,$7eff4e75
	DC.L	$0e000200,$0cff0400,$0a080600
LAB_0767:
	CMP.W	D0,D2
	BGE.S	LAB_0768
	EXG	D0,D2
LAB_0768:
	SUB.W	D0,D2
	MOVE.W	D2,D0
	MOVE.W	D2,D5
	LSR.W	#1,D0
	NEG.W	D0
	MOVE.W	D3,D2
	SUB.W	D1,D2
	BPL.S	LAB_0769
	EXG	D1,D3
	NEG.W	D2
LAB_0769:
	MOVE.W	D5,D1
	CMP.W	D2,D1
	BGE.S	LAB_076A
	EXG	D2,D1
	MOVE.W	D1,D0
	LSR.W	#1,D0
	NEG.W	D0
	MOVE.W	D1,D5
	MOVEQ	#-1,D3
	RTS
LAB_076A:
	MOVEQ	#0,D3
	RTS
LAB_076B:
	LEA	rtg_more_stuff(PC),A4
	MOVEA.L	192(A4),A5
	MOVEQ	#0,D7
	MOVE.W	8(A4),D7
	MOVE.W	10(A4),D6
	MULU	D6,D7
	ADDI.L	#$00000080,D7
	MOVE.L	#$52414421,D1
	MOVE.L	D7,D0
	JSR	alloc_mem
	MOVE.L	A0,172(A4)
	MOVEA.L	A0,A1
	MOVEA.L	LAB_0898,A0
	MOVE.W	10(A4),D7
	MOVEQ	#64,D7
	SUBQ.W	#1,D7
	MOVE.W	8(A4),D6
	MOVEQ	#64,D6
	MOVEQ	#0,D4
	MOVE.W	D6,D4
	LSL.W	#5,D4
	LSL.L	#5,D4
	SUBQ.W	#1,D6
	MOVE.L	blit_width,D5
	MOVE.W	D6,D3
	MOVEA.L	LAB_089C,A3
LAB_076C:
	MOVEA.L	A0,A2
	MOVE.W	D3,D6
LAB_076D:
	MOVEQ	#0,D0
	MOVE.B	16(A0),D0
	MOVE.B	0(A3,D0.W),(A1)+
	LEA	32(A0),A0
	DBF	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0773:
	TST.B	D0
	BEQ.S	LAB_0777
	TST.B	8(A5)
	BMI.S	LAB_0777
	BTST	#6,14(A6)
	BNE.S	LAB_0777
	MOVE.W	D0,D1
	ANDI.W	#$0100,D0
	BNE.S	LAB_0774
	MOVE.B	D3,(A0)+
	TST.W	D1
	BMI.S	LAB_0778
	ADDQ.B	#2,-1(A0)
	BRA.S	LAB_0778
LAB_0774:
	MOVE.B	D5,(A0)+
	TST.W	D1
	BMI.S	LAB_0778
	ADDQ.B	#2,-1(A0)
	BRA.S	LAB_0778
LAB_0775:
	ADDQ.W	#1,A1
LAB_0776:
	MOVE.B	D2,(A0)+
	BRA.S	LAB_0778
LAB_0777:
	MOVE.B	(A1),(A0)+
LAB_0778:
	ADDQ.W	#1,A1
	LEA	16(A5),A5
	DBF	D6,LAB_0771
	ADDQ.W	#1,A0
	MOVEA.L	A3,A5
	ADDA.L	4(A4),A5
	ADDA.L	D4,A0
	MOVEA.L	A2,A1
	ADDA.W	8(A4),A1
	DBF	D7,LAB_0770
	ADDI.W	#$0040,D4
	MOVEA.L	(A7)+,A0
	BSR.W	LAB_077C
LAB_0779:
	RTS
LAB_077A:
	BCLR	#5,14(A3)
	BEQ.S	LAB_0779
	BSET	#2,163(A4)
	RTS
	DC.L	$48e7fffe,$70003039
	DC.L	LAB_077B
	DC.L	$36000240,$003fc0c4,$d0c05248
	DC.W	$2479
	DC.L	LAB_089C
	DC.L	$70007e0b,$7c3d2248,$101010f2,$000051ce
	DC.L	$fff82049,$d0c45243,$0c43003f,$640451cf
	DC.L	$ffe4204e,$0679000a
	DC.L	LAB_077B
	DC.L	$4cdf7fff
	DC.W	$4e75
LAB_077B:
	DS.L	1
LAB_077C:
	MOVEA.L	192(A4),A5
	MOVEQ	#0,D7
	MOVE.W	106(A4),D7
	SUB.W	230(A4),D7
	BMI.W	LAB_077F
	MOVE.W	38(A5),D3
	ADDQ.W	#1,D3
	CMP.W	D3,D7
	BCC.W	LAB_077F
	MULU	D4,D7
	ADDA.L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A.L	224(A4),A3
	MOVEQ	#48,D0
	BSR.W	LAB_06B0
	SUBQ.W	#1,LAB_079D
	BNE.W	LAB_079B
	CLR.W	LAB_079C
	MOVEQ	#0,D0
	BRA.W	LAB_0781
	DC.W	$4e75
LAB_0796:
	CLR.W	LAB_079C
	MOVEQ	#0,D0
	MOVE.W	LAB_07A0,D0
	MOVE.L	D0,LAB_07A5
	TST.B	162(A4)
	BMI.S	LAB_079A
	LEA	LAB_07A8,A2
LAB_0797:
	LEA	LAB_07A7,A0
	MOVEA.L	A2,A1
	LEA	16(A2),A2
	TST.L	(A1)
	BEQ.S	LAB_079A
LAB_0798:
	MOVE.B	(A1),D0
	BEQ.S	LAB_0799
	ADDI.B	#$22,D0
	CMP.B	(A0),D0
	BNE.S	LAB_0797
	ADDQ.W	#1,A0
	ADDQ.W	#1,A1
	BRA.S	LAB_0798
LAB_0799:
	MOVE.L	4(A1),D0
	BEQ.S	LAB_079A
	MOVEA.L	D0,A2
	JSR	(A2)
	MOVEQ	#51,D0
	JSR	LAB_026C
	CLR.L	LAB_07A5
	LEA	LAB_07A7,A0
	MOVE.L	#$20202020,(A0)
	MOVE.L	#$20202020,4(A0)
LAB_079A:
	MOVEQ	#0,D0
	BRA.W	LAB_0781
LAB_079B:
	RTS
LAB_079C:
	DS.W	1
LAB_079D:
	DS.B	1
LAB_079E:
	DS.B	1
LAB_079F:
	DS.W	1
LAB_07A0:
	DS.W	1
LAB_07A1:
	DS.L	1
LAB_07A2:
	DS.L	1
LAB_07A3:
	DS.L	1
LAB_07A4:
	DS.L	1
LAB_07A5:
	DS.W	1
LAB_07A6:
	DS.W	1
LAB_07A7:
	DS.L	9
LAB_07A8:
	DC.L	$ffffffff,$ffffffff
	DS.L	2
	DC.L	$0f252d22,$2c233131
	DS.L	1
	DC.L	LAB_07A9
	DC.L	$10222321,$1f222331
	DS.L	1
	DC.L	LAB_07AA
	DC.L	$111f202a,$1f382335
	DS.L	1
	DC.L	LAB_07AB
	DC.L	$122a2d2d,$31272c25
	DS.L	1
	DC.L	LAB_07AC
	DC.L	$13322721,$29272c25
	DS.L	1
	DC.L	LAB_07AD
	DC.L	$14351f30,$242d2537
	DS.L	1
	DC.L	LAB_07AE
	DS.L	6
LAB_07A9:
	DC.L	$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_0237
	DC.L	$203c0000,$10000680,$00000388,$d0804eb9
	DC.L	LAB_02FE
	DC.L	$4cdf7fff
	DC.W	$4e75
LAB_07AA:
	DC.L	$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_0237
	DC.L	$177c0010,$0050177c,$00030051,$177c0003
	DC.L	$0052177c,$00030053,$177c0003,$0054177c
	DC.L	$00030055,$177c0003,$0056177c,$00030057
	DC.W	$4eb9
	DC.L	LAB_0429
	DC.L	$4cdf7fff
	DC.W	$4e75
LAB_07AB:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.W	126(A4),D7
	MOVE.W	124(A4),126(A4)
	JSR	LAB_0835
	MOVE.W	D7,126(A4)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_07AC:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.W	126(A4),D7
	MOVE.W	124(A4),126(A4)
	JSR	LAB_0833
	MOVE.W	D7,126(A4)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_07AD:
	DC.L	$06ac0000,$04b0011c
	DC.W	$4e75
LAB_07AE:
	DC.L	$48e7fffe
	DC.W	$4eb9
	DC.L	LAB_074D
	DC.L	$4cdf7fff,$4e753001,$e0490241,$0001b26c
	DC.L	$007c6600,$00224a40,$6b0a4eb9
	DC.L	LAB_022C
	DC.L	$72126008
	DC.W	$4eb9
	DC.L	LAB_022D
	DC.L	$72027000,$102a0008,$d0414e75,$70024e75
LAB_07AF:
	TST.W	236(A4)
	BEQ.W	LAB_07BC
	TST.W	238(A4)
	BEQ.W	LAB_07B8
	SUBQ.W	#1,238(A4)
	BNE.W	LAB_07BC
	MOVE.W	#$003c,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VEQ	#4,D7
LAB_07B7:
	MOVE.L	(A1),(A2)
	MOVE.B	4(A1),4(A2)
	LEA	257(A1),A1
	LEA	128(A2),A2
	DBF	D7,LAB_07B7
	LEA	6(A5),A2
	DBF	D6,LAB_07B5
LAB_07B8:
	CMPI.W	#$0002,128(A4)
	BCC.S	LAB_07BD
	TST.W	LAB_07BE
	BEQ.S	LAB_07BC
	SUBQ.W	#1,LAB_07BE
	JSR	LAB_0237
	MOVE.L	32(A3),D1
	SWAP	D1
	MOVEA.L	112(A4),A0
	MOVE.L	104(A4),D0
	LSL.L	#5,D0
	ADD.W	346(A4),D0
	SWAP	D0
	ADD.W	344(A4),D0
	SWAP	D0
	ADD.L	D0,D1
	BTST	#6,236(A4)
	BEQ.S	LAB_07BA
	BTST	#5,236(A4)
	BNE.S	LAB_07B9
	TST.B	236(A4)
	BPL.S	LAB_07BA
LAB_07B9:
	SUBI.L	#$00a00008,D1
	BRA.S	LAB_07BB
LAB_07BA:
	ADDI.L	#$ffc00010,D1
LAB_07BB:
	MOVE.L	D1,(A0)
	MOVEA.L	224(A4),A3
	MOVEQ	#16,D0
	MOVEQ	#0,D6
	JSR	LAB_06B0
LAB_07BC:
	RTS
LAB_07BD:
	CLR.L	236(A4)
	RTS
LAB_07BE:
	DS.L	2
LAB_07BF:
	LEA	rtg_more_stuff(PC),A4
	MOVE.L	#$44454621,D1
	MOVE.L	#$00008000,D0
	JSR	alloc_mem
	MOVE.L	A0,112(A4)
	MOVEA.L	A0,A2
	LEA	64(A0),A0
	MOVE.L	A0,116(A4)
	LEA	16384(A0),A0
	MOVE.L	A0,120(A4)
	MOVE.L	#$41445221,D1
	MOVE.L	#$00000800,D0		;MEMF_LOCAL
	JSR	alloc_mem
	MOVE.L	A0,72(A4)
	LEA	512(A0),A0
	MOVE.L	A0,76(A4)
	LEA	512(A0),A0
	MOVE.L	A0,80(A4)
	LEA	512(A0),A0
	MOVE.L	A0,84(A4)
	BSR.W	LAB_07C0
	BSR.W	LAB_07C4
	BSR.W	LAB_07C6
	BSR.W	LAB_07C8
	BSR.W	LAB_07CE
	RTS
	DC.W	$4ef9
	DC.L	exit_fail
LAB_07C0:
	MOVEA.L	#sxweapons_name,A0
	MOVE.L	#$554e5421,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_07C3
	MOVEA.L	84(A4),A5
	CLR.L	(A5)+
	MOVEQ	#71,D6
LAB_07C1:
	CMPI.L	#$554e4954,(A0)
	BNE.S	LAB_07C2
	MOVE.L	A0,(A5)
LAB_07C2:
	ADDQ.W	#4,A5
	LEA	128(A0),A0
	DBF	D6,LAB_07C1
	RTS
LAB_07C3:
	JMP	exit_fail
LAB_07C4:
	MOVEA.L	#pointers_name,A0
	MOVE.L	#$43485821,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.S	LAB_07C5
	MOVEA.L	72(A4),A5
	BRA.S	LAB_07CA
LAB_07C5:
	JMP	exit_fail
LAB_07C6:
	MOVEA.L	#sxweapons_name,A0
	MOVE.L	#$57455821,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.S	LAB_07C7
	MOVEA.L	76(A4),A5
	BRA.S	LAB_07CA
LAB_07C7:
	JMP	exit_fail
LAB_07C8:
	MOVEA.L	#sxotherss_name,A0
	MOVE.L	#$4f545821,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.S	LAB_07C9
	MOVEA.L	80(A4),A5
	BRA.S	LAB_07CA
LAB_07C9:
	JMP	exit_fail
LAB_07CA:
	LEA	rtg_more_stuff(PC),A4
	CLR.L	(A5)+
LAB_07CB:
	CMPI.L	#$46494e45,(A0)
	BEQ.S	LAB_07CD
	CMPI.L	#$4f424a21,(A0)
	BNE.S	LAB_07CC
	MOVE.L	A0,(A5)+
LAB_07CC:
	ADDQ.W	#4,A0
	BRA.S	LAB_07CB
LAB_07CD:
	RTS
LAB_07CE:
	MOVEA.L	84(A4),A5
	ADDQ.W	#4,A5
	MOVEQ	#71,D6
LAB_07CF:
	MOVE.L	(A5)+,D0
	BEQ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	BRA.S	LAB_07D6
LAB_07D5:
	DBF	D3,LAB_07D3
	DBF	D4,LAB_07D2
LAB_07D6:
	LEA	8(A2),A2
	ADDQ.W	#2,D2
	ANDI.W	#$001f,D2
	DBF	D7,LAB_07D1
LAB_07D7:
	DBF	D6,LAB_07CF
	RTS

LAB_07D8:
	MOVEQ	#-1,D0
	BSR.W	load_rgb_and_pointer

rtg_display_stuff:
	LEA	rtg_more_stuff(PC),A4
	MOVEA.L	100(A4),A1
	MOVEA.L	32(A4),A0
	BSR.W	rtg_copyblit
	MOVEA.L	RTGMasterBase,A6
	BTST	#1,160(A4)
	BEQ.S	LAB_07DA
	MOVEA.L	rtg_screen,A0
	JSR	_LVORtgWaitTOF(A6)
LAB_07DA:
	MOVEQ	#0,D0
	MOVE.W	LAB_02E7,D0
	ADDQ.W	#1,D0
	MOVE.W	D0,LAB_02E7
	ANDI.W	#$0001,D0
	BNE.S	LAB_07DB
	MOVE.L	68(A4),100(A4)
	BRA.S	LAB_07DC
LAB_07DB:
	MOVE.L	64(A4),100(A4)
LAB_07DC:
	MOVEA.L	rtg_screen,A0
	JSR	_LVOSwitchScreens(A6)
	RTS


LAB_07DD:
	LEA	rtg_more_stuff(PC),A4
	MOVEA.L	100(A4),A1
	MOVEA.L	32(A4),A0
	BSR.W	LAB_0608
	MOVEA.L	RTGMasterBase,A6
	MOVEQ	#0,D0
	MOVE.W	LAB_02E7,D0
	ADDQ.W	#1,D0
	MOVE.W	D0,LAB_02E7
	ANDI.W	#$0001,D0
	BNE.S	LAB_07DE
	MOVE.L	68(A4),100(A4)
	BRA.S	LAB_07DF
LAB_07DE:
	MOVE.L	64(A4),100(A4)
LAB_07DF:
	MOVEA.L	rtg_screen,A0
	JSR	_LVOSwitchScreens(A6)
	RTS
LAB_07E0:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	rtg_more_stuff(PC),A4
	MOVEA.L	100(A4),A1
	MOVEA.L	32(A4),A0
	BSR.W	LAB_0608
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	MOVEQ	#0,D0
	JSR	_LVOSwitchScreens(A6)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS


load_rgb_and_pointer:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	rtg_more_stuff(PC),A4
	JSR	LAB_0237
	TST.W	90(A3)
	BEQ.S	LAB_07E2
	MOVEQ	#0,D0
LAB_07E2:
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	TST.L	D0
	BMI.W	LAB_07E3
	CMP.W	128(A4),D0
	BEQ.W	LAB_07E5
	MOVE.W	D0,128(A4)
	LSL.W	#4,D0
	LEA	rgb_byte_table,A3
	ADDA.W	D0,A3
	LEA	rgb_table,A1
	MOVE.B	1(A3),4(A1)
	MOVE.B	2(A3),8(A1)
	MOVE.B	3(A3),12(A1)
	MOVE.B	5(A3),16(A1)
	MOVE.B	6(A3),20(A1)
	MOVE.B	7(A3),24(A1)
	MOVE.B	9(A3),28(A1)
	MOVE.B	10(A3),32(A1)
	MOVE.B	11(A3),36(A1)
	JSR	_LVOLoadRGBRtg(A6)
	CLR.W	LAB_07EE
	MOVEA.L	rtg_screen,A0
	BRA.W	LAB_07E4
LAB_07E3:
	BTST	#0,160(A4)
	BEQ.W	LAB_07E5
	MOVE.B	159(A4),D0
	ANDI.B	#$07,D0
	BNE.S	LAB_07E5
LAB_07E4:
	MOVE.W	128(A4),D0
	LSL.W	#2,D0
	MOVE.W	LAB_07EE,D1
	ANDI.W	#$0003,D1
	ADD.W	D1,D0
	MOVEA.L	220(A4),A1
	MULU	#$0048,D0
	ADDA.L	D0,A1
	MOVEQ	#16,D0
	MOVEQ	#16,D1
	MOVEQ	#-7,D2
	MOVEQ	#-7,D3
	JSR	_LVORtgSetPointer(A6)
	MOVE.B	159(A4),D0
	ANDI.B	#$01,D0
	BNE.S	LAB_07E5
	ADDQ.W	#1,LAB_07EE
LAB_07E5:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS


LAB_07E6:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	rtg_more_stuff(PC),A4
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	TST.L	D0
	BMI.W	LAB_07E7
	MOVE.L	D0,D7
	LSL.W	#4,D0
	LEA	rgb_byte_table,A3
	ADDA.W	D0,A3
	LEA	rgb_table,A1
	MOVE.B	1(A3),4(A1)
	MOVE.B	2(A3),8(A1)
	MOVE.B	3(A3),12(A1)
	MOVE.B	5(A3),16(A1)
	MOVE.B	6(A3),20(A1)
	MOVE.B	7(A3),24(A1)
	MOVE.B	9(A3),28(A1)
	MOVE.B	10(A3),32(A1)
	MOVE.B	11(A3),36(A1)
	CLR.W	LAB_07EE
	MOVEA.L	rtg_screen,A0
	MOVE.W	D7,D0
	LSL.W	#2,D0
	MOVEA.L	220(A4),A1
	MULU	#$0048,D0
	ADDA.L	D0,A1
	MOVEQ	#16,D0
	MOVEQ	#16,D1
	MOVEQ	#-7,D2
	MOVEQ	#-7,D3
	JSR	_LVORtgSetPointer(A6)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_07E7:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	rtg_more_stuff(PC),A4
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	JSR	_LVORtgClearPointer(A6)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_07E8:
	LEA	rtg_more_stuff(PC),A4
	BCLR	#2,160(A4)
	TST.L	LAB_07FB
	BEQ.S	LAB_07E9
	CMPI.L	#$00000002,LAB_07FB
	BNE.S	LAB_07EB
LAB_07E9:
	MOVE.L	blit_width(PC),D0
	MOVE.L	blit_height(PC),D1
	CMPI.W	#$00c8,D1
	BCS.S	LAB_07EB
	CMPI.W	#$0201,D1
	BCC.S	LAB_07EB
	CMPI.W	#$0140,D0
	BEQ.S	LAB_07EA
	CMPI.W	#$0180,D0
	BEQ.S	LAB_07EA
	CMPI.W	#$01e0,D0
	BEQ.S	LAB_07EA
	CMPI.W	#$0280,D0
	BNE.S	LAB_07EB
	BSET	#2,160(A4)
LAB_07EA:
	MOVE.L	LAB_07FA(PC),D2
	CMPI.L	#$00000008,D2
	BNE.S	LAB_07EB
	RTS
LAB_07EB:
	MOVEQ	#-6,D0
	JMP	exit_fail
LAB_07EC:
	TST.B	EXT_0003
	BEQ.S	LAB_07EC
LAB_07ED:
	TST.B	EXT_0003
	BNE.S	LAB_07ED
	RTS
	DC.L	$33f900df,$f00600df,$f1800839,$000a00df
	DC.L	$f01666ec
	DC.W	$4e75
LAB_07EE:
	DS.L	1

rtg_screen_tags:
	DC.L	smr_Buffers,		2
	DC.L	smr_ProgramUsesC2P,	0
	DC.L	smr_MinWidth,		320
	DC.L	smr_MaxWidth,		640
	DC.L	smr_MinHeight
LAB_07F0:
	DC.L	200
	DC.L	smr_MaxHeight,		512
	DC.L	smr_InitialWidth,	320
	DC.L	smr_InitialHeight,	256
	DC.L	smr_InitialDepth,	8
	DC.L	smr_ChunkySupport,	$00000200	;ColorMap
	DC.L	smr_PlanarSupport,	$00000080	;8 bitplanes non-interleaved
	DC.L	smr_TitleText,		rtg_reqtitle
	DC.L	smr_PrefsFileName,	rtg_prefsfile
;	DC.L	smr_ForceOpen,		-1
	DC.L	smr_MinPixelAspect,	$0000f000
	DC.L	smr_MaxPixelAspect,	$00014000
	DC.L	0,					0			;TAG_END

rtg_screen_tags2:
	DC.L	smr_Buffers,		2
	DC.L	smr_ProgramUsesC2P,	0
	DC.L	smr_MinWidth,		640
	DC.L	smr_MaxWidth,		640
	DC.L	smr_MinHeight
LAB_07F2:
	DC.L	400
	DC.L	smr_MaxHeight,		512
	DC.L	smr_InitialWidth,	640
	DC.L	smr_InitialHeight,	512
	DC.L	smr_InitialDepth,	8
	DC.L	smr_ChunkySupport,	$00000200	;ColorMap
	DC.L	smr_PlanarSupport,	$00000080	;8 bitplanes non-interleaved
	DC.L	smr_TitleText,		rtg_reqtitle

	DC.L	smr_PrefsFileName,	rtg_prefsfile2
;	DC.L	smr_ForceOpen,		-1
	DC.L	smr_MinPixelAspect,	$0000f000
	DC.L	smr_MaxPixelAspect,	$00014000
	DC.L	0,					0			;TAG_END


openscreen_tags:
	DC.L	rtg_Buffers,		2
	DC.L	rtg_Draggable,		0
	DC.L	rtg_Interleaved,	0
	DC.L	rtg_PlanarSupport,	$00000080	;8-bit non-interleaved
	DC.L	rtg_ChunkySupport,	$00000200	;ColorMap
	DC.L	0,					0


screendata_tags:
	DC.L	grd_PlaneSize
LAB_07F5:
	DC.L	0
	DC.L	grd_Width
blit_width:
	DC.W	0
blit_width_low:
	DC.W	$0000
	DC.L	grd_Height
blit_height:
	DC.W	0
blit_height_low:
	DC.W	$0000
	DC.L	grd_Depth
LAB_07FA:
	DC.L	0
	DC.L	grd_PixelLayout
LAB_07FB:
	DC.L	0
	DC.L	0,		0

rtg_reqtitle:
	DC.B	" Napalm screen setup...",0
rtg_prefsfile:
	DC.B	"NAPALM_Y:DEFRTG1",0
rtg_prefsfile2:
	DC.B	"NAPALM_Y:DEFRTG2",0
	DC.B	"TG"

LAB_07FF:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	LEA	LAB_0805,A5
	MOVE.L	blit_height,D0
	MOVE.W	D0,4(A5)
	SUBI.W	#$0020,D0
	MOVE.W	D0,34(A5)
	MOVE.L	blit_width,D0
	MOVE.L	D0,D6
	DIVU	#$0028,D6
	SUBQ.W	#1,D6
	BCC.S	LAB_0800
	MOVEQ	#0,D6
LAB_0800:
	MOVE.W	D6,26(A5)
	MOVE.W	D6,28(A5)
	MOVE.L	D0,D7
	MOVE.W	(A5),D1
	SUB.W	D1,D7
	MOVE.W	D7,2(A5)
	MOVE.W	44(A5),D1
	SUB.W	D1,D0
	BPL.S	LAB_0801
	MOVE.W	blit_width_low,44(A5)
LAB_0801:
	LSR.W	#1,D0
	SUBQ.W	#8,D0
	TST.W	D0
	BPL.S	LAB_0802
	CLR.W	D0
LAB_0802:
	MOVE.W	D0,40(A5)
	MOVE.L	blit_height,D0
	MOVE.W	46(A5),D1
	SUB.W	D1,D0
	BPL.S	LAB_0803
	MOVE.W	blit_height_low,46(A5)
LAB_0803:
	LSR.W	#1,D0
	ADDQ.W	#4,D0
	TST.W	D0
	BPL.S	LAB_0804
	CLR.W	D0
LAB_0804:
	MOVE.W	D0,42(A5)
	MOVE.W	40(A4),D0
	MOVE.W	8(A4),D1
	SUB.W	D0,D1
	MOVE.W	D1,36(A5)
	MOVE.W	42(A4),D0
	MOVE.W	10(A4),D1
	SUB.W	D0,D1
	MOVE.W	D1,38(A5)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_0805:
	DC.L	$00400100,$0100ffff,$0000000e,$00500060
	DC.L	$00300020,$00090020,$00010007,$00070000
	DC.L	$000a00e8
	DS.L	1
	DC.L	$00200020,$00ce00cc
	DS.L	4
LAB_0806:
	MOVEA.L	192(A4),A3
	MOVEQ	#2,D0
	MOVEQ	#0,D1
	MOVE.W	8(A3),D1
	BSR.W	LAB_0811
	MOVEQ	#3,D0
	ADD.W	124(A4),D0
	MOVE.W	10(A3),D1
	BSR.W	LAB_0811
	MOVEQ	#5,D0
	MOVE.W	12(A3),D1
	BSR.W	LAB_0811
	MOVEQ	#7,D0
	MOVE.W	12(A3),D1
	ADDQ.W	#2,D1
	SWAP	D1
	MOVE.W	20(A3),D1
	SWAP	D1
	BSR.W	LAB_0811
	MOVEQ	#9,D0
	MOVE.W	12(A3),D1
	ADDQ.W	#2,D1
	SWAP	D1
	MOVE.W	22(A3),D1
	SWAP	D1
	BSR.W	LAB_0811
	MOVE.L	blit_height(PC),D7
	SUB.W	14(A3),D7
	MOVE.W	18(A3),D6
	DIVU	D6,D7
	MOVE.W	D7,24(A3)
	SUBQ.W	#1,D7
	MOVEQ	#0,D1
	MOVE.W	14(A3),D1
LAB_0807:
	MOVEQ	#6,D0
	BSR.W	LAB_0811
	ADD.W	18(A3),D1
	DBF	D7,LAB_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OVE.W	D2,(A2)
	ADDQ.W	#3,A3
	ADDQ.W	#3,A2
	DBF	D0,LAB_0826
LAB_0827:
	RTS
	DC.L	$48e7fffe,$06850000,$00200280,$000000ff
	DC.L	$2200e809,$0200000f,$74001401,$224b2805
	DC.L	$c8fc000e,$d2c4d2fc,$000e6100,$00207400
	DC.L	$1400224b,$224b2805,$c8fc000e,$d2c4d2fc
	DC.L	$00126100,$00084cdf,$7fff4e75
	DC.W	$41f9
	DC.L	LAB_0828
	DC.L	$c4fc000f,$d1c27e04,$244912d8,$12d812d8
	DC.L	$224ad3c5,$51cffff2
	DC.W	$4e75
LAB_0828:
	DC.B	"ssss",0
	DC.B	"ss",0
	DC.B	"ss",0
	DC.B	"ssss",0
	DC.B	"s",0
	DC.B	"ss",0,0
	DC.B	"s",0,0
	DC.B	"s",0
	DC.B	"ssssss",0,0
	DC.B	"sssss",0,0
	DC.B	"ssssss",0,0
	DC.B	"ssss",0,0
	DC.B	"sssss",0,0
	DC.B	"s",0
	DC.B	"ssss",0,0
	DC.B	"s",0,0
	DC.B	"sssss",0,0
	DC.B	"sss",0,0
	DC.B	"ssssssss",0,0
	DC.B	"ssss",0
	DC.B	"sssssss",0,0
	DC.B	"s",0,0
	DC.B	"s",0,0
	DC.B	"s",0,0
	DC.B	"sssss",0
	DC.B	"sssss",0
	DC.B	"ssssssss",0
	DC.B	"ssss",0,0
	DC.B	"ssss",0
	DC.B	"s",0
	DC.B	"s",0
	DC.B	"sssss",0
	DC.B	"ss",0
	DC.B	"sss",0
	DC.B	"s",0
	DC.B	"sss",0
	DC.B	"s",0
	DC.B	"sss",0,0
	DC.B	"sss",0,0
	DC.B	"s",0,0
	DC.B	"s",0,0,0
	DC.B	"ssss",0
	DC.B	"s",0
	DC.B	"ss",0
	DC.B	"ss",0
	DC.B	"sss",0
	DC.B	"ssss",0,0
	DC.B	"ssss",0,0
	DC.B	"sssssss",0,0
	DC.B	"ssss",0,0
	DC.B	"s",0,0
LAB_0829:
	MOVEA.L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	(A1)+,D4
	CMP.L	D0,D4
	BCC.S	LAB_0832
	MOVE.L	D4,D0
	MOVE.L	D5,D6
LAB_0832:
	ADDQ.W	#1,D5
	DBF	D7,LAB_0831
	MOVE.L	D6,D0
	MOVEM.L	(A7)+,D1-D7/A0-A6
	RTS
LAB_0833:
	MOVE.L	A3,-(A7)
	JSR	LAB_0231
	TST.W	90(A3)
	BNE.S	LAB_0834
	MOVEQ	#0,D0
	JSR	load_rgb_and_pointer
	MOVEQ	#-1,D0
	JSR	load_rgb_and_pointer
	MOVEQ	#51,D0
	MOVE.W	D0,90(A3)
	MOVE.W	#$0064,88(A3)
	ADDQ.W	#1,126(A4)
	ANDI.W	#$0001,126(A4)
	JSR	LAB_0231
	MOVEQ	#50,D0
	MOVE.W	D0,90(A3)
	MOVE.W	#$0064,88(A3)
	ADDQ.W	#1,126(A4)
	ANDI.W	#$0001,126(A4)
LAB_0834:
	MOVEA.L	(A7)+,A3
	RTS
LAB_0835:
	MOVE.L	A3,-(A7)
	JSR	LAB_0231
	TST.W	90(A3)
	BNE.S	LAB_0836
	MOVEQ	#0,D0
	JSR	load_rgb_and_pointer
	MOVEQ	#-1,D0
	JSR	load_rgb_and_pointer
	MOVEQ	#50,D0
	MOVE.W	D0,90(A3)
	MOVE.W	#$0064,88(A3)
	ADDQ.W	#1,126(A4)
	ANDI.W	#$0001,126(A4)
	JSR	LAB_0231
	MOVEQ	#51,D0
	MOVE.W	D0,90(A3)
	MOVE.W	#$0064,88(A3)
	ADDQ.W	#1,126(A4)
	ANDI.W	#$0001,126(A4)
LAB_0836:
	MOVEA.L	(A7)+,A3
	RTS
LAB_0837:
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	JSR	_LVORtgScreenAtFront(A6)
	TST.L	D0
	BEQ.W	LAB_083A

_LVODoIO		EQU -456

	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	LAB_02CB,A1
	MOVE.W	#$000a,28(A1)
	LEA	LAB_0849,A0
	M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_0848(PC),A2
	LEA	LAB_0849,A3
	MOVEQ	#0,D7
	MOVEQ	#15,D2
LAB_0843:
	MOVE.W	(A2),D1
	BEQ.S	LAB_0845
	MOVE.W	D1,D0
	BTST	#6,D0
	BNE.S	LAB_0846
	ANDI.W	#$0007,D0
	LSR.W	#3,D1
	BTST	D0,0(A3,D1.W)
	BEQ.S	LAB_0845
LAB_0844:
	BSET	#0,D7
LAB_0845:
	ROL.W	#1,D7
	SUBQ.W	#2,A2
	DBF	D2,LAB_0843
	ROR.W	#1,D7
	RTS
LAB_0846:
	MOVE.W	D1,D3
	ANDI.W	#$0007,D0
	LSR.W	#3,D1
	CMPI.B	#$62,D3
	BEQ.S	LAB_0847
	BTST	D0,0(A3,D1.W)
	BNE.S	LAB_0844
LAB_0847:
	ADDQ.W	#1,D0
	BTST	D0,0(A3,D1.W)
	BNE.S	LAB_0844
	BRA.S	LAB_0845
	DC.L	$000f001d,$001e001f,$002d002e,$002f003d
	DC.L	$003e003f
	DS.L	2
	DS.W	1
LAB_0848:
	DC.W	$0060
LAB_0849:
	DS.L	10
LAB_084A:
	DS.B	1
LAB_084B:
	DS.B	1
LAB_084C:
	DS.L	8
	DS.W	1

_LVODisplayAlert	EQU -90

intui_display_alert:
	MOVE.L	IntuiBase(PC),D1
	BEQ.S	LAB_0850
	MOVEA.L	D1,A6
	LEA	LAB_0851(PC),A0
	TST.W	D0
	BEQ.S	LAB_0850
	NEG.W	D0
LAB_084E:
	TST.W	(A0)
	BEQ.S	LAB_084F
	ADDQ.W	#1,A0
	BRA.S	LAB_084E
LAB_084F:
	ADDQ.W	#2,A0
	SUBQ.W	#1,D0
	BNE.S	LAB_084E
	MOVEQ	#20,D1
	MOVEQ	#0,D0
	JSR	_LVODisplayAlert(A6)
LAB_0850:
	RTS


LAB_0851:
	DC.L	$00000010,$0c455252,$4f522023,$30303031
	DC.L	$3a202046,$696c6520,$6e6f7420,$666f756e
	DC.L	$642e2e2e,$00000010,$0c455252,$4f522023
	DC.L	$30303032,$3a20204e,$6f742065,$6e6f7567
	DC.L	$68206d65,$6d6f7279,$2e2e2e00,$0000100c
	DC.L	$4552524f,$52202330,$3030333a,$20205274
	DC.L	$674d6173,$74657220,$6c696273,$20617265
	DC.L	$6e277420,$696e7374,$616c6c65,$64207072
	DC.L	$6f706572,$6c792c20,$706c6561,$73652072
	DC.L	$652d696e,$7374616c,$6c2e2e2e,$00000010
	DC.L	$0c455252,$4f522023,$30303034,$3a202043
	DC.L	$6f756c64,$206e6f74,$206f7065,$6e205254
	DC.L	$47207363,$7265656e,$2e2e2e00,$0000100c
	DC.L	$4552524f,$52202330,$3030353a,$20204d65
	DC.L	$6d6f7279,$20616c6c,$6f636174,$696f6e20
	DC.L	$6661696c,$65642e2e,$2e000000,$100c4552
	DC.L	$524f5220,$23303030,$363a2020,$4e6f7420
	DC.L	$73757070,$6f727465,$64207265,$736f6c75
	DC.L	$74696f6e,$2e2e2e00,$0000100c,$4552524f
	DC.L	$52202330,$3030373a,$20205265,$61642f57
	DC.L	$72697465,$20646973,$6b206572,$726f722e
	DC.L	$2e2e0000,$00100c45,$52524f52,$20233030
	DC.L	$30383a20,$20496e76,$616c6964,$20657874
	DC.L	$65726e61,$6c206d6f,$64756c65,$2e2e2e00
	DC.L	$0000100c,$4552524f,$52202330,$3030393a
	DC.L	$20205363,$72697074,$206b6579,$776f7264
	DC.L	$206d6973,$73696e67,$2e2e2e00,$0000100c
	DC.L	$4552524f,$52202330,$3031303a,$2020556e
	DC.L	$61626c65,$20746f20,$6f70656e,$206c6962
	DC.L	$72617279,$21200000,$00100c45,$52524f52
	DC.L	$20233030,$31313a20,$2046696c,$65207374
	DC.L	$72756374,$75726520,$636f7272,$75707465
	DC.L	$642c2070,$6c656173,$65207265,$696e7374
	DC.L	$616c6c20,$67616d65,$2066726f,$6d204e61
	DC.L	$70616c6d,$20434400,$0000100c,$4552524f
	DC.L	$52202330,$3031323a,$2020436f,$756c6420
	DC.L	$6e6f7420,$616c6c6f,$63617465,$20617564
	DC.L	$696f2063,$68616e6e,$656c7320,$21000000
	DC.L	$100c4552,$524f5220,$23303031,$333a2020
	DC.L	$7070632e,$6c696272,$61727920,$69732061
	DC.L	$63746976,$652c2075,$6e61626c,$6520746f
	DC.L	$206c6175,$6e636820,$57617270,$4f532065
	DC.L	$6e766972,$6f6d656e,$742e2e2e
	DS.L	1
	DS.W	1

rtg_more_stuff:
	DS.L	27
	DC.L	$00000001
	DS.L	63

napalm_l_name:
	DC.B	"NAPALM_L",0
napalm_g_name:
	DC.B	"NAPALM_G:"
LAB_0855:
	DC.B	"xxxxxx",0
humans_mission_name:
	DC.B	"NAPALM_M:HUMANS/MISSION01.DAT",0
robots_mission_name:
	DC.B	"NAPALM_M:ROBOTS/MISSION01.DAT",0
prefs_name:
	DC.B	"NAPALM_Y:NAPALM.PREFS",0
warzone_name:
	DC.B	"NAPALM_G:WARZONE01.DAT",0
chunkyg_name:
	DC.B	"NAPALM_L:CHUNKYG01.DAT",0
	DC.B	"NAPALM_L:OBJECTS01.DAT",0
palette_name:
	DC.B	"NAPALM_L:PALLETE.DAT",0
pxboard_name:
	DC.B	"NAPALM_L:PXBOARD.DAT",0
sxcrash_name:
	DC.B	"NAPALM_L:SXCRASH.DAT",0
sxfires_name:
	DC.B	"NAPALM_L:SXFIRES.DAT",0
sxother_name:
	DC.B	"NAPALM_L:SXOTHER.DAT",0
pxicons_name:
	DC.B	"NAPALM_L:PXICONS.DAT",0
vxshade_name:
	DC.B	"NAPALM_L:VXSHADE.DAT",0
vxcamuf_name:
	DC.B	"NAPALM_L:VXCAMUF.DAT",0
vxtable_name:
	DC.B	"NAPALM_L:VXTABLE.DAT",0
sxfogge_name:
	DC.B	"NAPALM_L:SXFOGGE.DAT",0
sxfoton_name:
	DC.B	"NAPALM_L:SXFOTON.DAT",0
buildings_name:
	DC.B	"NAPALM_O:BUILDINGS.DAT",0
buildanim_name:
	DC.B	"NAPALM_O:BUILDANIM.DAT",0
buildshad_name:
	DC.B	"NAPALM_O:BUILDSHAD.DAT",0
blackfog_name:
	DC.B	"NAPALM_O:0BLACKFOG.DAT",0
pointers_name:
	DC.B	"NAPALM_O:0POINTERS.DAT",0
sxchassis_name:
	DC.B	"NAPALM_O:SXCHASSIS.DAT",0
sxotherss_name:
	DC.B	"NAPALM_O:SXOTHERSS.DAT",0
sxweapons_name:
	DC.B	"NAPALM_O:SXWEAPONS.DAT",0
units_name:
	DC.B	"NAPALM_U:UNITS.SET",0
build_name:
	DC.B	"NAPALM_U:BUILD.SET",0
title_name:
	DC.B	"NAPALM_I:TITLE01.DAT",0
humans01_name:
	DC.B	"NAPALM_I:HUMANS01.DAT",0
robots01_name:
	DC.B	"NAPALM_I:ROBOTS01.DAT",0
hmission_name:
	DC.B	"NAPALM_I:HMISSION01.DAT",0
rmission_name:
	DC.B	"NAPALM_I:RMISSION01.DAT",0
hstats_name:
	DC.B	"NAPALM_I:HSTATS01.DAT",0
rstats_name:
	DC.B	"NAPALM_I:RSTATS01.DAT",0
title06_name:
	DC.B	"NAPALM_I:TITLE06.DAT",0
	DC.B	"NAPALM_I:TITLE08.DAT",0
title09_name:
	DC.B	"NAPALM_I:TITLE09.DAT",0
LAB_0879:
	DC.B	"NAPALM_S:CLASS-X.SFX",0
LAB_087A:
	DC.B	"NAPALM_S:CLASS-Y.SFX",0
LAB_087B:
	DC.B	"NAPALM_S:CLASS-Z.SFX",0
LAB_087C:
	DC.B	"NAPALM_S:H-BRIEF01.SVX",0
LAB_087D:
	DC.B	"NAPALM_S:R-BRIEF01.SVX",0
LAB_087E:
	DC.B	"NAPALM_S:H-INTRO.SVX",0
LAB_087F:
	DC.B	"NAPALM_S:R-INTRO.SVX",0
LAB_0880:
	DC.B	"NAPALM_S:H-EXTRO.SVX",0
LAB_0881:
	DC.B	"NAPALM_S:R-EXTRO.SVX",0
LAB_0882:
	DC.B	"NAPALM_X:GAME_01.DAT",0

prefs_strings:
	DC.B	0
	DC.B	"mission",0
	DC.B	"techlevel",0
	DC.B	"briefing",0
	DC.B	"credits",0
	DC.B	"warzone",0
	DC.B	"terrain",0
	DC.B	"f01",0
	DC.B	"f02",0
	DC.B	"f03",0
	DC.B	"objective",0
	DC.B	"briefsfx",0
	DC.B	"crctest",0
	DC.B	"fr1",0
	DC.B	"fr2",0
	DC.B	"fr3",0
	DC.B	"fr4",0
	DC.B	"fr5",0
	DC.B	"fr6",0
	DC.B	"fr7",0
	DC.B	"cd_device",0
	DC.B	"cd_unit",0
	DC.B	"cd_nix",0
	DC.B	"cd_nixx",0
	DC.B	"screenmodetype",0
	DC.B	"free8",0
	DC.B	"language",0
	DC.B	"verticalres",0
	DC.B	"pointerfix",0
	DC.B	"net_initmodem",0
	DC.B	"net_dialtype",0
	DC.B	"net_phonecall",0
	DC.B	"net_driver",0
	DC.B	"net_device",0
	DC.B	"net_unit",0
	DC.B	"net_bauds",0
	DC.B	"net_nodenr",0
	DC.B	"net_nodename",0
	DC.B	"net_port",0
	DC.B	"net_tcphost",0
	DC.B	"net_?",0
	DC.B	"net_chat01",0
	DC.B	"net_chat02",0
	DC.B	"net_chat03",0
	DC.B	"net_chat04",0
	DC.B	"net_chat05",0
	DC.B	"net_chat06",0
	DC.B	"net_chat07",0
	DC.B	"net_chat08",0
	DC.B	"net_chat09",0
	DC.B	"net_chat10",0
	DC.B	"audio_driver",0
	DC.B	"audio_device",0
	DC.B	"audio_audioid",0
	DC.B	"audio_channels",0
	DC.B	"audio_mixfreq",0
	DC.B	"cd_intro",0
	DC.B	"cd_menu",0
	DC.B	"cd_sides",0
	DC.B	"cd_info",0
	DC.B	"cd_stats",0
	DC.B	"cd_briefing",0
	DC.B	"cd_over",0
	DC.B	"cd_win",0
	DC.B	"cd_level",0
	DC.B	"cd_levelnr",0
	DC.B	"cd_a",0
	DC.B	"cd_b",0
	DC.B	"cd_c",0
	DC.B	"cd_d",0
	DC.B	"net_money",0
	DC.B	"net_techlevel",0
	DC.B	"net_mission",0
	DC.B	"net_side",0
	DC.B	"ENDEi"

	IF 0

LAB_baduba:
	DS.B	1
	DC.L	$6d697373,$696f6e00,$74656368,$6c657665
	DC.L	$6c006272,$69656669,$6e670063,$72656469
	DC.L	$74730077,$61727a6f,$6e650074,$65727261
	DC.L	$696e0066,$30310066,$30320066,$3033006f
	DC.L	$626a6563,$74697665,$00627269,$65667366
	DC.L	$78006372,$63746573,$74006672,$31006672
	DC.L	$32006672,$33006672,$34006672,$35006672
	DC.L	$36006672,$37006364,$5f646576,$69636500
	DC.L	$63645f75,$6e697400,$63645f6e,$69780063
	DC.L	$645f6e69,$78780073,$63726565,$6e6d6f64
	DC.L	$65747970,$65006672,$65653800,$6c616e67
	DC.L	$75616765,$00766572,$74696361,$6c726573
	DC.L	$00706f69,$6e746572,$66697800,$6e65745f
	DC.L	$696e6974,$6d6f6465,$6d006e65,$745f6469
	DC.L	$616c7479,$7065006e,$65745f70,$686f6e65
	DC.L	$63616c6c,$006e6574,$5f647269,$76657200
	DC.L	$6e65745f,$64657669,$6365006e,$65745f75
	DC.L	$6e697400,$6e65745f,$62617564,$73006e65
	DC.L	$745f6e6f,$64656e72,$006e6574,$5f6e6f64
	DC.L	$656e616d,$65006e65,$745f706f,$7274006e
	DC.L	$65745f74,$6370686f,$7374006e,$65745f3f
	DC.L	$006e6574,$5f636861,$74303100,$6e65745f
	DC.L	$63686174,$3032006e,$65745f63,$68617430
	DC.L	$33006e65,$745f6368,$61743034,$006e6574
	DC.L	$5f636861,$74303500,$6e65745f,$63686174
	DC.L	$3036006e,$65745f63,$68617430,$37006e65
	DC.L	$745f6368,$61743038,$006e6574,$5f636861
	DC.L	$74303900,$6e65745f,$63686174,$31300061
	DC.L	$7564696f,$5f647269,$76657200,$61756469
	DC.L	$6f5f6465,$76696365,$00617564,$696f5f61
	DC.L	$7564696f,$69640061,$7564696f,$5f636861
	DC.L	$6e6e656c,$73006175,$64696f5f,$6d697866
	DC.L	$72657100,$63645f69,$6e74726f,$0063645f
	DC.L	$6d656e75,$0063645f,$73696465,$73006364
	DC.L	$5f696e66,$6f006364,$5f737461,$74730063
	DC.L	$645f6272,$69656669,$6e670063,$645f6f76
	DC.L	$65720063,$645f7769,$6e006364,$5f6c6576
	DC.L	$656c0063,$645f6c65,$76656c6e,$72006364
	DC.L	$5f610063,$645f6200,$63645f63,$0063645f
	DC.L	$64006e65,$745f6d6f,$6e657900,$6e65745f
	DC.L	$74656368,$6c657665,$6c006e65,$745f6d69
	DC.L	$7373696f,$6e006e65,$745f7369,$64650045
	DC.L	$4e444569
		ENDIF

stackpointer:
	DS.L	1
DosBase:
	DS.L	1
GraphicsBase:
	DS.L	1
IntuiBase:
	DS.L	1
GadtoolsBase:
	DS.L	1
LAB_0889:
	DS.L	1
LocaleBase:
	DS.L	1
CDPlayerBase:
	DS.L	1
UtilityBase:
	DS.L	1
prefs_mem_ptr:
	DS.L	1
self_task:
	DS.L	1
nul_mem_ptr:
	DS.L	1
chp_mem_ptr:
	DS.L	1
bf_mem_ptr:
	DS.L	1
net_segment_ptr:
	DS.L	1
net_segment_bptr:
	DS.L	1
audio_segment_ptr:
	DS.L	1
audio_segment_bptr:
	DS.L	2
LAB_0896:
	DS.L	1
LAB_0897:
	DS.L	1
LAB_0898:
	DS.L	2
LAB_0899:
	DS.L	1
LAB_089A:
	DS.L	1
LAB_089B:
	DS.L	1
LAB_089C:
	DS.L	1
LAB_089D:
	DS.L	1
LAB_089E:
	DS.L	1
LAB_089F:
	DS.L	1
LAB_08A0:
	DS.L	1
LAB_08A1:
	DS.L	1
LAB_08A2:
	DC.W	$0001
LAB_08A3:
	DC.W	$0001
LAB_08A4:
	DC.W	$0001
LAB_08A5:
	DS.W	1
LAB_08A6:
	DS.W	1
LAB_08A7:
	DS.W	1
LAB_08A8:
	DS.W	1
LAB_08A9:
	DS.W	1
entry_d0:
	DS.W	1
LAB_08AB:
	DS.W	1
LAB_08AC:
	DS.W	1
LAB_08AD:
	DC.W	$0001
LAB_08AE:
	DS.L	1
LAB_08AF:
	DS.L	1
LAB_08B0:
	DS.L	1
LAB_08B1:
	DS.L	1
LAB_08B2:
	DS.L	1
LAB_08B3:
	DS.L	1
LAB_08B4:
	DS.L	1
LAB_08B5:
	DS.L	1
cd_level:
	DS.L	1
cd_levelnr:
	DS.L	2
LAB_08B8:
	DS.L	1
LAB_08B9:
	DC.L	$80090001
	DS.L	1
	DC.L	$80090002
	DS.L	1
	DC.L	$80090003
	DS.L	1
	DC.L	$80090004
language_str:
	DS.L	3
LAB_08BB:
	DS.L	132
LAB_08BC:
	DC.L	$ffffffff,$8000ffff
	DS.L	1
	DC.L	$80000000
LAB_08BD:
	DS.L	4
LAB_08BE:
	DC.L	$1199613d,$c63cb405,$da91babe,$413b3c3f
	DC.L	$a2a3d1a0,$11f86ab3,$71097037,$87770733
	DC.L	$aaf8250c,$d0d0b9e0,$1a9c77c0,$d8c0b70e
	DC.L	$20fea866,$e4ee8172,$bfaa8be5,$ade4b234
	DC.L	$0039ae8b,$f8777807,$f40c2ab4,$d920066f
	DC.L	$0e09c628,$a20225cf,$ad155762,$d8ae59be
	DC.L	$400e2e3f,$43ae84b9,$a2431801,$fc3c33c8
	DC.L	$36d5002e,$00501c6a,$012a636e,$0d54b58f
	DC.L	$9030cdca,$8ea9b905,$279d0042,$95b3241c
	DC.L	$810f4196,$028cf922,$7aa5b2b1,$aaa44212
	DC.L	$d6d2e9b8,$ae78a683,$4d2f1ec2,$c30cbd83
	DC.L	$1990327d,$e154c8ca,$1799279c,$dd75b182
	DC.L	$f9936d9b,$29fc37aa,$3d34ae80,$c3617482
	DC.L	$932a3856,$0527b93e,$3e32a1f3,$60d7c116
	DC.L	$160fe30f,$d18be312,$f1c6064b,$12d7cb43
	DC.L	$638f89c6,$062e02d4,$81f5f133,$f39bb41b
LAB_08BF:
	LEA	LAB_08BE(PC),A0
	MOVE.W	#$00ff,D0
	MOVE.B	VHPOSR,D1
	MOVEQ	#0,D1
LAB_08C0:
	EOR.B	D1,(A0)+
	DBF	D0,LAB_08C0
	RTS
LAB_08C1:
	MOVEM.L	D0-D7/A0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JSR	_LVORtgText(A6)
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS


LAB_08C6:
	DS.L	1


LAB_08C7:
	BSR.W	clear_buffer
	LEA	title_name,A0
	JSR	swap_stuff
	MOVEA.L	#title_name,A0
	MOVE.L	#$494d4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_08D2

	MOVE.L	A0,-(A7)
	BSR.W	LAB_08CF
	MOVEA.L	(A7)+,A0
	RTS

LAB_08C8:
	BSR.W	clear_buffer
	LEA	title_name,A0
	JSR	swap_stuff
	MOVEA.L	#title_name,A0
	MOVE.L	#$494d4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_08D2
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_08CF
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_0829
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	RTS

LAB_08C9:
	BSR.W	clear_buffer
	LEA	humans01_name,A5
	TST.W	124(A4)
	BEQ.S	LAB_08CA
	LEA	robots01_name,A5
LAB_08CA:
	MOVEA.L	A5,A0
	JSR	swap_stuff
	MOVEA.L	A5,A0
	MOVE.L	#$494d4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_08D2
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_08CF
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_0829
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	RTS
LAB_08CB:
	BSR.W	clear_buffer
	LEA	hstats_name,A5
	TST.W	124(A4)
	BEQ.S	LAB_08CC
	LEA	rstats_name,A5
LAB_08CC:
	MOVEA.L	A5,A0
	JSR	swap_stuff
	MOVEA.L	A5,A0
	MOVE.L	#$494d4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_08D2
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_08CF
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_0829
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	RTS
LAB_08CD:
	BSR.W	clear_buffer
	LEA	hmission_name,A5
	TST.W	124(A4)
	BEQ.S	LAB_08CE
	LEA	rmission_name,A5
LAB_08CE:
	MOVEA.L	A5,A0
	JSR	swap_stuff
	MOVEA.L	A5,A0
	MOVE.L	#$494d4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_08D2
	MOVEM.L	D0-D7/A0-A6,-(A7)
	BSR.W	LAB_08CF
	MOVEM.L	(A7)+,D0-D7/A0-A6
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	RTS
LAB_08CF:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	LAB_031D
	LEA	1024(A0),A0
	MOVEA.L	render_buffer,A1
	MOVE.L	blit_height,D7
	SUBQ.W	#1,D7
LAB_08D0:
	MOVEA.L	A0,A2
	MOVE.L	blit_width,D6
	LSR.W	#2,D6
	SUBQ.W	#1,D6
LAB_08D1:
	MOVE.L	(A0)+,(A1)+
	DBF	D6,LAB_08D1
	LEA	640(A2),A0
	DBF	D7,LAB_08D0
	LEA	rtg_more_stuff,A4
	MOVE.L	render_buffer,32(A4)
	MOVE.L	LAB_02E3,88(A4)
	MOVE.L	rtg_buffer0,64(A4)
	MOVE.L	rtg_buffer1,68(A4)
	MOVE.L	rtg_buffer0,100(A4)
	JSR	LAB_07E0
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_062D
	JSR	LAB_062B
	RTS
LAB_08D2:
	JMP	exit_fail

clear_buffer:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	render_buffer,A1
	MOVE.L	blit_height,D7
	MOVE.L	blit_width,D6
	MULU	D6,D7
	LSR.L	#4,D7
	SUBQ.W	#1,D7
LAB_08D4:
	CLR.L	(A1)+
	CLR.L	(A1)+
	CLR.L	(A1)+
	CLR.L	(A1)+
	DBF	D7,LAB_08D4
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_08D5:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	LAB_0A54
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	MOVEQ	#3,D0
	JSR	LAB_08C7
	MOVE.L	A0,LAB_08E1
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	LAB_063B
	MOVEQ	#58,D0
	BSR.W	LAB_091F
	MOVEQ	#0,D0
	JSR	LAB_07E6
	MOVE.L	#$ffffffff,LAB_08E2
	BRA.W	LAB_08D7
LAB_08D6:
	JSR	LAB_0311
	CMPI.W	#$0032,D1
	BCS.S	LAB_08D9
	CMPI.W	#$012c,D1
	BCC.S	LAB_08D9
	CMPI.W	#$014a,D0
	BCC.S	LAB_08D8
LAB_08D7:
	CMPI.W	#$0040,D0
	BCS.S	LAB_08D9
	CMPI.W	#$0100,D0
	BCC.S	LAB_08D9
	TST.L	LAB_08E2
	BEQ.S	LAB_08DB
	BSR.W	LAB_08E4
	BRA.S	LAB_08DA
LAB_08D8:
	CMPI.W	#$0198,D0
	BCS.S	LAB_08D9
	CMPI.W	#$0250,D0
	BCC.S	LAB_08D9
	CMPI.L	#$00000001,LAB_08E2
	BEQ.S	LAB_08DB
	BSR.W	LAB_08E6
	BRA.S	LAB_08DA
LAB_08D9:
	BSR.W	LAB_08E3
LAB_08DA:
	JSR	rtg_display_stuff
LAB_08DB:
	JSR	LAB_0837
	CMPI.B	#$45,LAB_084A
	BNE.S	LAB_08DC
	MOVE.L	#$ffffffff,LAB_08E2
	BRA.S	LAB_08DD
LAB_08DC:
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.W	LAB_08D6
	TST.L	LAB_08E2
	BMI.W	LAB_08D6
LAB_08DD:
	BSR.W	LAB_08EF
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	JSR	alloc_and_free_mem
	MOVEM.L	(A7)+,D0-D7/A0-A6
	CMPI.W	#$0002,LAB_08A6
	BNE.S	LAB_08E0
	TST.W	LAB_08AC
	BNE.S	LAB_08DE
	MOVE.L	#$00000001,net_nodenr
	BRA.S	LAB_08DF
LAB_08DE:
	MOVE.L	#$00000002,net_nodenr
LAB_08DF:
	CLR.W	LAB_08AC
	CLR.W	LAB_08AD
LAB_08E0:
	TST.L	LAB_08E2
	RTS
LAB_08E1:
	DS.L	1
LAB_08E2:
	DS.L	1
LAB_08E3:
	MOVEA.L	LAB_08E1,A0
	ADDA.L	#$0005a400,A0
	MOVEQ	#0,D4
	MOVE.W	#$00eb,D5
	MOVE.W	#$0140,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	ADDA.L	#$00000140,A0
	MOVE.W	#$0140,D4
	MOVE.W	#$00eb,D5
	MOVE.W	#$0140,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	MOVE.L	#$ffffffff,LAB_08E2
	RTS
LAB_08E4:
	MOVEA.L	LAB_08E1,A0
	ADDA.L	#$00050400,A0
	MOVEQ	#0,D4
	MOVE.W	#$00eb,D5
	MOVE.W	#$0140,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	ADDA.L	#$0000a140,A0
	MOVE.W	#$0140,D4
	MOVE.W	#$00eb,D5
	MOVE.W	#$0140,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	CLR.L	LAB_08E2
	CLR.W	LAB_08AC
	MOVE.W	#$0001,LAB_08AD
	CMPI.W	#$0002,LAB_08A6
	BEQ.S	LAB_08E5
	LEA	rtg_more_stuff,A4
	CLR.W	360(A4)
LAB_08E5:
	RTS
LAB_08E6:
	MOVEA.L	LAB_08E1,A0
	ADDA.L	#$00050540,A0
	MOVE.W	#$0140,D4
	MOVE.W	#$00eb,D5
	MOVE.W	#$0140,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	ADDA.L	#$00009ec0,A0
	MOVEQ	#0,D4
	MOVE.W	#$00eb,D5
	MOVE.W	#$0140,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	MOVE.L	#$00000001,LAB_08E2
	CLR.W	LAB_08AD
	MOVE.W	#$0001,LAB_08AC
	CMPI.W	#$0002,LAB_08A6
	BEQ.S	LAB_08E7
	LEA	rtg_more_stuff,A4
	MOVE.W	#$0001,360(A4)
LAB_08E7:
	RTS
	DC.L	$48e7fffe,$363c00e0
	DC.W	$6026
LAB_08E8:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.W	#$0720,D3
	BRA.S	LAB_08EB
	DC.L	$48e7fffe,$363c0163
	DC.W	$6012


LAB_08E9:
	MOVEM.L	D0-D7/A0-A6,-(A7)		;A0 = title06_data
	MOVE.W	#$0058,D3
	BRA.S	LAB_08EB
LAB_08EA:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.W	#$0280,D3
LAB_08EB:
	MOVEA.L	render_buffer,A1		;A1 = render_buffer
	MOVEQ	#0,D2
	MOVE.W	D5,D2
	ADD.W	D7,D2
	CMP.L	blit_height,D2
	BCC.S	LAB_08EE
	MULU	#$0280,D5
	ADDA.L	D5,A1
	ADDA.W	D4,A1
	MOVE.L	D6,D4
	SUBQ.W	#1,D7
LAB_08EC:
	MOVEA.L	A0,A2
	MOVEA.L	A1,A3
	LSR.W	#2,D6
	SUBQ.W	#1,D6
LAB_08ED:
	MOVE.L	(A0)+,(A1)+
	DBF	D6,LAB_08ED
	LEA	640(A3),A1
	MOVEA.L	A2,A0
	ADDA.W	D3,A0
	MOVE.L	D4,D6
	DBF	D7,LAB_08EC
LAB_08EE:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_08EF:
	JSR	LAB_0635
	JSR	fade_out_rtg
	RTS


LAB_08F0:
	MOVE.W	D0,LAB_08F4
	JSR	alloc_and_free_mem
	CMPI.W	#$0002,LAB_08A6
	BEQ.W	LAB_08F3
	JSR	fade_out_rtg
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	MOVEQ	#0,D0
	MOVE.W	336(A4),D0
	JSR	LAB_08CD
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	CMPI.W	#$abcd,LAB_08F4
	BNE.S	LAB_08F1
	JSR	LAB_0A54
	MOVEQ	#61,D0
	BSR.W	LAB_0920
	JSR	LAB_0274
	TST.W	D0
	BNE.S	LAB_08F2
LAB_08F1:
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.S	LAB_08F1
LAB_08F2:
	JSR	fade_out_rtg
	BSR.W	clear_buffer
	JSR	LAB_07E0
LAB_08F3:
	LEA	rtg_stuff,A5
	JSR	rtg_fetch_data
	JSR	LAB_023C
	BSET	#2,163(A4)
	MOVE.B	#$ff,108(A4)
	JSR	clear_buffer
	JSR	LAB_03A6
	JSR	LAB_0627
	JSR	LAB_062A
	LEA	rtg_stuff,A5
	JSR	rtg_screen_to_front
	MOVEQ	#16,D0
	JSR	load_rgb_and_pointer
	JSR	alloc_and_free_mem
	RTS

	DC.W	$4ef9
	DC.L	exit_fail
	DS.W	1
LAB_08F4:
	DS.W	1
LAB_08F5:
	JSR	LAB_0A54
	LEA	rtg_more_stuff,A4
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	MOVEQ	#1,D0
	JSR	LAB_08C9
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	MOVEQ	#62,D0
	JSR	LAB_0920
	MOVE.L	#$00000064,D0
	MOVE.L	#$000000aa,D1
	BSR.W	LAB_0903
	BSR.W	LAB_07E0
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	MOVEA.L	LAB_02B2,A1
	JSR	_LVORtgSetFont(A6)

	MOVEM.L	(A7)+,D0-D7/A0-A6
	MOVEQ	#0,D0
	MOVEQ	#82,D1
	JSR	LAB_0409
	MOVEA.L	D0,A0
	MOVEQ	#0,D0
	MOVE.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	JSR	swap_stuff
	MOVEA.L	A5,A0
	MOVE.L	#$494d4721,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_090D
	MOVE.L	A0,LAB_090E
	ADDI.L	#$00000400,LAB_090E
	LEA	rtg_more_stuff,A4
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVE.L	LAB_090E,32(A4)
	MOVE.L	LAB_02E3,88(A4)
	MOVE.L	rtg_buffer0,64(A4)
	MOVE.L	rtg_buffer1,68(A4)
	MOVE.L	rtg_buffer1,100(A4)
	JSR	LAB_07E0
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	MOVEM.L	(A7)+,D0-D7/A0-A6
	JSR	LAB_062D
	JSR	LAB_062B
	JSR	LAB_063B
	MOVEQ	#63,D0
	JSR	LAB_0920
	JSR	LAB_0278
	MOVEQ	#100,D7
LAB_090A:
	MOVEQ	#1,D1
	JSR	dos_delay
	DBF	D7,LAB_090A
	MOVE.W	#$01b5,D7
LAB_090B:
	JSR	LAB_07EC
	MOVEM.L	D0-D7/A0-A6,-(A7)
	ADDI.L	#$00000500,32(A4)
	JSR	rtg_display_stuff
	MOVEM.L	(A7)+,D0-D7/A0-A6
	DBF	D7,LAB_090B
LAB_090C:
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.S	LAB_090C
	JSR	LAB_0635
	JSR	fade_out_rtg
	MOVE.L	#$494d4721,D1
	JSR	free_mem
LAB_090D:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_090E:
	DS.L	1
LAB_090F:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	#title09_name,A0
	MOVE.L	#$4e415021,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_091A
	MOVE.L	A0,LAB_091C
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	MOVEQ	#7,D0
	JSR	LAB_08C7
	MOVE.L	A0,LAB_091B
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	MOVEQ	#15,D0
	JSR	LAB_07E6
	MOVEQ	#56,D0
	BSR.W	LAB_091F
	MOVEQ	#100,D7
LAB_0910:
	MOVEQ	#1,D1
	JSR	dos_delay
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BEQ.W	LAB_0919
	DBF	D7,LAB_0910
	BSR.W	fade_out_rtg
	BSR.W	clear_buffer
	MOVEA.L	LAB_091B,A0
	ADDA.L	#$00050400,A0
	MOVE.W	#$0104,D4
	MOVE.W	#$00c8,D5
	MOVE.W	#$00a0,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	JSR	LAB_07E0
	BSR.W	LAB_063B
	MOVEQ	#100,D7
LAB_0911:
	MOVEQ	#1,D1
	JSR	dos_delay
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BEQ.W	LAB_0919
	DBF	D7,LAB_0911
	BSR.W	fade_out_rtg
	BSR.W	clear_buffer
	MOVEA.L	LAB_091B,A0
	ADDA.L	#$000504a0,A0
	MOVE.W	#$0104,D4
	MOVE.W	#$00c8,D5
	MOVE.W	#$00a0,D6
	MOVE.W	#$0032,D7
	BSR.W	LAB_08EA
	JSR	LAB_07E0
	BSR.W	LAB_063B
	MOVEQ	#100,D7
LAB_0912:
	MOVEQ	#1,D1
	JSR	dos_delay
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BEQ.W	LAB_0919
	DBF	D7,LAB_0912
	BSR.W	fade_out_rtg
	BSR.W	clear_buffer
	BSR.W	rtg_display_stuff
	BSR.W	rtg_display_stuff
	BSR.W	rtg_display_stuff
	BSR.W	fade_out_rtg
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	JSR	fade_out_rtg
	MOVEQ	#10,D0
	JSR	LAB_08C7
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	MOVE.W	#$00fa,D7
LAB_0913:
	MOVEQ	#1,D1
	JSR	dos_delay
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BEQ.W	LAB_0914
	DBF	D7,LAB_0913
LAB_0914:
	BSR.W	fade_out_rtg
	BSR.W	clear_buffer
	BSR.W	rtg_display_stuff
	BSR.W	rtg_display_stuff
	BSR.W	rtg_display_stuff
	MOVE.L	blit_width,D0
	MOVE.L	#$00000190,D1
	MOVEQ	#0,D2
	MOVEQ	#0,D3
	JSR	LAB_0607
	MOVEA.L	LAB_091C,A0
	CLR.L	(A0)
	BSR.W	LAB_062D
	BSR.W	LAB_063B
	MOVEQ	#0,D3
	MOVE.W	#$0278,D3
	MOVE.W	#$00d7,D2
	MOVEQ	#0,D1
LAB_0915:
	ADDI.W	#$0010,D1
	CMPI.W	#$018f,D1
	BCS.S	LAB_0916
	MOVE.W	#$018f,D1
LAB_0916:
	MOVEM.L	D0-D2,-(A7)
	BSR.W	LAB_091D
	JSR	LAB_07DD
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.W	LAB_0917
	MOVEM.L	(A7)+,D0-D2
	BRA.S	LAB_0919
LAB_0917:
	SUBQ.W	#8,D3
	BPL.S	LAB_0918
	CMPI.W	#$fcae,D3
	BCC.S	LAB_0918
	JSR	dim_colors_rtg
	JSR	dim_colors_rtg
	JSR	dim_colors_rtg
	JSR	dim_colors_rtg
LAB_0918:
	MOVEM.L	(A7)+,D0-D2
	DBF	D2,LAB_0915
LAB_0919:
	BSR.W	fade_out_rtg
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	JSR	alloc_and_free_mem
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS
LAB_091A:
	JMP	exit_fail
LAB_091B:
	DS.L	3
LAB_091C:
	DS.L	1
LAB_091D:
	MOVEA.L	LAB_091C,A0
	LEA	1024(A0),A0
	MOVE.W	D3,D4
	BPL.S	LAB_091E
	NEG.W	D4
	LEA	0(A0,D4.W),A0
	MOVEQ	#0,D4
LAB_091E:
	MOVEQ	#0,D5
	MOVE.W	#$0280,D7
	SUB.W	D4,D7
	MOVE.W	D7,D6
	MOVE.W	D1,D7
	BSR.W	LAB_08E8
	RTS
LAB_091F:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	do_prefs
	JSR	LAB_0A48
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS


LAB_0920:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	JSR	do_prefs
	TST.W	124(A4)
	BEQ.S	LAB_0921
	ADDQ.W	#1,D0
LAB_0921:
	JSR	LAB_0A48
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS


intro1:
	MOVEM.L	D0-D7/A0-A6,-(A7)

	TST.W	LAB_08A8
	BNE.W	LAB_0924
	BSR.W	LAB_090F
	JSR	LAB_0A54
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	MOVEQ	#1,D0
	JSR	LAB_08C8
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	MOVEQ	#0,D0
	JSR	LAB_07E6
	MOVEQ	#59,D0
	BSR.W	LAB_0920
LAB_0923:
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.W	LAB_0923
	BSR.W	LAB_08EF
	BRA.W	LAB_0924

	DC.W	$4eb9
	DC.L	LAB_0312
	DC.L	$0c400068,$6600fff4
	DC.W	$600c

LAB_0924:
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
LAB_0925:
	JSR	fade_out_rtg
	CLR.W	LAB_08A5
	MOVEA.L	#title06_name,A0
	MOVE.L	#$43424f21,D0
	JSR	load_stuff1
	TST.L	D0
	BMI.W	LAB_094F
	MOVE.L	A0,title06_data

	MOVEQ	#5,D0
	JSR	LAB_08C7
	MOVE.L	A0,LAB_0935

	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	rtg_display_stuff
	JSR	LAB_063B
	CLR.W	LAB_0937
	JSR	LAB_0A4C
	BNE.S	LAB_0926
	MOVEQ	#57,D0
	BSR.W	LAB_091F
LAB_0926:
	JSR	LAB_0311
	LEA	LAB_0931,A2
LAB_0927:
	MOVEQ	#0,D0
	MOVE.W	(A2),D0
	BMI.S	LAB_0929
	CMP.W	2(A2),D1
	BCS.S	LAB_0928
	ADDQ.W	#4,A2
	BRA.S	LAB_0927
LAB_0928:
	BSR.W	LAB_094C
	BSR.W	LAB_094A
	JSR	rtg_display_stuff
LAB_0929:
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.W	LAB_0926
	MOVE.L	LAB_0932,D0
	CMPI.B	#$04,D0
	BCC.S	LAB_0926
	MOVE.W	D0,LAB_08A6
	CMPI.W	#$0001,D0
	BEQ.S	LAB_092A
	BSR.W	LAB_08EF
LAB_092A:
	MOVE.L	#$43424f21,D1
	JSR	free_mem
	MOVE.L	#$494d4721,D1
	JSR	free_mem
	CMPI.W	#$0001,LAB_08A6
	BNE.W	LAB_0930
	JSR	fade_out_rtg
	MOVEQ	#4,D0
	JSR	LAB_08C8
	JSR	LAB_07E0
	JSR	LAB_063B
	JSR	LAB_05EB
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	MOVEA.L	LAB_02B0,A1
	JSR	_LVORtgSetFont(A6)
	MOVEQ	#15,D7
	MOVEQ	#64,D0
	MOVEQ	#46,D1
LAB_092B:
	BSR.W	LAB_0950
	ADDI.W	#$0002,D1
	BSR.W	LAB_0950
	ADDI.W	#$0014,D1
	DBF	D7,LAB_092B
	JSR	LAB_07E0
	MOVEQ	#0,D0
	MOVEQ	#3,D1
	JSR	LAB_0409
	MOVEA.L	D0,A0
	MOVEQ	#79,D0
	MOVEQ	#32,D1
	MOVE.W	#$00ff,D2
	LEA	LAB_093A,A0
	BSR.W	LAB_08C1
	MOVEQ	#0,D0
	MOVEQ	#15,D7
LAB_092C:
	MOVEQ	#19,D2
	BSR.W	LAB_093F
	ADDQ.W	#1,D0
	DBF	D7,LAB_092C
LAB_092D:
	JSR	LAB_0311
	SUBI.W	#$0032,D1
	DIVU	#$0016,D1
	MOVEQ	#0,D0
	MOVE.W	D1,D0
	MOVE.L	LAB_0938,D2
	BMI.S	LAB_092E
	CMP.L	D2,D0
	BEQ.S	LAB_092F
	MOVE.L	D0,D7
	MOVE.L	D2,D0
	MOVEQ	#0,D2
	MOVE.W	#$0013,D2
	BSR.W	LAB_093F
	MOVE.L	D7,D0
LAB_092E:
	MOVE.L	D0,LAB_0938
	MOVEQ	#0,D2
	MOVE.W	#$0012,D2
	BSR.W	LAB_093F
LAB_092F:
	JSR	LAB_0837
	CMPI.B	#$45,LAB_084A
	BEQ.W	LAB_0925
	JSR	LAB_0312
	CMPI.W	#$0069,D0
	BEQ.W	LAB_0925
	CMPI.W	#$0068,D0
	BNE.W	LAB_092D
	MOVEA.L	LAB_0939,A0
	TST.L	20(A0)
	BEQ.S	LAB_092D
	MOVE.L	LAB_0938,D0
	ADDQ.W	#1,D0
	MOVE.W	D0,LAB_08A5
	JSR	fade_out_rtg
LAB_0930:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS							;end of intro1


LAB_0931:
	DC.L	$000400b9,$000000e1,$00010109,$0002012c
	DC.L	$00040145,$0003016d,$00040200,$ffffffff
LAB_0932:
	DS.L	1
LAB_0933:
	DS.L	1
title06_data:
	DS.L	1
LAB_0935:
	DS.L	1
LAB_0936:
	DS.L	1
LAB_0937:
	DS.L	1
LAB_0938:
	DC.L	$ffffffff
LAB_0939:
	DS.L	1
LAB_093A:
	DC.B	"Mission:                               Date:",0
LAB_093B:
	DC.B	"     "
LAB_093C:
	DC.B	"XXXXXXXXXXXXXXXX",0
LAB_093D:
	DC.B	"  00:00.00,",0
LAB_093E:
	DC.B	"  05.06.1974",0
LAB_093F:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	CMPI.W	#$0010,D0
	BCC.S	LAB_0941
	MOVE.L	D2,D7
	LEA	LAB_08BB,A0
	MOVEQ	#0,D1
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
LAB_0947:
	TST.W	D4
	BMI.S	LAB_0949
	TST.W	D5
	BNE.S	LAB_0948
	MOVE.L	#$202d2d2d,(A2)+
	MOVE.L	#$2d2d2020,(A2)+
	MOVEQ	#7,D4
LAB_0948:
	MOVE.B	#$20,(A2)+
	DBF	D4,LAB_0948
LAB_0949:
	LEA	LAB_08BD,A0
	MOVE.L	24(A5),D0
	MOVEA.L	UtilityBase,A6
	JSR	-120(A6)
	LEA	LAB_093D,A2
	ADDQ.W	#2,A2
	MOVE.W	4(A0),D0
	BSR.W	LAB_0942
	ADDQ.W	#1,A2
	MOVE.W	2(A0),D0
	BSR.W	LAB_0942
	ADDQ.W	#1,A2
	MOVE.W	(A0),D0
	BSR.W	LAB_0942
	LEA	LAB_093E,A2
	ADDQ.W	#2,A2
	MOVE.W	6(A0),D0
	BSR.W	LAB_0942
	ADDQ.W	#1,A2
	MOVE.W	8(A0),D0
	BSR.W	LAB_0942
	ADDQ.W	#1,A2
	MOVE.W	10(A0),D0
	BSR.W	LAB_0943
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS


LAB_094A:
	MOVEA.L	title06_data,A0
	MOVE.L	LAB_0933,D0
	ADDQ.W	#1,D0
	CMPI.W	#$001e,D0
	BCS.S	LAB_094B
	MOVEQ	#0,D0
LAB_094B:
	MOVE.L	D0,LAB_0933
	MULU	#$0d10,D0
	ADDA.L	D0,A0
	MOVE.W	#$0208,D4
	MOVE.W	#$01b8,D5
	MOVE.W	#$0058,D6
	MOVE.W	#$0026,D7
	BSR.W	LAB_08E9
	RTS


LAB_094C:
	LEA	LAB_0953,A2
	MOVE.L	D0,LAB_0932
	DC.W	$3632
	DC.W	$0200
	MOVEA.L	LAB_0936,A0
	ADDA.L	#$0000a000,A0
	MOVE.W	LAB_0937,D5
	BEQ.W	LAB_094D
	MOVE.W	#$0100,D4
	MOVE.W	#$00a0,D6
	MOVE.W	#$002a,D7
	BSR.W	LAB_08EA
	TST.W	D3
	BEQ.W	LAB_094E
LAB_094D:
	MOVEA.L	LAB_0935,A0
	ADDA.L	#$00050400,A0
	MULU	#$00a0,D0
	ADDA.L	D0,A0
	MOVE.L	A0,LAB_0936
	MOVE.W	D3,D5
	BEQ.W	LAB_094E
	MOVE.W	D5,LAB_0937
	MOVE.W	#$0100,D4
	MOVE.W	#$00a0,D6
	MOVE.W	#$002a,D7
	BSR.W	LAB_08EA
LAB_094E:
	RTS
LAB_094F:
	JMP	exit_fail
LAB_0950:
	MOVEM.L	D0-D1/D7,-(A7)
	JSR	LAB_0239
	LEA	LAB_02DB,A0
	MOVEQ	#0,D0
	MOVE.W	#$000e,D7
LAB_0951:
	MOVE.W	#$01e0,D6
	MOVEA.L	A3,A1
LAB_0952:
	MOVE.B	(A3),D0
	MOVE.B	0(A0,D0.W),(A3)+
	DBF	D6,LAB_0952
	MOVEA.L	A1,A3
	ADDA.L	D2,A3
	DBF	D7,LAB_0951
	MOVEM.L	(A7)+,D0-D1/D7
	RTS
LAB_0953:
	DC.L	$00ae00d8,$00fe013a
	DS.L	2
LAB_0954:
	JSR	alloc_and_free_mem
	JSR	fade_out_rtg
	JSR	LAB_0A54
	LEA	rtg_stuff2,A5
	JSR	rtg_fetch_data
	MOVEQ	#0,D0
	MOVE.W	338(A4),D0
	ADDQ.W	#1,D0
	BEQ.S	LAB_0955
	CMPI.W	#$0014,D0
	BCS.S	LAB_0956
LAB_0955:
	MOVEQ	#20,D0
LAB_0956:
	JSR	LAB_08CB
	LEA	rtg_stuff2,A5
	JSR	rtg_screen_to_front
	JSR	LAB_07E0
	JSR	LAB_063B
	MOVEA.L	RTGMasterBase,A6
	MOVEA.L	rtg_screen,A0
	MOVEA.L	LAB_02B0,A1
	JSR	_LVORtgSetFont(A6)
	MOVEQ	#60,D0
	BSR.W	LAB_091F
	LEA	rtg_more_stuff,A4
	MOVEA.L	184(A4),A3
	TST.W	124(A4)
	BEQ.S	LAB_0957
	MOVEA.L	188(A4),A3
LAB_0957:
	MOVEQ	#0,D0
	MOVE.W	94(A3),D0
	MOVEQ	#0,D1
	MOVE.W	92(A3),D1
	MOVE.W	#$007a,D2
	BSR.W	LAB_095A
	BMI.S	LAB_0959
	MOVEQ	#0,D0
	MOVE.W	26(A3),D0
	MOVEQ	#0,D1
	MOVE.W	24(A3),D1
	MOVE.W	#$00e0,D2
	BSR.W	LAB_095A
	BMI.S	LAB_0959
	MOVEQ	#0,D0
	MOVE.W	30(A3),D0
	MOVEQ	#0,D1
	MOVE.W	28(A3),D1
	MOVE.W	#$0147,D2
	BSR.W	LAB_095A
	BMI.S	LAB_0959
	MOVE.L	268(A4),D0
	MOVE.W	#$00b6,D2
	BSR.W	LAB_0967
	MOVEQ	#20,D1
	JSR	dos_delay
	MOVEQ	#0,D0
	MOVE.W	336(A4),D0
	MOVE.W	#$0119,D2
	BSR.W	LAB_0968
	JSR	LAB_031D
LAB_0958:
	JSR	LAB_0312
	CMPI.W	#$0068,D0
	BNE.S	LAB_0958
LAB_0959:
	JSR	fade_out_rtg
	BSR.W	clear_buffer
	MOVE.L	#$524e4b21,D1
	JSR	free_mem
	JSR	alloc_and_free_mem
	RTS
	DC.W	$4ef9
	DC.L	exit_fail
LAB_095A:
	MOVEM.L	D0-D5,-(A7)
	CMP.L	D1,D0
	BCC.S	LAB_095B
	EXG	D0,D1
	BSR.W	LAB_0971
	MOVE.L	D7,D6
	MOVEQ	#100,D7
	BRA.S	LAB_095C
LAB_095B:
	BSR.W	LAB_0971
	MOVEQ	#100,D6
LAB_095C:
	MOVEM.L	(A7)+,D0-D5
	MOVE.L	D0,LAB_096E
	MOVE.L	D1,LAB_096F
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEQ	#76,D3
	BSR.W	LAB_095E
	BMI.S	LAB_095D
	MOVEQ	#30,D1
	JSR	dos_delay
	BMI.S	LAB_095D
	MOVE.L	D7,D6
	ADDI.W	#$0187,D3
	MOVE.L	LAB_096F,D0
	BSR.W	LAB_095E
	BMI.S	LAB_095D
	MOVEQ	#80,D1
	JSR	dos_delay
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.W	D7,D6
	CMP.W	D0,D1
	BCC.S	LAB_0973
LAB_0972:
	LSR.W	#1,D2
	LSR.W	#1,D6
	BEQ.S	LAB_0973
	BSR.W	LAB_0974
	CMP.W	D0,D1
	BNE.S	LAB_0972
LAB_0973:
	RTS
LAB_0974:
	CMP.W	D0,D1
	BCC.S	LAB_0975
	SUB.W	D6,D7
	SUB.W	D2,D0
	BRA.S	LAB_0976
LAB_0975:
	ADD.W	D6,D7
	ADD.W	D2,D0
LAB_0976:
	RTS
LAB_0977:
	DC.L	$0000ffff,$0008ffff,$0001ffff,$0001fff8
	DC.L	$00010000,$00010008,$00010001,$00080001
	DC.L	$00000001,$fff80001,$ffff0001,$ffff0008
	DC.L	$ffff0000,$fffffff8,$ffffffff,$fff8ffff
LAB_0978:
	DC.L	$0000ffff,$0001ffff,$0001ffff,$0001ffff
	DC.L	$00010000,$00010001,$00010001,$00010001
	DC.L	$00000001,$ffff0001,$ffff0001,$ffff0001
	DC.L	$ffff0000,$ffffffff,$ffffffff,$ffffffff
LAB_0979:
	DC.L	$0000ffff,$0001ffff,$00010000,$00010001
	DC.L	$00000001,$ffff0001,$ffff0000,$ffffffff
LAB_097A:
	DC.L	$0001ffff,$0001ffff,$0001ffff,$0001ffff
	DC.L	$00010001,$00010001,$00010001,$00010001
	DC.L	$00010001,$ffff0001,$ffff0001,$ffff0001
	DC.L	$ffff0001,$ffffffff,$ffffffff,$ffffffff
	DS.L	4
	DC.L	$0000e00c,$00000018
	DS.L	768
LAB_097B:
	DS.L	2
	DC.L	$0000ffff
	DS.L	1
	DC.L	$0001ffff
	DS.L	1
	DC.L	$00010000
	DS.L	1
	DC.L	$00010001
	DS.L	1
	DC.L	$00000001
	DS.L	1
	DC.L	$ffff0001
	DS.L	1
	DC.L	$ffff0000
	DS.L	1
	DC.L	$ffffffff
	DS.L	1
	DC.L	$aaaaaaaa
LAB_097C:
	DC.L	$0000fffe
	DS.L	1
	DC.L	$0001fffe
	DS.L	1
	DC.L	$0002fffe
	DS.L	1
	DC.L	$0002ffff
	DS.L	1
	DC.L	$00020000
	DS.L	1
	DC.L	$00020001
	DS.L	1
	DC.L	$00020002
	DS.L	1
	DC.L	$00010002
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$ffff0002
	DS.L	1
	DC.L	$fffe0002
	DS.L	1
	DC.L	$fffe0001
	DS.L	1
	DC.L	$fffe0000
	DS.L	1
	DC.L	$fffeffff
	DS.L	1
	DC.L	$fffefffe
	DS.L	1
	DC.L	$fffffffe
	DS.L	1
	DC.L	$0000fffd,$00c30000,$0001fffd,$00c30000
	DC.L	$0002fffd,$00c70000,$0003fffe,$008f0000
	DC.L	$0003ffff,$000f0000,$00030000,$000f0000
	DC.L	$00030001,$000f0000,$00030002,$001f0000
	DC.L	$00020003,$003e0000,$00010003,$003c0000
	DC.L	$00000003,$003c0000,$ffff0003,$003c0000
	DC.L	$fffe0003,$007c0000,$fffd0002,$00f80000
	DC.L	$fffd0001,$00f00000,$fffd0000,$00f00000
	DC.L	$fffdffff,$00f00000,$fffdfffe,$00f10000
	DC.L	$fffefffd,$00e30000,$fffffffd,$00c30000
	DC.L	$aaaaaaaa
LAB_097D:
	DC.L	$0000fffe
	DS.L	1
	DC.L	$0001fffe
	DS.L	1
	DC.L	$0002fffe
	DS.L	1
	DC.L	$0002ffff
	DS.L	1
	DC.L	$00020000
	DS.L	1
	DC.L	$00020001
	DS.L	1
	DC.L	$00020002
	DS.L	1
	DC.L	$00010002
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$ffff0002
	DS.L	1
	DC.L	$fffe0002
	DS.L	1
	DC.L	$fffe0001
	DS.L	1
	DC.L	$fffe0000
	DS.L	1
	DC.L	$fffeffff
	DS.L	1
	DC.L	$fffefffe
	DS.L	1
	DC.L	$fffffffe
	DS.L	1
	DC.L	$0000fffd
	DS.L	1
	DC.L	$0001fffd
	DS.L	1
	DC.L	$0002fffd
	DS.L	1
	DC.L	$0003fffe
	DS.L	1
	DC.L	$0003ffff
	DS.L	1
	DC.L	$00030000
	DS.L	1
	DC.L	$00030001
	DS.L	1
	DC.L	$00030002
	DS.L	1
	DC.L	$00020003
	DS.L	1
	DC.L	$00010003
	DS.L	1
	DC.L	$00000003
	DS.L	1
	DC.L	$ffff0003
	DS.L	1
	DC.L	$fffe0003
	DS.L	1
	DC.L	$fffd0002
	DS.L	1
	DC.L	$fffd0001
	DS.L	1
	DC.L	$fffd0000
	DS.L	1
	DC.L	$fffdffff
	DS.L	1
	DC.L	$fffdfffe
	DS.L	1
	DC.L	$fffefffd
	DS.L	1
	DC.L	$fffffffd
	DS.L	1
	DC.L	$0000fffc,$00c30000,$0001fffc,$00c30000
	DC.L	$0002fffc,$00c70000,$0003fffd,$00870000
	DC.L	$0004fffe,$008f0000,$0004ffff,$000f0000
	DC.L	$00040000,$000f0000,$00040001,$000f0000
	DC.L	$00040002,$001f0000,$00030003,$001e0000
	DC.L	$00020004,$003e0000,$00010004,$003c0000
	DC.L	$00000004,$003c0000,$ffff0004,$003c0000
	DC.L	$fffe0004,$007c0000,$fffd0003,$00780000
	DC.L	$fffc0002,$00f80000,$fffc0001,$00f00000
	DC.L	$fffc0000,$00f00000,$fffcffff,$00f00000
	DC.L	$fffcfffe,$00f10000,$fffdfffd,$00e10000
	DC.L	$fffefffc,$00e30000,$fffffffc,$00c30000
	DC.L	$aaaaaaaa
LAB_097E:
	DC.L	$0000fffe
	DS.L	1
	DC.L	$0001fffe
	DS.L	1
	DC.L	$0002fffe
	DS.L	1
	DC.L	$0002ffff
	DS.L	1
	DC.L	$00020000
	DS.L	1
	DC.L	$00020001
	DS.L	1
	DC.L	$00020002
	DS.L	1
	DC.L	$00010002
	DS.L	1
	DC.L	$00000002
	DS.L	1
	DC.L	$ffff0002
	DS.L	1
	DC.L	$fffe0002
	DS.L	1
	DC.L	$fffe0001
	DS.L	1
	DC.L	$fffe0000
	DS.L	1
	DC.L	$fffeffff
	DS.L	1
	DC.L	$fffefffe
	DS.L	1
	DC.L	$fffffffe
	DS.L	1
	DC.L	$0000fffd
	DS.L	1
	DC.L	$0001fffd
	DS.L	1
	DC.L	$0002fffd
	DS.L	1
	DC.L	$0003fffe
	DS.L	1
	DC.L	$0003ffff
	DS.L	1
	DC.L	$00030000
	DS.L	1
	DC.L	$00030001
	DS.L	1
	DC.L	$00030002
	DS.L	1
	DC.L	$00020003
	DS.L	1
	DC.L	$00010003
	DS.L	1
	DC.L	$00000003
	DS.L	1
	DC.L	$ffff0003
	DS.L	1
	DC.L	$fffe0003
	DS.L	1
	DC.L	$fffd0002
	DS.L	1
	DC.L	$fffd0001
	DS.L	1
	DC.L	$fffd0000
	DS.L	1
	DC.L	$fffdffff
	DS.L	1
	DC.L	$fffdfffe
	DS.L	1
	DC.L	$fffefffd
	DS.L	1
	DC.L	$fffffffd
	DS.L	1
	DC.L	$0000fffc
	DS.L	1
	DC.L	$0001fffc
	DS.L	1
	DC.L	$0002fffc
	DS.L	1
	DC.L	$0003fffd
	DS.L	1
	DC.L	$0004fffe
	DS.L	1
	DC.L	$0004ffff
	DS.L	1
	DC.L	$00040000
	DS.L	1
	DC.L	$00040001
	DS.L	1
	DC.L	$00040002
	DS.L	1
	DC.L	$00030003
	DS.L	1
	DC.L	$00020004
	DS.L	1
	DC.L	$00010004
	DS.L	1
	DC.L	$00000004
	DS.L	1
	DC.L	$ffff0004
	DS.L	1
	DC.L	$fffe0004
	DS.L	1
	DC.L	$fffd0003
	DS.L	1
	DC.L	$fffc0002
	DS.L	1
	DC.L	$fffc0001
	DS.L	1
	DC.L	$fffc0000
	DS.L	1
	DC.L	$fffcffff
	DS.L	1
	DC.L	$fffcfffe
	DS.L	1
	DC.L	$fffdfffd
	DS.L	1
	DC.L	$fffefffc
	DS.L	1
	DC.L	$fffffffc
	DS.L	1
	DC.L	$0000fffb,$00c30000,$0001fffb,$00c30000
	DC.L	$0002fffb,$00c70000,$0003fffc,$00870000
	DC.L	$0004fffd,$00870000,$0005fffe,$008f0000
	DC.L	$0005ffff,$000f0000,$00050000,$000f0000
	DC.L	$00050001,$000f0000,$00050002,$001f0000
	DC.L	$00040003,$001e0000,$00030004,$001e0000
	DC.L	$00020005,$003e0000,$00010005,$003c0000
	DC.L	$00000005,$003c0000,$ffff0005,$003c0000
	DC.L	$fffe0005,$007c0000,$fffd0004,$00780000
	DC.L	$fffc0003,$00780000,$fffb0002,$00f80000
	DC.L	$fffb0001,$00f00000,$fffb0000,$00f00000
	DC.L	$fffbffff,$00f00000,$fffbfffe,$00f10000
	DC.L	$fffcfffd,$00e10000,$fffdfffc,$00e10000
	DC.L	$fffefffb,$00e30000,$fffffffb,$00c30000
	DC.L	$aaaaaaaa
LAB_097F:
	DC.L	$0000ffff,$0001ffff,$00010000,$00010001
	DC.L	$00000001,$ffff0001,$ffff0000,$ffffffff
	DC.L	$0000fffe,$0001fffe,$0002fffe,$0002ffff
	DC.L	$00020000,$00020001,$00020002,$00010002
	DC.L	$00000002,$ffff0002,$fffe0002,$fffe0001
	DC.L	$fffe0000,$fffeffff,$fffefffe,$fffffffe
	DC.L	$0000fffd,$0001fffd,$0002fffd,$0003fffe
	DC.L	$0003ffff,$00030000,$00030001,$00030002
	DC.L	$00020003,$00010003,$00000003,$ffff0003
	DC.L	$fffe0003,$fffd0002,$fffd0001,$fffd0000
	DC.L	$fffdffff,$fffdfffe,$fffefffd,$fffffffd
	DC.L	$0000fffc,$0001fffc,$0002fffc,$0003fffd
	DC.L	$0004fffe,$0004ffff,$00040000,$00040001
	DC.L	$00040002,$00030003,$00020004,$00010004
	DC.L	$00000004,$ffff0004,$fffe0004,$fffd0003
	DC.L	$fffc0002,$fffc0001,$fffc0000,$fffcffff
	DC.L	$fffcfffe,$fffdfffd,$fffefffc,$fffffffc
	DC.L	$0000fffb,$0001fffb,$0002fffb,$0003fffc
	DC.L	$0004fffd,$0005fffe,$0005ffff,$00050000
	DC.L	$00050001,$00050002,$00040003,$00030004
	DC.L	$00020005,$00010005,$00000005,$ffff0005
	DC.L	$fffe0005,$fffd0004,$fffc0003,$fffb0002
	DC.L	$fffb0001,$fffb0000,$fffbffff,$fffbfffe
	DC.L	$fffcfffd,$fffdfffc,$fffefffb,$fffffffb
	DC.L	$fffafffa,$aaaaaaaa
LAB_0980:
	DC.L	$00030003,$00020003,$00010003,$00000003
	DC.L	$ffff0003,$fffe0003,$fffd0003,$00030002
	DC.L	$00020002,$00010002,$00000002,$ffff0002
	DC.L	$fffe0002,$fffd0002,$00030001,$00020001
	DC.L	$00010001,$00000001,$ffff0001,$fffe0001
	DC.L	$fffd0001,$00030000,$00020000,$00010000
	DS.L	1
	DC.L	$ffff0000,$fffe0000,$fffd0000,$0003ffff
	DC.L	$0002ffff,$0001ffff,$0000ffff,$ffffffff
	DC.L	$fffeffff,$fffdffff,$0003fffe,$0002fffe
	DC.L	$0001fffe,$0000fffe,$fffffffe,$fffefffe
	DC.L	$fffdfffe,$0003fffd,$0002fffd,$0001fffd
	DC.L	$0000fffd,$fffffffd,$fffefffd,$fffdfffd
	DC.L	$aaaaaaaa
LAB_0981:
	DC.L	$ffffffff,$0a01ff00,$0a01ff00,$0a01ff00
	DC.L	$0a01ff00,$0a01ff00,$0a01ff00,$0901ff00
	DC.L	$0900ff00,$0901ff00,$0900ff00,$0901ff00
	DC.L	$0900ff00,$0901ff00,$0900ff00,$0901ff00
	DC.L	$0900ff00,$09000000,$09000000,$09000000
	DC.L	$09000000,$09000010,$09000011,$09000012
	DC.L	$09000013,$09000014,$ffffffff
LAB_0982:
	DC.L	$ffffffff,$08000000,$08000000,$08000000
	DC.L	$0800ff00,$0800ff00,$0800ff00,$0800ff00
	DC.L	$0800ff00,$0800ff00,$0800ff00,$0800ff00
	DC.L	$0800ff00,$0800ff00,$0800ff00,$0800ff00
	DC.L	$0800ff00,$0800ff00,$0800ff00,$0800ff00
	DC.L	$07ffff00,$0700ff00,$06ffff00,$06ffff00
	DC.L	$05ff0000,$05ffff00,$05000000,$05000000
	DC.L	$05000000,$05000000,$05000015,$05000016
	DC.L	$05000017,$05000018,$05000019,$ffffffff
LAB_0983:
	DC.L	$ffffffff,$0c000000,$0c000000,$0c000000
	DC.L	$0c010000,$0c010000,$0c010000,$0c010000
	DC.L	$0b010000,$0b01ff00,$0b010000,$0b01ff00
	DC.L	$0b010000,$0b01ff00,$0b010000,$0b01ff00
	DC.L	$0a01ff00,$0a01ff00,$0a01ff00,$0a01ff00
	DC.L	$0a01ff00,$0a01ff00,$0a01ff00,$0a01ff00
	DC.L	$0901ff00,$0900ff00,$0901ff00,$0900ff00
	DC.L	$0901ff00,$0900ff00,$0901ff00,$0900ff00
	DC.L	$0901ff00,$0900ff00,$0901ff00,$0900ff00
	DC.L	$0901ff00,$0900ff00,$0901ff00,$0900ff00
	DC.L	$0901ff00,$0900ff00,$0901ff00,$0900ff00
	DC.L	$0901ff00,$0900ff00,$0901ff00,$0900ff00
	DC.L	$09000000,$ffffffff
LAB_0984:
	DC.L	$ffffffff,$04000000,$04ff0000,$04ff0000
	DC.L	$04ff0000,$04ff0000,$04ff0000,$04ff0000
	DC.L	$04ff0000,$04ff0000,$04ff0000,$04ff0000
	DC.L	$03ff0000,$03ff0100,$02ff0100,$02ff0100
	DC.L	$01ff0100,$01000100,$00000100,$00000100
	DS.L	2
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00
	DS.L	4
	DC.L	$00f0fe10,$00000010,$00000011,$00000011
	DC.L	$00000012,$00000012,$00000013,$00000013
	DC.L	$00000014,$00000014,$00000015,$00000015
	DC.L	$00000016,$00000016,$00000017,$00000017
	DC.L	$00000018,$00000018,$00000019,$00000019
	DC.L	$0000001a,$0000001a,$0000001b,$0000001b
	DC.L	$0000001c,$0000001c,$0000001d,$0000001d
	DC.L	$0000001e,$0000001e,$0000001f,$0000001f
	DC.L	$00000020,$00000020,$00000021,$00000021
	DC.L	$00000022,$00000022,$00000023,$00000023
	DC.L	$00000023,$00000023,$00000023,$00000023
	DC.L	$00000023,$00000023,$00000023,$ffffffff
	DC.L	$fefefefe,$ffffffff,$0e000000,$ffffffff
LAB_0985:
	DC.L	$ffffffff,$00000028,$00ff0128,$00ff0129
	DC.L	$00ff012a,$00ff012b,$00ff012c,$00ff012b
	DC.L	$00ff012a,$00ff0129,$00ff0128,$00ff0129
	DC.L	$00ff012a,$00ff012b,$00ff012c,$00ff012b
	DC.L	$00ff012a,$00ff0129,$00ff0128,$00ff0129
	DC.L	$00ff012a,$00ff012b,$00ff012c,$00ff012b
	DC.L	$00ff012a,$ffffffff
LAB_0986:
	DC.L	$ffffffff,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$0000ff00,$0000ff00,$0000ff00
	DC.L	$0000ff00,$ffffffff
LAB_0987:
	DC.L	$ffffffff,$0000ff01,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$0000ff00,$0000ff01,$0000ff02
	DC.L	$0000ff03,$0000ff04,$0000ff03,$0000ff02
	DC.L	$0000ff01,$ffffffff
LAB_0988:
	DS.L	1
	DC.L	$00010000,$0001ffff,$0001ffff,$0001ffff
	DC.L	$0002ffff,$0003ffff,$0004fffe,$0004ffff
	DC.L	$0005fffe,$0005ffff,$0006fffe,$0006ffff
	DC.L	$0007fffe,$0008fffe,$0009fffe
	DS.L	2
	DC.L	$00010000,$0001ffff,$0001ffff,$0001ffff
	DC.L	$0001ffff,$00020000,$0002ffff,$00020000
	DC.L	$0003ffff,$00030000,$0003ffff,$00040000
	DC.L	$00050000,$00060000
	DS.L	1
	DC.L	$00010000,$0001ffff,$0001ffff,$0001ffff
	DC.L	$0001ffff,$0001ffff,$0002fffe,$0003ffff
	DC.L	$00020000,$0002ffff,$00020000,$0003ffff
	DC.L	$00030000,$0004ffff,$00050000
	DS.L	1
	DC.L	$00010000,$00010000,$0001ffff,$0001ffff
	DC.L	$0001ffff,$0002ffff,$0001ffff,$0002ffff
	DC.L	$0002ffff,$0002fffe,$0002fffe,$0003fffd
	DC.L	$0003fffd,$0004fffc,$0005fffb
	DS.L	2
	DC.L	$00010000,$0001ffff,$0001ffff,$0001ffff
	DC.L	$0001ffff,$0002fffe,$0001ffff,$0002fffe
	DC.L	$0001ffff,$0002fffe,$0002ffff,$0002ffff
	DC.L	$0003ffff,$0004ffff
	DS.L	2
	DC.L	$00010000,$00010000,$0001ffff,$0001ffff
	DC.L	$0001ffff,$0002ffff,$0002ffff,$00030000
	DC.L	$00030000,$00040000,$00050000,$00050000
	DC.L	$00060000,$00070000
	DS.L	2
	DC.L	$00010000,$0001ffff,$0001ffff,$0001ffff
	DC.L	$0001fffe,$0002fffe,$0002ffff,$0002ffff
	DC.L	$0002ffff,$0002ffff,$0003ffff,$0003ffff
	DC.L	$0004ffff,$0005ffff
	DS.L	1
	DC.L	$00010000,$00010000,$00010000,$00010000
	DC.L	$00010000,$00020000,$0002ffff,$0003ffff
	DC.L	$0004ffff,$00050000,$0006ffff,$00070000
	DC.L	$00080000,$00090000,$000a0000
LAB_0989:
	DC.L	$08080809,$0a0b0405,$06070706,$05040302
	DC.L	$01000001,$02030405,$06070706,$05040302
	DC.L	$01000001,$02030405,$06070706,$05040302
	DC.L	$01000001,$02030405,$06070706,$05040302
	DC.L	$01000001,$02030405,$06070706,$05040302
	DC.L	$01000001,$02030404,$04040b0b,$0b0b0a0a
	DC.L	$09090808
LAB_098A:
	DC.L	$070605ff,$00ff04ff,$010203ff
	DS.L	1
LAB_098B:
	DC.L	$ffffff0a,$0008ffff,$ffffffff,$030605ff
	DC.L	$ffffffff,$ff0b0409,$0affffff,$ffff0702
	DC.L	$0003ffff,$ffffff01,$08060bff,$ffffffff
	DC.L	$ff050407,$ffffffff,$ffff0902,$01ffffff
LAB_098C:
	DC.L	$fd060000
	DS.L	3
	DC.L	$02070008
	DS.L	3
	DC.L	$080bfc0d
	DS.L	3
	DC.L	$0000fb12,$00080000
	DS.L	3
	DC.L	$fa040000
	DS.L	3
	DC.L	$f9080000
	DS.L	3
	DC.L	$f610f8fa,$08020000
	DS.L	3
	DC.L	$05030000
	DS.L	3
	DC.L	$fd030000
	DS.L	3
	DC.L	$00000701
	DS.L	3
	DC.L	$000008fb,$0a0d0000
	DS.L	3
	DC.L	$060a0000
	DS.L	3
	DC.L	$06040000
	DS.L	3
	DC.L	$00000313
	DS.L	3
	DC.L	$0000030d
	DS.L	3
	DC.L	$00000708
LAB_098D:
	DC.L	$00400001,$00550004,$006a000c,$00790019
	DC.L	$00800028,$00790037,$006a0044,$0055004c
	DC.L	$00400050,$002b004c,$00160044,$00070037
	DC.L	$00010028,$00070019,$0016000c,$002b0004
	DS.L	1
LAB_098E:
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DS.L	8
	DC.L	$00010203,$04050403,$02010001,$02030405
	DC.L	$05040302,$01000102,$03040504,$03020100
	DS.L	4
	DC.L	$05050505,$05050505,$05050505,$05050505
	DC.L	$00010203,$00010203,$00010203,$00010203
	DC.L	$00010203,$00010203,$00010203,$00010203
	DC.L	$00010203,$04050607,$00010203,$04050607
	DC.L	$00010203,$04050607,$00010203,$04050607
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$08080909,$0a0a0b0b,$0c0c0d0d,$0e0e0f0f
	DS.L	16
	DC.L	$00010203,$04050403,$02010001,$02030405
	DC.L	$05040302,$01000102,$03040504,$03020100
	DS.L	8
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050607,$07070707,$07070707
	DC.L	$07070707,$07070707,$07060504,$03020100
	DS.L	40
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00010203,$00010203,$00010203,$00010203
	DC.L	$00010203,$00010203,$00010203,$00010203
	DS.L	8
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050403,$02010001,$02030405
	DC.L	$05040302,$01000102,$03040504,$03020100
	DS.L	56
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DS.L	8
	DC.L	$00010203,$04050403,$02010001,$02030405
	DC.L	$05040302,$01000102,$03040504,$03020100
	DS.L	4
	DC.L	$05050505,$05050505,$05050505,$05050505
	DC.L	$00010203,$00010203,$00010203,$00010203
	DC.L	$00010203,$00010203,$00010203,$00010203
	DC.L	$00010203,$04050607,$00010203,$04050607
	DC.L	$00010203,$04050607,$00010203,$04050607
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$08080909,$0a0a0b0b,$0c0c0d0d,$0e0e0f0f
	DS.L	16
	DC.L	$00010203,$04050403,$02010001,$02030405
	DC.L	$05040302,$01000102,$03040504,$03020100
	DS.L	8
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050607,$07070707,$07070707
	DC.L	$07070707,$07070707,$07060504,$03020100
	DS.L	40
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00000101,$02020303,$04040505,$06060707
	DC.L	$00010203,$00010203,$00010203,$00010203
	DC.L	$00010203,$00010203,$00010203,$00010203
	DS.L	8
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$00010203,$04050403,$02010001,$02030405
	DC.L	$05040302,$01000102,$03040504,$03020100
	DS.L	56
LAB_098F:
	DC.L	$1a1a1b1b,$1c1c1d1d,$1d1d1c1c,$1b1b1a1a
LAB_0990:
	DC.L	$02030403,$02010001
LAB_0991:
	DC.L	$02050605,$06050605,$06050605,$06050602
	DC.L	$04050506,$06070705,$05050505,$05050505
	DC.L	$04050506,$06070705,$05050505,$05050505
	DS.L	4
	DC.L	$02050605,$06050605,$06050602,$02020202
	DC.L	$02050605,$06050605,$06050602,$02020202
	DC.L	$02070705,$05060607,$07020202,$02020202
	DC.L	$02070707,$06050505,$05060702,$02020202
	DS.L	8
LAB_0992:
	DC.L	$0010243c,$00000020,$00400060
LAB_0993:
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$0f0f0f0f,$0f0f0f0f,$0f0f0f0f,$0f0fff00
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$13131313,$13131313,$1313ff04
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$14151617,$17171717,$1717ff08
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$14151617,$18191a1b,$1c1dff8c
LAB_0994:
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$0f0f0f0f,$0f0f0f0f,$0f0f0f0f,$0f0fff14
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$13131313,$13131313,$1313ff18
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$14151617,$17171717,$1717ff1c
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$14151617,$18191a1b,$1c1dffa0
LAB_0995:
	DC.L	$60606162,$63646566,$6768696a,$6b6c6d6e
	DC.L	$10111213,$14151617,$18191a1b,$1c1d1e1f
	DC.L	$20212223,$24252627,$28292a2b,$2c2d2e2f
	DC.L	$30313233,$34353637,$38393a3b,$3c3d3e3f
	DC.L	$40414243,$44454647,$48494a4b,$4c4d4e4f
	DC.L	$50515253,$54555657,$58595a5b,$5c5d5e5f
	DC.L	$60616263,$64656667,$68696a6b,$6c6d6e6f
	DC.L	$70717273,$74757677,$78797a7b,$7c7d7e7f
	DC.L	$e0e0e1e2,$e3e4e5e6,$e7e8e9ea,$ebecedee
	DC.L	$90919293,$94959697,$98999a9b,$9c9d9e9f
	DC.L	$a0a1a2a3,$a4a5a6a7,$a8a9aaab,$acadaeaf
	DC.L	$b0b1b2b3,$b4b5b6b7,$b8b9babb,$bcbdbebf
	DC.L	$c0c1c2c3,$c4c5c6c7,$c8c9cacb,$cccdcecf
	DC.L	$d0d1d2d3,$d4d5d6d7,$d8d9dadb,$dcdddedf
	DC.L	$e0e1e2e3,$e4e5e6e7,$e8e9eaeb,$ecedeeef
	DC.L	$f0f1f2f3,$f4f5f6f7,$f8f9fafb,$fcfdfeff
LAB_0996:
	DC.L	$00010203,$04050607,$08090a0b,$0c0d0e0f
	DC.L	$10111213,$14151617,$18191a1b,$1c1d1e1f
	DC.L	$20212223,$24252627,$28292a2b,$2c2d2e2f
	DC.L	$30313233,$34353637,$38393a3b,$3c3d3e3f
	DC.L	$40414243,$44454647,$48494a4b,$4c4d4e4f
	DC.L	$50515253,$54555657,$58595a5b,$5c5d5e5f
	DC.L	$60616263,$64656667,$68696a6b,$6c6d6e6f
	DC.L	$70717273,$74757677,$78797a7b,$7c7d7e7f
	DC.L	$80818283,$84858687,$88898a8b,$8c8d8e8f
	DC.L	$90919293,$94959697,$98999a9b,$9c9d9e9f
	DC.L	$a0a1a2a3,$a4a5a6a7,$a8a9aaab,$acadaeaf
	DC.L	$b0b1b2b3,$b4b5b6b7,$b8b9babb,$bcbdbebf
	DC.L	$c0c1c2c3,$c4c5c6c7,$c8c9cacb,$cccdcecf
	DC.L	$d0d1d2d3,$d4d5d6d7,$d8d9dadb,$dcdddedf
	DC.L	$e0e1e2e3,$e4e5e6e7,$e8e9eaeb,$ecedeeef
	DC.L	$f0f1f2f3,$f4f5f6f7,$f8f9fafb,$fcfdfeff
LAB_0997:
	DC.L	$40414243,$44454647,$48494a4b,$4c4d4e4f
	DC.L	$10111213,$14151617,$18191a1b,$1c1d1e1f
	DC.L	$20212223,$24252627,$28292a2b,$2c2d2e2f
	DC.L	$30313233,$34353637,$38393a3b,$3c3d3e3f
	DC.L	$40414243,$44454647,$48494a4b,$4c4d4e4f
	DC.L	$50515253,$54555657,$58595a5b,$5c5d5e5f
	DC.L	$60616263,$64656667,$68696a6b,$6c6d6e6f
	DC.L	$70717273,$74757677,$78797a7b,$7c7d7e7f
	DC.L	$c0c1c2c3,$c4c5c6c7,$c8c9cacb,$cccdcecf
	DC.L	$90919293,$94959697,$98999a9b,$9c9d9e9f
	DC.L	$a0a1a2a3,$a4a5a6a7,$a8a9aaab,$acadaeaf
	DC.L	$b0b1b2b3,$b4b5b6b7,$b8b9babb,$bcbdbebf
	DC.L	$c0c1c2c3,$c4c5c6c7,$c8c9cacb,$cccdcecf
	DC.L	$d0d1d2d3,$d4d5d6d7,$d8d9dadb,$dcdddedf
	DC.L	$e0e1e2e3,$e4e5e6e7,$e8e9eaeb,$ecedeeef
	DC.L	$f0f1f2f3,$f4f5f6f7,$f8f9fafb,$fcfdfeff
LAB_0998:
	DC.L	$0000ffd0,$0005ffd0,$000affd1,$000fffd2
	DC.L	$0013ffd4,$0017ffd6,$001bffd8,$001fffdb
	DC.L	$0022ffde,$0025ffe1,$0028ffe5,$002affe9
	DC.L	$002cffed,$002efff1,$002ffff6,$0030fffb
	DC.L	$00300000,$00300005,$002f000a,$002e000f
	DC.L	$002c0013,$002a0017,$0028001b,$0025001f
	DC.L	$00220022,$001f0025,$001b0028,$0017002a
	DC.L	$0013002c,$000f002e,$000a002f,$00050030
	DC.L	$00000030,$fffb0030,$fff6002f,$fff1002e
	DC.L	$ffed002c,$ffe9002a,$ffe50028,$ffe10025
	DC.L	$ffde0022,$ffdb001f,$ffd8001b,$ffd60017
	DC.L	$ffd40013,$ffd2000f,$ffd1000a,$ffd00005
	DC.L	$ffd00000,$ffd0fffb,$ffd1fff6,$ffd2fff1
	DC.L	$ffd4ffed,$ffd6ffe9,$ffd8ffe5,$ffdbffe1
	DC.L	$ffdeffde,$ffe1ffdb,$ffe5ffd8,$ffe9ffd6
	DC.L	$ffedffd4,$fff1ffd2,$fff6ffd1,$fffbffd0

alloc_mem:
	MOVEM.L	D0-D7/A1-A5,-(A7)	;D0 = 0x10
	BSR.W	alloc_and_free_mem	;D1 = 0x234e554c
	BSR.W	avail_mem
	MOVE.L	D0,D6				;D6 = 0x10
	MOVE.L	D1,D0				;D0 = 0x234e554c
	MOVE.L	D1,D5				;D5 = 0x234e554c

	BSR.W	do_mem_table
	TST.L	D0
	BEQ.S	LAB_099C

	ADDI.L	#$00000010,D6		;D6 = 0x20
	CMP.L	D6,D0
	BEQ.S	LAB_099A

	MOVE.L	D5,D1
	JSR	free_mem
	BRA.S	LAB_099C
LAB_099A:
	MOVEA.L	A1,A0
	SUBI.L	#$00000010,D6
LAB_099B:
	CLR.B	(A1)+
	SUBI.L	#$00000001,D6
	BNE.S	LAB_099B
	MOVEM.L	(A7)+,D0-D7/A1-A5
	BRA.W	LAB_09A7
LAB_099C:
	MOVEM.L	(A7)+,D0-D7/A1-A5
	MOVEM.L	D1-D7/A1-A6,-(A7)
	TST.L	mem_table_addr
	BNE.S	LAB_099D
	MOVE.L	#mem_table,mem_table_addr
LAB_099D:
	MOVE.L	D1,D7
	MOVE.L	#$00010002,D1
	CMPI.B	#$21,D7
	BNE.S	LAB_099E

	MOVE.L	#$00010004,D1		;MEMF_CLEAR|MEMF_FAST
LAB_099E:
	MOVEA.L	ABSEXECBASE.W,A6
	ADDI.L	#$00000010,D0
	ADD.L	D0,reserved_mem_size
LAB_099F:
	MOVEM.L	D0-D1,-(A7)
	JSR	_LVOAllocMem(A6)
	TST.L	D0
	BNE.S	LAB_09A0

	CMPI.L	#$534e3321,D7
	BEQ.W	LAB_09A9
	JSR	LAB_09C4
	MOVE.L	D0,D2
	MOVEM.L	(A7)+,D0-D1
	TST.L	D2
	BMI.W	LAB_09A8
	BRA.S	LAB_099F

LAB_09A0:
	MOVEA.L	D0,A0
	MOVEM.L	(A7)+,D0-D1
	MOVEA.L	mem_table_addr,A2
	LEA	mem_table,A3
LAB_09A1:
	CMPA.L	A2,A3
	BGE.S	LAB_09A3
	CMPI.L	#$4e4f4e45,4(A3)
	BEQ.S	LAB_09A2
	LEA	16(A3),A3
	BRA.S	LAB_09A1
LAB_09A2:
	MOVEA.L	A3,A2
	MOVE.L	D0,(A2)+
	MOVE.L	D7,(A2)+
	MOVE.L	A0,(A2)+
	CLR.L	(A2)+
	BRA.S	LAB_09A4
LAB_09A3:
	MOVE.L	D0,(A2)+
	MOVE.L	D7,(A2)+
	MOVE.L	A0,(A2)+
	CLR.L	(A2)+
	MOVE.L	A2,mem_table_addr
LAB_09A4:
	MOVEA.L	A0,A1
LAB_09A5:
	MOVE.L	A1,D1
	ANDI.L	#$0000000f,D1
	BEQ.S	LAB_09A6
	ADDQ.W	#1,A1
	BRA.S	LAB_09A5
LAB_09A6:
	MOVEA.L	A1,A0
	MOVE.L	A0,-4(A2)
	MOVEM.L	(A7)+,D1-D7/A1-A6
LAB_09A7:
	RTS



LAB_09A8:
	MOVEM.L	(A7)+,D1-D7/A1-A6
	MOVEQ	#-2,D0
	JMP	exit_fail

	DC.L	$4cdf3eff,$70fb4ef9
	DC.L	exit_fail

LAB_09A9:
	MOVEM.L	(A7)+,D0-D1
	MOVEM.L	(A7)+,D1-D7/A1-A6
	SUBA.L	A0,A0
	MOVEQ	#-2,D0
	RTS

free_mem:						;FREEMEM: tag is in D1
								;		  find tag, free the mem associated with it and set to 'NONE'
	LEA	mem_table(PC),A2
LAB_09AB:
	MOVEM.L	(A2)+,D0/D2/A0-A1
	CMPI.L	#$2a2a2a2a,D0		;'****'
	BEQ.S	LAB_09AD
	TST.L	D1
	BEQ.S	LAB_09AC
	CMP.L	D1,D2
	BNE.S	LAB_09AB
LAB_09AC:
	TST.L	D0
	BEQ.S	LAB_09AD			;if(D0 == 0) end
	CMPI.L	#$4e4f4e45,D2
	BEQ.S	LAB_09AB			;if(D2 == 'NONE') continue
	SUB.L	D0,reserved_mem_size
	MOVEA.L	A0,A1
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEM.L	D0-D1,-(A7)
	JSR	_LVOFreeMem(A6)
	MOVEM.L	(A7)+,D0-D1
	MOVE.L	#$4e4f4e45,-12(A2)	;set to 'NONE'
	TST.L	D1
	BEQ.S	LAB_09AB
LAB_09AD:
	BSR.W	avail_mem
	RTS


do_mem_table:
	LEA	mem_table(PC),A2
	MOVE.L	D0,D7
LAB_09AF:
	MOVEM.L	(A2)+,D0/D2/A0-A1
	TST.L	D0
	BEQ.S	LAB_09B0
	CMP.L	D7,D2
	BNE.S	LAB_09AF
LAB_09B0:
	RTS

available_mem:
	DS.L	1
reserved_mem_size:
	DS.L	1
mem_table_addr:
	DS.L	1
mem_table:
	DS.L	2052
	DC.L	$2a2a2a2a
	DS.L	3

_LVOAllocMem		EQU -198
_LVOFreeMem			EQU -210
_LVOAvailMem		EQU -216

alloc_and_free_mem:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVE.L	#$007fffff,D0
	MOVEQ	#1,D1				;MEMF_PUBLIC
	JSR	_LVOAllocMem(A6)
	MOVE.L	D0,D7
	TST.L	D7
	BEQ.S	LAB_09B6

	MOVEA.L	D7,A0
	MOVEA.L	A0,A1
	MOVE.L	#$007fffff,D0
	JSR	_LVOFreeMem(A6)
LAB_09B6:
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS

avail_mem:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEQ	#2,D1				;MEMF_CHIP
	JSR	_LVOAvailMem(A6)
	MOVE.L	D0,available_mem
	MOVEM.L	(A7)+,D0-D7/A0-A6
	RTS

	DC.L	$45fadf96,$4cda0305,$e19a0c02,$002367f4
	DC.L	$e09a4a80,$672a0c82,$4e4f4e45,$67e691b9
	DC.L	reserved_mem_size
	DC.L	$22482c78,$000448e7,$c0004eae,$ff2e4cdf
	DC.L	$0003257c,$4e4f4e45,$fff460c4,$6100ffa4
	DC.W	$4e75

_LVOCreateMsgPort		EQU -666
_LVOCreateIORequest		EQU -654
_LVOOpenDevice			EQU -444
_LVOCloseDevice			EQU -450
_LVODeleteIORequest		EQU -660
_LVODeleteMsgPort		EQU -672

open_device:
	MOVEM.L	D0/A0,-(A7)
	MOVEA.L	ABSEXECBASE.W,A6
	JSR	_LVOCreateMsgPort(A6)
	MOVE.L	D0,D7
	BEQ.S	LAB_09B9

	MOVEA.L	D0,A0
	MOVEQ	#80,D0
	JSR	_LVOCreateIORequest(A6)
	MOVE.L	D0,D6
	BEQ.S	LAB_09B9

	MOVEM.L	(A7)+,D0/A0
	MOVEA.L	D6,A1
	MOVEQ	#0,D1
	JSR	_LVOOpenDevice(A6)
	RTS
LAB_09B9:
	MOVEQ	#0,D6
	MOVEQ	#0,D7
	MOVEQ	#-1,D0
	RTS

close_device:
	MOVEA.L	ABSEXECBASE.W,A6
	TST.L	D0
	BNE.S	LAB_09BB
	TST.L	D6
	BEQ.S	LAB_09BB
	MOVEA.L	D6,A1
	JSR	_LVOCloseDevice(A6)
LAB_09BB:
	TST.L	D6
	BEQ.S	LAB_09BC
	MOVEA.L	D6,A0
	JSR	_LVODeleteIORequest(A6)
LAB_09BC:
	TST.L	D7
	BEQ.S	LAB_09BD
	MOVEA.L	D7,A0
	JSR	_LVODeleteMsgPort(A6)
LAB_09BD:
	RTS

; =====================================

_LVODisable		EQU -120
_LVOEnable		EQU -126

_LVOForbid		EQU -132
_LVOPermit		EQU -138

_LVOFindTask	EQU -294
_LVOAllocVec	EQU -684

_LVOCacheClearU EQU -636

; Increases the ramlib stack, not needed for os4

doramlib:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	ABSEXECBASE.W,A6

	JSR	_LVOForbid(A6)

	LEA	ramlib_name,A1
	JSR	_LVOFindTask(A6)
	TST.L	D0
	BEQ.S	ramlib_done

	MOVEA.L	D0,A2
	MOVE.L	62(A2),D2
	MOVE.L	58(A2),D3
	MOVE.L	D2,D0
	SUB.L	D3,D0
	CMPI.L	#$00000800,D0
	BNE.S	ramlib_done

	MOVE.L	#$00004000,D0
	MOVEQ	#1,D1
	JSR	_LVOAllocVec(A6)
	TST.L	D0
	BEQ.S	ramlib_done

	MOVEA.L	D0,A3

	JSR	_LVODisable(A6)

	MOVEA.L	A3,A1
	MOVE.L	A1,58(A2)
	LEA	16384(A1),A1
	MOVE.L	A1,62(A2)
	MOVE.L	A1,D1
	SUB.L	54(A2),D2
	SUBA.L	D2,A1
	MOVE.L	A1,54(A2)
	MOVEA.L	D3,A0
	MOVEA.L	D1,A1
	LEA	-2048(A1),A1
	MOVE.L	#$000001ff,D0
LAB_09BF:
	MOVE.L	(A0)+,(A1)+
	DBF	D0,LAB_09BF

	MOVE.L	#$00004000,132(A2)
	MOVE.L	A3,D0
	LSR.L	#2,D0
	MOVE.L	D0,144(A2)
	SUBQ.L	#4,D1
	MOVE.L	D1,176(A2)

	JSR	_LVOCacheClearU(A6)

	JSR	_LVOEnable(A6)

ramlib_done:
	JSR _LVOPermit(A6)

	MOVEM.L	(A7)+,D0-D7/A0-A6
	MOVEQ	#0,D0
	RTS

ramlib_name:
	DC.B	"ramlib",0,0

; ==========================================


do_intuition_window1:
	MOVEM.L	D1-D7/A0-A6,-(A7)
	JSR	do_intuition_window
	MOVEM.L	(A7)+,D1-D7/A0-A6
	RTS

done_intuition_window:
	MOVEM.L	D1-D7/A0-A6,-(A7)
	JSR	close_intuition_window2
	MOVEM.L	(A7)+,D1-D7/A0-A6
	RTS

_LVOWBenchToFront		EQU -342
_LVOWBenchToBack		EQU -336

_LVOWaitPort			EQU -384

_LVOGT_GetIMsg			EQU -72
_LVOGT_ReplyIMsg		EQU -78
_LVOGT_BeginRefresh		EQU -90
_LVOGT_EndRefresh		EQU -96

LAB_09C4:
	MOVEM.L	D1-D7/A0-A6,-(A7)
	JSR	LAB_0A26
	TST.L	D0
	BNE.W	LAB_09C8
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	IntuiBase,A6
	JSR	_LVOWBenchToFront(A6)
	MOVEM.L	(A7)+,D0-D7/A0-A6
LAB_09C5:
	MOVEA.L	window_ptr2,A1
	MOVEA.L	86(A1),A2
	MOVEA.L	A2,A0
	MOVEA.L	ABSEXECBASE.W,A6
	JSR	_LVOWaitPort(A6)
LAB_09C6:
	MOVEA.L	window_ptr2,A1
	MOVEA.L	86(A1),A2
	MOVEA.L	A2,A0
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGT_GetIMsg(A6)
	TST.L	D0
	BEQ.W	LAB_09C5
	MOVEA.L	D0,A1
	MOVE.L	20(A1),D2
	MOVE.W	24(A1),D3
	MOVEA.L	28(A1),A4
	MOVE.L	20(A1),D4
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGT_ReplyIMsg(A6)
	CMPI.L	#$00000200,D4
	BEQ.W	LAB_09C7
	MOVE.L	D2,D0
	MOVE.W	D3,D1
	MOVEA.L	A4,A0
	JSR	LAB_09CA
	TST.L	LAB_09C9
	BNE.S	LAB_09C7
	JMP	LAB_09C6
LAB_09C7:
	MOVE.L	window_ptr2,D0
	TST.L	D0
	BEQ.W	LAB_09C8
	JSR	LAB_0A3B
	MOVEM.L	D0-D7/A0-A6,-(A7)
	MOVEA.L	IntuiBase,A6
	JSR	_LVOWBenchToBack(A6)
	MOVEM.L	(A7)+,D0-D7/A0-A6
LAB_09C8:
	MOVEM.L	(A7)+,D1-D7/A0-A6
	MOVE.L	LAB_09C9,D0
	RTS
LAB_09C9:
	DS.L	1
LAB_09CA:
	MOVEM.L	D1-D4/A0-A6,-(A7)
	CMPI.L	#$00000040,D0
	BNE.W	LAB_09CD
	MOVE.W	38(A0),D0
	CMPI.W	#$0000,D0
	BNE.W	LAB_09CB
	MOVE.L	#$00000001,LAB_09C9
	JMP	LAB_09CF
LAB_09CB:
	CMPI.W	#$0001,D0
	BNE.W	LAB_09CC
	MOVE.L	#$ffffffff,LAB_09C9
	JMP	LAB_09CF
LAB_09CC:
	JMP	LAB_09CF
LAB_09CD:
	CMPI.L	#$00000200,D0
	BNE.W	LAB_09CE
	JMP	LAB_09CF
LAB_09CE:
	CMPI.L	#$00000004,D0
	BNE.W	LAB_09CF
	MOVEA.L	window_ptr2,A0
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGT_BeginRefresh(A6)
	MOVE.L	#$00000001,D0
	MOVEA.L	window_ptr2,A0
	JSR	_LVOGT_EndRefresh(A6)
	JMP	LAB_09CF
LAB_09CF:
	MOVEM.L	(A7)+,D1-D4/A0-A6
	RTS



bevel_tags:
	DC.L	$80080033,$00000001,$80080034
LAB_09D1:
	DS.L	2
window_ptr:
	DS.L	1
visualinfo:
	DS.L	1
screen_draw_info:
	DS.L	1
screen_title:
	DC.B	"NAPALM: The Crimson Crisis",0
window_title:
	DC.B	"Napalm StartUp...",0
	DC.B	"r"


newgadget_struct:
newgadget_leftedge
	DS.W	1			;LeftEdge
newgadget_topedge:
	DS.W	1			;TopEdge
	DS.W	2			;Width, Height
	DS.L	2			;GadgetText, TextAttr
	DS.W	1			;GadgetID
	DS.L	1			;Flags
newgadget_visualinfo:
	DS.L	1			;VisualInfo
	DS.L 	1			;UserData

gadget_text:
	DC.B	"    ALLOCATING HARDWARE RESOURCES...    ",0
	DC.B	"."

gadget_taglist:
	DC.L	GTTX_Text,		gadget_text
	DC.L	GTTX_Border,	1
	DC.L	GTTX_FrontPen,	2
	DC.L	GTTX_BackPen,	0
	DC.L	GTTX_Justification,2
	DC.L	0


LAB_09DC:
	DC.W	$000d

newgadget_save:
	DC.W	7, 5			;LeftEdge, TopEdge
	DC.W	336, 12			;Width, Height
	DC.L	gadget_label	;GadgetText
	DC.L	gadget_font		;TextAttr
	DC.W	0				;GadgetID
	DC.L	PLACETEXT_LEFT	;Flags
	DS.L	2				;VisualInfo, UserData

gadget_label:
	DS.W	1

LAB_09DF:
	DS.L	1

class_pointer:
	DS.L	1
LAB_09E1:
	DS.L	4
LAB_09E2:
	DS.B	1

intui_borderleft:
	DS.B	1
intui_bordertop_ish:
	DS.W	1


window_taglist:						;=== tags for OpenWindowTags()
	DC.L	WA_Left,		$000000a0
	DC.L	WA_Top,			$00000064

	DC.L	WA_Width
LAB_09E6:
	DC.L	$00000164
	DC.L	WA_Height
LAB_09E7:
	DC.L	$00000023

	DC.L	WA_Title,		window_title
	DC.L	WA_ScreenTitle,	screen_title
	DC.L	WA_MinWidth,	$00000168
	DC.L	WA_MinHeight,	$0000002a
	DC.L	WA_MaxWidth,	$00000168
	DC.L	WA_MaxHeight,	$0000002a
	DC.L	WA_DragBar,		$00000001
	DC.L	WA_Activate,	$00000001
	DC.L	WA_NewLookMenus,$00000001
	DC.L	WA_SmartRefresh,$00000001
	DC.L	WA_AutoAdjust,	$00000001
	DC.L	WA_Gadgets
gadgetlist:
	DC.L	0
	DC.L	WA_PubScreen
pubscreen_save:
	DC.L	0

	DC.L	WA_IDCMP,$00000244
	DC.L	0						;=== TAG_DONE



window_ptr2:
	DS.L	1
LAB_09EB:
	DS.L	1
LAB_09EC:
	DS.L	1
LAB_09ED:
	DC.B	"NAPALM: THE CRIMSON CRISIS",0
LAB_09EE:
	DC.B	"CRITICAL ERROR",0
LAB_09EF:
	DS.W	1
LAB_09F0:
	DS.L	5
LAB_09F1:
	DS.L	2
LAB_09F2:
	DC.L	$bbbbbbbb,$bbbbbbbb,$20212057,$41524e49
	DC.L	$4e472021,$20ababab,$abababab
	DC.W	$ab00
LAB_09F3:
	DC.B	"UNABLE TO ALLOCATE ENOUGH MEMORY!",0
gadget_tags2:
	DS.L	2
	DC.L	$8008000b
	DC.L	LAB_09F2
	DC.L	$80080048,$00000002,$80080039,$00000001
	DC.L	$8008004a,$00000002
	DS.L	1
	DC.L	$8008000b
	DC.L	LAB_09F3
	DC.L	$80080039,$00000001,$8008004a,$00000002
	DS.L	1
LAB_09F5:
	DC.L	$00010001,$000d000d
LAB_09F6:
	DC.L	$0001001d,$0098000b
	DC.L	LAB_09F7
	DC.L	gadget_font
	DS.L	1
	DC.L	$00100000
	DS.L	1
	DC.L	$0000009e,$001d0098
	DC.W	$000b
	DC.L	LAB_09F8
	DC.L	gadget_font
	DC.L	$00010000,$00100000
	DS.L	1
	DC.L	$00000003,$00020131
	DC.W	$000c
	DC.L	LAB_09F9
	DC.L	gadget_font
	DC.L	$00020000,$00010000
	DS.L	1
	DC.L	$00000001,$00100135
	DC.W	$000c
	DC.L	LAB_09FA
	DC.L	gadget_font
	DC.L	$00030000,$00010000
	DS.L	1
	DS.W	1
LAB_09F7:
	DC.B	"RETRY",0
LAB_09F8:
	DC.B	"ABORT",0
LAB_09F9:
	DS.W	1
LAB_09FA:
	DS.W	1
LAB_09FB:
	DS.L	4
LAB_09FC:
	DS.L	1
LAB_09FD:
	DS.L	4
LAB_09FE:
	DS.B	1
LAB_09FF:
	DS.B	1
LAB_0A00:
	DS.W	1
LAB_0A01:
	DC.L	$80000064,$000000a3,$80000065,$00000048
	DC.L	$80000066
LAB_0A02:
	DC.L	$0000013c,$80000067
LAB_0A03:
	DC.L	$0000002b,$8000006e
	DC.L	LAB_09EE
	DC.L	$8000006f
	DC.L	LAB_09ED
	DC.L	$80000072,$00000096,$80000073,$00000019
	DC.L	$80000074,$000004b0,$80000075,$000004b0
	DC.L	$80000082,$00000001,$80000083,$00000001
	DC.L	$80000084,$00000001,$80000089,$00000001
	DC.L	$80000093,$00000001,$8000008d,$00000001
	DC.L	$80000090,$00000001,$8000006c
LAB_0A04:
	DS.L	1
	DC.L	$80000079
workbench_ptr:
	DS.L	1
	DC.L	$8000006a,$00000244
	DS.L	1

gadget_font:
	DC.L	LAB_0A07
	DC.L	$00080000
LAB_0A07:
	DC.B	"topaz.font",0
	DC.B	"a"


_LVODrawBevelBoxA 		EQU -120

draw_bevel:
	MOVEM.L	D0-D4/A0-A4/A6,-(A7)
	MOVEA.L	IntuiBase,A6
	MOVE.L	window_ptr,D0
	TST.L	D0
	BEQ.W	LAB_0A09
	MOVEA.L	window_ptr,A0
	MOVEA.L	50(A0),A4				;RPort
	MOVE.L	visualinfo,LAB_09D1
	MOVEA.L	GadtoolsBase,A6
	MOVE.L	#$00000016,D0
	MOVE.L	D0,D3
	MOVE.L	#$0000015f,D0
	MOVE.L	D0,D2
	MOVE.L	#$00000000,D0
	ADD.W	intui_bordertop_ish,D0
	MOVE.L	D0,D1
	MOVE.L	#$00000001,D0
	ADD.W	LAB_09E2,D0
	MOVEA.L	A4,A0
	MOVE.L	A0,rastport
	LEA	bevel_tags,A1
	ADDA.L	#$00000008,A1
	JSR	_LVODrawBevelBoxA(A6)
LAB_0A09:
	MOVEM.L	(A7)+,D0-D4/A0-A4/A6
	RTS


; =====================================================
_LVOCopyMem				EQU -624

_LVOCloseWindow			EQU -72
_LVOWindowToFront		EQU -312
_LVORefreshGList		EQU -432
_LVOActivateWindow		EQU -450
_LVOLockPubScreen		EQU -510
_LVOUnlockPubScreen		EQU -516
_LVOOpenWindowTagList	EQU -606
_LVONewObjectA			EQU -636
_LVOGetScreenDrawInfo	EQU -690
_LVOFreeScreenDrawInfo	EQU -696

_LVOCreateGadgetA		EQU -30
_LVOFreeGadgets			EQU -36
_LVOGT_RefreshWindow	EQU -84
_LVOCreateContext		EQU -114
_LVOGetVisualInfoA		EQU -126
_LVOFreeVisualInfo		EQU -132


do_intuition_window:
	MOVEM.L	D1-D4/A0-A6,-(A7)

	MOVE.L	window_ptr,D0
	TST.L	D0
	BNE.W	close_intuition_window

	MOVEA.L	#$00000000,A0		;pubscreen = LockPubScreen(NULL) (Workbench)
	MOVEA.L	IntuiBase,A6
	JSR	_LVOLockPubScreen(A6)
	MOVE.L	D0,pubscreen_save
	BEQ.W	LAB_0A1D

	MOVE.L	#$00000164,LAB_09E6
	MOVE.L	#$0000001f,LAB_09E7
	MOVEA.L	pubscreen_save,A0
	MOVE.B	36(A0),intui_borderleft		;sc_WBorLeft
	MOVEA.L	40(A0),A1					;sc_Font
	MOVE.W	4(A1),D1					;??? YSize ?
	ADDQ.W	#1,D1
	MOVE.B	35(A0),D0					;sc_WBorTop
	EXT.W	D0
	ADD.W	D1,D0
	MOVE.W	D0,intui_bordertop_ish

	MOVE.L	LAB_09E7,D1
	ADD.W	D0,D1
	MOVE.L	D1,LAB_09E7

	MOVE.W	LAB_09E2,D0
	MOVE.L	LAB_09E6,D1
	ADD.W	D0,D1
	MOVE.L	D1,LAB_09E6

	MOVEA.L	pubscreen_save,A0	;visualinfo = GetVisualInfoA(pubscreen, NULL)
	MOVEA.L	#$00000000,A1
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGetVisualInfoA(A6)
	MOVE.L	D0,visualinfo
	BEQ.W	LAB_0A1B

	MOVEA.L	pubscreen_save,A0	;screendrawinfo = GetScreenDrawInfo(pubscreen)
	MOVEA.L	IntuiBase,A6
	JSR	_LVOGetScreenDrawInfo(A6)
	MOVE.L	D0,screen_draw_info
	BEQ.W	LAB_0A19

	MOVE.L	#$00000000,gadgetlist	;a2 = CreateContext(&gadgetlist)
	MOVEA.L	GadtoolsBase,A6
	LEA	gadgetlist,A0
	JSR	_LVOCreateContext(A6)
	MOVEA.L	D0,A2
	TST.L	D0
	BEQ.W	LAB_0A17

	MOVE.L	#$00000000,D3
	LEA	newgadget_save,A5
	LEA	gadget_taglist,A4
	LEA	LAB_09DC,A3
LAB_0A0B:
	MOVE.W	(A3),D0
	CMPI.W	#$00c6,D0
	BEQ.W	LAB_0A0C
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	A5,A0
	LEA	newgadget_struct,A1
	MOVEQ	#30,D0				;CopyMem (newgadget_save, newgadget_struct, sizeof(struct NewGadget))
	JSR	_LVOCopyMem(A6)

	MOVE.L	#$00000000,D0
	MOVE.L	visualinfo,newgadget_visualinfo
	MOVE.W	LAB_09E2,D0
	MOVE.W	newgadget_leftedge,D1
	ADD.W	D1,D0
	MOVE.W	D0,newgadget_leftedge
	MOVE.W	intui_bordertop_ish,D0
	MOVE.W	newgadget_topedge,D1
	ADD.W	D1,D0
	MOVE.W	D0,newgadget_topedge

	MOVE.L	#$00000000,D0		;GENERIC_KIND
	MOVEA.L	GadtoolsBase,A6
	MOVEA.L	A2,A0
	MOVE.W	(A3),D0
	LEA	newgadget_struct,A1
	MOVEA.L	A4,A2
	JSR	_LVOCreateGadgetA(A6)
	MOVEA.L	D0,A2
	TST.L	D0
	BEQ.W	LAB_0A15

	LEA	LAB_09DF,A0
	MOVE.L	D3,D0
	MULU	#$0004,D0
	ADDA.L	D0,A0
	MOVE.L	A2,(A0)
LAB_0A0C:
	ADDI.W	#$0001,D3
	ADDA.W	#$001e,A5
	ADDA.W	#$0002,A3
	JMP	LAB_0A0E
LAB_0A0D:
	ADDA.W	#$0008,A4

LAB_0A0E:
	MOVE.L	(A4),D0
	TST.L	D0
	BNE.W	LAB_0A0D
	ADDA.W	#$0004,A4
	MOVE.W	D3,D0
	SUBI.W	#$0001,D0
	TST.W	D0
	BNE.W	LAB_0A0B
	MOVE.L	A2,LAB_09E1
	MOVE.L	#$00000000,D3
	LEA	newgadget_save,A5
	LEA	gadget_taglist,A4
	LEA	LAB_09DC,A3
LAB_0A0F:
	MOVE.W	(A3),D0
	CMPI.W	#$00c6,D0
	BNE.W	LAB_0A10

;	MOVE.L	#$00000000,class_pointer
;	MOVEA.L	class_pointer,A0
;	MOVEA.L	8(A5),A1				;is this part broken or smth??
;	MOVEA.L	A4,A2
;	MOVEA.L	IntuiBase,A6
;	JSR	_LVONewObjectA(A6)
;	MOVEA.L	D0,A2

;	LEA	LAB_09DF,A0
;	MOVE.L	D3,D0
;	MULU	#$0004,D0
;	ADDA.L	D0,A0
;	MOVE.L	A2,(A0)
;	TST.L	D0
;	BEQ.W	LAB_0A15

LAB_0A10:
	ADDI.W	#$0001,D3
	ADDA.W	#$001e,A5
	ADDA.W	#$0002,A3
	JMP	LAB_0A12

LAB_0A11:
	ADDA.W	#$0008,A4
LAB_0A12:
	MOVE.L	(A4),D0
	TST.L	D0
	BNE.W	LAB_0A11

	ADDA.W	#$0004,A4
	MOVE.W	D3,D0
	SUBI.W	#$0001,D0
	TST.W	D0
	BNE.W	LAB_0A0F

	MOVEA.L	#$00000000,A0
	LEA	window_taglist,A1
	MOVEA.L	IntuiBase,A6
	JSR	_LVOOpenWindowTagList(A6)			;OpenWindowTagList
	MOVE.L	D0,window_ptr
	TST.L	D0
	BEQ.W	LAB_0A14

	JSR	draw_bevel

	MOVEA.L	window_ptr,A1			;RefreshGList(gadgetlist, window_ptr, 0x0, 0xffff)
	MOVEA.L	gadgetlist,A0
	MOVEA.L	#$00000000,A2
	MOVE.L	#$0000ffff,D0
	MOVEA.L	IntuiBase,A6
	JSR	_LVORefreshGList(A6)

	MOVEA.L	window_ptr,A0			;GT_RefreshWindow(window_ptr, 0x0)
	MOVEA.L	#$00000000,A1
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGT_RefreshWindow(A6)

	MOVE.L	#$00000000,D0
	JMP	LAB_0A1C

close_intuition_window:
	MOVEA.L	IntuiBase,A6
	MOVEA.L	window_ptr,A0
	JSR	_LVOActivateWindow(A6)
	JSR	_LVOWindowToFront(A6)
	MOVE.L	#$00000000,D0
	JMP	LAB_0A1E
LAB_0A14:
	MOVE.L	#$00000001,D0
	JMP	LAB_0A16
LAB_0A15:
	MOVE.L	#$00000002,D0
LAB_0A16:
	MOVE.L	D0,D2
	MOVEA.L	GadtoolsBase,A6
	MOVEA.L	gadgetlist,A0
	JSR	_LVOFreeGadgets(A6)
	MOVE.L	D2,D0
	JMP	LAB_0A18
LAB_0A17:
	MOVE.L	#$00000004,D0
LAB_0A18:
	MOVE.L	D0,D2
	MOVEA.L	IntuiBase,A6
	MOVEA.L	pubscreen_save,A0
	MOVEA.L	screen_draw_info,A1
	JSR	_LVOFreeScreenDrawInfo(A6)
	MOVE.L	#$00000000,screen_draw_info
	MOVE.L	D2,D0
	JMP	LAB_0A1A
LAB_0A19:
	MOVE.L	#$00000080,D0
LAB_0A1A:
	MOVE.L	D0,D2
	MOVEA.L	GadtoolsBase,A6
	MOVEA.L	visualinfo,A0
	JSR	_LVOFreeVisualInfo(A6)
	MOVE.L	#$00000000,visualinfo
	MOVE.L	D2,D0
	JMP	LAB_0A1C
LAB_0A1B:
	MOVE.L	#$00000008,D0

LAB_0A1C:
	MOVE.L	D0,D2
	MOVEA.L	IntuiBase,A6
	MOVEA.L	#$00000000,A0
	MOVEA.L	pubscreen_save,A1
	JSR	_LVOUnlockPubScreen(A6)
	MOVE.L	#$00000000,pubscreen_save
	MOVE.L	D2,D0
	JMP	LAB_0A1E
LAB_0A1D:
	MOVE.L	#$00000010,D0
LAB_0A1E:
	MOVEM.L	(A7)+,D1-D4/A0-A6
	RTS


close_intuition_window2:
	MOVEM.L	D0-D2/A0-A6,-(A7)
	MOVE.L	window_ptr,D1
	TST.L	D1
	BEQ.W	LAB_0A21
	MOVE.L	screen_draw_info,D1
	TST.L	D1
	BEQ.W	LAB_0A20
	MOVEA.L	window_ptr,A0
	MOVEA.L	46(A0),A0		;screen
	MOVEA.L	screen_draw_info,A1
	MOVEA.L	IntuiBase,A6
	JSR	_LVOFreeScreenDrawInfo(A6)
	MOVE.L	#$00000000,screen_draw_info

LAB_0A20:
	MOVEA.L	window_ptr,A0
	MOVEA.L	IntuiBase,A6
	JSR	_LVOCloseWindow(A6)
	MOVE.L	#$00000000,window_ptr

LAB_0A21:
	MOVE.L	visualinfo,D1
	TST.L	D1
	BEQ.W	LAB_0A22
	MOVEA.L	D1,A0
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOFreeVisualInfo(A6)
	MOVE.L	#$00000000,visualinfo

LAB_0A22:
	MOVE.L	gadgetlist,D1
	TST.L	D1
	BEQ.W	LAB_0A23
	MOVEA.L	D1,A0
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOFreeGadgets(A6)
	MOVE.L	#$00000000,gadgetlist
LAB_0A23:
	MOVEM.L	(A7)+,D0-D2/A0-A6
	RTS


update_bevel_box:
	MOVEM.L	D0-D4/A0-A4/A6,-(A7)
	MOVEA.L	IntuiBase,A6
	MOVE.L	window_ptr2,D0
	TST.L	D0
	BEQ.W	LAB_0A25
	MOVEA.L	window_ptr2,A0
	MOVEA.L	50(A0),A4			;RPort
	MOVE.L	LAB_09EB,LAB_09D1
	MOVEA.L	GadtoolsBase,A6
	MOVE.L	#$00000002,D0
	MOVE.L	D0,D3
	MOVE.L	#$00000135,D0
	MOVE.L	D0,D2
	MOVE.L	#$00000001,D0
	ADD.W	LAB_0A00,D0
	MOVE.L	D0,D1
	MOVE.L	#$00000001,D0
	ADD.W	LAB_09FE,D0
	MOVEA.L	A4,A0
	LEA	bevel_tags,A1
	ADDA.L	#$00000008,A1
	JSR	_LVODrawBevelBoxA(A6)

	MOVE.L	#$00000002,D0
	MOVE.L	D0,D3
	MOVE.L	#$00000135,D0
	MOVE.L	D0,D2
	MOVE.L	#$0000000d,D0
	ADD.W	LAB_0A00,D0
	MOVE.L	D0,D1
	MOVE.L	#$00000001,D0
	ADD.W	LAB_09FE,D0
	MOVEA.L	A4,A0
	LEA	bevel_tags,A1
	ADDA.L	#$00000008,A1
	JSR	_LVODrawBevelBoxA(A6)

	MOVE.L	#$0000000c,D0
	MOVE.L	D0,D3
	MOVE.L	#$00000004,D0
	MOVE.L	D0,D2
	MOVE.L	#$0000001d,D0
	ADD.W	LAB_0A00,D0
	MOVE.L	D0,D1
	MOVE.L	#$0000009a,D0
	ADD.W	LAB_09FE,D0
	MOVEA.L	A4,A0
	LEA	bevel_tags,A1
	ADDA.L	#$00000008,A1
	JSR	_LVODrawBevelBoxA(A6)
LAB_0A25:
	MOVEM.L	(A7)+,D0-D4/A0-A4/A6
	RTS


LAB_0A26:
	MOVEM.L	D1-D4/A0-A6,-(A7)
	MOVE.L	window_ptr2,D0
	TST.L	D0
	BNE.W	LAB_0A2F
	MOVEA.L	#$00000000,A0
	MOVEA.L	IntuiBase,A6
	JSR	_LVOLockPubScreen(A6)
	MOVE.L	D0,workbench_ptr

	BEQ.W	LAB_0A39
	MOVE.L	#$0000013c,LAB_0A02
	MOVE.L	#$0000002b,LAB_0A03
	MOVEA.L	workbench_ptr,A0
	MOVE.B	36(A0),LAB_09FF
	MOVEA.L	40(A0),A1
	MOVE.W	4(A1),D1
	ADDQ.W	#1,D1
	MOVE.B	35(A0),D0
	EXT.W	D0
	ADD.W	D1,D0
	MOVE.W	D0,LAB_0A00
	MOVE.L	LAB_0A03,D1
	ADD.W	D0,D1
	MOVE.L	D1,LAB_0A03
	MOVE.W	LAB_09FE,D0
	MOVE.L	LAB_0A02,D1
	ADD.W	D0,D1
	MOVE.L	D1,LAB_0A02

	MOVEA.L	workbench_ptr,A0
	MOVEA.L	#$00000000,A1
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGetVisualInfoA(A6)
	MOVE.L	D0,LAB_09EB
	BEQ.W	LAB_0A37

	MOVEA.L	workbench_ptr,A0
	MOVEA.L	IntuiBase,A6
	JSR	_LVOGetScreenDrawInfo(A6)
	MOVE.L	D0,LAB_09EC
	BEQ.W	LAB_0A35
	MOVE.L	#$00000000,LAB_0A04
	MOVEA.L	GadtoolsBase,A6
	LEA	LAB_0A04,A0
	JSR	_LVOCreateContext(A6)
	MOVEA.L	D0,A2
	TST.L	D0
	BEQ.W	LAB_0A33

	MOVE.L	#$00000000,D3
	LEA	LAB_09F6,A5
	LEA	gadget_tags2,A4
	LEA	LAB_09F5,A3

LAB_0A27:
	MOVE.W	(A3),D0
	CMPI.W	#$00c6,D0
	BEQ.W	LAB_0A28
	MOVEA.L	ABSEXECBASE.W,A6
	MOVEA.L	A5,A0
	LEA	LAB_09EF,A1
	MOVEQ	#30,D0
	JSR	_LVOCopyMem(A6)

	MOVE.L	#$00000000,D0
	MOVE.L	LAB_09EB,LAB_09F1
	MOVE.W	LAB_09FE,D0
	MOVE.W	LAB_09EF,D1
	ADD.W	D1,D0
	MOVE.W	D0,LAB_09EF
	MOVE.W	LAB_0A00,D0
	MOVE.W	LAB_09F0,D1
	ADD.W	D1,D0
	MOVE.W	D0,LAB_09F0
	MOVE.L	#$00000000,D0

	MOVEA.L	GadtoolsBase,A6
	MOVEA.L	A2,A0
	MOVE.W	(A3),D0
	LEA	LAB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WindowTagList(A6)
	MOVE.L	D0,window_ptr2
	TST.L	D0
	BEQ.W	LAB_0A30

	JSR	update_bevel_box
	MOVEA.L	window_ptr2,A1
	MOVEA.L	LAB_0A04,A0
	MOVEA.L	#$00000000,A2
	MOVE.L	#$0000ffff,D0
	MOVEA.L	IntuiBase,A6
	JSR	_LVORefreshGList(A6)

	MOVEA.L	window_ptr2,A0
	MOVEA.L	#$00000000,A1
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOGT_RefreshWindow(A6)
	MOVE.L	#$00000000,D0
	JMP	LAB_0A38
LAB_0A2F:
	MOVEA.L	IntuiBase,A6
	MOVEA.L	window_ptr2,A0
	JSR	_LVOActivateWindow(A6)
	JSR	_LVOWindowToFront(A6)

	MOVE.L	#$00000000,D0
	JMP	LAB_0A3A
LAB_0A30:
	MOVE.L	#$00000001,D0
	JMP	LAB_0A32
LAB_0A31:
	MOVE.L	#$00000002,D0
LAB_0A32:
	MOVE.L	D0,D2
	MOVEA.L	GadtoolsBase,A6
	MOVEA.L	LAB_0A04,A0
	JSR	_LVOFreeGadgets(A6)
	MOVE.L	D2,D0
	JMP	LAB_0A34
LAB_0A33:
	MOVE.L	#$00000004,D0
LAB_0A34:
	MOVE.L	D0,D2
	MOVEA.L	IntuiBase,A6
	MOVEA.L	workbench_ptr,A0
	MOVEA.L	LAB_09EC,A1
	JSR	_LVOFreeScreenDrawInfo(A6)
	MOVE.L	#$00000000,LAB_09EC
	MOVE.L	D2,D0
	JMP	LAB_0A36
LAB_0A35:
	MOVE.L	#$00000080,D0
LAB_0A36:
	MOVE.L	D0,D2
	MOVEA.L	GadtoolsBase,A6
	MOVEA.L	LAB_09EB,A0
	JSR	_LVOFreeVisualInfo(A6)
	MOVE.L	#$00000000,LAB_09EB
	MOVE.L	D2,D0
	JMP	LAB_0A38
LAB_0A37:
	MOVE.L	#$00000008,D0
LAB_0A38:
	MOVE.L	D0,D2
	MOVEA.L	IntuiBase,A6
	MOVEA.L	#$00000000,A0
	MOVEA.L	workbench_ptr,A1
	JSR	_LVOUnlockPubScreen(A6)
	MOVE.L	#$00000000,workbench_ptr
	MOVE.L	D2,D0
	JMP	LAB_0A3A
LAB_0A39:
	MOVE.L	#$00000010,D0
LAB_0A3A:
	MOVEM.L	(A7)+,D1-D4/A0-A6
	RTS
LAB_0A3B:
	MOVEM.L	D0-D2/A0-A6,-(A7)
	MOVE.L	window_ptr2,D1
	TST.L	D1
	BEQ.W	LAB_0A3D
	MOVE.L	LAB_09EC,D1
	TST.L	D1
	BEQ.W	LAB_0A3C
	MOVEA.L	window_ptr2,A0
	MOVEA.L	46(A0),A0
	MOVEA.L	LAB_09EC,A1
	MOVEA.L	IntuiBase,A6
	JSR	_LVOFreeScreenDrawInfo(A6)
	MOVE.L	#$00000000,LAB_09EC
LAB_0A3C:
	MOVEA.L	window_ptr2,A0
	MOVEA.L	IntuiBase,A6
	JSR	_LVOCloseWindow(A6)
	MOVE.L	#$00000000,window_ptr2
LAB_0A3D:
	MOVE.L	LAB_09EB,D1
	TST.L	D1
	BEQ.W	LAB_0A3E
	MOVEA.L	D1,A0
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOFreeVisualInfo(A6)
	MOVE.L	#$00000000,LAB_09EB
LAB_0A3E:
	MOVE.L	LAB_0A04,D1
	TST.L	D1
	BEQ.W	LAB_0A3F
	MOVEA.L	D1,A0
	MOVEA.L	GadtoolsBase,A6
	JSR	_LVOFreeGadgets(A6)
	MOVE.L	#$00000000,LAB_0A04
LAB_0A3F:
	MOVEM.L	(A7)+,D0-D2/A0-A6
	RTS

_LVOSetAPen		EQU -342
_LVOMove		EQU -240
_LVODraw		EQU -246

draw_to_rastport:
	SUBQ.W	#1,D0				;D0 = #24
LAB_0A41:
	MOVEM.L	D0-D7/A0-A6,-(A7)
	CLR.L	D3
	CLR.L	D5
	CLR.L	D6
	CLR.L	D7
	MOVEA.L	rastport,A3
	MOVE.W	LAB_0A45,D5
	MOVE.W	LAB_0A44,D6
	MOVE.W	LAB_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