DKC1_CODE_B98FB3.asm
Yoshifanatic1_Donkey-Kong-Country-3-Disassembly/DKC3/GarbageData/DKC1_CODE_B98FB3.asm

ADDR_B98FB3:
	RTL

ADDR_B98FB4:
	LDA.w #$0018
	JML.l ADDR_B99036

ADDR_B98FBB:
	LDA.w #$000D
	STA.b $32
	LDA.w #$0200
	STA.b $4A
	LDA.w #$0016
	JSR.w $B9A4DC
	LDA.w #$000C
	JSL.l $818C66
	LDA.w #$6C00
	JSR.w $B999CA
	LDA.w #$001D
	JSR.w $B9A924
	JSR.w ADDR_B9906B
	JSR.w ADDR_B993BA
	JSR.w ADDR_B98FF8
	LDX.w #$0020
	LDY.w #$0000
	LDA.w #$D683
	JSL.l $B999F1
	JML.l $81D302

ADDR_B98FF8:
	STZ.w $2112
	STZ.w $2112
	STZ.w $0889
	STZ.w $088B
	STZ.w $0895
	STZ.w $0897
	RTS

ADDR_B9900B:
	LDA.w #$0001
	STA.w $1B03
	JML.l $B9AD17

ADDR_B99015:
	LDA.w #$0017
	JML.l ADDR_B99036

ADDR_B9901C:
	LDA.w #$000E
	JML.l ADDR_B99036

ADDR_B99023:
	JSR.w ADDR_B99027
	RTL

ADDR_B99027:
	CMP.w $0521
	BEQ.b ADDR_B99035
	STA.w $0521
	PHA
	PLA
	JSL.l $8AB414
ADDR_B99035:
	RTS

ADDR_B99036:
	PHA
	JSR.w ADDR_B99061
	JSL.l ADDR_B990E7
	PLA
	PHA
	JSR.w ADDR_B99027
	PLA
	JSL.l ADDR_B990CE
	RTL

ADDR_B99049:
	CMP.w $0523
	BEQ.b ADDR_B99060
	PHA
	JSR.w ADDR_B99061
	JSL.l ADDR_B990E7
	PLA
	PHA
	JSR.w ADDR_B99027
	PLA
	JSL.l ADDR_B990CE
ADDR_B99060:
	RTL

ADDR_B99061:
	SEP.b #$20
	LDA.b #$01
	STA.w $4200
	REP.b #$20
	RTS

ADDR_B9906B:
	LDA.w $1E15
	AND.w #$0400
	BNE.b ADDR_B9909E
	LDA.w #$0015
ADDR_B99076:
	JSR.w $B9A924
	JSR.w ADDR_B99089
	JSR.w ADDR_B9908F
	JSR.w ADDR_B99083
	RTS

ADDR_B99083:
	LDA.w #$0014
	JMP.w $B9A924

ADDR_B99089:
	LDA.w #$0004
	JMP.w $B9A924

ADDR_B9908F:
	LDA.w $050A
	CMP.w #$81E7
	BEQ.b ADDR_B99098
	RTS

ADDR_B99098:
	LDA.w #$0006
	JMP.w $B9A924

ADDR_B9909E:
	LDA.b $3E
	CMP.l UNK_B990C6
	BEQ.b ADDR_B990B7
	CMP.l UNK_B990C6+$02
	BEQ.b ADDR_B990BC
	CMP.l UNK_B990C6+$04
	BEQ.b ADDR_B990C1
	LDA.w #$0019
	BRA.b ADDR_B99076

ADDR_B990B7:
	LDA.w #$0016
	BRA.b ADDR_B99076

ADDR_B990BC:
	LDA.w #$0017
	BRA.b ADDR_B99076

ADDR_B990C1:
	LDA.w #$0018
	BRA.b ADDR_B99076

UNK_B990C6:
	dw $00D2,$006C,$00D3,$00A6

ADDR_B990CE:
	STA.w $0523
	JSL.l $8AB1CB
	LDA.w #$0001
	STA.w $051D
	SEP.b #$20
	LDX.w #$00FE
	JSL.l $8AB1AF
	REP.b #$30
	RTL

ADDR_B990E7:
	STZ.w $0523
	LDA.w $051D
	BEQ.b ADDR_B990FF
	STZ.w $051D
	NOP #2
	SEP.b #$20
	LDX.w #$00FF
	JSL.l $8AB1AF
	REP.b #$20
ADDR_B990FF:
	RTL

ADDR_B99100:
	STZ.w $0889
	STZ.w $088B
	STZ.w $0A75
	STZ.w $0895
	STZ.w $0897
	LDA.w #$FEF8
ADDR_B99112:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0100
	BNE.b ADDR_B99112
	STA.w $088B
	LDA.w #$6800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B99138:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B99138
	LDA.w #$7000
	STA.w $2116
	LDX.w #$0000
ADDR_B9914F:
	LDA.l $7E2000,x
	AND.w #$03FF
	CMP.w #$03F0
	LDA.l $7E2000,x
	BCC.b ADDR_B99162
	EOR.w #$0010
ADDR_B99162:
	STA.w $2118
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B9914F
	RTS

ADDR_B9916D:
	LDA.w $0504
	AND.w #$8000
	BEQ.b ADDR_B99178
	JSR.w ADDR_B991A2
ADDR_B99178:
	LDA.w $0504
	AND.w #$0020
	BEQ.b ADDR_B9918B
	DEC.w $1E3B
	BPL.b ADDR_B9918B
	LDA.w #$001A
	STA.w $1E3B
ADDR_B9918B:
	LDA.w $0504
	AND.w #$0010
	BEQ.b ADDR_B991A1
	INC.w $1E3B
	LDA.w $1E3B
	CMP.w #$001B
	BNE.b ADDR_B991A1
	STZ.w $1E3B
ADDR_B991A1:
	RTL

ADDR_B991A2:
	LDA.w $1E3B
	CMP.w #$000A
	BEQ.b ADDR_B991BB
	JSL.l ADDR_B990E7
	LDA.w $1E3B
	JSR.w ADDR_B99027
	LDA.w $1E3B
	JSL.l ADDR_B990CE
ADDR_B991BB:
	RTS

ADDR_B991BC:
	STZ.w $0889
	STZ.w $088B
	STZ.w $0A75
	STZ.w $0895
	STZ.w $0897
	STZ.w $1A5B
	LDA.w #$FEF8
ADDR_B991D1:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0000
	BNE.b ADDR_B991D1
	STZ.w $088B
	LDA.w #$6800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B991F7:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$0800
	BNE.b ADDR_B991F7
	LDA.w #$7C00
	STA.w $2116
	LDX.w #$0000
ADDR_B9920E:
	LDA.l $7E2000,x
	STA.w $2118
	INX
	INX
	CPX.w #$0800
	BNE.b ADDR_B9920E
	RTS

ADDR_B9921D:
	STZ.w $0A75
	STZ.w $1A5B
	STZ.w $0895
	STZ.w $0897
	LDA.w #$FEF8
ADDR_B9922C:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0100
	BNE.b ADDR_B9922C
	LDA.w #$7800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B9924F:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B9924F
	LDA.w #$0100
	STA.w $0895
	LDA.w #$FEF8
ADDR_B99266:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0100
	BNE.b ADDR_B99266
	STZ.w $088B
	LDA.w #$7800
	STA.w $2116
	LDA.w $2139
	LDX.w #$1000
ADDR_B9928C:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$2000
	BNE.b ADDR_B9928C
	LDA.w #$6800
	STA.w $2116
	LDX.w #$0000
ADDR_B992A3:
	LDA.l $7E2000,x
	STA.w $2118
	INX
	INX
	CPX.w #$2000
	BNE.b ADDR_B992A3
	RTS

ADDR_B992B2:
	STZ.w $0A75
	STZ.w $1A5B
	STZ.w $0895
	STZ.w $0897
	LDA.w #$FEF8
ADDR_B992C1:
	STA.w $088B
	JSL.l $818DFA
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0100
	BNE.b ADDR_B992C1
	LDA.w #$7800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B992E4:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B992E4
	LDA.w #$7000
	STA.w $2116
	LDX.w #$0000
ADDR_B992FB:
	LDA.l $7E2000,x
	STA.w $2118
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B992FB
	RTS

ADDR_B9930A:
	STZ.w $0A75
	STZ.w $1A5B
	STZ.w $0895
	STZ.w $0897
	LDA.w #$FEF8
ADDR_B99319:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0100
	BNE.b ADDR_B99319
	LDA.w #$7800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B9933C:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B9933C
	LDA.w #$5800
	STA.w $2116
	LDX.w #$0000
ADDR_B99353:
	LDA.l $7E2000,x
	STA.w $2118
	INX
	INX
	CPX.w #$1000
	BNE.b ADDR_B99353
	RTS

ADDR_B99362:
	STZ.w $0A75
	STZ.w $1A5B
	STZ.w $0895
	STZ.w $0897
	LDA.w #$FEF8
ADDR_B99371:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	CMP.w #$0100
	BNE.b ADDR_B99371
	LDA.w #$7800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B99394:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$0800
	BNE.b ADDR_B99394
	LDA.w #$7400
	STA.w $2116
	LDX.w #$0000
ADDR_B993AB:
	LDA.l $7E2000,x
	STA.w $2118
	INX
	INX
	CPX.w #$0800
	BNE.b ADDR_B993AB
	RTS

ADDR_B993BA:
	STZ.w $0A75
	STZ.w $1A5B
	LDA.w #$0100
	STA.w $0895
	STZ.w $0897
	LDA.w #$FEF8
ADDR_B993CC:
	STA.w $088B
	JSL.l $818705
	JSL.l $81883F
	LDA.w $088B
	CLC
	ADC.w #$0008
	BNE.b ADDR_B993CC
	LDA.w #$7800
	STA.w $2116
	LDA.w $2139
	LDX.w #$0000
ADDR_B993EC:
	LDA.w $2139
	STA.l $7E2000,x
	INX
	INX
	CPX.w #$0800
	BNE.b ADDR_B993EC
	LDA.w #$7400
	STA.w $2116							; Note: This routine just cuts off here.