Engine.asm
Yoshifanatic1_Super-Mario-Kart-Disassembly/SMK/SPC700/Engine.asm

%SPCDataBlockStart(3C70)
DATA_3C70:
	db $32,$65,$7F,$98,$B2,$CB,$E5,$FC

DATA_3C78:
	db $19,$32,$4C,$65,$72,$7F,$8C,$98,$A5,$B2,$BF,$CB,$D8,$E5,$F2,$FC

DATA_3C88:
	db $00,$FF,$80,$B8,$05,$70,$01,$FF,$E0,$B8,$01,$A0,$02,$FF,$E0,$B8
	db $27,$F0,$03,$FF,$E0,$B8,$01,$20

DATA_3CA0:
	db $04,$8F,$ED,$B8,$07,$A0,$05,$FF,$E0,$B8,$07,$A0,$06,$FF,$E0,$B8
	db $01,$60,$07,$FF,$E0,$B8,$01,$B0,$08,$FF,$E0,$B8,$03,$E0,$09,$8F
	db $E0,$B8,$03,$10,$0A,$FF,$E0,$B8,$02,$90,$0B,$8F,$EE,$B8,$07,$10
	db $0C,$FF,$71,$B8,$03,$F0,$0D,$8F,$F8,$B8,$05,$F0,$0E,$8F,$E0,$B8
	db $03,$00,$0F,$FF,$E0,$B8,$02,$60,$10,$FF,$E0,$B8,$03,$F0,$11,$FF
	db $E0,$B8,$03,$C0,$12,$FF,$E0,$B8,$02,$80,$13,$FF,$E0,$B8,$00,$C0
	db $14,$FF,$E0,$B8,$02,$00,$15,$FF,$E0,$B8,$0B,$20,$16,$FF,$E0,$B8
	db $02,$30,$17,$FF,$E0,$B8,$08,$60,$18,$FF,$E0,$B8,$21,$F0,$19,$FF
	db $E0,$B8,$04,$70,$3E,$3D,$2E,$3D,$FF,$00,$26,$3D,$00,$00,$4E,$3D
	db $69,$3D,$8D,$3D,$B9,$3D,$DD,$3D,$F6,$3D,$0F,$3E,$00,$00,$27,$3E
	db $35,$3E,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ED,$E6
	db $E0,$0D,$F4,$80,$0C,$6F,$90,$98,$9F,$91,$98,$A1,$A0,$9C,$97,$95
	db $94,$92,$91,$98,$A1,$9F,$9A,$91,$00,$E0,$0D,$ED,$FF,$F4,$80,$18
	db $7F,$AB,$0C,$B0,$18,$B7,$06,$B5,$AD,$18,$AF,$0C,$B4,$18,$BB,$06
	db $B9,$B1,$18,$B9,$06,$B7,$B5,$0C,$B4,$B2,$06,$AD,$AF,$ED,$FA,$E0
	db $0D,$F4,$80,$06,$79,$9F,$A4,$AB,$9F,$A4,$AB,$A1,$A4,$AB,$A1,$A9
	db $A1,$A3,$A8,$AF,$A3,$A8,$AF,$A5,$A8,$AF,$A5,$AD,$A5,$AD,$A4,$A9
	db $AD,$A4,$A9,$AD,$A4,$A9,$AD,$AB,$A3,$ED,$FF,$E0,$0D,$F4,$80,$0D
	db $C9,$18,$77,$AB,$0C,$B0,$18,$B7,$06,$B5,$AD,$18,$AF,$0C,$B4,$18
	db $BB,$06,$B9,$B1,$18,$B9,$06,$B7,$B5,$0C,$B4,$0B,$B2,$ED,$96,$E0
	db $0F,$0C,$C9,$0C,$1F,$AB,$AB,$C9,$AB,$A9,$C9,$AF,$AF,$C9,$AF,$AD
	db $C9,$AD,$AD,$C9,$AD,$AD,$ED,$96,$E0,$0F,$0C,$C9,$0C,$1F,$A4,$A4
	db $C9,$A1,$A1,$C9,$A8,$A8,$C9,$A5,$A5,$C9,$A4,$A4,$C9,$A4,$A3,$E0
	db $0C,$ED,$FF,$24,$7F,$9C,$18,$9D,$06,$9E,$9F,$24,$A0,$A1,$18,$9A
	db $06,$9D,$9E,$18,$9F,$0C,$9D,$FA,$1A,$E5,$C8,$E7,$14,$F5,$BF,$2E
	db $2E,$12,$C9,$C9,$00,$E0,$0D,$ED,$FF,$E3,$0C,$2A,$1E,$F4,$80,$0C
	db $7F,$A8,$A9,$AA,$00,$49,$3E,$00,$00,$59,$3E,$8A,$3E,$A4,$3E,$C5
	db $3E,$DF,$3E,$F9,$3E,$25,$3F,$00,$00,$FA,$1A,$E5,$A0,$F5,$FF,$14
	db $14,$E7,$39,$E1,$05,$E0,$0B,$ED,$BE,$0C,$6D,$AE,$F5,$1F,$1E,$1E
	db $B8,$C9,$B8,$18,$B8,$F5,$00,$28,$28,$0C,$AF,$F5,$1F,$1E,$1E,$B9
	db $C9,$B9,$18,$B9,$0C,$BA,$C9,$32,$BA,$00,$E1,$0F,$E0,$0B,$ED,$AA
	db $0C,$6D,$A9,$B2,$C9,$B2,$18,$B2,$0C,$A9,$B3,$C9,$B3,$18,$B3,$0C
	db $B4,$C9,$32,$B4,$E0,$0B,$ED,$FF,$0C,$7B,$A0,$0C,$79,$A4,$A8,$AA
	db $AB,$0C,$7B,$AC,$A1,$0C,$79,$A5,$A9,$AB,$AC,$0C,$7B,$AD,$18,$AE
	db $30,$7D,$AE,$02,$C9,$E1,$0F,$E0,$08,$ED,$DC,$0C,$6D,$A2,$AC,$C9
	db $AC,$18,$AC,$0C,$A3,$AD,$C9,$AD,$18,$AD,$0C

DATA_3EDB:
	db $AE,$C9,$32,$AE,$E1,$05,$E0,$08,$ED,$C8,$0C,$6D,$9D,$A6,$C9,$A6
	db $18,$A6,$0C,$9D,$A7,$C9

DATA_3EF1:
	db $A7,$18,$A7,$0C,$A8,$C9,$32,$A8,$E0,$05,$ED,$C8,$0C,$7D,$A4,$0C
	db $55,$A4,$A4,$0C,$75,$A4,$0C,$55,$A4,$0C,$75,$A4,$0C,$7D,$A4,$0C
	db $55,$A4,$A4,$0C,$75,$A4,$0C,$55,$A4,$0C,$75,$A4,$18,$7D,$A4,$30
	db $7F,$A4,$02,$C9,$E0,$08,$ED,$B4,$48,$7D,$A0,$A1,$A2,$02,$C9,$00

DATA_3F31:
	db $7F,$00,$00,$00,$00,$00,$00,$00,$58,$BF,$DB,$F0,$FE,$07,$0C,$0C
	db $0C,$21,$2B,$2B,$13,$FE,$F3,$F9,$34,$33,$00,$D9,$E5,$01,$FC,$EB

DATA_3F51:
	db $5F,$08,$DE,$08,$65,$09,$F4,$09,$8C,$0A,$2C,$0B,$D6,$0B,$8B,$0C
	db $4A,$0D,$14,$0E,$EA,$0E,$CD,$0F,$BE,$10,$18,$15,$59,$16,$AD,$17

DATA_3F71:
	db $16,$19,$94,$1A,$28,$1C,$D5,$1D,$9B,$1F,$2A,$56,$65,$72,$20,$53
	db $31,$2E,$32,$30,$2A

DATA_3F86:
	db $00,$01,$03,$07,$0D,$15,$1E,$29,$34,$42,$51,$5E,$67,$6E,$73,$77
	db $7A,$7C,$7D,$7E,$7F,$B5,$0B,$0E,$0C,$1C,$0C,$35,$0C,$41,$0C,$5C
	db $0C,$61,$0C,$73,$0C,$78,$0C,$8A,$0C,$8D,$0C,$91,$0C,$9D,$0C,$BE
	db $0C,$C7,$0C,$E4,$0C,$4C,$0C,$A0,$0C,$A4,$0C,$BA,$0C,$E0,$0C,$07
	db $0D,$41,$0D,$48,$0D,$20,$0D,$C3,$0D,$B0,$0D,$01,$01,$02,$03,$00
	db $01,$02,$01,$02,$01,$01,$03,$00,$01,$02,$03,$01,$03,$03,$00,$01
	db $03,$00,$03,$03,$03

DATA_3FEB:
	db $01,$2C,$3C,$0D,$4D,$6C,$4C,$5C,$3D,$2D

DATA_3FF5:
	db $5C,$61,$63,$4E,$4A,$48,$45,$0E,$49,$4B,$46
%SPCDataBlockEnd(3C70)

%SPCDataBlockStart(03DB)
DATA_03DB:
	db $F1,$03,$E1,$03,$00,$00,$01,$04,$27,$04,$49,$04,$6A,$04,$8C,$04
	db $B0,$04,$D0,$04,$00,$00,$F8,$04,$00,$00,$00,$00,$00,$00,$00,$00
	db $00,$00,$00,$00,$00,$00,$ED,$D2,$E0,$0B,$18,$7F,$8C,$12,$C9,$06
	db $8C,$18,$90,$12,$C9,$06,$90,$18,$91,$12,$91,$06,$90,$12,$C9,$18
	db $8E,$06,$8C,$2A,$91,$06,$93,$18,$C9,$78,$95,$00,$E0,$0B,$ED,$A5
	db $18,$C9,$18,$6D,$B0,$12,$C9,$1E,$AB,$18,$AD,$12,$AD,$06,$AB,$12
	db $C9,$06,$AB,$18,$A9,$2A,$AD,$06,$AF,$18,$C9,$B1,$60,$C8,$E1,$07
	db $E0,$16,$ED,$FF,$60,$C9,$C9,$0C,$C9,$04,$77,$AB,$04,$79,$AB,$04
	db $7B,$AB,$18,$7F,$AD,$12,$AD,$06,$AD,$18,$AD,$C9,$C9,$C9,$C9,$E0
	db $0B,$ED,$A5,$18,$C9,$18,$6D,$AB,$12,$C9,$1E,$A6,$18,$A8,$12,$A8
	db $06,$A6,$12,$C9,$06,$A6,$18,$A4,$2A,$A8,$06,$AD,$18,$C9,$AF,$60
	db $C8,$E1,$02,$E0,$0B,$ED,$A5,$18,$C9,$18,$6D,$A8,$12,$C9,$1E,$A4
	db $18,$A4,$12,$A4,$06,$A4,$12,$C9,$06,$A4,$18,$A1,$2A,$A4,$06,$A6
	db $18,$C9,$A8,$60,$C8,$E1,$12,$E0,$19,$ED,$B4,$18,$C9,$18,$6D,$AD
	db $12,$C9,$06,$AD,$18,$A9,$AD,$48,$C9,$2A,$A9,$06,$A9,$18,$C9,$AD
	db $30,$C8,$18,$C9,$C9,$E1,$0D,$E0,$15,$ED,$B4,$18,$6D,$9D,$9D,$2A
	db $98,$06,$9D,$12,$C9,$06,$9D,$12,$C9,$06,$9D,$18,$98,$98,$9D,$12
	db $9D,$06,$9D,$12,$C9,$06,$9D,$18,$98,$C9,$C9,$C9,$C9,$FA,$1A,$E5
	db $BE,$E7,$2F,$F5,$BA,$28,$28,$58,$C9,$00,$00,$20,$05,$10,$05,$FF
	db $00,$08,$05,$00,$00,$30,$05,$57,$05,$6A,$05,$92,$05,$A9,$05,$C0
	db $05,$00,$00,$00,$00,$DF,$05,$EE,$05,$00,$00,$00,$00,$00,$00,$00
	db $00,$00,$00,$00,$00,$ED,$FF,$E0,$0B,$06,$3D,$95,$90,$93,$90,$95
	db $90,$93,$90,$95,$90,$93,$90,$95,$90,$93,$90,$95,$90,$93,$90,$95
	db $90,$93,$90,$95,$90,$93,$90,$95,$90,$93,$90,$00,$18,$7F,$AD,$0C
	db $C9,$B0,$18,$C9,$A8,$0C,$C9,$18,$AA,$0C,$AB,$C9,$AB,$18,$AB,$E0
	db $06,$ED,$C8,$18,$7F,$93,$E0,$05,$12,$A8,$E0,$06,$06,$93,$0C,$C9
	db $93,$E0,$05,$18,$A8,$E0,$06,$93,$E0,$05,$12,$A8,$E0,$06,$06,$93
	db $0C,$C9,$93,$E0,$05,$A8,$A8,$E0,$0A,$ED,$96,$18,$7F,$A8,$0C,$C9
	db $AD,$18,$C9,$A4,$0C,$C9,$18,$A6,$0C,$A6,$C9,$A6,$18,$A6,$E0,$0A
	db $ED,$96,$18,$7F,$A4,$0C,$C9,$A8,$18,$C9,$9F,$0C,$C9,$18,$A1,$0C
	db $A3,$C9,$A3,$18,$A3,$E0,$10,$ED,$C8,$0F,$7D,$AB,$03,$AF,$AD,$AC
	db $0C,$AB,$AB,$AE,$AB,$AB,$AB,$0F,$AB,$03,$AF,$AD,$AC,$0C,$AB,$AB
	db $AE,$AB,$AB,$AB,$FA,$1A,$E5,$A3,$E7,$1E,$F5,$DE,$2E,$2E,$18,$C9
	db $0C,$C9,$00,$E0,$07,$ED,$FF,$E3,$0C,$2A,$1E,$F4,$80,$0C,$7F,$A8
	db $A9,$AB,$00,$18,$06,$08,$06,$FF,$00,$00,$06,$00,$00,$28,$06,$37
	db $06,$3B,$06,$4C,$06,$5D,$06,$6E,$06,$76,$06,$00,$00,$A3,$06,$B1
	db $06,$00,$00,$00,$00,$00,$00,$C2,$06,$00,$00,$00,$00,$ED,$FF,$E0
	db $0C,$18,$7F,$9C,$A8,$9D,$A9,$9F,$AB,$9D,$A9,$00,$EF,$D4,$06,$01
	db $E1,$08,$ED,$82,$E0,$0E,$18,$C9,$18,$4D,$A4,$C9,$A4,$C9,$A3,$C9
	db $A3,$E1,$0C,$ED,$82,$E0,$0E,$18,$C9,$18,$4D,$9F,$C9,$A1,$C9,$A1
	db $C9,$9F,$E1,$10,$ED,$82,$E0,$0E,$18,$C9,$18,$4D,$9A,$C9,$9C,$C9
	db $9A,$C9,$9A,$E3,$0C,$18,$30,$EF,$D4,$06,$01,$ED,$E6,$E0,$06,$18
	db $7F,$A8,$E0,$15,$12,$AB,$E0,$06,$06,$A8,$18,$A8,$E0,$15,$12,$A4
	db $E0,$06,$06,$AE,$18,$A8,$E0,$15,$12,$AB,$E0,$06,$06,$A8,$18,$A8
	db $E0,$15,$12,$A4,$E0,$06,$06,$AE,$FA,$1A,$E5,$A3,$E7,$19,$F5,$BE
	db $2E,$2E,$12,$C9,$C9,$00,$E0,$0F,$ED,$DC,$E1,$05,$E3,$0C,$2A,$1E
	db $0C,$7F,$90,$12,$91,$06,$92,$E0,$0B,$ED,$DC,$E1,$0F,$E3,$0C,$2A
	db $1E,$0C,$7F,$90,$12,$91,$06,$92,$00,$12,$7F,$93,$06,$98,$12,$9F
	db $06,$98,$12,$A1,$06,$98,$12,$C9,$06,$98,$12,$C9,$1E,$97,$12,$95
	db $18,$97,$06,$95,$00,$06,$07,$F6,$06,$00,$00,$16,$07,$3C,$07,$61
	db $07,$00,$00,$86,$07,$95,$07,$00,$00,$00,$00,$BC,$07,$00,$00,$00
	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$E0,$08,$ED,$A0,$E1
	db $0D,$0C,$7E,$A4,$0C,$7B,$A3,$06,$5E,$A2,$06,$5B,$A3,$A2,$A1,$0C
	db $2D,$A0,$0C,$2B,$9F,$0C,$7B,$9E,$EE,$78,$00,$60,$7C,$9F,$01,$C9
	db $00,$E0,$08,$E1,$04,$ED,$96,$0C,$7E,$A1,$0C,$7B,$A0,$06,$7D,$9F
	db $06,$7B,$A0,$9F,$9E,$0C,$2D,$9D,$0C,$2B,$9C,$0C,$7B,$9B,$EE,$78
	db $00,$60,$7C,$9C,$01,$C9,$E0,$08,$E1,$0E,$ED,$96,$0C,$7E,$9E,$0C
	db $7B,$9D,$06,$7D,$9C,$06,$7B,$9D,$9C,$9B,$0C,$2D,$9A,$0C,$2B,$99
	db $0C,$7B,$98,$EE,$78,$00,$60,$7D,$99,$01,$C9,$E0,$0B,$ED,$CD,$18
	db $7D,$98,$97,$96,$0C,$94,$60,$93,$01,$C9,$E0,$08,$ED,$A0,$F4,$14
	db $E1,$07,$01,$C9,$0C,$7E,$A4,$0C,$7B,$A3,$06,$5E,$A2,$06,$5B,$A3
	db $A2,$A1,$0C,$2D,$A0,$0C,$2B,$9F,$0C,$7B,$9E,$EE,$78,$00,$60,$7C
	db $9F,$FA,$1A,$E5,$EB,$F5,$FF,$23,$23,$E7,$19,$32,$C9,$00,$00,$CE
	db $07,$00,$00,$DE,$07,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00
	db $00,$00,$00,$FA,$1A,$E5,$A0,$F5,$00,$28,$28,$E7,$29,$ED,$FF,$E0
	db $0E,$60,$C9,$C9,$30,$C9,$18,$7B,$B4,$48,$C9,$18,$B4,$48,$C9,$C0
	db $00,$00
%SPCDataBlockEnd(03DB)

%SPCDataBlockStart(D783)
DATA_D783:
	db $87,$D7,$00,$00,$97,$D7,$BE,$D7,$12,$D8,$64,$D8,$A2,$D8,$F4,$D8
	db $00,$00,$00,$00,$FA,$1A,$E5,$9B,$F5,$3C,$28,$28,$E7,$29,$ED,$FF
	db $E0,$0E,$60,$C9,$C9,$30,$C9,$18,$7B,$B4,$48,$C9,$18,$B4,$48,$C9
	db $C0,$18,$C9,$C9,$C9,$C9,$C9,$C9,$07,$C9,$00,$ED,$8C,$E1,$06,$E0
	db $02,$0F,$7F,$A2,$F9,$00,$0F,$A4,$01,$0F,$C8,$0F,$7F,$A4,$F9,$00
	db $0F,$A2,$01,$0F,$C8,$0A,$7F,$A2,$01,$08,$C8,$0F,$7F,$A2,$F9,$00
	db $0F,$A4,$01,$0F,$C8,$50,$7F,$A4,$F9,$00,$50,$A2,$01,$0F,$C8,$01
	db $7F,$A2,$01,$08,$C8,$EF,$74,$D9,$03,$1E,$7F,$A2,$01,$08,$C8,$EE
	db $FF,$00,$63,$7F,$A2,$F9,$00,$63,$A4,$18,$C9,$C9,$C9,$17,$C9,$ED
	db $96,$E1,$0E,$E0,$03,$EA,$16,$0A,$7F,$A3,$F9,$00,$0A,$AD,$01,$0F
	db $C8,$32,$7F,$AD,$F9,$00,$32,$A3,$01,$0F,$C8,$2C,$7F,$A3,$5F,$A3
	db $01,$08,$C8,$0F,$7F,$A3,$F9,$00,$0F,$AD,$01,$0F,$C8,$1E,$7F,$AD
	db $F9,$00,$1E,$A3,$01,$0F,$C8,$2B,$7F,$A3,$01,$08,$C8,$EF,$7B,$D9
	db $02,$46,$7F,$A3,$01,$08,$C8,$EE,$FF,$00,$63,$7F,$A3,$F9,$00,$63
	db $A9,$ED,$8C,$E0,$02,$5F,$7F,$A1,$01,$08,$C8,$0F,$7F,$A1,$F9,$00
	db $0F,$A3,$01,$0F,$C8,$23,$7F,$A3,$F9,$00,$23,$A1,$01,$0F,$C8,$2C
	db $7F,$A1,$01,$08,$C8,$EF,$82,$D9,$02,$5A,$7F,$A1,$01,$08,$C8,$EE
	db $FF,$00,$63,$7F,$A2,$F9,$00,$63,$A3,$18,$C9,$C9,$C9,$08,$C9,$ED
	db $BE,$E1,$08,$E0,$17,$EA,$F6,$28,$7F,$A2,$01,$0F,$C8,$5F,$7F,$A2
	db $01,$0F,$C8,$0F,$7F,$A2,$F9,$00,$0F,$A9,$01,$0F,$C8,$0F,$7F,$A9
	db $F9,$00,$0F,$A2,$01,$0F,$C8,$02,$7F,$A2,$01,$08,$C8,$0F,$7F,$A2
	db $F9,$00,$0F,$AB,$01,$0F,$C8,$23,$7F,$AB,$F9,$00,$23,$A2,$2C,$A2
	db $01,$08,$C8,$EF,$74,$D9,$02,$5A,$7F,$A2,$EE,$64,$00,$63,$A2,$06
	db $C9,$ED,$A0,$E1,$0C,$E0,$18,$63,$7F,$A4,$01,$0F,$C8,$5F,$7F,$A4
	db $01,$08,$C8,$0F,$7F,$A4,$F9,$00,$0F,$A6,$01,$0F,$C8,$0F,$7F,$A6
	db $F9,$00,$0F,$A4,$01,$0F,$C8,$02,$7F,$A4,$0F,$A4,$F9,$00,$0F,$A6
	db $01,$0F,$C8,$50,$7F,$A6,$F9,$00,$50,$A4,$01,$0F,$C8,$02,$7F,$A4
	db $0A,$A4,$F9,$00,$0A,$A7,$01,$0F,$C8,$0F,$7F,$A7,$F9,$00,$0F,$A4
	db $01,$0F,$C8,$02,$7F,$A4,$01,$0F,$C8,$0A,$7F,$A4,$F9,$00,$0A,$A6
	db $01,$0F,$C8,$63,$7F,$A6,$F9,$00,$63,$A4,$01,$0F,$C8,$01,$7F,$A4
	db $0F,$A4,$F9,$00,$0F,$A5,$18,$C9,$C9,$C9,$C9,$C9,$C9,$C9,$01,$C9
	db $00,$5F,$7F,$A2,$01,$08,$C8,$00,$5F,$7F,$A3,$01,$08,$C8,$00,$5F
	db $7F,$A1,$01,$08,$C8,$00,$A3,$D9,$93,$D9,$FF,$00,$8B,$D9,$00,$00
	db $B3,$D9,$CB,$D9,$EB,$D9,$07,$DA,$23,$DA,$46,$DA,$69,$DA,$8D,$DA
	db $AB,$DA,$BA,$DA,$C7,$DA,$D6,$DA,$00,$00,$00,$00,$00,$00,$E7,$DA
	db $ED,$FF,$E0,$0D,$F4,$80,$24,$6F,$8F,$8A,$89,$18,$8E,$0C,$8C,$24
	db $8B,$90,$91,$0C,$8A,$8C,$8E,$00,$ED,$FF,$18,$4F,$A2,$0C,$A7,$C9
	db $18,$9B,$0C,$C9,$18,$A4,$A6,$0C,$A6,$18,$A6,$0C,$AB,$C9,$18,$9F
	db $0C,$C9,$18,$A4,$0C,$A4,$A2,$A0,$18,$49,$9F,$0C,$A2,$C9,$18,$96
	db $0C,$C9,$18,$9F,$A4,$0C,$A4,$18,$A1,$0C,$A6,$C9,$18,$9A,$0C,$C9
	db $18,$A0,$24,$A0,$18,$49,$9D,$0C,$9F,$C9,$18,$93,$0C,$C9,$18,$9C
	db $9F,$0C,$9E,$18,$9E,$0C,$A1,$C9,$18,$97,$0C,$C9,$18,$9B,$24,$9A
	db $E1,$02,$ED,$EB,$E0,$0D,$F4,$80,$0C,$C9,$0C,$6F,$96,$96,$C9,$96
	db $96,$C9,$98,$98,$98,$18,$98,$0C,$C9,$9A,$9A,$C9,$9A,$9A,$C9,$98
	db $98,$24,$98,$E1,$12,$ED,$EB,$E0,$0D,$F4,$80,$0C,$C9,$0C,$6F,$93
	db $93,$C9,$93,$93,$C9,$93,$90,$93,$18,$92,$0C,$C9,$95,$95,$C9,$93
	db $93,$C9,$8F,$8F,$24,$8E,$E0,$0F,$ED,$F0,$0D,$C9,$18,$47,$A2,$0C
	db $A7,$C9,$18,$9B,$0C,$C9,$18,$A4,$A6,$0C,$A6,$18,$A6,$0C,$AB,$C9
	db $18,$9F,$0C,$C9,$18,$A4,$0C,$A4,$0B,$A2,$18,$7F,$A2,$0C,$A7,$C9
	db $18,$9B,$0C,$C9,$18,$A4,$A6,$0C,$A6,$18,$A6,$0C,$AB,$C9,$18,$9F
	db $0C,$C9,$18,$A4,$0C,$A4,$A2,$A0,$FA,$1A,$E5,$96,$E7,$19,$F5,$FF
	db $2E,$2E,$18,$C9,$0C,$C9,$00,$E0,$0F,$ED,$E6,$E3,$0C,$2A,$1E,$0C
	db $6D,$9F,$A0,$A1,$E1,$05,$E0,$0F,$ED,$E6,$E3,$0C,$2A,$1E,$0C,$6D
	db $9B,$9D,$9E,$E1,$0F,$E0,$0F,$ED,$E6,$E3,$0C,$2A,$1E,$0D,$C9,$0C
	db $67,$9F,$0B,$A0,$E1,$0C,$E0,$0D,$ED,$FF,$E3,$0C,$2A,$1E,$F4,$80
	db $0C,$6D,$9F,$A0,$A1,$00,$0F,$DB,$FF,$DA,$00,$00,$1F,$DB,$3D,$DB
	db $5C,$DB,$7B,$DB,$9B,$DB,$C0,$DB,$0A,$DC,$00,$00,$29,$DC,$00,$00
	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ED,$FF,$E0,$0C
	db $12,$7F,$9A,$06,$A1,$12,$A1,$06,$9F,$12,$9F,$06,$9A,$0C,$9A,$9F
	db $12,$9D,$06,$9F,$C9,$9F,$C9,$60,$A4,$00,$E0,$0B,$ED,$A5,$0C,$7D
	db $AD,$06,$AD,$AD,$C9,$AD,$C9,$AF,$C9,$AF,$C9,$AF,$0C,$AF,$AF,$06
	db $B0,$B0,$B0,$B2,$C9,$B2,$C9,$60,$B7,$E0,$0B,$ED,$A5,$0C,$7D,$A9
	db $06,$A9,$A9,$C9,$A9,$C9,$AB,$C9,$AB,$C9,$AB,$0C,$AB,$AB,$06,$AD
	db $AD,$AD,$AF,$C9,$AF,$C9,$60,$B4,$E0,$19,$ED,$8C,$0C,$6D,$AD,$AD
	db $12,$A9,$06,$AD,$C9,$AD,$C9,$AD,$0C,$A9,$A9,$12,$AD,$06,$AD,$C9
	db $AD,$C9,$46,$AD,$18,$C9,$02,$C9,$E0,$0D,$ED,$C8,$E3,$0C,$2A,$1E
	db $06,$7F,$B0,$A9,$AD,$A9,$B0,$A9,$AD,$A9,$B0,$A9,$AD,$A9,$B0,$A9
	db $AD,$A9,$06,$7D,$B0,$B0,$B0,$B2,$C9,$B2,$C9,$60,$B7,$E0,$10,$ED
	db $C8,$06,$6D,$AB,$AB,$AE,$AB,$AB,$AB,$AE,$AE,$AB,$AB,$AE,$AB,$AB
	db $AE,$AE,$AE,$AB,$AB,$AB,$AE,$C9,$AE,$C9,$03,$65,$AD,$03,$66,$AD
	db $03,$67,$AD,$03,$68,$AD,$03,$69,$AD,$03,$6A,$AD,$03,$6B,$AD,$03
	db $6C,$AD,$03,$6D,$AD,$03,$6E,$AD,$03,$6F,$AD,$AD,$AD,$AD,$AD,$AD
	db $AD,$AD,$AD,$18,$C9,$0F,$C9,$E0,$0B,$ED,$A5,$0C,$7D,$A4,$06,$A4
	db $A4,$C9,$A4,$C9,$A6,$C9,$A6,$C9,$A6,$0C,$A6,$A6,$06,$A8,$A8,$A8
	db $A9,$C9,$A9,$C9,$60,$AF,$FA,$1A,$E5,$F0,$E7,$1B,$F5,$9E,$2E,$2E
	db $36,$C9,$00,$00,$51,$DC,$41,$DC,$FF,$00,$39,$DC,$00,$00,$61,$DC
	db $76,$DC,$89,$DC,$9C,$DC,$B8,$DC,$CF,$DC,$00,$00,$00,$00,$E6,$DC
	db $F5,$DC,$02,$DD,$11,$DD,$29,$DD,$00,$00,$00,$00,$00,$00,$ED,$FF
	db $E0,$0C,$24,$6F,$A1,$0C,$9C,$24,$9C,$0C,$9B,$24,$9A,$0C,$9A,$18
	db $9A,$9C,$00,$18,$6D,$A4,$0C,$A8,$9F,$C9,$A8,$C9,$9E,$C9,$A8,$C9
	db $9E,$18,$9E,$0C,$9F,$A0,$18,$6D,$A1,$0C,$A4,$9C,$C9,$98,$C9,$9A
	db $C9,$A4,$C9,$9A,$18,$A1,$0C,$A2,$A3,$18,$7F,$AE,$48,$C9,$0C,$C9
	db $0C,$79,$AB,$0C,$7A,$AB,$0C,$7B,$AB,$0C,$7C,$AB,$0C,$7D,$AB,$0C
	db $7E,$AB,$0C,$7F,$AB,$E0,$0B,$E1,$08,$ED,$96,$18,$6D,$A4,$0C,$A8
	db $AB,$C9,$A8,$C9,$AA,$C9,$A6,$C9,$A6,$C9,$24,$A8,$E0,$0B,$E1,$0C
	db $ED,$96,$18,$6D,$A1,$0C,$A4,$A8,$C9,$A4,$C9,$A6,$C9,$A1,$C9,$A1
	db $C9,$24,$A3,$FA,$1A,$E5,$9D,$E7,$2B,$F5,$F6,$2E,$2E,$18,$C9,$0C
	db $C9,$00,$E0,$11,$ED,$F0,$E3,$0C,$2A,$1E,$0C,$6D,$9E,$9F,$A0,$E1
	db $05,$E0,$11,$ED,$F0,$E3,$0C,$2A,$1E,$0C,$6D,$A1,$A2,$A3,$ED,$E6
	db $E0,$10,$0C,$C9,$04,$69,$AB,$04,$6A,$AB,$04,$6B,$AB,$04,$6C,$AB
	db $04,$6D,$AB,$04,$6E,$AB,$E1,$0F,$E0,$11,$ED,$E6,$E3,$0C,$2A,$1E
	db $0D,$C9,$0C,$67,$9F,$0B,$A0,$00,$55,$DD,$45,$DD,$FF,$00,$3D,$DD
	db $00,$00,$65,$DD,$7C,$DD,$9A,$DD,$AF,$DD,$C4,$DD,$E1,$DD,$FA,$DD
	db $00,$00,$11,$DE,$00,$00,$20,$DE,$29,$DE,$00,$00,$00,$00,$00,$00
	db $00,$00,$ED,$FF,$E0,$0C,$24,$7F,$98,$0C,$98,$24,$93,$0C,$9A,$C9
	db $9A,$C9,$9A,$18,$93,$0C,$95,$97,$00,$E0,$10,$ED,$C8,$0C,$5B,$AB
	db $AB,$AB,$AB,$0C,$5F,$AE,$0C,$5B,$AB,$AB,$AB,$AB,$AB,$AB,$AB,$0C
	db $5F,$AE,$0C,$5B,$AB,$AB,$AB,$ED,$C3,$18,$6D,$AB,$0C,$C9,$B0,$18
	db $C9,$A4,$0C,$C9,$18,$AD,$0C,$AF,$C9,$AE,$18,$AD,$ED,$C3,$18,$6D
	db $A8,$0C,$C9,$AB,$18,$C9,$9F,$0C,$C9,$18,$A9,$0C,$AB,$C9,$AA,$18
	db $A9,$E1,$06,$ED,$82,$E3,$23,$1E,$3B,$E0,$0B,$18,$3B,$A3,$0C,$A8
	db $AB,$A3,$A8,$AB,$A4,$C8,$A9,$AD,$A4,$18,$AD,$0C,$AB,$A9,$E1,$02
	db $ED,$82,$E0,$0B,$18,$3B,$9F,$0C,$A3,$A8,$9F,$A3,$A8,$A1,$C8,$A4
	db $A9,$A1,$18,$A9,$0C,$A9,$A9,$E1,$0E,$ED,$82,$E0,$0B,$18,$3B,$9C
	db $0C,$9F,$A3,$9C,$9F,$A3,$9D,$C8,$A1,$A4,$9D,$18,$A4,$A3,$FA,$1A
	db $E5,$DE,$E7,$27,$F5,$FC,$2E,$2E,$18,$C9,$0C,$C9,$00,$E0,$11,$ED
	db $C8,$0C,$6D,$A8,$A9,$AA,$E0,$11,$ED,$C8,$0C,$6D,$A4,$A6,$A7,$00
	db $37,$DE,$00,$00,$47,$DE,$6D,$DE,$8E,$DE,$AD,$DE,$CC,$DE,$00,$00
	db $00,$00,$00,$00,$FA,$1A,$E5,$A5,$E7,$12,$F5,$EF,$28,$28,$ED,$E6
	db $E0,$0B,$06,$6D,$95,$97,$C9,$95,$C9,$93,$C9,$91,$C9,$8F,$C9,$8D
	db $ED,$96,$48,$8B,$EE,$3C,$FA,$0C,$C9,$00,$E0,$0A,$ED,$E6,$E3,$18
	db $18,$1E,$E0,$0A,$06,$6D,$A4,$A6,$C9,$A4,$C9,$A2,$C9,$A0,$C9,$9E
	db $C9,$9C,$ED,$96,$48,$9A,$EE,$3C,$FA,$0C,$C9,$ED,$E6,$E3,$18,$18
	db $1E,$E0,$0A,$06,$6D,$A8,$AA,$C9,$A8,$C9,$A6,$C9,$A4,$C9,$A2,$C9
	db $A0,$ED,$96,$48,$9E,$EE,$3C,$FA,$0C,$C9,$ED,$E6,$E3,$18,$18,$1E
	db $E0,$0A,$06,$6D,$9F,$A1,$C9,$9F,$C9,$9D,$C9,$9B,$C9,$99,$C9,$97
	db $ED,$96,$EE,$3C,$FA,$48,$95,$0C,$C9,$ED,$B4,$E0,$10,$48,$C9,$ED
	db $3C,$EE,$14,$FA,$02,$6D,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC
	db $AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC,$AC
	db $AC,$06,$6F,$AC,$18,$AE,$00
%SPCDataBlockEnd(D783)

%SPCDataBlockStart(FF00)
DATA_FF00:
	db $04,$FF,$00,$00,$14,$FF,$2F,$FF,$4F,$FF,$6F,$FF,$8F,$FF,$A6,$FF
	db $00,$00,$00,$00,$FA,$1A,$E5,$B4,$E7,$19,$F5,$EE,$2E,$2E,$24,$C9
	db $E0,$11,$06,$7F,$8C,$8C,$C9,$8C,$C9,$8C,$0C,$8E,$30,$90,$00,$E0
	db $08,$ED,$B4,$E3,$0C,$2A,$1E,$06,$7F,$A1,$A4,$08,$A9,$AD,$A9,$06
	db $AB,$AB,$C9,$AB,$C9,$AB,$0C,$AD,$18,$AF,$F9,$0C,$18,$A8,$C9,$E0
	db $08,$ED,$B4,$E3,$0C,$2A,$1E,$06,$7F,$98,$9D,$08,$A4,$A9,$A4,$06
	db $A8,$A8,$C9,$A8,$C9,$A8,$0C,$AA,$18,$AC,$F9,$0C,$18,$A0,$C9,$E0
	db $08,$ED,$B4,$E3,$0C,$2A,$1E,$06,$7F,$9D,$A1,$08,$A1,$A4,$A1,$06
	db $A3,$A3,$C9,$A3,$C9,$A3,$0C,$A5,$18,$A7,$F9,$0C,$18,$9B,$C9,$ED
	db $F0,$E0,$10,$06,$7F,$AB,$AB,$08,$AB,$AB,$AB,$06,$AB,$AB,$C9,$AB
	db $C9,$AB,$0C,$AB,$30,$AB,$ED,$FF,$E0,$07,$24,$C9,$F4,$80,$0C,$7F
	db $AB,$06,$C9,$AB,$C9,$AB,$0C,$AD,$18,$AF,$F9,$0C,$18,$A8,$C9,$00
%SPCDataBlockEnd(FF00)

%SPCDataBlockStart(!Define_SMK_SPC700_EngineStartAddress)
SPC700_Engine:
	CLRp
	MOV X, #$CF
	MOV SP, X
	MOV A, #$00
	MOV X, A
CODE_0807:
	MOV (X+), A
	CMP X, #$F0
	BNE CODE_0807
	MOV X, A
CODE_080D:
	MOV $0200+x, A
	INC X
	BNE CODE_080D
CODE_0813:
	MOV $0300+x, A
	INC X
	CMP X, #$DB
	BNE CODE_0813
	MOV X, A
	INC A
CODE_081D:
	MOV $0361+x, A
	INC X
	INC X
	CMP X, #$10
	BNE CODE_081D
	MOV A, #$03
	MOV $0390, A
	MOV $0391, A
	MOV $03C0, A
	MOV A, #$47
	MOV $03B2, A
	MOV $03B3, A
	MOV A, #$0E
	MOV $03B4, A
	MOV A, #$22
	MOV $03D6, A
	MOV $03D7, A
	MOV A, #$11
	MOV $03D4, A
	MOV $03D5, A
	MOV A, #$01
	MOV $E3, A
	CALL CODE_0D6A
	SET5 $48
	MOV A, #$60
	MOV Y, #$0C
	CALL CODE_09FD
	MOV Y, #$1C
	CALL CODE_09FD
	MOV A, #$3C
	MOV Y, #$5D
	CALL CODE_09FD
	MOV A, #$F0
	MOV $00F1, A
	MOV A, #$10
	MOV $00FA, A
	MOV $53, A
	MOV A, #$01
	MOV $00F1, A
CODE_087B:
	MOV Y, #$0A
CODE_087D:
	CMP Y, #$05
	BEQ CODE_0888
	BCS CODE_088B
	CMP $4C, $4D
	BNE CODE_0899
CODE_0888:
	BBS7 $4C, CODE_0899
CODE_088B:
	MOV A, DATA_3FEB+y
	MOV $00F2, A
	MOV A, DATA_3FF5+y
	MOV X, A
	MOV A, (X)
	MOV $00F3, A
CODE_0899:
	DBNZ Y, CODE_087D
	MOV $45, Y
	MOV $46, Y
	MOV A, $18
	EOR A, $19
	LSR A
	LSR A
	NOTC
	ROR $18
	ROR $19
CODE_08AA:
	MOV Y, $00FD
	BEQ CODE_08AA
	PUSH Y
	MOV A, #$20
	MUL YA
	CLRC
	ADC A, $43
	MOV $43, A
	BCC CODE_08C4
	CALL CODE_1664
	CMP $4C, $4D
	BEQ CODE_08C4
	INC $4C
CODE_08C4:
	MOV A, $53
	POP Y
	MUL YA
	CLRC
	ADC A, $51
	MOV $51, A
	BCC CODE_08D9
	CALL CODE_0A6A
	MOV X, #$00
	CALL CODE_08F2
	BRA CODE_087B

CODE_08D9:
	MOV A, $04
	BEQ CODE_08EF
	MOV X, #$00
	MOV $47, #$01
CODE_08E2:
	MOV A, $31+x
	BEQ CODE_08E9
	CALL CODE_0FCD
CODE_08E9:
	INC X
	INC X
	ASL $47
	BNE CODE_08E2
CODE_08EF:
	JMP CODE_087B

CODE_08F2:
	MOV A, $04+x
	MOV $00F4+x, A
	MOV A, $00F4
	MOV $00F4, A
	MOV A, $00F4+x
	CMP A, $00F4+x
	BNE CODE_08F2
	MOV $00+x, A
CODE_0907:
	RET

;--------------------------------------------------------------------

CODE_0908:
	CMP Y, #$CA
	BCC CODE_0911
	CALL CODE_0BB5
	MOV Y, #$A4
CODE_0911:
	CMP Y, #$C8
	BCS CODE_0907
	MOV A, $1A
	AND A, $47
	BNE CODE_0907
	MOV A, Y
	AND A, #$7F
	CLRC
	ADC A, $50
	CLRC
	ADC A, $02F0+x
	MOV $0361+x, A
	MOV A, $0381+x
	MOV $0360+x, A
	MOV A, $02B1+x
	LSR A
	MOV A, #$00
	ROR A
	MOV $02A0+x, A
	MOV A, #$00
	MOV $B0+x, A
	MOV $0100+x, A
	MOV $02D0+x, A
	MOV $C0+x, A
	OR $5E, $47
	OR $45, $47
	MOV A, $0280+x
	MOV $A0+x, A
	BEQ CODE_096F
	MOV A, $0281+x
	MOV $A1+x, A
	MOV A, $0290+x
	BNE CODE_0965
	MOV A, $0361+x
	SETC
	SBC A, $0291+x
	MOV $0361+x, A
CODE_0965:
	MOV A, $0291+x
	CLRC
	ADC A, $0361+x
	CALL CODE_0DD3
CODE_096F:
	CALL CODE_0DEB
CODE_0972:
	MOV Y, #$00
	MOV A, $11
	SETC
	SBC A, #$34
	BCS CODE_0984
	MOV A, $11
	SETC
	SBC A, #$13
	BCS CODE_0988
	DEC Y
	ASL A
CODE_0984:
	ADDW YA, $10
	MOVW $10, YA
CODE_0988:
	PUSH X
	MOV A, $11
	ASL A
	MOV Y, #$00
	MOV X, #$18
	DIV YA, X
	MOV X, A
	MOV A, DATA_3F51+$01+y
	MOV $15, A
	MOV A, DATA_3F51+y
	MOV $14, A
	MOV A, DATA_3F51+$03+y
	PUSH A
	MOV A, DATA_3F51+$02+y
	POP Y
	SUBW YA, $14
	MOV Y, $10
	MUL YA
	MOV A, Y
	MOV Y, #$00
	ADDW YA, $14
	MOV $15, Y
	ASL A
	ROL $15
	MOV $14, A
	BRA CODE_09BB

CODE_09B7:
	LSR $15
	ROR A
	INC X
CODE_09BB:
	CMP X, #$06
	BNE CODE_09B7
	MOV $14, A
	POP X
	MOV A, $0220+x
	MOV Y, $15
	MUL YA
	MOVW $16, YA
	MOV A, $0220+x
	MOV Y, $14
	MUL YA
	PUSH Y
	MOV A, $0221+x
	MOV Y, $14
	MUL YA
	ADDW YA, $16
	MOVW $16, YA
	MOV A, $0221+x
	MOV Y, $15
	MUL YA
	MOV Y, A
	POP A
	ADDW YA, $16
	MOVW $16, YA
	MOV A, X
	XCN A
	LSR A
	OR A, #$02
	MOV Y, A
	MOV A, $16
	CALL CODE_09F5
	INC Y
	MOV A, $17
CODE_09F5:
	PUSH A
	MOV A, $47
	AND A, $1A
	POP A
	BNE CODE_0A03
CODE_09FD:
	MOV $00F2, Y
	MOV $00F3, A
CODE_0A03:
	RET

;--------------------------------------------------------------------

CODE_0A04:
	MOV Y, #$00
	MOV A, ($40)+y
	INCW $40
	PUSH A
	MOV A, ($40)+y
	INCW $40
	MOV Y, A
	POP A
	RET

;--------------------------------------------------------------------

CODE_0A12:
	CALL CODE_1070
	MOV $08, A
CODE_0A17:
	CALL CODE_1691
	MOV $04, A
	ASL A
	MOV X, A
	MOV A, DATA_1564+$01+x
	MOV Y, A
	MOV A, DATA_1564+x
	MOVW $40, YA
	MOV $0C, #$02
CODE_0A2A:
	MOV A, $1A
	EOR A, #$FF
	TSET $0046, A
	RET

CODE_0A32:
	MOV X, #$0E
	MOV $47, #$80
CODE_0A37:
	MOV A, #$FF
	MOV $0301+x, A
	MOV A, #$0A
	CALL CODE_0C0E
	MOV $0211+x, A
	MOV $0381+x, A
	MOV $02F0+x, A
	MOV $0280+x, A
	MOV $B1+x, A
	MOV $C1+x, A
	DEC X
	DEC X
	LSR $47
	BNE CODE_0A37
	MOV $5A, A
	MOV $68, A
	MOV $54, A
	MOV $50, A
	MOV $42, A
	MOV $5F, A
	MOV $59, #$C0
	MOV $53, #$20
CODE_0A67:
	RET

;--------------------------------------------------------------------

CODE_0A6A:
	MOV A, $00
	CMP A, #$1D
	BEQ CODE_0A2A
	CMP A, #$1E
	BEQ CODE_0A7F
	CMP A, #$1F
	BEQ CODE_0A12
	CALL CODE_1679
	MOV A, $00
	BNE CODE_0A17
CODE_0A7F:
	MOV A, $04
	BEQ CODE_0A67
	MOV A, $0C
	BEQ CODE_0AD3
	DBNZ $0C, CODE_0A32
CODE_0A8A:
	CALL CODE_0A04
	BNE CODE_0AA3
	MOV Y, A
	BEQ CODE_0A17
	DEC $42
	BPL CODE_0A98
	MOV $42, A
CODE_0A98:
	CALL CODE_0A04
	MOV X, $42
	BEQ CODE_0A8A
	MOVW $40, YA
	BRA CODE_0A8A

CODE_0AA3:
	MOVW $16, YA
	MOV Y, #$0F
CODE_0AA7:
	MOV A, ($16)+y
	MOV $0030+y, A
	DEC Y
	BPL CODE_0AA7
	MOV X, #$00
	MOV $47, #$01
CODE_0AB4:
	MOV A, $31+x
	BEQ CODE_0AC2
	MOV A, $0211+x
	BNE CODE_0AC2
	MOV A, #$00
	CALL CODE_0BB5
CODE_0AC2:
	MOV A, #$00
	MOV $80+x, A
	MOV $90+x, A
	MOV $91+x, A
	INC A
	MOV $70+x, A
	INC X
	INC X
	ASL $47
	BNE CODE_0AB4
CODE_0AD3:
	MOV X, #$00
	MOV $5E, X
	MOV $47, #$01
CODE_0ADA:
	MOV $44, X
	MOV A, $31+x
	BEQ CODE_0B46
	DEC $70+x
	BNE CODE_0B40
CODE_0AE4:
	CALL CODE_0BAB
	BNE CODE_0B00
	MOV A, $80+x
	BEQ CODE_0A8A
	CALL CODE_0CFC
	DEC $80+x
	BNE CODE_0AE4
	MOV A, $0230+x
	MOV $30+x, A
	MOV A, $0231+x
	MOV $31+x, A
	BRA CODE_0AE4

CODE_0B00:
	BMI CODE_0B22
	MOV $0200+x, A
	CALL CODE_0BAB
	BMI CODE_0B22
	PUSH A
	XCN A
	AND A, #$07
	MOV Y, A
	MOV A, DATA_3C70+y
	MOV $0201+x, A
	POP A
	AND A, #$0F
	MOV Y, A
	MOV A, DATA_3C78+y
	MOV $0210+x, A
	CALL CODE_0BAB
CODE_0B22:
	CMP A, #$E0
	BCC CODE_0B2B
	CALL CODE_0B99
	BRA CODE_0AE4

CODE_0B2B:
	CALL CODE_0908
	MOV A, $0200+x
	MOV $70+x, A
	MOV Y, A
	MOV A, $0201+x
	MUL YA
	MOV A, Y
	BNE CODE_0B3C
	INC A
CODE_0B3C:
	MOV $71+x, A
	BRA CODE_0B43

CODE_0B40:
	CALL CODE_0EDB
CODE_0B43:
	CALL CODE_0DB3
CODE_0B46:
	INC X
	INC X
	ASL $47
	BNE CODE_0ADA
	MOV A, $54
	BEQ CODE_0B5B
	MOVW YA, $56
	ADDW YA, $52
	DBNZ $54, CODE_0B59
	MOVW YA, $54
CODE_0B59:
	MOVW $52, YA
CODE_0B5B:
	MOV A, $68
	BEQ CODE_0B74
	MOVW YA, $64
	ADDW YA, $60
	MOVW $60, YA
	MOVW YA, $66
	ADDW YA, $62
	DBNZ $68, CODE_0B72
	MOVW YA, $68
	MOVW $60, YA
	MOV Y, $6A
CODE_0B72:
	MOVW $62, YA
CODE_0B74:
	MOV A, $5A
	BEQ CODE_0B86
	MOVW YA, $5C
	ADDW YA, $58
	DBNZ $5A, CODE_0B81
	MOVW YA, $5A
CODE_0B81:
	MOVW $58, YA
	MOV $5E, #$FF
CODE_0B86:
	MOV X, #$00
	MOV $47, #$01
CODE_0B8B:
	MOV A, $31+x
	BEQ CODE_0B92
	CALL CODE_0E12
CODE_0B92:
	INC X
	INC X
	ASL $47
	BNE CODE_0B8B
	RET

;--------------------------------------------------------------------

CODE_0B99:
	ASL A
	MOV Y, A
	MOV A, DATA_3EDB+$01+y
	PUSH A
	MOV A, DATA_3EDB+y
	PUSH A
	MOV A, Y
	LSR A
	MOV Y, A
	MOV A, DATA_3F71+y
	BEQ CODE_0BB3
CODE_0BAB:
	MOV A, ($30+x)
CODE_0BAD:
	INC $30+x
	BNE CODE_0BB3
	INC $31+x
CODE_0BB3:
	MOV Y, A
	RET

;--------------------------------------------------------------------

CODE_0BB5:
	MOV $0211+x, A
CODE_0BB8:
	MOV Y, A
	BPL CODE_0BC1
	SETC
	SBC A, #$CA
	CLRC
	ADC A, $5F
CODE_0BC1:
	MOV Y, #$06
	MUL YA
	MOVW $14, YA
	CLRC
	ADC $14, #DATA_3C88
	ADC $15, #DATA_3C88>>8
	MOV A, $1A
	AND A, $47
	BNE CODE_0C0D
	PUSH X
	MOV A, X
	XCN A
	LSR A
	OR A, #$04
	MOV X, A
	MOV Y, #$00
	MOV A, ($14)+y
	BPL CODE_0BEE
	AND A, #$1F
	AND $48, #$20
	TSET $0048, A
	OR $49, $47
	MOV A, Y
	BRA CODE_0BF5

CODE_0BEE:
	MOV A, $47
	TCLR $0049, A
CODE_0BF3:
	MOV A, ($14)+y
CODE_0BF5:
	MOV $00F2, X
	MOV $00F3, A
	INC X
	INC Y
	CMP Y, #$04
	BNE CODE_0BF3
	POP X
	MOV A, ($14)+y
	MOV $0221+x, A
	INC Y
	MOV A, ($14)+y
	MOV $0220+x, A
CODE_0C0D:
	RET

;--------------------------------------------------------------------

CODE_0C0E:
	MOV $0351+x, A
	AND A, #$1F
	MOV $0331+x, A
	MOV A, #$00
	MOV $0330+x, A
	RET

;--------------------------------------------------------------------

CODE_0C1C:
	MOV $91+x, A
	PUSH A
	CALL CODE_0BAB
	MOV $0350+x, A
	SETC
	SBC A, $0331+x
	POP X
	CALL CODE_0DF6
	MOV $0340+x, A
	MOV A, Y
	MOV $0341+x, A
	RET

;--------------------------------------------------------------------

CODE_0C35:
	MOV $02B0+x, A
	CALL CODE_0BAB
	MOV $02A1+x, A
	CALL CODE_0BAB
	MOV $B1+x, A
	MOV $02C1+x, A
	MOV A, #$00
	MOV $02B1+x, A
	RET

;--------------------------------------------------------------------

CODE_0C4C:
	MOV $02B1+x, A
	PUSH A
	MOV Y, #$00
	MOV A, $B1+x
	POP X
	DIV YA, X
	MOV X, $44
	MOV $02C0+x, A
	RET

;--------------------------------------------------------------------

CODE_0C5C:
	MOV A, #$00
	MOVW $58, YA
	RET

;--------------------------------------------------------------------

CODE_0C61:
	MOV $5A, A
	CALL CODE_0BAB
	MOV $5B, A
	SETC
	SBC A, $59
	MOV X, $5A
	CALL CODE_0DF6
	MOVW $5C, YA
	RET

;--------------------------------------------------------------------

CODE_0C73:
	MOV A, #$00
	MOVW $52, YA
	RET

;--------------------------------------------------------------------

CODE_0C78:
	MOV $54, A
	CALL CODE_0BAB
	MOV $55, A
	SETC
	SBC A, $53
	MOV X, $54
	CALL CODE_0DF6
	MOVW $56, YA
	RET

;--------------------------------------------------------------------

CODE_0C8A:
	MOV $50, A
	RET

;--------------------------------------------------------------------

CODE_0C8D:
	MOV $02F0+x, A
	RET

;--------------------------------------------------------------------

CODE_0C91:
	MOV $02E0+x, A
	CALL CODE_0BAB
	MOV $02D1+x, A
	CALL CODE_0BAB
	MOV $C1+x, A
	RET

;--------------------------------------------------------------------

CODE_0CA0:
	MOV A, #$01
	BRA CODE_0CA6

CODE_0CA4:
	MOV A, #$00
CODE_0CA6:
	MOV $0290+x, A
	MOV A, Y
	MOV $0281+x, A
	CALL CODE_0BAB
	MOV $0280+x, A
	CALL CODE_0BAB
	MOV $0291+x, A
	RET

;--------------------------------------------------------------------

CODE_0CBA:
	MOV $0280+x, A
	RET

;--------------------------------------------------------------------

CODE_0CBE:
	MOV $0301+x, A
	MOV A, #$00
	MOV $0300+x, A
	RET

;--------------------------------------------------------------------

CODE_0CC7:
	MOV $90+x, A
	PUSH A
	CALL CODE_0BAB
	MOV $0320+x, A
	SETC
	SBC A, $0301+x
	POP X
	CALL CODE_0DF6
	MOV $0310+x, A
	MOV A, Y
	MOV $0311+x, A
	RET

;--------------------------------------------------------------------

CODE_0CE0:
	MOV $0381+x, A
	RET

;--------------------------------------------------------------------

CODE_0CE4:
	MOV $0240+x, A
	CALL CODE_0BAB
	MOV $0241+x, A
	CALL CODE_0BAB
	MOV $80+x, A
	MOV A, $30+x
	MOV $0230+x, A
	MOV A, $31+x
	MOV $0231+x, A
CODE_0CFC:
	MOV A, $0240+x
	MOV $30+x, A
	MOV A, $0241+x
	MOV $31+x, A
	RET

;--------------------------------------------------------------------

CODE_0D07:
	MOV $4F, A
	AND A, $1A
	EOR A, $4F
	MOV $4A, A
	CALL CODE_0BAB
	MOV A, #$00
	MOVW $60, YA
	CALL CODE_0BAB
	MOV A, #$00
	MOVW $62, YA
	CLR5 $48
	RET

;--------------------------------------------------------------------

CODE_0D20:
	MOV $68, A
	CALL CODE_0BAB
	MOV $69, A
	SETC
	SBC A, $61
	MOV X, $68
	CALL CODE_0DF6
	MOVW $64, YA
	CALL CODE_0BAB
	MOV $6A, A
	SETC
	SBC A, $63
	MOV X, $68
	CALL CODE_0DF6
	MOVW $66, YA
	RET

;--------------------------------------------------------------------

CODE_0D41:
	MOVW $60, YA
	MOVW $62, YA
	SET5 $48
	RET

;--------------------------------------------------------------------

CODE_0D48:
	CALL CODE_0D6A
	CALL CODE_0BAB
	MOV $4E, A
	CALL CODE_0BAB
	MOV Y, #$08
	MUL YA
	MOV X, A
	MOV Y, #$0F
CODE_0D59:
	MOV A, DATA_3F31+x
	CALL CODE_09FD
	INC X
	MOV A, Y
	CLRC
	ADC A, #$10
	MOV Y, A
	BPL CODE_0D59
	MOV X, $44
	RET

;--------------------------------------------------------------------

CODE_0D6A:
	MOV $4D, A
	MOV Y, #$7D
	MOV $00F2, Y
	MOV A, $00F3
	CMP A, $4D
	BEQ CODE_0DA3
	AND A, #$0F
	EOR A, #$FF
	BBC7 $4C, CODE_0D82
	CLRC
	ADC A, $4C
CODE_0D82:
	MOV $4C, A
	MOV Y, #$04
CODE_0D86:
	MOV A, DATA_3FEB+y
	MOV $00F2, A
	MOV A, #$00
	MOV $00F3, A
	DBNZ Y, CODE_0D86
	MOV A, $48
	OR A, #$20
	MOV Y, #$6C
	CALL CODE_09FD
	MOV A, $4D
	MOV Y, #$7D
	CALL CODE_09FD
CODE_0DA3:
	ASL A
	ASL A
	ASL A
	EOR A, #$FF
	SETC
	ADC A, #$FF
	MOV Y, #$6D
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_0DB0:
	MOV $5F, A
	RET

;--------------------------------------------------------------------

CODE_0DB3:
	MOV A, $A0+x
	BNE CODE_0DEA
	MOV A, ($30+x)
	CMP A, #$F9
	BNE CODE_0DEA
	CALL CODE_0BAD
	CALL CODE_0BAB
	MOV $A1+x, A
	CALL CODE_0BAB
	MOV $A0+x, A
	CALL CODE_0BAB
	CLRC
	ADC A, $50
	ADC A, $02F0+x
CODE_0DD3:
	AND A, #$7F
	MOV $0380+x, A
	SETC
	SBC A, $0361+x
	MOV Y, $A0+x
	PUSH Y
	POP X
	CALL CODE_0DF6
	MOV $0370+x, A
	MOV A, Y
	MOV $0371+x, A
CODE_0DEA:
	RET

;--------------------------------------------------------------------

CODE_0DEB:
	MOV A, $0361+x
	MOV $11, A
	MOV A, $0360+x
	MOV $10, A
	RET

;--------------------------------------------------------------------

CODE_0DF6:
	NOTC
	ROR $12
	BPL CODE_0DFE
	EOR A, #$FF
	INC A
CODE_0DFE:
	MOV Y, #$00
	DIV YA, X
	PUSH A
	MOV A, #$00
	DIV YA, X
	POP Y
	MOV X, $44
CODE_0E08:
	BBC7 $12, CODE_0E11
	MOVW $14, YA
	MOVW YA, $0E
	SUBW YA, $14
CODE_0E11:
	RET

;--------------------------------------------------------------------

CODE_0E12:
	MOV A, $90+x
	BEQ CODE_0E3A
	OR $5E, $47
	DEC $90+x
	BNE CODE_0E27
	MOV A, #$00
	MOV $0300+x, A
	MOV A, $0320+x
	BRA CODE_0E37

CODE_0E27:
	CLRC
	MOV A, $0300+x
	ADC A, $0310+x
	MOV $0300+x, A
	MOV A, $0301+x
	ADC A, $0311+x
CODE_0E37:
	MOV $0301+x, A
CODE_0E3A:
	MOV Y, $C1+x
	BEQ CODE_0E61
	MOV A, $02E0+x
	CBNE $C0+x, CODE_0E5F
	OR $5E, $47
	MOV A, $02D0+x
	BPL CODE_0E53
	INC Y
	BNE CODE_0E53
	MOV A, #$80
	BRA CODE_0E57

CODE_0E53:
	CLRC
	ADC A, $02D1+x
CODE_0E57:
	MOV $02D0+x, A
	CALL CODE_1053
	BRA CODE_0E66

CODE_0E5F:
	INC $C0+x
CODE_0E61:
	MOV A, #$FF
	CALL CODE_105E
CODE_0E66:
	MOV A, $91+x
	BEQ CODE_0E8E
	OR $5E, $47
	DEC $91+x
	BNE CODE_0E7B
	MOV A, #$00
	MOV $0330+x, A
	MOV A, $0350+x
	BRA CODE_0E8B

CODE_0E7B:
	CLRC
	MOV A, $0330+x
	ADC A, $0340+x
	MOV $0330+x, A
	MOV A, $0331+x
	ADC A, $0341+x
CODE_0E8B:
	MOV $0331+x, A
CODE_0E8E:
	MOV A, $47
	AND A, $5E
	BEQ CODE_0EDA
	MOV A, $0331+x
	MOV Y, A
	MOV A, $0330+x
	MOVW $10, YA
CODE_0E9D:
	MOV A, X
	XCN A
	LSR A
	MOV $12, A
CODE_0EA2:
	MOV Y, $11
	MOV A, DATA_3F86+$01+y
	SETC
	SBC A, DATA_3F86+y
	MOV Y, $10
	MUL YA
	MOV A, Y
	MOV Y, $11
	CLRC
	ADC A, DATA_3F86+y
	MOV Y, A
	MOV A, $0321+x
	MUL YA
	MOV A, $0351+x
	ASL A
	BBC0 $12, CODE_0EC2
	ASL A
CODE_0EC2:
	MOV A, Y
	BCC CODE_0EC8
	EOR A, #$FF
	INC A
CODE_0EC8:
	MOV Y, $12
	CALL CODE_09F5
	MOV Y, #$14
	MOV A, #$00
	SUBW YA, $10
	MOVW $10, YA
	INC $12
	BBC1 $12, CODE_0EA2
CODE_0EDA:
	RET

;--------------------------------------------------------------------

CODE_0EDB:
	MOV A, $71+x
	BEQ CODE_0F44
	DEC $71+x
	BEQ CODE_0EE8
	MOV A, #$02
	CBNE $70+x, CODE_0F44
CODE_0EE8:
	MOV A, $80+x
	MOV $17, A
	MOV A, $30+x
	MOV Y, $31+x
CODE_0EF0:
	MOVW $14, YA
	MOV Y, #$00
CODE_0EF4:
	MOV A, ($14)+y
	BEQ CODE_0F16
	BMI CODE_0F01
CODE_0EFA:
	INC Y
	BMI CODE_0F3D
	MOV A, ($14)+y
	BPL CODE_0EFA
CODE_0F01:
	CMP A, #$C8
	BEQ CODE_0F44
	CMP A, #$EF
	BEQ CODE_0F32
	CMP A, #$E0
	BCC CODE_0F3D
	PUSH Y
	MOV Y, A
	POP A
	ADC A, DATA_3EF1+y
	MOV Y, A
	BRA CODE_0EF4

CODE_0F16:
	MOV A, $17
	BEQ CODE_0F3D
	DEC $17
	BNE CODE_0F28
	MOV A, $0231+x
	PUSH A
	MOV A, $0230+x
	POP Y
	BRA CODE_0EF0

CODE_0F28:
	MOV A, $0241+x
	PUSH A
	MOV A, $0240+x
	POP Y
	BRA CODE_0EF0

CODE_0F32:
	INC Y
	MOV A, ($14)+y
	PUSH A
	INC Y
	MOV A, ($14)+y
	MOV Y, A
	POP A
	BRA CODE_0EF0

CODE_0F3D:
	MOV A, $47
	MOV Y, #$5C
	CALL CODE_09F5
CODE_0F44:
	CLR7 $13
	MOV A, $A0+x
	BEQ CODE_0F76
	MOV A, $A1+x
	BEQ CODE_0F52
	DEC $A1+x
	BRA CODE_0F76

CODE_0F52:
	SET7 $13
	DEC $A0+x
	BNE CODE_0F63
	MOV A, $0381+x
	MOV $0360+x, A
	MOV A, $0380+x
	BRA CODE_0F73

CODE_0F63:
	CLRC
	MOV A, $0360+x
	ADC A, $0370+x
	MOV $0360+x, A
	MOV A, $0361+x
	ADC A, $0371+x
CODE_0F73:
	MOV $0361+x, A
CODE_0F76:
	CALL CODE_0DEB
	MOV A, $B1+x
	BEQ CODE_0FC9
	MOV A, $02B0+x
	CBNE $B0+x, CODE_0FC8
	MOV A, $0100+x
	CMP A, $02B1+x
	BNE CODE_0F90
	MOV A, $02C1+x
	BRA CODE_0F9D

CODE_0F90:
	SETP
	INC $00+x
	CLRp
	MOV Y, A
	BEQ CODE_0F99
	MOV A, $B1+x
CODE_0F99:
	CLRC
	ADC A, $02C0+x
CODE_0F9D:
	MOV $B1+x, A
	MOV A, $02A0+x
	CLRC
	ADC A, $02A1+x
	MOV $02A0+x, A
CODE_0FA9:
	MOV $12, A
	ASL A
	ASL A
	BCC CODE_0FB1
	EOR A, #$FF
CODE_0FB1:
	MOV Y, A
	MOV A, $B1+x
	CMP A, #$F1
	BCC CODE_0FBD
	AND A, #$0F
	MUL YA
	BRA CODE_0FC1

CODE_0FBD:
	MUL YA
	MOV A, Y
	MOV Y, #$00
CODE_0FC1:
	CALL CODE_103E
CODE_0FC4:
	JMP CODE_0972

CODE_0FC8:
	INC $B0+x
CODE_0FC9:
	BBS7 $13, CODE_0FC4
	RET

;--------------------------------------------------------------------

CODE_0FCD:
	CLR7 $13
	MOV A, $C1+x
	BEQ CODE_0FDC
	MOV A, $02E0+x
	CBNE $C0+x, CODE_0FDC
	CALL CODE_1046
CODE_0FDC:
	MOV A, $0331+x
	MOV Y, A
	MOV A, $0330+x
	MOVW $10, YA
	MOV A, $91+x
	BEQ CODE_0FF3
	MOV A, $0341+x
	MOV Y, A
	MOV A, $0340+x
	CALL CODE_1028
CODE_0FF3:
	BBC7 $13, CODE_0FF9
	CALL CODE_0E9D
CODE_0FF9:
	CLR7 $13
	CALL CODE_0DEB
	MOV A, $A0+x
	BEQ CODE_1010
	MOV A, $A1+x
	BNE CODE_1010
	MOV A, $0371+x
	MOV Y, A
	MOV A, $0370+x
	CALL CODE_1028
CODE_1010:
	MOV A, $B1+x
	BEQ CODE_0FC9
	MOV A, $02B0+x
	CBNE $B0+x, CODE_0FC9
	MOV Y, $51
	MOV A, $02A1+x
	MUL YA
	MOV A, Y
	CLRC
	ADC A, $02A0+x
	JMP CODE_0FA9

;--------------------------------------------------------------------

CODE_1028:
	SET7 $13
	MOV $12, Y
	CALL CODE_0E08
	PUSH Y
	MOV Y, $51
	MUL YA
	MOV $14, Y
	MOV $15, #$00
	MOV Y, $51
	POP A
	MUL YA
	ADDW YA, $14
CODE_103E:
	CALL CODE_0E08
	ADDW YA, $10
	MOVW $10, YA
	RET

;--------------------------------------------------------------------

CODE_1046:
	SET7 $13
	MOV Y, $51
	MOV A, $02D1+x
	MUL YA
	MOV A, Y
	CLRC
	ADC A, $02D0+x
CODE_1053:
	ASL A
	BCC CODE_1058
	EOR A, #$FF
CODE_1058:
	MOV Y, $C1+x
	MUL YA
	MOV A, Y
	EOR A, #$FF
CODE_105E:
	MOV Y, $59
	MUL YA
	MOV A, $0210+x
	MUL YA
	MOV A, $0301+x
	MUL YA
	MOV A, Y
	MUL YA
	MOV A, Y
	MOV $0321+x, A
	RET

;--------------------------------------------------------------------

CODE_1070:
	CALL CODE_1691
	MOV A, #$AA
	MOV $00F4, A
	MOV A, #$BB
	MOV $00F5, A
CODE_107D:
	MOV A, $00F4
	CMP A, #$CC
	BNE CODE_107D
	BRA CODE_10A6

CODE_1086:
	MOV Y, $00F4
	BNE CODE_1086
CODE_108B:
	CMP Y, $00F4
	BNE CODE_109F
	MOV A, $00F5
	MOV $00F4, Y
	MOV ($14)+y, A
	INC Y
	BNE CODE_108B
	INC $15
	BRA CODE_108B

CODE_109F:
	BPL CODE_108B
	CMP Y, $00F4
	BPL CODE_108B
CODE_10A6:
	MOV A, $00F6
	MOV Y, $00F7
	MOVW $14, YA
	MOV Y, $00F4
	MOV A, $00F5
	MOV $00F4, Y
	BNE CODE_1086
	MOV X, #$31
	MOV $00F1, X
	RET

;--------------------------------------------------------------------

DATA_10BF:
	db $D9,$10,$C9,$10,$FF,$00,$C1,$10,$00,$00,$E9,$10,$32,$11,$6E,$11
	db $85,$11,$C1,$11,$FD,$11,$0A,$12,$00,$00,$42,$12,$00,$00,$00,$00
	db $00,$00,$00,$00,$00,$00,$00,$00,$00,$00,$ED,$96,$E0,$04,$06,$7F
	db $A4,$A4,$A4,$A4,$E0,$05,$06,$7B,$A4,$E0,$04,$06,$7F,$A4,$A4,$A4
	db $A4,$A4,$A4,$A4,$E0,$05,$06,$7B,$A4,$E0,$04,$06,$7F,$A4,$A4,$A4
	db $E0,$04,$A4,$A4,$A4,$A4,$E0,$05,$06,$7B,$A4,$E0,$04,$06,$7F,$A4
	db $A4,$A4,$A4,$A4,$A4,$A4,$E0,$05,$06,$7B,$A4,$E0,$04,$06,$7F,$A4
	db $A4,$A4,$00,$E1,$08,$ED,$8C,$E0,$0B,$E3,$00,$12,$37,$0C,$3D,$B0
	db $B0,$B0,$06,$2B,$A6,$06,$3D,$B0,$C9,$0C,$B0,$06,$29,$A6,$06,$3D
	db $B0,$06,$2B,$A6,$0C,$3D,$B0,$AF,$AF,$AF,$06,$2B,$A4,$06,$3D,$AF
	db $C9,$0C,$AF,$06,$29,$A4,$06,$3D,$AF,$06,$2B,$A4,$0C,$3D,$AF,$ED
	db $C8,$E0,$0B,$18,$6D,$8E,$12,$95,$9A,$0C,$C9,$95,$9A,$18,$8C,$12
	db $93,$98,$0C,$C9,$93,$98,$ED,$6E,$E0,$14,$E1,$0C,$E3,$00,$16,$32
	db $0C,$3D,$A9,$A9,$A9,$06,$29,$A6,$06,$3D,$A9,$C9,$0C,$A9,$06,$29
	db $A6,$06,$3D,$A9,$06,$29,$A6,$0C,$3D,$A9,$A8,$A8,$A8,$06,$29,$A4
	db $06,$3D,$A8,$C9,$0C,$A8,$06,$29,$A4,$06,$3D,$A8,$06,$29,$A4,$0C
	db $3D,$A8,$E1,$0D,$ED,$82,$E0,$0B,$EB,$00,$28,$3C,$0C,$6D,$B0,$B0
	db $B0,$06,$39,$A6,$06,$6D,$B0,$C9,$0C,$B0,$06,$39,$A6,$06,$6D,$B0
	db $06,$39,$A6,$0C,$6D,$B0,$AF,$AF,$AF,$06,$39,$A4,$06,$6D,$AF,$C9
	db $0C,$AF,$06,$39,$A4,$06,$6D,$AF,$06,$39,$A4,$0C,$6D,$AF,$ED,$78
	db $E0,$05,$18,$C9,$30,$7B,$A4,$A4,$A4,$18,$A4,$E1,$08,$ED,$73,$E0
	db $0B,$0C,$6D,$A9,$A9,$A9,$06,$39,$A6,$06,$6D,$A9,$C9,$0C,$A9,$06
	db $39,$A6,$06,$6D,$A9,$06,$39,$A6,$0C,$6D,$A9,$A8,$A8,$A8,$06,$39
	db $A4,$06,$6D,$A8,$C9,$0C,$A8,$06,$39,$A4,$06,$6D,$A8,$06,$39,$A4
	db $0C,$6D,$A8,$FA,$1A,$E5,$D2,$E7,$1F,$F5,$3A,$28,$28,$00,$00,$68
	db $12,$58,$12,$FF,$00,$50,$12,$00,$00,$78,$12,$8E,$12,$A9,$12,$DE
	db $12,$F9,$12,$03,$13,$26,$13,$60,$13,$7B,$13,$88,$13,$00,$00,$95
	db $13,$00,$00,$00,$00,$00,$00,$A2,$13,$ED,$FF,$E0,$0C,$18,$7F,$9D
	db $98,$12,$9D,$98,$0C,$97,$18,$96,$9D,$12,$96,$9A,$0C,$9B,$00,$12
	db $7F,$A4,$06,$A4,$18,$C9,$0C,$C9,$A4,$06,$C9,$0C,$A4,$06,$A4,$12
	db $A4,$06,$A4,$30,$C9,$06,$C9,$A1,$A2,$A3,$ED,$AA,$E0,$06,$18,$7F
	db $9C,$E0,$05,$0C,$A4,$E0,$06,$9C,$06,$9C,$E0,$05,$0C,$A4,$06,$A4
	db $0C,$A4,$E0,$06,$06,$9C,$9C,$E0,$06,$18,$9C,$E0,$05,$0C,$A4,$E0
	db $06,$9C,$06,$9C,$E0,$05,$0C,$A4,$06,$A4,$0C,$A4,$06,$A4,$A4,$12
	db $7F,$A0,$06,$A0,$18,$C9,$0C,$C9,$A0,$06,$C9,$0C,$A0,$06,$A0,$12
	db $A0,$06,$A0,$30,$C9,$06,$C9,$9D,$9E,$9F,$ED,$8C,$E1,$0C,$E0,$10
	db $EF,$B0,$13,$02,$E1,$0F,$ED,$88,$E0,$15,$0C,$7F,$9D,$9D,$12,$98
	db $06,$9D,$C9,$0C,$9D,$06,$9D,$0C,$98,$98,$9D,$9D,$98,$9D,$ED,$91
	db $E0,$19,$B0,$06,$B0,$1E,$B0,$E1,$08,$ED,$AA,$E0,$16,$0C,$7F,$AB
	db $04,$79,$AB,$04,$7B,$AB,$04,$7D,$AB,$0C,$7F,$AD,$06,$AB,$AB,$C9
	db $0C,$AD,$06,$AD,$AD,$AD,$0C,$AD,$AD,$04,$79,$AD,$04,$7B,$AD,$04
	db $7D,$AD,$0C,$7F,$AD,$06,$AD,$AD,$C9,$0C,$AD,$06,$AD,$AD,$AD,$0C
	db $AD,$12,$7F,$9B,$06,$9B,$18,$C9,$0C,$C9,$9B,$06,$C9,$0C,$9B,$06
	db $9B,$12,$9A,$06,$9A,$30,$C9,$06,$C9,$98,$99,$9A,$FA,$1A,$E5,$D2
	db $E7,$1B,$F5,$8A,$28,$28,$12,$C9,$00,$E0,$0B,$ED,$82,$E3,$0C,$2A
	db $1E,$06,$7F,$A1,$A2,$A3,$E0,$0B,$ED,$82,$E3,$0C,$2A,$1E,$06,$7F
	db $9D,$9E,$9F,$E0,$0B,$ED,$82,$E3,$0C,$2A,$1E,$06,$7F,$98,$99,$9A
	db $00,$06,$6B,$AB,$06,$6D,$AB,$06,$6F,$AE,$06,$6D,$AB,$C9,$06,$6B
	db $AE,$06,$6D,$AE,$06,$6F,$AE,$0C,$6D,$AE,$06,$AB,$AB,$C9,$06,$6B
	db $AB,$06,$6D,$AB,$06,$6F,$AB,$00,$F1,$13,$E1,$13,$FF,$00,$D9,$13
	db $00,$00,$01,$14,$22,$14,$61,$14,$83,$14,$A5,$14,$C7,$14,$E9,$14
	db $00,$00,$07,$15,$00,$00,$16,$15,$00,$00,$00,$00,$00,$00,$00,$00
	db $00,$00,$ED,$E6,$E0,$0B,$12,$7F,$98,$06,$98,$12,$90,$06,$91,$C9
	db $0C,$91,$06,$91,$0C,$93,$93,$12,$98,$06,$98,$9A,$9A,$C9,$9C,$18
	db $C9,$C9,$00,$ED,$D2,$E0,$10,$06,$7F,$AB,$AB,$AB,$AB,$0C,$AE,$06
	db $AB,$AB,$C9,$0C,$AE,$06,$AB,$0C,$AE,$06,$AE,$AE,$AB,$AB,$AB,$AB
	db $AE,$AE,$C9,$AE,$E0,$07,$ED,$C8,$0C,$C9,$09,$AD,$F9,$00,$0D,$B8
	db $03,$C9,$01,$0F,$B8,$F9,$00,$01,$AA,$0D,$7F,$AA,$F9,$00,$0D,$A6
	db $0A,$C9,$E0,$11,$ED,$FA,$12,$7F,$9F,$06,$A4,$0C,$C9,$A8,$06,$C9
	db $0C,$A9,$06,$AB,$C9,$AB,$0C,$AB,$12,$3F,$A8,$06,$A8,$A9,$A9,$C9
	db $AB,$18,$C9,$C9,$E1,$09,$ED,$9B,$E0,$0B,$12,$3F,$A4,$06,$A4,$12
	db $A4,$06,$A4,$C9,$0C,$A4,$06,$A4,$0C,$A6,$A6,$12,$A4,$06,$A4,$A6
	db $A6,$C9,$A8,$18,$C9,$C9,$E1,$03,$ED,$A0,$E0,$0B,$12,$3F,$A8,$06
	db $A8,$12,$A8,$06,$A9,$C9,$0C,$A9,$06,$A9,$0C,$AB,$AB,$12,$A8,$06
	db $A8,$A9,$A9,$C9,$AB,$18,$C9,$C9,$E1,$11,$ED,$9B,$E0,$0B,$12,$3F
	db $9F,$06,$9F,$12,$9F,$06,$A1,$C9,$0C,$A1,$06,$A1,$0C,$A3,$A3,$12
	db $9F,$06,$9F,$A1,$A1,$C9,$A3,$18,$C9,$C9,$E0,$19,$ED,$AA,$0C,$7F
	db $AC,$AC,$12,$A7,$06,$AC,$C9,$0C,$AC,$06,$AC,$0C,$A7,$A7,$AC,$AC
	db $06,$AC,$AC,$C9,$AC,$18,$C9,$C9,$FA,$1A,$E5,$AF,$E7,$18,$F5,$BD
	db $2E,$2E,$12,$C9,$0C,$C9,$00,$E0,$11,$ED,$FA,$E3,$0C,$2A,$1E,$06
	db $7F,$9C,$12,$9D,$06,$9E,$00

DATA_1526:
	db $00,$63,$5F,$5A,$55,$50,$46,$41
	db $00,$BE,$B9,$AF,$AA,$A5,$A0,$9C

DATA_1536:
	db $00,$05,$05,$05,$05,$05,$05,$05
	db $05,$04,$04,$04,$04,$04,$04,$04

DATA_1546:
	db $00,$08,$07,$06,$05,$04,$03,$02
	db $02,$02,$03,$04,$05,$06,$07,$08

DATA_1556:
	db $3C,$A0,$96,$78,$5A,$3C,$1E,$05

DATA_155E:
	db $05,$1E,$3C,$5A,$78,$96

DATA_1564:
	dw DATA_3CA0
	dw DATA_FF00
	dw $07CA
	dw DATA_D783
	dw $D000
	dw $3E45
	dw $D000
	dw $D000
	dw DATA_10BF
	dw $DAF9
	dw DATA_03DB
	dw $06F0
	dw $DD3B
	dw $DC37
	dw $0506
	dw $D989
	dw $124E
	dw $05FE
	dw $3D24
	dw $13D7
	dw $DE33
	dw $D000
	dw $D000

DATA_1592:
	dw CODE_2CF4
	dw CODE_2D1B
	dw CODE_2D3C
	dw CODE_2D5D
	dw CODE_2D7E
	dw CODE_2DAB
	dw CODE_2DD2
	dw CODE_2DFF
	dw CODE_2E20
	dw CODE_2E47
	dw CODE_2E6E
	dw CODE_2ED2
	dw CODE_2F0E
	dw CODE_2F35
	dw CODE_2F62
	dw CODE_2F8F
	dw CODE_2FBC
	dw CODE_2FC1
	dw CODE_2FC6
	dw CODE_2FED
	dw CODE_2FF2
	dw CODE_2FF7
	dw CODE_301E
	dw CODE_3023
	dw CODE_3028
	dw CODE_304F
	dw CODE_304F
	dw CODE_30C9
	dw CODE_3123
	dw CODE_3128
	dw CODE_312D
	dw CODE_3154
	dw CODE_317B
	dw CODE_31A2
	dw CODE_31C9
	dw CODE_31F0
	dw CODE_3217
	dw CODE_321C
	dw CODE_3221
	dw CODE_3248
	dw CODE_32B3
	dw CODE_32D4
	dw CODE_2D1B
	dw CODE_3301
	dw CODE_338E
	dw CODE_33B5
	dw CODE_33DF
	dw CODE_3426
	dw CODE_34A0
	dw CODE_34DC
	dw CODE_34FD
	dw CODE_351E
	dw CODE_355A
	dw CODE_3584
	dw CODE_35B8
	dw CODE_35F0
	dw CODE_36A0
	dw CODE_36A8
	dw CODE_36B0
	dw CODE_36EC
	dw CODE_376D
	dw CODE_37A9
	dw CODE_37F0
	dw CODE_3809
	dw CODE_384E
	dw CODE_3867
	dw CODE_38BC
	dw CODE_38C2
	dw CODE_38CB
	dw CODE_3907
	dw CODE_3934
	dw CODE_3934
	dw CODE_3982

DATA_1624:
	dw CODE_16F1
	dw CODE_16FC
	dw CODE_1707
	dw CODE_1712
	dw CODE_172A
	dw CODE_1735
	dw CODE_1740
	dw CODE_174B
	dw CODE_1763
	dw CODE_1769
	dw CODE_176F
	dw CODE_1775
	dw CODE_1780
	dw CODE_1784
	dw CODE_385B
	dw CODE_3861

DATA_1644:
	dw CODE_23AD
	dw CODE_2437
	dw CODE_2464
	dw CODE_2491
	dw CODE_24AC
	dw CODE_24D9
	dw CODE_24F4
	dw CODE_25D6
	dw CODE_25EE
	dw CODE_260C
	dw CODE_2716
	dw CODE_27D9
	dw CODE_28F3
	dw CODE_2920
	dw CODE_29B3
	dw CODE_2CD6

;--------------------------------------------------------------------

CODE_1664:
	CALL CODE_17AF
	CALL CODE_169C
	CALL CODE_16B8
	CALL CODE_1797
	CALL CODE_17DA
	CALL CODE_182E
	JMP CODE_1868

;--------------------------------------------------------------------

CODE_1679:
	MOV A, $00
	BEQ CODE_1690
	CMP A, #$1F
	BEQ CODE_1690
	MOV A, $00
	BMI CODE_168C
	MOV A, $00
	SETC
	SBC A, #$20
	BMI CODE_1690
CODE_168C:
	MOV A, #$00
	MOV $00, A
CODE_1690:
	RET

;--------------------------------------------------------------------

CODE_1691:
	MOV X, #$00
	MOV $EA, X
	MOV $6B, X
	INC X
	MOV $03B5, X
	RET

;--------------------------------------------------------------------

CODE_169C:
	MOV A, $00
	AND A, #$7F
	MOV X, A
	BEQ CODE_16AF
	SETC
	SBC A, #$20
	BMI CODE_16B4
	MOV A, X
	SETC
	SBC A, #$70
	BPL CODE_16B4
	MOV A, X
CODE_16AF:
	MOV $E8, A
	JMP CODE_19B4

CODE_16B4:
	MOV A, #$00
	BRA CODE_16AF

;--------------------------------------------------------------------

CODE_16B8:
	MOV A, $00
	AND A, #$7F
	CMP A, #$04
	BEQ CODE_16D3
	CMP A, #$1D
	BEQ CODE_16D8
	CMP A, #$1E
	BEQ CODE_16E2
CODE_16C8:
	SETC
	SBC A, #$70
	BMI CODE_16D2
	ASL A
	MOV X, A
	JMP (DATA_1624+x)

CODE_16D2:
	RET

CODE_16D3:
	CALL CODE_1788
	BRA CODE_16C8

CODE_16D8:
	MOV A, #$00
	MOV $04, A
	MOV $6B, A
	MOV $EA, A
	BRA CODE_16E6

CODE_16E2:
	MOV A, #$01
	MOV $6B, A
CODE_16E6:
	MOV A, #$00
	MOV $E1, A
	MOV $6C, A
	INC A
	MOV $03A4, A
	RET

;--------------------------------------------------------------------

CODE_16F1:
	MOV A, #$47
	MOV X, #$22
	MOV Y, #$11
	MOV $20, #$03
	BRA CODE_171B

CODE_16FC:
	MOV A, #$48
	MOV X, #$26
	MOV Y, #$0F
	MOV $20, #$04
	BRA CODE_171B

CODE_1707:
	MOV A, #$46
	MOV X, #$1D
	MOV Y, #$19
	MOV $20, #$19
	BRA CODE_171B

CODE_1712:
	MOV A, #$46
	MOV X, #$13
	MOV Y, #$20
	MOV $20, #$18
CODE_171B:
	MOV $03B2, A
	MOV $03D6, X
	MOV $03D4, Y
	MOV A, $20
	MOV $0390, A
	RET

;--------------------------------------------------------------------

CODE_172A:
	MOV A, #$47
	MOV X, #$22
	MOV Y, #$11
	MOV $20, #$03
	BRA CODE_1754

CODE_1735:
	MOV A, #$48
	MOV X, #$26
	MOV Y, #$0F
	MOV $20, #$04
	BRA CODE_1754

CODE_1740:
	MOV A, #$46
	MOV X, #$1D
	MOV Y, #$19
	MOV $20, #$19
	BRA CODE_1754

CODE_174B:
	MOV A, #$46
	MOV X, #$13
	MOV Y, #$20
	MOV $20, #$18
CODE_1754:
	MOV $03B3, A
	MOV $03D7, X
	MOV $03D5, Y
	MOV A, $20
	MOV $0391, A
	RET

;--------------------------------------------------------------------

CODE_1763:
	MOV A, #$0E
	MOV X, #$03
	BRA CODE_1779

CODE_1769:
	MOV A, #$0E
	MOV X, #$04
	BRA CODE_1779

CODE_176F:
	MOV A, #$0A
	MOV X, #$19
	BRA CODE_1779

CODE_1775:
	MOV A, #$06
	MOV X, #$18
CODE_1779:
	MOV $03B4, A
	MOV $03C0, X
	RET

;--------------------------------------------------------------------

CODE_1780:
	MOV A, #$01
	BRA CODE_1786

CODE_1784:
	MOV A, #$00
CODE_1786:
	MOV $E3, A
CODE_1788:
	MOV A, #$00
	MOV $0394, A
	MOV $0396, A
	MOV $0395, A
	MOV $0397, A
	RET

;--------------------------------------------------------------------

CODE_1797:
	CALL CODE_1CE8
	MOV X, #$01
	CALL CODE_08F2
	CALL CODE_1A8B
	MOV X, #$02
	CALL CODE_08F2
	CALL CODE_1B57
	MOV X, #$03
	JMP CODE_08F2

;--------------------------------------------------------------------

CODE_17AF:
	BBS7 $00, CODE_17C6
	MOV A, $E4
	CMP A, #$01
	BNE CODE_17BF
	MOV A, #$02
	MOV $1B, A
	MOV $E4, A
	RET

CODE_17BF:
	MOV A, #$00
	MOV $1B, A
	MOV $E4, A
	RET

CODE_17C6:
	MOV A, $E4
	BEQ CODE_17D2
	MOV A, #$00
	MOV $1B, A
	INC A
	MOV $E4, A
	RET

CODE_17D2:
	MOV A, #$01
	MOV $1B, A
	INC A
	MOV $E4, A
	RET

;--------------------------------------------------------------------

CODE_17DA:
	MOV A, $04
	AND A, #$7F
	CMP A, #$07
	BEQ CODE_17EF
	CMP A, #$06
	BEQ CODE_17FC
	CMP A, #$15
	BEQ CODE_1809
	MOV A, #$00
	MOV $EA, A
	RET

CODE_17EF:
	MOV A, $EA
	CMP A, #$0A
	BEQ CODE_1816
	CMP A, #$0B
	BEQ CODE_1815
	INC $EA
	RET

CODE_17FC:
	MOV A, $EA
	CMP A, #$FE
	BEQ CODE_1816
	CMP A, #$FF
	BEQ CODE_1815
	INC $EA
	RET

CODE_1809:
	MOV A, $EA
	CMP A, #$0A
	BEQ CODE_181B
	CMP A, #$0B
	BEQ CODE_1815
	INC $EA
CODE_1815:
	RET

CODE_1816:
	MOV $21, #$55
	BRA CODE_181E

CODE_181B:
	MOV $21, #$99
CODE_181E:
	MOV A, $53
	MOV $20, A
	MOV Y, $21
	MUL YA
	MOV A, Y
	CLRC
	ADC A, $20
	MOV $53, A
	INC $EA
	RET

;--------------------------------------------------------------------

CODE_182E:
	MOV A, $6B
	BEQ CODE_1844
	MOV A, $E4
	BNE CODE_1838
	DEC $59
CODE_1838:
	DEC $59
	MOV A, $59
	CMP A, #$01
	BEQ CODE_1845
	CMP A, #$00
	BEQ CODE_1845
CODE_1844:
	RET

CODE_1845:
	MOV A, #$00
	MOV $59, A
	MOV Y, #$00
CODE_184B:
	MOV A, #$00
	CALL CODE_09FD
	INC Y
	CALL CODE_09FD
	MOV A, Y
	CLRC
	ADC A, #$0F
	MOV Y, A
	CMP Y, #$80
	BNE CODE_184B
	MOV A, #$00
	MOV $6B, A
	MOV $04, A
	MOV A, $E4
	BEQ CODE_1844
	RET

;--------------------------------------------------------------------

CODE_1868:
	MOV A, $E4
	CMP A, #$01
	BEQ CODE_189F
	CMP A, #$02
	BNE CODE_188F
	MOV A, $1B
	CMP A, #$02
	BEQ CODE_1886
CODE_1878:
	MOV A, $D3
	BNE CODE_189F
	MOV A, $59
	MOV $D3, A
	MOV Y, #$8E
	MUL YA
	MOV $59, Y
	RET

CODE_1886:
	MOV A, $D3
	MOV $59, A
	MOV A, #$00
	MOV $D3, A
	RET

CODE_188F:
	MOV A, $E9
	CMP A, #$61
	BNE CODE_189F
	MOV A, $E2
	CMP A, #$03
	BEQ CODE_18A0
	CMP A, #$FA
	BEQ CODE_18A7
CODE_189F:
	RET

CODE_18A0:
	MOV A, #$00
	MOV $03B5, A
	BRA CODE_1878

CODE_18A7:
	MOV A, $03B5
	BEQ CODE_1886
	MOV A, #$01
	MOV $03B5, A
	DEC A
	MOV $D3, A
	RET

DATA_18B5:
	db $20,$24,$26,$27,$28,$29,$2A,$2B
	db $47,$48,$4F,$55,$5D,$5E,$5F,$60
	db $62,$63,$68,$4E,$65,$56,$57,$3A
	db $66,$67,$39,$00

DATA_18D1:
	db $39,$3A,$50,$5B,$5D,$5E,$5F,$60
	db $62,$63,$65,$4E,$68,$55,$27,$2A
	db $48,$56,$57,$47,$2B,$66,$67,$24
	db $29,$3B,$00

DATA_18EC:
	db $1E,$1E,$14,$64,$5A,$03,$3C,$03
	db $3C,$03,$32,$3C,$3C,$28,$0F,$1E
	db $32,$2D,$2D,$7D,$14,$14,$14,$14
	db $32,$2A

CODE_1906:
	MOV A, $E8
	CMP A, #$68
	BEQ CODE_1981
	CMP A, #$61
	BEQ CODE_1981
	MOV A, $E9
	CMP A, #$68
	BEQ CODE_191C
	CMP A, #$61
	BEQ CODE_191C
	BRA CODE_1922

CODE_191C:
	MOV A, #$00
	MOV $E8, A
	BRA CODE_1981

CODE_1922:
	MOV A, $E9
	CMP A, #$4E
	BNE CODE_194A
	MOV A, $E8
	CMP A, #$25
	BEQ CODE_1981
	CMP A, #$4C
	BEQ CODE_1981
	CMP A, #$27
	BEQ CODE_1981
	CMP A, #$28
	BEQ CODE_1981
	CMP A, #$40
	BEQ CODE_1981
	CMP A, #$41
	BEQ CODE_1981
	CMP A, #$42
	BEQ CODE_1981
	CMP A, #$43
	BEQ CODE_1981
CODE_194A:
	MOV X, #$00
CODE_194C:
	MOV A, $E8
	CMP A, DATA_18B5+x
	BEQ CODE_1981
	INC X
	MOV A, DATA_18B5+x
	BNE CODE_194C
	MOV X, #$00
CODE_195B:
	MOV A, DATA_18D1+x
	MOV $20, A
	MOV A, $E9
	CMP A, $20
	BNE CODE_197B
	BRA CODE_196E

CODE_1968:
	MOV A, #$00
	MOV $E8, A
	BRA CODE_197B

CODE_196E:
	MOV A, $E8
	CMP A, $20
	BEQ CODE_197B
	MOV A, $E2
	SBC A, DATA_18EC+x
	BMI CODE_1968
CODE_197B:
	INC X
	MOV A, DATA_18D1+x
	BNE CODE_195B
CODE_1981:
	MOV A, $E8
	CMP A, #$4F
	BNE CODE_198D
	MOV A, #$00
	MOV $E1, A
	MOV $E0, A
CODE_198D:
	MOV A, $E9
	BNE CODE_199D
	MOV A, $E1
	BEQ CODE_199D
	MOV A, $E4
	BNE CODE_199D
	MOV A, #$4F
	MOV $E8, A
CODE_199D:
	MOV A, $6C
	BEQ CODE_19A7
	MOV A, $E4
	BNE CODE_19A7
	INC $E1
CODE_19A7:
	MOV A, $E1
	CMP A, #$E1
	BNE CODE_19B3
	MOV A, #$00
	MOV $6C, A
	MOV $E1, A
CODE_19B3:
	RET

;--------------------------------------------------------------------

CODE_19B4:
	CALL CODE_1906
	MOV A, $E4
	CMP A, #$02
	BNE CODE_19C9
	MOV A, $1B
	CMP A, #$01
	BEQ CODE_19C5
	BRA CODE_19C9

CODE_19C5:
	MOV A, #$2D
	MOV $E8, A
CODE_19C9:
	MOV A, $E8
	BEQ CODE_19DE
	MOV A, $E9
	CMP A, #$4F
	BNE CODE_19D7
	MOV A, #$01
	MOV $6C, A
CODE_19D7:
	CALL CODE_1A03
	MOV A, $E8
	MOV $E9, A
CODE_19DE:
	MOV A, $E9
	BEQ CODE_1A03
	INC $E2
	MOV A, $E2
	CMP A, #$FE
	BEQ CODE_19F3
	MOV A, $E2
	CMP A, #$01
	BNE CODE_1A12
	JMP CODE_1A3D

CODE_19F3:
	INC $03BD
	MOV A, $03BD
	CMP A, #$02
	BEQ CODE_1A00
	SET3 $46
	RET

CODE_1A00:
	CALL CODE_238A
CODE_1A03:
	MOV A, #$00
	MOV $E2, A
	MOV $E9, A
	MOV $03BC, A
	MOV $EF, A
	MOV $03BD, A
	RET

CODE_1A12:
	MOV A, $E9
	CALL CODE_2CEC
	MOV $039E, A
	MOV A, $03BC
	BNE CODE_19F3
	CALL CODE_22D8
	MOV A, $EF
	BEQ CODE_1A3C
	CMP A, #$02
	BEQ CODE_1A36
	CMP A, #$03
	BEQ CODE_1A30
	SET3 $46
CODE_1A30:
	MOV A, #$02
	MOV $EF, A
	BRA CODE_1A3C

CODE_1A36:
	SET3 $45
	MOV A, #$00
	MOV $EF, A

CODE_1A3C:
	RET

;--------------------------------------------------------------------

CODE_1A3D:
	SET3 $1A
	SET3 $46
	MOV A, $E9
	CALL CODE_2CEC
	CALL CODE_1A53
	MOV A, $1F
	BNE CODE_1A50
	CLR3 $4A
	RET

CODE_1A50:
	SET3 $4A
	RET

;--------------------------------------------------------------------

CODE_1A53:
	MOV A, $02
	AND A, #$80
	BNE CODE_1A6B
	MOV A, $ED
	MOV Y, #$D0
	MUL YA
	MOV $03C8, Y
	MOV A, $EE
	MOV Y, #$D0
	MUL YA
	MOV $03C9, Y
	BRA CODE_1A7B

CODE_1A6B:
	MOV A, $ED
	MOV Y, #$D0
	MUL YA
	MOV $03C9, Y
	MOV A, $EE
	MOV Y, #$D0
	MUL YA
	MOV $03C8, Y
CODE_1A7B:
	MOV A, $E3
	BEQ CODE_1A8A
	MOV A, $ED
	MOV Y, #$85
	MUL YA
	MOV $03C8, Y
	MOV $03C9, Y
CODE_1A8A:
	RET

;--------------------------------------------------------------------

CODE_1A8B:
	MOV A, $02
	MOV $06, A
	AND A, #$7F
	MOV $DA, A
	MOV A, $01
	AND A, #$80
	MOV $03AE, A
	MOV A, $DA
	BNE CODE_1AB4
	MOV A, $0394
	BEQ CODE_1ACC
	MOV A, $00E4
	BNE CODE_1AAD
	DEC $0394
	BRA CODE_1ABE

CODE_1AAD:
	MOV A, #$00
	MOV $0394, A
	BRA CODE_1ACC

CODE_1AB4:
	MOV A, #$FF
	MOV $0394, A
	MOV A, $DA
	MOV $0396, A
CODE_1ABE:
	MOV A, $DA
	BNE CODE_1ACC
	MOV A, $03A4
	BNE CODE_1ACC
	MOV A, $0396
	MOV $DA, A
CODE_1ACC:
	MOV A, $DA
	BEQ CODE_1ADA
	MOV A, $E4
	CMP A, #$01
	BEQ CODE_1AFD
	CMP A, #$02
	BEQ CODE_1B0A
CODE_1ADA:
	MOV A, $DA
	BEQ CODE_1AED
	MOV A, #$00
	MOV $03A4, A
	MOV A, $DC
	BEQ CODE_1B14
	CMP A, #$01
	BEQ CODE_1B1E
	BRA CODE_1B31

CODE_1AED:
	MOV A, $03BA
	BEQ CODE_1B4B
	MOV A, $DC
	CMP A, #$02
	BEQ CODE_1B44
	CMP A, #$01
	BEQ CODE_1B4B
	RET

CODE_1AFD:
	MOV A, $DC
	BEQ CODE_1B3E
	MOV A, #$00
	MOV $DC, A
	CALL CODE_2312
	BRA CODE_1B3E

CODE_1B0A:
	MOV A, #$01
	MOV $DC, A
	SET7 $1A
	SET7 $46
	BRA CODE_1B3E

CODE_1B14:
	MOV A, #$01
	MOV $DC, A
	SET7 $1A
	SET7 $46
	BRA CODE_1B3E

CODE_1B1E:
	MOV A, #$02
	MOV $DC, A
	SET7 $45
	MOV A, $03A5
	BNE CODE_1B2D
	MOV A, #$00
	BRA CODE_1B2F

CODE_1B2D:
	MOV A, #$0D
CODE_1B2F:
	MOV $1C, A
CODE_1B31:
	MOV A, $1F
	BNE CODE_1B39
	CLR7 $4A
	BRA CODE_1B3B

CODE_1B39:
	SET7 $4A
CODE_1B3B:
	CALL CODE_2044
CODE_1B3E:
	MOV A, $DA
	MOV $03BA, A
	RET
CODE_1B44:
	MOV A, #$01
	MOV $DC, A
	SET7 $46
	RET

CODE_1B4B:
	MOV A, #$00
	MOV $DC, A
	CALL CODE_2312
	BRA CODE_1B3E

;--------------------------------------------------------------------

CODE_1B54:
	JMP CODE_1C2A

CODE_1B57:
	MOV A, $03
	MOV $07, A
	AND A, #$80
	MOV $1F, A
	MOV A, $E3
	BNE CODE_1B54
	MOV A, $03
	AND A, #$7F
	MOV $DB, A
	MOV A, $01
	AND A, #$40
	MOV $03AF, A
	MOV A, $DB
	BNE CODE_1B8A
	MOV A, $0395
	BEQ CODE_1BA2
	MOV A, $00E4
	BNE CODE_1B83
	DEC $0395
	BRA CODE_1B94

CODE_1B83:
	MOV A, #$00
	MOV $0395, A
	BRA CODE_1BA2

CODE_1B8A:
	MOV A, #$FF
	MOV $0395, A
	MOV A, $DB
	MOV $0397, A
CODE_1B94:
	MOV A, $DB
	BNE CODE_1BA2
	MOV A, $03A4
	BNE CODE_1BA2
	MOV A, $0397
	MOV $DB, A
CODE_1BA2:
	MOV A, $DB
	BEQ CODE_1BB0
	MOV A, $E4
	CMP A, #$01
	BEQ CODE_1BD3
	CMP A, #$02
	BEQ CODE_1BE0
CODE_1BB0:
	MOV A, $DB
	BEQ CODE_1BC3
	MOV A, #$00
	MOV $03A4, A
	MOV A, $DD
	BEQ CODE_1BEA
	CMP A, #$01
	BEQ CODE_1BF4
	BRA CODE_1C07

CODE_1BC3:
	MOV A, $03BB
	BEQ CODE_1C21
	MOV A, $DD
	CMP A, #$02
	BEQ CODE_1C1A
	CMP A, #$01
	BEQ CODE_1C21
	RET

CODE_1BD3:
	MOV A, $DD
	BEQ CODE_1C14
	MOV A, #$00
	MOV $DD, A
	CALL CODE_2330
	BRA CODE_1C14

CODE_1BE0:
	MOV A, #$01
	MOV $DD, A
	SET6 $1A
	SET6 $46
	BRA CODE_1C14

CODE_1BEA:
	MOV A, #$01
	MOV $DD, A
	SET6 $1A
	SET6 $46
	BRA CODE_1C14

CODE_1BF4:
	MOV A, #$02
	MOV $DD, A
	SET6 $45
	MOV A, $03A6
	BNE CODE_1C03
	MOV A, #$00
	BRA CODE_1C05

CODE_1C03:
	MOV A, #$0D
CODE_1C05:
	MOV $1D, A
CODE_1C07:
	MOV A, $1F
	BNE CODE_1C0F
	CLR6 $4A
	BRA CODE_1C11

CODE_1C0F:
	SET6 $4A
CODE_1C11:
	CALL CODE_20F7
CODE_1C14:
	MOV A, $DB
	MOV $03BB, A
	RET

CODE_1C1A:
	MOV A, #$01
	MOV $DD, A
	SET6 $46
	RET

CODE_1C21:
	MOV A, #$00
	MOV $DD, A
	CALL CODE_2330
	BRA CODE_1C14

;--------------------------------------------------------------------

CODE_1C2A:
	MOV A, $03
	MOV $07, A
	AND A, #$0F
	MOV $6F, A
	MOV A, $07
	AND A, #$70
	LSR A
	LSR A
	LSR A
	LSR A
	MOV $03D9, A
	MOV A, $07
	AND A, #$7F
	MOV $03DA, A
	BEQ CODE_1C50
	MOV A, $E4
	CMP A, #$01
	BEQ CODE_1C8B
	CMP A, #$02
	BEQ CODE_1C98
CODE_1C50:
	MOV A, $03DA
	BEQ CODE_1C7B
	MOV A, $6F
	BEQ CODE_1C7B
	MOV A, $039F
	CMP A, #$02
	BEQ CODE_1C71
	CMP A, #$01
	BNE CODE_1C6B
	MOV A, #$02
	MOV $039F, A
	BRA CODE_1C71

CODE_1C6B:
	MOV A, #$01
	MOV $039F, A
	RET

CODE_1C71:
	MOV A, $D5
	BEQ CODE_1CA2
	CMP A, #$01
	BEQ CODE_1CAC
	BRA CODE_1CBF

CODE_1C7B:
	MOV A, $D5
	CMP A, #$02
	BEQ CODE_1CC8
	CMP A, #$01
	BEQ CODE_1CCF
	MOV A, #$00
	MOV $039F, A
	RET

CODE_1C8B:
	MOV A, $D5
	BEQ CODE_1CC7
	MOV A, #$00
	MOV $D5, A
	CALL CODE_2330
	BRA CODE_1CC7

CODE_1C98:
	MOV A, #$01
	MOV $D5, A
	SET6 $1A
	SET6 $46
	BRA CODE_1CC7

CODE_1CA2:
	MOV A, #$01
	MOV $D5, A
	SET6 $1A
	SET6 $46
	BRA CODE_1CC7

CODE_1CAC:
	SET6 $45
	MOV A, #$02
	MOV $D5, A
	MOV A, $03A7
	BNE CODE_1CBB
	MOV A, #$00
	BRA CODE_1CBD

CODE_1CBB:
	MOV A, #$0B
CODE_1CBD:
	MOV $1E, A
CODE_1CBF:
	SET6 $4A
	MOV A, $03DA
	CALL CODE_219A
CODE_1CC7:
	RET

CODE_1CC8:
	MOV A, #$01
	MOV $D5, A
	SET6 $46
	RET

CODE_1CCF:
	MOV A, $03C1
	CMP A, #$40
	BEQ CODE_1CDA
	INC $03C1
	RET

CODE_1CDA:
	MOV A, #$00
	MOV $D5, A
	CALL CODE_2330
	MOV A, #$00
	MOV $03C1, A
	BRA CODE_1CC7

;--------------------------------------------------------------------

CODE_1CE8:
	MOV A, $01
	MOV $05, A
	AND A, #$0F
	MOV $E7, A
	MOV A, $05
	AND A, #$30
	MOV $D4, A
	MOV A, $E4
	CMP A, #$01
	BEQ CODE_1D57
	CMP A, #$02
	BEQ CODE_1D5F
	MOV A, $03C6
	BEQ CODE_1D15
	CMP A, #$01
	BEQ CODE_1D10
	MOV A, #$00
	MOV $03C6, A
	BRA CODE_1D15

CODE_1D10:
	MOV A, #$02
	MOV $03C6, A
CODE_1D15:
	MOV A, $03C7
	BEQ CODE_1D2A
	CMP A, #$01
	BEQ CODE_1D25
	MOV A, #$00
	MOV $03C7, A
	BRA CODE_1D2A

CODE_1D25:
	MOV A, #$02
	MOV $03C7, A
CODE_1D2A:
	CALL CODE_1E0C
	MOV A, $D4
	BEQ CODE_1D40
	CMP A, #$20
	BEQ CODE_1D43
	CMP A, #$10
	BEQ CODE_1D4D
	CALL CODE_1F3E
	CALL CODE_1F6D
CODE_1D3F:
	RET

CODE_1D40:
	JMP CODE_1E43

CODE_1D43:
	CALL CODE_1F3E
	MOV A, $D9
	BEQ CODE_1D3F
	JMP CODE_1E43

CODE_1D4D:
	CALL CODE_1F6D
	MOV A, $D8
	BEQ CODE_1D3F
	JMP CODE_1E43

CODE_1D57:
	MOV A, #$00
	MOV $E7, A
	MOV $D4, A
	BRA CODE_1D2A

CODE_1D5F:
	MOV A, $1B
	BEQ CODE_1D95
	CMP A, #$02
	BEQ CODE_1D98
	MOV A, $D6
	MOV $03CA, A
	MOV A, $D7
	MOV $03CB, A
	MOV A, $D8
	MOV $03CC, A
	MOV A, $D9
	MOV $03CD, A
	MOV A, $EB
	MOV $03CE, A
	MOV A, $EC
	MOV $03CF, A
	MOV A, #$00
	MOV $03C4, A
	MOV $03C5, A
	MOV A, #$30
	MOV $D4, A
	MOV A, #$0F
	MOV $E7, A
CODE_1D95:
	JMP CODE_1D2A

CODE_1D98:
	MOV A, $03CE
	MOV $EB, A
	MOV A, $03CF
	MOV $EC, A
	MOV A, $03CC
	MOV $D8, A
	BEQ CODE_1DB5
	CMP A, #$01
	BEQ CODE_1DCC
	CMP A, #$02
	BEQ CODE_1DD4
	MOV A, #$00
	MOV $D8, A
CODE_1DB5:
	MOV A, $03CD
	MOV $D9, A
	BEQ CODE_1DC9
	CMP A, #$01
	BEQ CODE_1DE1
	CMP A, #$02
	BEQ CODE_1DE7
	MOV A, #$00
	MOV $D9, A
	RET

CODE_1DC9:
	JMP CODE_1D2A

CODE_1DCC:
	CALL CODE_1DF2
	CALL CODE_1D2A
	BRA CODE_1DB5

CODE_1DD4:
	CALL CODE_1DF2
	MOV A, #$01
	MOV $03C6, A
	CALL CODE_1D2A
	BRA CODE_1DB5

CODE_1DE1:
	CALL CODE_1DFF
	JMP CODE_1D2A

CODE_1DE7:
	CALL CODE_1DFF
	MOV A, #$01
	MOV $03C7, A
	JMP CODE_1D2A

;--------------------------------------------------------------------

CODE_1DF2:
	MOV A, #$20
	MOV $D4, A
	MOV A, $EB
	MOV $E7, A
	MOV A, #$00
	MOV $D8, A
	RET

;--------------------------------------------------------------------

CODE_1DFF:
	MOV A, #$10
	MOV $D4, A
	MOV A, $EC
	MOV $E7, A
	MOV A, #$00
	MOV $D9, A
	RET

;--------------------------------------------------------------------

CODE_1E0C:
	MOV A, $03C4
	BNE CODE_1E17
	MOV A, $03C5
	BNE CODE_1E33
	RET

CODE_1E17:
	MOV A, $03C5
	BEQ CODE_1E23
	CALL CODE_1E23
	CALL CODE_1E33
	RET

;--------------------------------------------------------------------

CODE_1E23:
	MOV A, $D4
	OR A, #$20
	MOV $D4, A
	MOV A, #$0F
	MOV $E7, A
	MOV A, #$00
	MOV $03C4, A
	RET

;--------------------------------------------------------------------

CODE_1E33:
	MOV A, $D4
	OR A, #$10
	MOV $D4, A
	MOV A, #$0F
	MOV $E7, A
	MOV A, #$00
	MOV $03C5, A
CODE_1E42:
	RET

;--------------------------------------------------------------------

CODE_1E43:
	MOV A, $D8
	BEQ CODE_1E53
	CMP A, #$01
	BEQ CODE_1E5D
	CMP A, #$02
	BEQ CODE_1E67
	CMP A, #$03
	BEQ CODE_1E71
CODE_1E53:
	MOV A, $D9
	BEQ CODE_1E42
	CMP A, #$03
	BEQ CODE_1E7B
	BRA CODE_1E7E

CODE_1E5D:
	MOV A, $D9
	BEQ CODE_1E81
	CMP A, #$03
	BEQ CODE_1E84
	BRA CODE_1E8A

CODE_1E67:
	MOV A, $D9
	BEQ CODE_1E90
	CMP A, #$03
	BEQ CODE_1E93
	BRA CODE_1E99

CODE_1E71:
	MOV A, $D9
	BEQ CODE_1E9F
	CMP A, #$03
	BEQ CODE_1EA2
	BRA CODE_1EA8

CODE_1E7B:
	JMP CODE_1F32

CODE_1E7E:
	JMP CODE_1EEA

CODE_1E81:
	JMP CODE_1EAE

CODE_1E84:
	CALL CODE_1EAE
	JMP CODE_1F32

CODE_1E8A:
	CALL CODE_1EAE
	JMP CODE_1EEA

CODE_1E90:
	JMP CODE_1EAE

CODE_1E93:
	CALL CODE_1EAE
	JMP CODE_1F32

CODE_1E99:
	CALL CODE_1EAE
	JMP CODE_1EEA

CODE_1E9F:
	JMP CODE_1F26

CODE_1EA2:
	CALL CODE_1F26
	JMP CODE_1F32

CODE_1EA8:
	CALL CODE_1F26
	JMP CODE_1EEA

;--------------------------------------------------------------------

CODE_1EAE:
	MOV A, $EB
	CMP A, #$0C
	BEQ CODE_1ED5
	CMP A, #$0D
	BEQ CODE_1ED5
	MOV A, $D8
	CMP A, #$02
	BEQ CODE_1ED5
CODE_1EBE:
	MOV A, $03C2
	CMP A, #$02
	BEQ CODE_1ECE
	SET5 $46
	MOV A, #$02
	MOV $03C2, A
	BRA CODE_1ED5

CODE_1ECE:
	SET5 $45
	MOV A, #$00
	MOV $03C2, A
CODE_1ED5:
	MOV A, $03C2
	BNE CODE_1EBE
	CALL CODE_1F9C
	MOV A, $D8
	CMP A, #$01
	BNE CODE_1EE5
	CLR5 $4A
CODE_1EE5:
	MOV A, #$02
	MOV $D8, A
	RET

;--------------------------------------------------------------------

CODE_1EEA:
	MOV A, $EC
	CMP A, #$0C
	BEQ CODE_1F11
	CMP A, #$0D
	BEQ CODE_1F11
	MOV A, $D9
	CMP A, #$02
	BEQ CODE_1F11
CODE_1EFA:
	MOV A, $03C3
	CMP A, #$02
	BEQ CODE_1F0A
	SET4 $46
	MOV A, #$02
	MOV $03C3, A
	BRA CODE_1F11

CODE_1F0A:
	SET4 $45
	MOV A, #$00
	MOV $03C3, A
CODE_1F11:
	MOV A, $03C3
	BNE CODE_1EFA
	CALL CODE_1FB5
	MOV A, $D9
	CMP A, #$01
	BNE CODE_1F21
	CLR4 $4A
CODE_1F21:
	MOV A, #$02
	MOV $D9, A
	RET

;--------------------------------------------------------------------

CODE_1F26:
	MOV A, #$00
	MOV $D8, A
	MOV $D6, A
	MOV $03C4, A
	JMP CODE_234E

;--------------------------------------------------------------------

CODE_1F32:
	MOV A, #$00
	MOV $D9, A
	MOV $D7, A
	MOV $03C5, A
	JMP CODE_236C

;--------------------------------------------------------------------

CODE_1F3E:
	MOV A, #$00
	MOV $D6, A
	MOV A, $E7
	MOV $EB, A
	CMP A, #$0F
	BEQ CODE_1F58
	MOV A, #$01
	MOV $D8, A
	SET5 $1A
	SET5 $46
	MOV A, #$00
	MOV $03B0, A
	RET

CODE_1F58:
	MOV A, $D8
	BEQ CODE_1F6C
	MOV A, #$03
	MOV $D8, A
	MOV A, $03B0
	BNE CODE_1F26
	SET5 $46
	MOV A, #$01
	MOV $03B0, A
CODE_1F6C:
	RET

;--------------------------------------------------------------------

CODE_1F6D:
	MOV A, #$00
	MOV $D7, A
	MOV A, $E7
	MOV $EC, A
	CMP A, #$0F
	BEQ CODE_1F87
	MOV A, #$01
	MOV $D9, A
	SET4 $1A
	SET4 $46
	MOV A, #$00
	MOV $03B1, A
	RET

CODE_1F87:
	MOV A, $D9
	BEQ CODE_1F9B
	MOV A, #$03
	MOV $D9, A
	MOV A, $03B1
	BNE CODE_1F32
	SET4 $46
	MOV A, #$01
	MOV $03B1, A
CODE_1F9B:
	RET

;--------------------------------------------------------------------

CODE_1F9C:
	INC $D6
	MOV A, $03C6
	CMP A, #$02
	BNE CODE_1FAA
	MOV A, $03CA
	MOV $D6, A
CODE_1FAA:
	MOV $20, #$01
	MOV A, $EB
	CALL CODE_23A8
	JMP CODE_220A

;--------------------------------------------------------------------

CODE_1FB5:
	INC $D7
	MOV A, $03C7
	CMP A, #$02
	BNE CODE_1FC3
	MOV A, $03CB
	MOV $D7, A
CODE_1FC3:
	MOV $20, #$02
	MOV A, $EC
	CALL CODE_23A8
	JMP CODE_2273

;--------------------------------------------------------------------

CODE_1FCE:
	MOV Y, #$9F
	MUL YA
	MOV A, Y
	RET

;--------------------------------------------------------------------

CODE_1FD3:
	MOV $20, A
	MOV Y, #$32
	MUL YA
	MOV A, Y
	CLRC
	ADC A, $20
	RET

;--------------------------------------------------------------------

CODE_1FDD:
	MOV Y, #$99
	MUL YA
	MOV A, Y
	RET

;--------------------------------------------------------------------

CODE_1FE2:
	MOV $20, A
	MOV A, $02
	AND A, #$7F
	BEQ CODE_1FFB
	MOV A, #$00
	MOV $03A2, A
	MOV A, $03AE
	BEQ CODE_2010
CODE_1FF4:
	MOV A, $20
	MOV Y, #$90
	MUL YA
	MOV A, Y
	RET

CODE_1FFB:
	MOV A, $03A2
	BNE CODE_200B
	MOV A, $03AE
	MOV $03A0, A
	MOV A, #$01
	MOV $03A2, A
CODE_200B:
	MOV A, $03A0
	BNE CODE_1FF4
CODE_2010:
	MOV A, $20
	RET

;--------------------------------------------------------------------

CODE_2013:
	MOV $20, A
	MOV A, $03
	AND A, #$7F
	BEQ CODE_1FFB
	MOV A, #$00
	MOV $03A3, A
	MOV A, $03AF
	BEQ CODE_2041
CODE_2025:
	MOV A, $20
	MOV Y, #$90
	MUL YA
	MOV A, Y
	RET

;--------------------------------------------------------------------

CODE_202C:
	MOV A, $03A3
	BNE CODE_203C
	MOV A, $03AF
	MOV $03A1, A
	MOV A, #$01
	MOV $03A3, A
CODE_203C:
	MOV A, $03A1
	BNE CODE_2025
CODE_2041:
	MOV A, $20
	RET

;--------------------------------------------------------------------

CODE_2044:
	MOV A, $DA
	MOV Y, #$00
	MOV X, #$09
	DIV YA, X
	CLRC
	ADC A, $03D4
	MOV X, $EB
	CMP X, #$03
	BNE CODE_2056
	LSR A
CODE_2056:
	CALL CODE_1FE2
	MOV $20, A
	MOV A, $02
	AND A, #$7F
	BNE CODE_2079
	MOV A, $0394
	EOR A, #$FF
	MOV Y, #$40
	MUL YA
	MOV $21, Y
	MOV A, $20
	SETC
	SBC A, $21
	BPL CODE_207B
	MOV A, #$00
	MOV $0394, A
	BRA CODE_207B

CODE_2079:
	MOV A, $20
CODE_207B:
	MOV X, $1C
	BEQ CODE_2082
	CALL CODE_1FDD
CODE_2082:
	MOV X, $E3
	BNE CODE_209A
	CALL CODE_1FD3
	MOV Y, #$70
	CALL CODE_09FD
	MOV Y, #$00
	MOV X, #$28
	DIV YA, X
	MOV Y, #$71
	CALL CODE_09FD
	BRA CODE_20A4

CODE_209A:
	MOV Y, #$70
	CALL CODE_09FD
	MOV Y, #$71
	CALL CODE_09FD
CODE_20A4:
	MOV A, #$00
	MOV $20, A
	MOV A, $03B2
	MOV $21, A
	MOV A, $DA
	MOV Y, $03D6
	MUL YA
	ADDW YA, $20
	MOV X, $03A5
	BEQ CODE_20C7
	MOV $20, #$00
	MOV X, $1C
	CMP X, #$0D
	BEQ CODE_20CD
	INC $1C
	BRA CODE_20CD

CODE_20C7:
	MOV X, $1C
	BEQ CODE_20CD
	DEC $1C
CODE_20CD:
	MOV X, $1C
	MOV $21, X
	ADDW YA, $20
	PUSH Y
	MOV Y, #$72
	CALL CODE_09FD
	MOV Y, #$73
	POP A
	CALL CODE_09FD
	MOV Y, #$74
	MOV X, $0390
	DEC X
	MOV A, X
	CALL CODE_09FD
	MOV Y, #$75
	MOV A, #$FE
	CALL CODE_09FD
	MOV Y, #$76
	MOV A, #$E0
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_20F7:
	MOV A, $DB
	MOV Y, #$00
	MOV X, #$09
	DIV YA, X
	CLRC
	ADC A, $03D5
	MOV X, $EC
	CMP X, #$03
	BNE CODE_2109
	LSR A
CODE_2109:
	CALL CODE_2013
	MOV $20, A
	MOV A, $03
	AND A, #$7F
	BNE CODE_212C
	MOV A, $0395
	EOR A, #$FF
	MOV Y, #$40
	MUL YA
	MOV $21, Y
	MOV A, $20
	SETC
	SBC A, $21
	BPL CODE_212E
	MOV A, #$00
	MOV $0395, A
	BRA CODE_212E

CODE_212C:
	MOV A, $20
CODE_212E:
	MOV X, $1D
	BEQ CODE_2135
	CALL CODE_1FDD
CODE_2135:
	CALL CODE_1FD3
	MOV Y, #$61
	CALL CODE_09FD
	MOV Y, #$00
	MOV X, #$28
	DIV YA, X
	MOV Y, #$60
	CALL CODE_09FD
	MOV A, #$00
	MOV $20, A
	MOV A, $03B3
	MOV $21, A
	MOV A, $DB
	MOV Y, $03D7
	MUL YA
	ADDW YA, $20
	MOV X, $03A6
	BEQ CODE_216A
	MOV $20, #$00
	MOV X, $1D
	CMP X, #$0D
	BEQ CODE_2170
	INC $1D
	BRA CODE_2170

CODE_216A:
	MOV X, $1D
	BEQ CODE_2170
	DEC $1D
CODE_2170:
	MOV X, $1D
	MOV $21, X
	ADDW YA, $20
	PUSH Y
	MOV Y, #$62
	CALL CODE_09FD
	MOV Y, #$63
	POP A
	CALL CODE_09FD
	MOV Y, #$64
	MOV X, $0391
	DEC X
	MOV A, X
	CALL CODE_09FD
	MOV Y, #$65
	MOV A, #$FE
	CALL CODE_09FD
	MOV Y, #$66
	MOV A, #$E0
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_219A:
	MOV Y, $6F
	MOV A, DATA_1546+y
	MOV X, A
	MOV Y, $03D9
	MOV A, DATA_1556+y
	MOV Y, #$00
	DIV YA, X
	MOV Y, #$60
	CALL CODE_09FD
	MOV Y, $6F
	MOV A, DATA_1546+y
	MOV X, A
	MOV Y, $03D9
	MOV A, DATA_155E+y
	MOV Y, #$00
	DIV YA, X
	MOV Y, #$61
	CALL CODE_09FD
	MOV X, $6F
	MOV A, DATA_1526+x
	MOV Y, #$62
	CALL CODE_09FD
	MOV X, $6F
	MOV A, DATA_1536+x
	CLRC
	ADC A, $03B4
	MOV X, $03A7
	BEQ CODE_21E4
	MOV X, $1E
	CMP X, #$0B
	BEQ CODE_21EA
	INC $1E
	BRA CODE_21EA

CODE_21E4:
	MOV X, $1E
	BEQ CODE_21EA
	DEC $1E
CODE_21EA:
	CLRC
	ADC A, $1E
	MOV Y, #$63
	CALL CODE_09FD
	MOV Y, #$64
	MOV X, $03C0
	DEC X
	MOV A, X
	CALL CODE_09FD
	MOV Y, #$65
	MOV A, #$FE
	CALL CODE_09FD
	MOV Y, #$66
	MOV A, #$E0
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_220A:
	MOV A, $E3
	BEQ CODE_2222
	MOV A, $03AA
	CLRC
	ADC A, $03AC
	MOV Y, #$F0
	MUL YA
	MOV $20, Y
	MOV $21, Y
	MOV $20, Y
	MOV $21, Y
	BRA CODE_223C

CODE_2222:
	MOV A, $03AA
	MOV $20, A
	MOV Y, #$38
	MUL YA
	MOV A, Y
	ADC A, $20
	MOV $20, A
	MOV A, $03AC
	MOV $21, A
	MOV Y, #$38
	MUL YA
	MOV A, Y
	ADC A, $21
	MOV $21, A
CODE_223C:
	MOV Y, #$50
	MOV A, $20
	CALL CODE_09FD
	MOV Y, #$51
	MOV A, $21
	CALL CODE_09FD
	MOV Y, #$52
	MOV A, $039A
	CALL CODE_09FD
	MOV Y, #$53
	MOV A, $039C
	CALL CODE_09FD
	MOV Y, #$54
	MOV X, $DE
	DEC X
	MOV A, X
	CALL CODE_09FD
	MOV Y, #$55
	MOV A, $03B6
	CALL CODE_09FD
	MOV Y, #$56
	MOV A, $03B7
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_2273:
	MOV A, $E3
	BEQ CODE_2287
	MOV A, $03AD
	CLRC
	ADC A, $03AB
	MOV Y, #$F0
	MUL YA
	MOV $20, Y
	MOV $21, Y
	BRA CODE_22A1

CODE_2287:
	MOV A, $03AD
	MOV $20, A
	MOV Y, #$38
	MUL YA
	MOV A, Y
	ADC A, $20
	MOV $20, A
	MOV A, $03AB
	MOV $21, A
	MOV Y, #$38
	MUL YA
	MOV A, Y
	ADC A, $21
	MOV $21, A
CODE_22A1:
	MOV Y, #$40
	MOV A, $20
	CALL CODE_09FD
	MOV Y, #$41
	MOV A, $21
	CALL CODE_09FD
	MOV Y, #$42
	MOV A, $039B
	CALL CODE_09FD
	MOV Y, #$43
	MOV A, $039D
	CALL CODE_09FD
	MOV Y, #$44
	MOV X, $DF
	DEC X
	MOV A, X
	CALL CODE_09FD
	MOV Y, #$45
	MOV A, $03BE
	CALL CODE_09FD
	MOV Y, #$46
	MOV A, $03BF
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_22D8:
	MOV Y, #$30
	MOV A, $03C8
	CALL CODE_09FD
	MOV Y, #$31
	MOV A, $03C9
	CALL CODE_09FD
	MOV Y, #$32
	MOV A, $03B8
	CALL CODE_09FD
	MOV Y, #$33
	MOV A, $03B9
	CALL CODE_09FD
	MOV Y, #$34
	MOV X, $039E
	DEC X
	MOV A, X
	CALL CODE_09FD
	MOV Y, #$35
	MOV A, $03A8
	CALL CODE_09FD
	MOV Y, #$36
	MOV A, $03A9
	JMP CODE_09FD

;--------------------------------------------------------------------

CODE_2312:
	CLR7 $1A
	MOV X, #$0E
	MOV A, $0211+x
	CALL CODE_0BB8
	BBC7 $4F, CODE_2323
	SET7 $4A
	BRA CODE_2325

CODE_2323:
	CLR7 $4A
CODE_2325:
	CLR7 $1A
	MOV X, #$0E
	SET7 $47
	SET7 $5E
	JMP CODE_0E8E

;--------------------------------------------------------------------

CODE_2330:
	CLR6 $1A
	MOV X, #$0C
	MOV A, $0211+x
	CALL CODE_0BB8
	BBC6 $4F, CODE_2341
	SET6 $4A
	BRA CODE_2343

CODE_2341:
	CLR6 $4A
CODE_2343:
	CLR6 $1A
	MOV X, #$0C
	SET6 $47
	SET6 $5E
	JMP CODE_0E8E

;--------------------------------------------------------------------

CODE_234E:
	CLR5 $1A
	MOV X, #$0A
	MOV A, $0211+x
	CALL CODE_0BB8
	BBC5 $4F, CODE_235F
	SET5 $4A
	BRA CODE_2361

CODE_235F:
	CLR5 $4A
CODE_2361:
	CLR5 $1A
	MOV X, #$0A
	SET5 $47
	SET5 $5E
	JMP CODE_0E8E

;--------------------------------------------------------------------

CODE_236C:
	CLR4 $1A
	MOV X, #$08
	MOV A, $0211+x
	CALL CODE_0BB8
	BBC4 $4F, CODE_237D
	SET4 $4A
	BRA CODE_237F

CODE_237D:
	CLR4 $4A
CODE_237F:
	CLR4 $1A
	MOV X, #$08
	SET4 $47
	SET4 $5E
	JMP CODE_0E8E

;--------------------------------------------------------------------

CODE_238A:
	CLR3 $1A
	MOV X, #$06
	MOV A, $0211+x
	CALL CODE_0BB8
	BBC3 $4F, CODE_239B
	SET3 $4A
	BRA CODE_239D

CODE_239B:
	CLR3 $4A
CODE_239D:
	CLR3 $1A
	MOV X, #$06
	SET3 $47
	SET3 $5E
	JMP CODE_0E8E

;--------------------------------------------------------------------

CODE_23A8:
	ASL A
	MOV X, A
	JMP (DATA_1644+x)

;--------------------------------------------------------------------

CODE_23AD:
	MOV A, $20
	CMP A, #$01
	BNE CODE_23F5
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_23C6
	CMP A, #$05
	BEQ CODE_23CF
	CMP A, #$10
	BEQ CODE_23DB
	BRA CODE_23DF

CODE_23C6:
	MOV A, #$00
	MOV Y, #$0E
	CALL CODE_3B92
	BRA CODE_23DF

CODE_23CF:
	MOV A, #$00
	MOV Y, #$11
	CALL CODE_3B92
	CALL CODE_3BAE
	BRA CODE_23DF

CODE_23DB:
	MOV A, #$01
	MOV $D6, A
CODE_23DF:
	MOV A, $DA
	MOV Y, #$00
	MOV X, #$09
	DIV YA, X
	CLRC
	ADC A, #$19
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B53
	MOV A, #$01
	MOV $DE, A
	RET

CODE_23F5:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_2408
	CMP A, #$05
	BEQ CODE_2411
	CMP A, #$10
	BEQ CODE_241D
	BRA CODE_2421

CODE_2408:
	MOV A, #$00
	MOV Y, #$0E
	CALL CODE_3B99
	BRA CODE_2421

CODE_2411:
	MOV A, #$00
	MOV Y, #$11
	CALL CODE_3B99
	CALL CODE_3BB4
	BRA CODE_2421

CODE_241D:
	MOV A, #$01
	MOV $D7, A
CODE_2421:
	MOV A, $DB
	MOV Y, #$00
	MOV X, #$09
	DIV YA, X
	CLRC
	ADC A, #$19
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B65
	MOV A, #$01
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_2437:
	MOV $22, #$00
	MOV $23, #$12
	MOV $24, #$00
	MOV $25, #$10
	MOV $26, #$00
	MOV $27, #$11
	MOV $28, #$00
	MOV $29, #$0F
	MOV $2A, #$19
	MOV $2B, #$FF
	MOV $2C, #$E0
	MOV $2D, #$01
	MOV $2E, #$09
	MOV $2F, #$00
	JMP CODE_2B12

;--------------------------------------------------------------------

CODE_2464:
	MOV $22, #$00
	MOV $23, #$05
	MOV $24, #$00
	MOV $25, #$04
	MOV $26, #$00
	MOV $27, #$02
	MOV $28, #$00
	MOV $29, #$03
	MOV $2A, #$1D
	MOV $2B, #$FF
	MOV $2C, #$E0
	MOV $2D, #$14
	MOV $2E, #$09
	MOV $2F, #$00
	JMP CODE_2B12

;--------------------------------------------------------------------

CODE_2491:
	MOV $22, #$00
	MOV $23, #$01
	MOV $24, #$0F
	MOV $25, #$50
	MOV $26, #$FF
	MOV $27, #$E0
	MOV $28, #$13
	MOV $29, #$00
	JMP CODE_2C18

;--------------------------------------------------------------------

CODE_24AC:
	MOV $22, #$00
	MOV $23, #$03
	MOV $24, #$00
	MOV $25, #$04
	MOV $26, #$80
	MOV $27, #$02
	MOV $28, #$80
	MOV $29, #$03
	MOV $2A, #$37
	MOV $2B, #$FC
	MOV $2C, #$E0
	MOV $2D, #$01
	MOV $2E, #$02
	MOV $2F, #$00
	JMP CODE_2B12

;--------------------------------------------------------------------

CODE_24D9:
	MOV $22, #$00
	MOV $23, #$06
	MOV $24, #$02
	MOV $25, #$46
	MOV $26, #$D9
	MOV $27, #$95
	MOV $28, #$05
	MOV $29, #$01
	JMP CODE_2C18

;--------------------------------------------------------------------

CODE_24F4:
	MOV A, $20
	CMP A, #$01
	BNE CODE_2568
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_253E
	CMP A, #$10
	BNE CODE_250B
	MOV A, #$01
	MOV $D6, A
CODE_250B:
	MOV A, $DA
	BEQ CODE_252D
	LSR A
	LSR A
	LSR A
	LSR A
	EOR A, #$07
	MOV $20, A
	CLRC
	ADC $20, #$01
	INC $E5
	MOV A, $E5
	CMP A, $20
	BNE CODE_2527
CODE_2523:
	MOV A, #$00
	MOV $E5, A
CODE_2527:
	MOV A, $E5
	CMP A, #$00
	BEQ CODE_2536
CODE_252D:
	MOV A, $E5
	SETC
	SBC A, #$0B
	BPL CODE_2523
	BRA CODE_2552

CODE_2536:
	CALL CODE_3BAE
	MOV A, $0392
	BNE CODE_2546
CODE_253E:
	MOV A, #$00
	MOV Y, #$04
	MOV X, #$01
	BRA CODE_254C

CODE_2546:
	MOV A, #$00
	MOV Y, #$03
	MOV X, #$00
CODE_254C:
	MOV $0392, X
	CALL CODE_3B92
CODE_2552:
	MOV A, $DA
	MOV Y, #$00
	MOV X, #$07
	DIV YA, X
	CLRC
	ADC A, #$32
	MOV X, #$BE
	MOV Y, #$BA
	CALL CODE_3B53
	MOV A, #$17
	MOV $DE, A
	RET

CODE_2568:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_25AC
	CMP A, #$10
	BNE CODE_2579
	MOV A, #$01
	MOV $D7, A
CODE_2579:
	MOV A, $DB
	BEQ CODE_259B
	LSR A
	LSR A
	LSR A
	LSR A
	EOR A, #$07
	MOV $20, A
	CLRC
	ADC $20, #$01
	INC $E6
	MOV A, $E6
	CMP A, $20
	BNE CODE_2595
CODE_2591:
	MOV A, #$00
	MOV $E6, A
CODE_2595:
	MOV A, $E6
	CMP A, #$00
	BEQ CODE_25A4
CODE_259B:
	MOV A, $E6
	SETC
	SBC A, #$0B
	BPL CODE_2591
	BRA CODE_25C0

CODE_25A4:
	CALL CODE_3BB4
	MOV A, $0393
	BNE CODE_25B4
CODE_25AC:
	MOV A, #$00
	MOV Y, #$04
	MOV X, #$01
	BRA CODE_25BA

CODE_25B4:
	MOV A, #$00
	MOV Y, #$03
	MOV X, #$00
CODE_25BA:
	MOV $0393, X
	CALL CODE_3B99
CODE_25C0:
	MOV A, $DB
	MOV Y, #$00
	MOV X, #$07
	DIV YA, X
	CLRC
	ADC A, #$32
	MOV X, #$BE
	MOV Y, #$BA
	CALL CODE_3B65
	MOV A, #$17
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_25D6:
	MOV $22, #$00
	MOV $23, #$04
	MOV $24, #$04
	MOV $25, #$28
	MOV $26, #$BC
	MOV $27, #$9E
	MOV $28, #$05
	JMP CODE_2C18

;--------------------------------------------------------------------

CODE_25EE:
	MOV $22, #$00
	MOV $23, #$0A
	MOV $24, #$08
	MOV $25, #$19
	MOV $26, #$BE
	MOV $27, #$79
	MOV $28, #$13
	MOV $29, #$01
	JMP CODE_2C18

;--------------------------------------------------------------------

CODE_2609:
	JMP CODE_2694

CODE_260C:
	MOV A, $20
	CMP A, #$01
	BNE CODE_2609
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_2627
	CMP A, #$96
	BEQ CODE_2621
	BRA CODE_2639

CODE_2621:
	MOV A, #$01
	MOV $03C4, A
	RET

CODE_2627:
	CALL CODE_3BAE
	MOV A, #$00
	MOV $6D, A
	MOV $0398, A
	MOV $03D0, A
	MOV A, #$04
	MOV $03D1, A
CODE_2639:
	INC $03D0
	CMP A, #$0F
	BNE CODE_2648
	INC $03D1
	MOV A, #$00
	MOV $03D0, A
CODE_2648:
	MOV A, $D6
	MOV Y, #$25
	MUL YA
	CALL CODE_3BBA
	MOV A, #$00
	MOV Y, #$16
	SUBW YA, $20
	CALL CODE_3B92
	MOV A, $0398
	BNE CODE_2669
	INC $6D
	MOV A, $6D
	CMP A, $03D1
	BEQ CODE_2671
	BRA CODE_267D

CODE_2669:
	DEC $6D
	MOV A, $6D
	BEQ CODE_2678
	BRA CODE_267D

CODE_2671:
	MOV A, #$01
	MOV $0398, A
	BRA CODE_267D

CODE_2678:
	MOV A, #$00
	MOV $0398, A
CODE_267D:
	MOV A, $039C
	CLRC
	ADC A, $6D
	MOV $039C, A
	MOV A, #$21
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B53
	MOV A, #$01
	MOV $DE, A
	RET

CODE_2694:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_26A9
	CMP A, #$96
	BEQ CODE_26A3
	BRA CODE_26BB

CODE_26A3:
	MOV A, #$01
	MOV $03C5, A
	RET

CODE_26A9:
	CALL CODE_3BB4
	MOV A, #$00
	MOV $6E, A
	MOV $0399, A
	MOV $03D2, A
	MOV A, #$04
	MOV $03D3, A
CODE_26BB:
	INC $03D2
	CMP A, #$0F
	BNE CODE_26CA
	INC $03D3
	MOV A, #$00
	MOV $03D2, A
CODE_26CA:
	MOV A, $D7
	MOV Y, #$25
	MUL YA
	CALL CODE_3BBA
	MOV A, #$00
	MOV Y, #$16
	SUBW YA, $20
	CALL CODE_3B99
	MOV A, $0399
	BNE CODE_26EB
	INC $6E
	MOV A, $6E
	CMP A, $03D3
	BEQ CODE_26F3
	BRA CODE_26FF

CODE_26EB:
	DEC $6E
	MOV A, $6E
	BEQ CODE_26FA
	BRA CODE_26FF

CODE_26F3:
	MOV A, #$01
	MOV $0399, A
	BRA CODE_26FF

CODE_26FA:
	MOV A, #$00
	MOV $0399, A
CODE_26FF:
	MOV A, $039D
	CLRC
	ADC A, $6E
	MOV $039D, A
	MOV A, #$21
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B65
	MOV A, #$01
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_2716:
	MOV A, $20
	CMP A, #$01
	BNE CODE_2779
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_272F
	CMP A, #$1F
	BEQ CODE_272B
	BRA CODE_273E

CODE_272B:
	MOV A, #$01
	MOV $D6, A
CODE_272F:
	MOV A, #$00
	MOV $03AA, A
	MOV $03AC, A
	MOV A, #$00
	MOV Y, #$03
	CALL CODE_3B92
CODE_273E:
	MOV A, $D6
	MOV $20, A
	BBS4 $20, CODE_275A
	CALL CODE_3BA0
	CALL CODE_3BBA
	MOV A, #$32
	MOV Y, #$00
	ADDW YA, $20
	CALL CODE_3B92
	MOV A, $03AA
	INC A
	BRA CODE_276D

CODE_275A:
	MOV A, #$32
	MOV Y, #$00
	CALL CODE_3BBA
	CALL CODE_3BA0
	SUBW YA, $20
	CALL CODE_3B92
	MOV A, $03AA
	DEC A
CODE_276D:
	MOV X, #$84
	MOV Y, #$EA
	CALL CODE_3B53
	MOV A, #$10
	MOV $DE, A
	RET

CODE_2779:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_278C
	CMP A, #$1F
	BEQ CODE_2788
	BRA CODE_279B

CODE_2788:
	MOV A, #$01
	MOV $D7, A
CODE_278C:
	MOV A, #$00
	MOV $03AB, A
	MOV $03AD, A
	MOV A, #$00
	MOV Y, #$03
	CALL CODE_3B99
CODE_279B:
	MOV A, $D7
	MOV $20, A
	BBS4 $20, CODE_27B7
	CALL CODE_3BA7
	CALL CODE_3BBA
	MOV A, #$32
	MOV Y, #$00
	ADDW YA, $20
	CALL CODE_3B99
	MOV A, $03AB
	INC A
	BRA CODE_27CA

CODE_27B7:
	MOV A, #$32
	MOV Y, #$00
	CALL CODE_3BBA
	CALL CODE_3BA7
	SUBW YA, $20
	CALL CODE_3B99
	MOV A, $03AB
	DEC A
CODE_27CA:
	MOV X, #$84
	MOV Y, #$EA
	CALL CODE_3B65
	MOV A, #$10
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_27D6:
	JMP CODE_2869

CODE_27D9:
	MOV A, $20
	CMP A, #$01
	BNE CODE_27D6
	MOV $20, #$00
	MOV A, $EC
	CMP A, #$0C
	BNE CODE_27FC
	MOV A, $D6
	CMP A, #$01
	BNE CODE_27FC
	MOV A, $D7
	SETC
	SBC A, #$2B
	BPL CODE_2822
	MOV A, $D7
	CLRC
	ADC A, #$06
	MOV $D6, A
CODE_27FC:
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_2828
	CMP A, #$08
	BEQ CODE_282E
	CMP A, #$0E
	BEQ CODE_2834
	CMP A, #$14
	BEQ CODE_283A
	CMP A, #$1A
	BEQ CODE_2840
	CMP A, #$20
	BEQ CODE_2846
	CMP A, #$26
	BEQ CODE_284C
	CMP A, #$2C
	BEQ CODE_2852
	CMP A, #$32
	BEQ CODE_2824
CODE_2822:
	BRA CODE_285B

CODE_2824:
	MOV A, #$01
	MOV $D6, A
CODE_2828:
	MOV A, #$2F
	MOV Y, #$04
	BRA CODE_2856

CODE_282E:
	MOV A, #$45
	MOV Y, #$06
	BRA CODE_2856

CODE_2834:
	MOV A, #$5F
	MOV Y, #$08
	BRA CODE_2856

CODE_283A:
	MOV A, #$8B
	MOV Y, #$0C
	BRA CODE_2856

CODE_2840:
	MOV A, #$BE
	MOV Y, #$10
	BRA CODE_2856

CODE_2846:
	MOV A, #$8C
	MOV Y, #$0A
	BRA CODE_2856

CODE_284C:
	MOV A, #$8B
	MOV Y, #$0C
	BRA CODE_2856

CODE_2852:
	MOV A, #$BE
	MOV Y, #$10
CODE_2856:
	CALL CODE_3B92
	SET5 $45
CODE_285B:
	MOV A, #$55
	MOV X, #$DD
	MOV Y, #$F6
	CALL CODE_3B53
	MOV A, #$0E
	MOV $DE, A
	RET

CODE_2869:
	MOV $20, #$00
	MOV A, $EB
	CMP A, #$0C
	BNE CODE_2886
	MOV A, $D7
	CMP A, #$01
	BNE CODE_2886
	MOV A, $D6
	SETC
	SBC A, #$2B
	BPL CODE_28AC
	MOV A, $D6
	CLRC
	ADC A, #$06
	MOV $D7, A
CODE_2886:
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_28B2
	CMP A, #$08
	BEQ CODE_28B8
	CMP A, #$0E
	BEQ CODE_28BE
	CMP A, #$14
	BEQ CODE_28C4
	CMP A, #$1A
	BEQ CODE_28CA
	CMP A, #$20
	BEQ CODE_28D0
	CMP A, #$26
	BEQ CODE_28D6
	CMP A, #$2C
	BEQ CODE_28DC
	CMP A, #$32
	BEQ CODE_28AE
CODE_28AC:
	BRA CODE_28E5

CODE_28AE:
	MOV A, #$01
	MOV $D7, A
CODE_28B2:
	MOV A, #$2F
	MOV Y, #$04
	BRA CODE_28E0

CODE_28B8:
	MOV A, #$45
	MOV Y, #$06
	BRA CODE_28E0

CODE_28BE:
	MOV A, #$5F
	MOV Y, #$08
	BRA CODE_28E0

CODE_28C4:
	MOV A, #$8B
	MOV Y, #$0C
	BRA CODE_28E0

CODE_28CA:
	MOV A, #$BE
	MOV Y, #$10
	BRA CODE_28E0

CODE_28D0:
	MOV A, #$8C
	MOV Y, #$0A
	BRA CODE_28E0

CODE_28D6:
	MOV A, #$8B
	MOV Y, #$0C
	BRA CODE_28E0

CODE_28DC:
	MOV A, #$BE
	MOV Y, #$10
CODE_28E0:
	CALL CODE_3B99
	SET4 $45
CODE_28E5:
	MOV A, #$55
	MOV X, #$DD
	MOV Y, #$F6
	CALL CODE_3B65
	MOV A, #$0E
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_28F3:
	MOV $22, #$00
	MOV $23, #$1C
	MOV $24, #$00
	MOV $25, #$14
	MOV $26, #$00
	MOV $27, #$12
	MOV $28, #$00
	MOV $29, #$16
	MOV $2A, #$26
	MOV $2B, #$DD
	MOV $2C, #$40
	MOV $2D, #$09
	MOV $2E, #$05
	MOV $2F, #$01
	JMP CODE_2B12

;--------------------------------------------------------------------

CODE_2920:
	MOV A, $20
	CMP A, #$01
	BNE CODE_296B
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_2945
	CMP A, #$0A
	BEQ CODE_295D
	CMP A, #$12
	BEQ CODE_294E
	CMP A, #$13
	BEQ CODE_2959
	CMP A, #$1A
	BEQ CODE_295D
	CMP A, #$21
	BEQ CODE_2953
	BRA CODE_2966

CODE_2945:
	MOV A, #$10
	MOV Y, #$22
	CALL CODE_3B92
	BRA CODE_2959

CODE_294E:
	CALL CODE_3BAE
	BRA CODE_2966

CODE_2953:
	MOV A, #$10
	MOV $D6, A
	BRA CODE_2966

CODE_2959:
	MOV A, #$14
	BRA CODE_295F

CODE_295D:
	MOV A, #$03
CODE_295F:
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B53
CODE_2966:
	MOV A, #$0C
	MOV $DE, A
	RET

CODE_296B:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_298A
	CMP A, #$0A
	BEQ CODE_29A2
	CMP A, #$12
	BEQ CODE_2993
	CMP A, #$13
	BEQ CODE_299E
	CMP A, #$1A
	BEQ CODE_29A2
	CMP A, #$21
	BEQ CODE_2998
	BRA CODE_29AB

CODE_298A:
	MOV A, #$10
	MOV Y, #$22
	CALL CODE_3B99
	BRA CODE_299E

CODE_2993:
	CALL CODE_3BB4
	BRA CODE_29AB

CODE_2998:
	MOV A, #$10
	MOV $D7, A
	BRA CODE_29AB

CODE_299E:
	MOV A, #$14
	BRA CODE_29A4

CODE_29A2:
	MOV A, #$03
CODE_29A4:
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B65
CODE_29AB:
	MOV A, #$0C
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_29B0:
	JMP CODE_2A64

CODE_29B3:
	MOV A, $20
	CMP A, #$01
	BNE CODE_29B0
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$01
	BEQ CODE_29CC
	CMP A, #$07
	BEQ CODE_29D6
	CMP A, #$3C
	BEQ CODE_29E0
	BRA CODE_29F7

CODE_29CC:
	MOV X, #$16
	MOV $DE, X
	MOV A, #$00
	MOV Y, #$03
	BRA CODE_29E8

CODE_29D6:
	MOV X, #$12
	MOV $DE, X
	MOV A, #$00
	MOV Y, #$04
	BRA CODE_29E8

CODE_29E0:
	MOV X, #$0B
	MOV $DE, X
	MOV A, #$00
	MOV Y, #$28
CODE_29E8:
	CALL CODE_3B92
	CALL CODE_3BAE
	MOV A, #$5A
	MOV X, #$FF
	MOV Y, #$F0
	JMP CODE_3B53

CODE_29F7:
	MOV A, $D6
	SBC A, #$07
	BMI CODE_2A46
	MOV A, $D6
	SBC A, #$3C
	BMI CODE_2A51
	MOV X, $D6
	MOV A, $18
	LSR A
	LSR A
	LSR A
	ADC A, #$5A
	MOV $20, A
	CMP X, $20
	BEQ CODE_2A5F
	CMP X, #$7F
	BEQ CODE_2A5F
	MOV A, $D6
	SBC A, #$50
	BPL CODE_2A41
	MOV A, #$12
	CALL CODE_3B59
	MOV A, $D6
	SBC A, #$4A
	BPL CODE_2A34
	CALL CODE_3BA0
	MOV $20, #$D0
	MOV $21, #$00
	SUBW YA, $20
	BRA CODE_2A5C

CODE_2A34:
	CALL CODE_3BA0
	MOV $20, #$00
	MOV $21, #$01
	ADDW YA, $20
	BRA CODE_2A5C

CODE_2A41:
	MOV A, #$00
	JMP CODE_3B59

CODE_2A46:
	CALL CODE_3BA0
	MOV $20, #$00
	MOV $21, #$01
	BRA CODE_2A5A

CODE_2A51:
	CALL CODE_3BA0
	MOV $20, #$00
	MOV $21, #$04
CODE_2A5A:
	ADDW YA, $20
CODE_2A5C:
	JMP CODE_3B92
CODE_2A5F:
	MOV A, #$3A
	MOV $D6, A
	RET

CODE_2A64:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$01
	BEQ CODE_2A77
	CMP A, #$07
	BEQ CODE_2A81
	CMP A, #$3C
	BEQ CODE_2A8B
	BRA CODE_2AA2

CODE_2A77:
	MOV X, #$16
	MOV $DF, X
	MOV A, #$00
	MOV Y, #$03
	BRA CODE_2A93

CODE_2A81:
	MOV X, #$12
	MOV $DF, X
	MOV A, #$00
	MOV Y, #$04
	BRA CODE_2A93

CODE_2A8B:
	MOV X, #$0B
	MOV $DF, X
	MOV A, #$00
	MOV Y, #$28
CODE_2A93:
	CALL CODE_3B99
	CALL CODE_3BB4
	MOV A, #$5A
	MOV X, #$FF
	MOV Y, #$F0
	JMP CODE_3B65

CODE_2AA2:
	MOV A, $D7
	SBC A, #$07
	BMI CODE_2AF1
	MOV A, $D7
	SBC A, #$3C
	BMI CODE_2AFC
	MOV X, $D7
	MOV A, $18
	LSR A
	LSR A
	LSR A
	ADC A, #$5A
	MOV $20, A
	CMP X, $20
	BEQ CODE_2B0A
	CMP X, #$7F
	BEQ CODE_2B0A
	MOV A, $D7
	SBC A, #$50
	BPL CODE_2AEC
	MOV A, #$12
	CALL CODE_3B6B
	MOV A, $D7
	SBC A, #$4A
	BPL CODE_2ADF
	CALL CODE_3BA7
	MOV $20, #$D0
	MOV $21, #$00
	SUBW YA, $20
	BRA CODE_2B07

CODE_2ADF:
	CALL CODE_3BA7
	MOV $20, #$00
	MOV $21, #$01
	ADDW YA, $20
	BRA CODE_2B07

CODE_2AEC:
	MOV A, #$00
	JMP CODE_3B6B

CODE_2AF1:
	CALL CODE_3BA7
	MOV $20, #$00
	MOV $21, #$01
	BRA CODE_2B05

CODE_2AFC:
	CALL CODE_3BA7
	MOV $20, #$00
	MOV $21, #$04
CODE_2B05:
	ADDW YA, $20
CODE_2B07:
	JMP CODE_3B99

CODE_2B0A:
	MOV A, #$3A
	MOV $D7, A
	RET

;--------------------------------------------------------------------

CODE_2B0F:
	JMP CODE_2B98

CODE_2B12:
	MOV A, $20
	CMP A, #$01
	BNE CODE_2B0F
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$10
	BNE CODE_2B25
	MOV A, #$03
	MOV $D6, A
CODE_2B25:
	MOV A, $DA
	BEQ CODE_2B47
	LSR A
	LSR A
	LSR A
	LSR A
	EOR A, #$07
	MOV $20, A
	CLRC
	ADC $20, #$05
	INC $E5
	MOV A, $E5
	CMP A, $20
	BNE CODE_2B41
CODE_2B3D:
	MOV A, #$00
	MOV $E5, A
CODE_2B41:
	MOV A, $E5
	CMP A, #$00
	BEQ CODE_2B50
CODE_2B47:
	MOV A, $E5
	SETC
	SBC A, #$0B
	BPL CODE_2B3D
	BRA CODE_2B57

CODE_2B50:
	MOV A, $2F
	BEQ CODE_2B57
	CALL CODE_3BAE
CODE_2B57:
	MOV A, $D6
	AND A, #$03
	CMP A, #$00
	BEQ CODE_2B69
	CMP A, #$01
	BEQ CODE_2B6F
	CMP A, #$02
	BEQ CODE_2B75
	BRA CODE_2B7B

CODE_2B69:
	MOV A, $22
	MOV Y, $23
	BRA CODE_2B7F

CODE_2B6F:
	MOV A, $24
	MOV Y, $25
	BRA CODE_2B7F

CODE_2B75:
	MOV A, $26
	MOV Y, $27
	BRA CODE_2B7F

CODE_2B7B:
	MOV A, $28
	MOV Y, $29
CODE_2B7F:
	CALL CODE_3B92
	MOV A, $DA
	MOV Y, #$00
	MOV X, $2E
	DIV YA, X
	CLRC
	ADC A, $2A
	MOV X, $2B
	MOV Y, $2C
	CALL CODE_3B53
	MOV A, $2D
	MOV $DE, A
	RET

;--------------------------------------------------------------------

CODE_2B98:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$10
	BNE CODE_2BA5
	MOV A, #$03
	MOV $D7, A
CODE_2BA5:
	MOV A, $DB
	BEQ CODE_2BC7
	LSR A
	LSR A
	LSR A
	LSR A
	EOR A, #$07
	MOV $20, A
	CLRC
	ADC $20, #$05
	INC $E6
	MOV A, $E6
	CMP A, $20
	BNE CODE_2BC1
CODE_2BBD:
	MOV A, #$00
	MOV $E6, A
CODE_2BC1:
	MOV A, $E6
	CMP A, #$00
	BEQ CODE_2BD0
CODE_2BC7:
	MOV A, $E6
	SETC
	SBC A, #$0B
	BPL CODE_2BBD
	BRA CODE_2BD7

CODE_2BD0:
	MOV A, $2F
	BEQ CODE_2BD7
	CALL CODE_3BB4
CODE_2BD7:
	MOV A, $D7
	AND A, #$03
	CMP A, #$00
	BEQ CODE_2BE9
	CMP A, #$01
	BEQ CODE_2BEF
	CMP A, #$02
	BEQ CODE_2BF5
	BRA CODE_2BFB

CODE_2BE9:
	MOV A, $22
	MOV Y, $23
	BRA CODE_2BFF

CODE_2BEF:
	MOV A, $24
	MOV Y, $25
	BRA CODE_2BFF

CODE_2BF5:
	MOV A, $26
	MOV Y, $27
	BRA CODE_2BFF

CODE_2BFB:
	MOV A, $28
	MOV Y, $29
CODE_2BFF:
	CALL CODE_3B99
	MOV A, $DB
	MOV Y, #$00
	MOV X, $2E
	DIV YA, X
	CLRC
	ADC A, $2A
	MOV X, $2B
	MOV Y, $2C
	CALL CODE_3B65
	MOV A, $2D
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_2C18:
	MOV A, $20
	CMP A, #$01
	BNE CODE_2C7A
	MOV $20, #$00
	MOV A, $D6
	CMP A, #$10
	BNE CODE_2C2B
	MOV A, #$01
	MOV $D6, A
CODE_2C2B:
	MOV A, $DA
	BEQ CODE_2C4D
	LSR A
	LSR A
	LSR A
	LSR A
	EOR A, #$07
	MOV $20, A
	CLRC
	ADC $20, #$05
	INC $E5
	MOV A, $E5
	CMP A, $20
	BNE CODE_2C47
CODE_2C43:
	MOV A, #$00
	MOV $E5, A
CODE_2C47:
	MOV A, $E5
	CMP A, #$00
	BEQ CODE_2C56
CODE_2C4D:
	MOV A, $E5
	SETC
	SBC A, #$0B
	BPL CODE_2C43
	BRA CODE_2C5D

CODE_2C56:
	MOV A, $29
	BEQ CODE_2C5D
	CALL CODE_3BAE
CODE_2C5D:
	MOV A, $22
	MOV Y, $23
	CALL CODE_3B92
	MOV A, $DA
	MOV Y, #$00
	MOV X, $24
	DIV YA, X
	CLRC
	ADC A, $25
	MOV X, $26
	MOV Y, $27
	CALL CODE_3B53
	MOV A, $28
	MOV $DE, A
	RET

CODE_2C7A:
	MOV $20, #$00
	MOV A, $D7
	CMP A, #$10
	BNE CODE_2C87
	MOV A, #$01
	MOV $D7, A
CODE_2C87:
	MOV A, $DB
	BEQ CODE_2CA9
	LSR A
	LSR A
	LSR A
	LSR A
	EOR A, #$07
	MOV $20, A
	CLRC
	ADC $20, #$05
	INC $E6
	MOV A, $E6
	CMP A, $20
	BNE CODE_2CA3
CODE_2C9F:
	MOV A, #$00
	MOV $E6, A
CODE_2CA3:
	MOV A, $E6
	CMP A, #$00
	BEQ CODE_2CB2
CODE_2CA9:
	MOV A, $E6
	SETC
	SBC A, #$0B
	BPL CODE_2C9F
	BRA CODE_2CB9

CODE_2CB2:
	MOV A, $29
	BEQ CODE_2CB9
	CALL CODE_3BB4
CODE_2CB9:
	MOV A, $22
	MOV Y, $23
	CALL CODE_3B99
	MOV A, $DB
	MOV Y, #$00
	MOV X, $24
	DIV YA, X
	CLRC
	ADC A, $25
	MOV X, $26
	MOV Y, $27
	CALL CODE_3B65
	MOV A, $28
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_2CD6:
	MOV A, $20
	CMP A, #$01
	BNE CODE_2CE4
	MOV $20, #$00
	MOV A, #$FF
	MOV $DE, A
	RET

CODE_2CE4:
	MOV $20, #$00
	MOV A, #$FF
	MOV $DF, A
	RET

;--------------------------------------------------------------------

CODE_2CEC:
	SETC
	SBC A, #$20
	ASL A
	MOV X, A
	JMP (DATA_1592+x)


;--------------------------------------------------------------------

CODE_2CF4:
	MOV $20, #$06
	MOV $21, #$32
	MOV $22, #$AD
	MOV $23, #$17
	MOV $24, #$96
	MOV $25, #$1F
	MOV $26, #$6E
	MOV $27, #$FE
	MOV $28, #$F2
	MOV $29, #$0E
	MOV $2A, #$0E
	MOV $2B, #$01
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_2D1B:
	MOV $20, #$1B
	MOV $21, #$00
	MOV $22, #$0C
	MOV $23, #$00
	MOV $24, #$01
	MOV $25, #$78
	MOV $26, #$DF
	MOV $27, #$52
	MOV $28, #$0C
	MOV $29, #$00
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_2D3C:
	MOV $20, #$12
	MOV $21, #$00
	MOV $22, #$03
	MOV $23, #$32
	MOV $24, #$01
	MOV $25, #$50
	MOV $26, #$FE
	MOV $27, #$E0
	MOV $28, #$11
	MOV $29, #$00
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_2D5D:
	MOV $20, #$14
	MOV $21, #$00
	MOV $22, #$02
	MOV $23, #$00
	MOV $24, #$01
	MOV $25, #$5A
	MOV $26, #$FE
	MOV $27, #$E0
	MOV $28, #$12
	MOV $29, #$00
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_2D7E:
	MOV $22, #$00
	MOV $23, #$07
	MOV $24, #$00
	MOV $25, #$14
	MOV $26, #$09
	MOV $27, #$3C
	MOV $28, #$00
	MOV $29, #$02
	MOV $2A, #$64
	MOV $2B, #$9E
	MOV $2C, #$ED
	MOV $2D, #$0D
	MOV $2E, #$0D
	MOV $2F, #$00
	JMP CODE_3AD5

;--------------------------------------------------------------------

CODE_2DAB:
	MOV $20, #$02
	MOV $21, #$07
	MOV $22, #$00
	MOV $23, #$05
	MOV $24, #$00
	MOV $25, #$05
	MOV $26, #$2D
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$08
	MOV $2A, #$08
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_2DD2:
	CALL CODE_3B77
	MOV $20, #$07
	MOV $21, #$1E
	MOV $22, #$32
	MOV $23, #$06
	MOV $24, #$00
	MOV $25, #$0A
	MOV $26, #$5F
	MOV $27, #$EC
	MOV $28, #$35
	MOV $29, #$02
	MOV $2A, #$01
	MOV $2B, #$00
	CALL CODE_39E8
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_2DFF:
	MOV $20, #$27
	MOV $21, #$00
	MOV $22, #$0A
	MOV $23, #$0C
	MOV $24, #$00
	MOV $25, #$37
	MOV $26, #$FE
	MOV $27, #$F3
	MOV $28, #$10
	MOV $29, #$01
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_2E20:
	MOV $20, #$08
	MOV $21, #$32
	MOV $22, #$50
	MOV $23, #$04
	MOV $24, #$50
	MOV $25, #$07
	MOV $26, #$7F
	MOV $27, #$EE
	MOV $28, #$51
	MOV $29, #$02
	MOV $2A, #$02
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_2E47:
	MOV $20, #$07
	MOV $21, #$78
	MOV $22, #$00
	MOV $23, #$05
	MOV $24, #$00
	MOV $25, #$07
	MOV $26, #$7F
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$06
	MOV $2A, #$06
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_2E6E:
	CALL CODE_3B77
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_2E95
	CMP A, #$08
	BEQ CODE_2E9B
	CMP A, #$10
	BEQ CODE_2EA1
	CMP A, #$18
	BEQ CODE_2EA7
	CMP A, #$20
	BEQ CODE_2EAD
	CMP A, #$2C
	BEQ CODE_2EB3
	CMP A, #$3A
	BEQ CODE_2EB9
	CMP A, #$48
	BEQ CODE_2ECF
	BRA CODE_2EC3

CODE_2E95:
	MOV A, #$F5
	MOV Y, #$02
	BRA CODE_2EBD

CODE_2E9B:
	MOV A, #$2F
	MOV Y, #$04
	BRA CODE_2EBD

CODE_2EA1:
	MOV A, #$F3
	MOV Y, #$03
	BRA CODE_2EBD

CODE_2EA7:
	MOV A, #$BA
	MOV Y, #$03
	BRA CODE_2EBD

CODE_2EAD:
	MOV A, #$85
	MOV Y, #$03
	BRA CODE_2EBD

CODE_2EB3:
	MOV A, #$52
	MOV Y, #$03
	BRA CODE_2EBD

CODE_2EB9:
	MOV A, #$22
	MOV Y, #$03
CODE_2EBD:
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_2EC3:
	MOV A, #$50
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B43
	MOV A, #$0D
	RET

CODE_2ECF:
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_2ED2:
	MOV $20, #$09
	MOV $21, #$32
	MOV $22, #$00
	MOV $23, #$09
	MOV $24, #$00
	MOV $25, #$09
	MOV $26, #$5A
	MOV $27, #$00
	MOV $28, #$01
	MOV $29, #$30
	MOV $2A, #$00
	MOV $2B, #$01
	MOV $2C, #$50
	MOV $2D, #$28
	MOV $2E, #$FE
	MOV $2F, #$F0
	MOV $D0, #$06
	MOV $D1, #$10
	MOV $D2, #$00
	JMP CODE_3A5F

;--------------------------------------------------------------------

CODE_2F0E:
	CALL CODE_3B77
	MOV $20, #$1E
	MOV $21, #$00
	MOV $22, #$0A
	MOV $23, #$DC
	MOV $24, #$00
	MOV $25, #$49
	MOV $26, #$8F
	MOV $27, #$F0
	MOV $28, #$12
	MOV $29, #$00
	CALL CODE_3A2D
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_2F35:
	CALL CODE_3B77
	MOV $20, #$08
	MOV $21, #$28
	MOV $22, #$96
	MOV $23, #$1F
	MOV $24, #$AD
	MOV $25, #$17
	MOV $26, #$7F
	MOV $27, #$DD
	MOV $28, #$74
	MOV $29, #$0E
	MOV $2A, #$0E
	MOV $2B, #$01
	CALL CODE_39E8
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_2F62:
	CALL CODE_3B77
	MOV $20, #$06
	MOV $21, #$28
	MOV $22, #$AD
	MOV $23, #$17
	MOV $24, #$AD
	MOV $25, #$17
	MOV $26, #$3C
	MOV $27, #$FE
	MOV $28, #$11
	MOV $29, #$0F
	MOV $2A, #$0F
	MOV $2B, #$00
	CALL CODE_39E8
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_2F8F:
	CALL CODE_3B77
	MOV $20, #$07
	MOV $21, #$28
	MOV $22, #$00
	MOV $23, #$07
	MOV $24, #$00
	MOV $25, #$07
	MOV $26, #$46
	MOV $27, #$FE
	MOV $28, #$11
	MOV $29, #$0F
	MOV $2A, #$0F
	MOV $2B, #$00
	CALL CODE_39E8
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_2FBC:
	MOV $26, #$50
	BRA CODE_2FC9

CODE_2FC1:
	MOV $26, #$32
	BRA CODE_2FC9

CODE_2FC6:
	MOV $26, #$1E
CODE_2FC9:
	MOV $20, #$04
	MOV $21, #$0C
	MOV $22, #$00
	MOV $23, #$03
	MOV $24, #$50
	MOV $25, #$03
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$17
	MOV $2A, #$16
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_2FED:
	MOV $26, #$7D
	BRA CODE_2FFA

CODE_2FF2:
	MOV $26, #$69
	BRA CODE_2FFA

CODE_2FF7:
	MOV $26, #$46
CODE_2FFA:
	MOV $20, #$06
	MOV $21, #$14
	MOV $22, #$40
	MOV $23, #$03
	MOV $24, #$00
	MOV $25, #$02
	MOV $27, #$FF
	MOV $28, #$F6
	MOV $29, #$16
	MOV $2A, #$02
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_301E:
	MOV $26, #$78
	BRA CODE_302B

CODE_3023:
	MOV $26, #$61
	BRA CODE_302B

CODE_3028:
	MOV $26, #$55
CODE_302B:
	MOV $20, #$07
	MOV $21, #$28
	MOV $22, #$00
	MOV $23, #$0F
	MOV $24, #$00
	MOV $25, #$27
	MOV $27, #$FF
	MOV $28, #$F8
	MOV $29, #$0E
	MOV $2A, #$0E
	MOV $2B, #$00
	JMP CODE_39E8

------------------------------------------------------------------

CODE_304F:
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_306B
	CMP A, #$05
	BEQ CODE_307B
	CMP A, #$14
	BEQ CODE_3087
	CMP A, #$37
	BEQ CODE_3068
	SETC
	SBC A, #$14
	BPL CODE_3093
	BRA CODE_30B3

CODE_3068:
	JMP CODE_3A27

CODE_306B:
	MOV A, #$00
	MOV $E0, A
	MOV A, #$00
	MOV Y, #$06
	CALL CODE_3BC9
	CALL CODE_3BBF
	BRA CODE_30B3

CODE_307B:
	MOV A, #$00
	MOV Y, #$07
	CALL CODE_3BC9
	CALL CODE_3BBF
	BRA CODE_30B3

CODE_3087:
	MOV A, #$00
	MOV Y, #$10
	CALL CODE_3BC9
	CALL CODE_3BBF
	BRA CODE_30B3

CODE_3093:
	INC $E0
	BBS2 $E0, CODE_30A5
	MOV $20, #$E0
	MOV $21, #$00
	CALL CODE_3BD0
	ADDW YA, $20
	BRA CODE_30B0

CODE_30A5:
	MOV $20, #$A0
	MOV $21, #$01
	CALL CODE_3BD0
	SUBW YA, $20
CODE_30B0:
	CALL CODE_3BC9
CODE_30B3:
	MOV A, #$6E
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B43
	MOV A, $E2
	SETC
	SBC A, #$14
	BPL CODE_30C6
	MOV A, #$06
	RET

CODE_30C6:
	MOV A, #$01
	RET

;--------------------------------------------------------------------

CODE_30C9:
	CALL CODE_3B7C
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_30EF
	CMP A, #$07
	BEQ CODE_30F5
	CMP A, #$0E
	BEQ CODE_30FB
	CMP A, #$15
	BEQ CODE_3101
	CMP A, #$1C
	BEQ CODE_3107
	CMP A, #$23
	BEQ CODE_310D
	CMP A, #$2E
	BEQ CODE_30EC
	BRA CODE_3117

CODE_30EC:
	JMP CODE_3A27

CODE_30EF:
	MOV A, #$CD
	MOV Y, #$0F
	BRA CODE_3111

CODE_30F5:
	MOV A, #$CB
	MOV Y, #$12
	BRA CODE_3111

CODE_30FB:
	MOV A, #$96
	MOV Y, #$1F
	BRA CODE_3111

CODE_3101:
	MOV A, #$16
	MOV Y, #$19
	BRA CODE_3111

CODE_3107:
	MOV A, #$28
	MOV Y, #$1C
	BRA CODE_3111

CODE_310D:
	MOV A, #$96
	MOV Y, #$25
CODE_3111:
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_3117:
	MOV A, #$7F
	MOV X, #$AF
	MOV Y, #$51
	CALL CODE_3B43
	MOV A, #$0E
	RET

;--------------------------------------------------------------------

CODE_3123:
	MOV $26, #$64
	BRA CODE_3130

CODE_3128:
	MOV $26, #$4B
	BRA CODE_3130

CODE_312D:
	MOV $26, #$32
CODE_3130:
	MOV $20, #$06
	MOV $21, #$0F
	MOV $22, #$32
	MOV $23, #$05
	MOV $24, #$14
	MOV $25, #$02
	MOV $27, #$FF
	MOV $28, #$F6
	MOV $29, #$06
	MOV $2A, #$02
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_3154:
	MOV $20, #$05
	MOV $21, #$0F
	MOV $22, #$32
	MOV $23, #$02
	MOV $24, #$00
	MOV $25, #$03
	MOV $26, #$46
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$02
	MOV $2A, #$02
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_317B:
	MOV $20, #$06
	MOV $21, #$19
	MOV $22, #$32
	MOV $23, #$02
	MOV $24, #$00
	MOV $25, #$01
	MOV $26, #$64
	MOV $27, #$FF
	MOV $28, #$F0
	MOV $29, #$06
	MOV $2A, #$02
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_31A2:
	MOV $20, #$07
	MOV $21, #$1E
	MOV $22, #$00
	MOV $23, #$15
	MOV $24, #$00
	MOV $25, #$20
	MOV $26, #$5A
	MOV $27, #$FF
	MOV $28, #$F3
	MOV $29, #$12
	MOV $2A, #$0E
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_31C9:
	MOV $20, #$02
	MOV $21, #$0F
	MOV $22, #$32
	MOV $23, #$02
	MOV $24, #$32
	MOV $25, #$02
	MOV $26, #$5F
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$02
	MOV $2A, #$02
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_31F0:
	MOV $20, #$07
	MOV $21, #$14
	MOV $22, #$1E
	MOV $23, #$02
	MOV $24, #$00
	MOV $25, #$03
	MOV $26, #$64
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$02
	MOV $2A, #$17
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_3217:
	MOV $26, #$64
	BRA CODE_3224

CODE_321C:
	MOV $26, #$46
	BRA CODE_3224

CODE_3221:
	MOV $26, #$32
CODE_3224:
	MOV $20, #$07
	MOV $21, #$28
	MOV $22, #$00
	MOV $23, #$03
	MOV $24, #$00
	MOV $25, #$03
	MOV $27, #$FF
	MOV $28, #$F3
	MOV $29, #$02
	MOV $2A, #$06
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_3248:
	INC $E0
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_325E
	CMP A, #$28
	BEQ CODE_3267
	CMP A, #$50
	BEQ CODE_3270
	CMP A, #$7D
	BEQ CODE_32B0
	BRA CODE_327E

CODE_325E:
	CALL CODE_3BBF
	MOV A, #$00
	MOV Y, #$06
	BRA CODE_3277

CODE_3267:
	CALL CODE_3BBF
	MOV A, #$00
	MOV Y, #$05
	BRA CODE_3277

CODE_3270:
	CALL CODE_3BBF
	MOV A, #$00
	MOV Y, #$04
CODE_3277:
	CALL CODE_3BC9
	MOV A, #$01
	MOV $E0, A
CODE_327E:
	MOV $20, #$0D
	MOV $21, #$00
	MOV A, $E0
	SETC
	SBC A, #$0F
	BPL CODE_3292
	CALL CODE_3BD0
	SUBW YA, $20
	BRA CODE_3297

CODE_3292:
	CALL CODE_3BD0
	ADDW YA, $20
CODE_3297:
	CALL CODE_3BC9
	MOV A, $E2
	LSR A
	LSR A
	LSR A
	MOV $20, A
	MOV A, #$28
	SETC
	SBC A, $20
	MOV X, #$F5
	MOV Y, #$F6
	CALL CODE_3B43
	MOV A, #$10
	RET

CODE_32B0:
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_32B3:
	MOV $20, #$46
	MOV $21, #$00
	MOV $22, #$0F
	MOV $23, #$33
	MOV $24, #$00
	MOV $25, #$1E
	MOV $26, #$8C
	MOV $27, #$F0
	MOV $28, #$14
	MOV $29, #$00
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_32D4:
	CALL CODE_3B7C
	MOV $20, #$05
	MOV $21, #$10
	MOV $22, #$80
	MOV $23, #$08
	MOV $24, #$80
	MOV $25, #$06
	MOV $26, #$78
	MOV $27, #$FF
	MOV $28, #$F0
	MOV $29, #$01
	MOV $2A, #$0E
	MOV $2B, #$00
	CALL CODE_39E8
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_3301:
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_3327
	CMP A, #$63
	BEQ CODE_334B
	CMP A, #$64
	BEQ CODE_334F
	CMP A, #$80
	BEQ CODE_335B
	CMP A, #$9C
	BEQ CODE_3367
	CMP A, #$B8
	BEQ CODE_3324
	MOV A, $E2
	SETC
	SBC A, #$64
	BMI CODE_3331
	BRA CODE_3371

CODE_3324:
	JMP CODE_3A27

CODE_3327:
	MOV A, #$00
	MOV Y, #$06
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_3331:
	CALL CODE_3BD0
	MOV $20, #$08
	MOV $21, #$00
	SUBW YA, $20
	CALL CODE_3BC9
	MOV A, #$5A
	MOV X, #$F4
	MOV Y, #$E0
	CALL CODE_3B43
	MOV A, #$14
	RET

CODE_334B:
	SET3 $46
	BRA CODE_337F

CODE_334F:
	MOV A, #$00
	MOV Y, #$0C
	CALL CODE_3BC9
	CALL CODE_3BBF
	BRA CODE_3371

CODE_335B:
	MOV A, #$00
	MOV Y, #$07
	CALL CODE_3BC9
	CALL CODE_3BBF
	BRA CODE_3371

CODE_3367:
	MOV A, #$00
	MOV Y, #$02
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_3371:
	CALL CODE_3BD0
	MOV $20, #$99
	MOV $21, #$00
	ADDW YA, $20
	CALL CODE_3BC9
CODE_337F:
	MOV A, #$7F
	MOV X, #$9E
	MOV Y, #$95
	CALL CODE_3B43
	CALL CODE_1A53
	MOV A, #$0E
	RET

;--------------------------------------------------------------------

CODE_338E:
	MOV $20, #$05
	MOV $21, #$0A
	MOV $22, #$00
	MOV $23, #$09
	MOV $24, #$00
	MOV $25, #$0B
	MOV $26, #$7F
	MOV $27, #$DF
	MOV $28, #$30
	MOV $29, #$13
	MOV $2A, #$13
	MOV $2B, #$01
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_33B5:
	CALL CODE_3B77
	MOV $20, #$08
	MOV $21, #$1E
	MOV $22, #$00
	MOV $23, #$0E
	MOV $24, #$00
	MOV $25, #$10
	MOV $26, #$50
	MOV $27, #$FE
	MOV $28, #$F0
	MOV $29, #$12
	MOV $2A, #$12
	MOV $2B, #$00
	JMP CODE_39E8

;--------------------------------------------------------------------

CODE_33DF:
	MOV $20, #$45
	MOV $21, #$00
	MOV $22, #$0C
	MOV $23, #$C9
	MOV $24, #$00
	MOV $25, #$7D
	MOV $26, #$DF
	MOV $27, #$4C
	MOV $28, #$0C
	MOV $29, #$00
	CALL CODE_3A2D
	PUSH A
	MOV A, $E2
	SBC A, #$14
	BMI CODE_341F
	INC $03D8
	MOV A, $ED
	ADC A, $03D8
	MOV $ED, A
	MOV A, $EE
	ADC A, $03D8
	MOV $EE, A
	MOV A, #$8C
	MOV $03A9, A
	BRA CODE_3424

CODE_341F:
	MOV A, #$00
	MOV $03D8, A
CODE_3424:
	POP A
	RET

;--------------------------------------------------------------------

CODE_3426:
	MOV A, #$00
	MOV $6C, A
	INC $E1
	CALL CODE_3B77
	MOV A, $E1
	CMP A, #$02
	BEQ CODE_343B
	CMP A, #$E1
	BEQ CODE_3499
	BRA CODE_3441

CODE_343B:
	MOV A, #$00
	MOV $E0, A
	BRA CODE_347F

CODE_3441:
	INC $E0
	MOV A, $E0
	CMP A, #$02
	BEQ CODE_345B
	CMP A, #$08
	BEQ CODE_3461
	CMP A, #$0E
	BEQ CODE_3467
	CMP A, #$14
	BEQ CODE_346D
	CMP A, #$1A
	BEQ CODE_3473
	BRA CODE_347F

CODE_345B:
	MOV A, #$E6
	MOV Y, #$07
	BRA CODE_3479

CODE_3461:
	MOV A, #$5F
	MOV Y, #$08
	BRA CODE_3479

CODE_3467:
	MOV A, #$DE
	MOV Y, #$08
	BRA CODE_3479

CODE_346D:
	MOV A, #$65
	MOV Y, #$09
	BRA CODE_3479

CODE_3473:
	MOV A, #$02
	MOV $E0, A
	BRA CODE_345B

CODE_3479:
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_347F:
	MOV A, $E1
	BPL CODE_3487
	EOR A, #$FF
	BRA CODE_3489

CODE_3487:
	MOV A, #$7F
CODE_3489:
	SETC
	SBC A, #$1E
	MOV X, #$FE
	MOV Y, #$D0
	CALL CODE_3B43
	CALL CODE_3B81
	MOV A, #$12
	RET

CODE_3499:
	MOV A, #$FF
	MOV $E1, A
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_34A0:
	MOV $20, #$13
	MOV $21, #$32
	MOV $22, #$00
	MOV $23, #$07
	MOV $24, #$00
	MOV $25, #$06
	MOV $26, #$B0
	MOV $27, #$00
	MOV $28, #$00
	MOV $29, #$0C
	MOV $2A, #$00
	MOV $2B, #$01
	MOV $2C, #$37
	MOV $2D, #$37
	MOV $2E, #$FB
	MOV $2F, #$F0
	MOV $D0, #$08
	MOV $D1, #$08
	MOV $D2, #$00
	JMP CODE_3A5F

;--------------------------------------------------------------------

CODE_34DC:
	MOV $20, #$0A
	MOV $21, #$00
	MOV $22, #$02
	MOV $23, #$1E
	MOV $24, #$00
	MOV $25, #$5A
	MOV $26, #$FF
	MOV $27, #$E0
	MOV $28, #$14
	MOV $29, #$00
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_34FD:
	MOV $20, #$0F
	MOV $21, #$00
	MOV $22, #$06
	MOV $23, #$64
	MOV $24, #$00
	MOV $25, #$7F
	MOV $26, #$FF
	MOV $27, #$E0
	MOV $28, #$01
	MOV $29, #$01
	JMP CODE_3A2D

;--------------------------------------------------------------------

CODE_351E:
	MOV $20, #$08
	MOV $21, #$32
	MOV $22, #$00
	MOV $23, #$05
	MOV $24, #$1E
	MOV $25, #$07
	MOV $26, #$00
	MOV $27, #$00
	MOV $28, #$00
	MOV $29, #$1E
	MOV $2A, #$00
	MOV $2B, #$01
	MOV $2C, #$73
	MOV $2D, #$32
	MOV $2E, #$FE
	MOV $2F, #$F0
	MOV $D0, #$01
	MOV $D1, #$10
	MOV $D2, #$00
	JMP CODE_3A5F

;--------------------------------------------------------------------

CODE_355A:
	MOV $20, #$02
	MOV $21, #$0F
	MOV $22, #$32
	MOV $23, #$02
	MOV $24, #$32
	MOV $25, #$02
	MOV $26, #$5F
	MOV $27, #$FF
	MOV $28, #$E0
	MOV $29, #$02
	MOV $2A, #$02
	MOV $2B, #$00
	CALL CODE_39E8
	JMP CODE_3B81

;--------------------------------------------------------------------

CODE_3584:
	CALL CODE_3B77
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_359F
	CMP A, #$15
	BEQ CODE_359F
	CMP A, #$2A
	BEQ CODE_359F
	CMP A, #$3F
	BEQ CODE_359F
	CMP A, #$54
	BEQ CODE_35B5
	BRA CODE_35A9

CODE_359F:
	MOV A, #$00
	MOV Y, #$30
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_35A9:
	MOV A, #$2D
	MOV X, #$BF
	MOV Y, #$2F
	CALL CODE_3B43
	MOV A, #$0C
	RET

CODE_35B5:
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_35B8:
	MOV $20, #$45
	MOV $21, #$06
	MOV $22, #$E6
	MOV $23, #$07
	MOV $24, #$DE
	MOV $25, #$08
	MOV $26, #$F4
	MOV $27, #$09
	MOV $28, #$2C
	MOV $29, #$0B
	MOV $2A, #$8B
	MOV $2B, #$0C
	MOV $2C, #$14
	MOV $2D, #$0E
	MOV $2E, #$CD
	MOV $2F, #$0F
	MOV $D0, #$BD
	MOV $D1, #$11
	BRA CODE_3628

CODE_35F0:
	MOV $20, #$BD
	MOV $21, #$11
	MOV $22, #$CD
	MOV $23, #$0F
	MOV $24, #$14
	MOV $25, #$0E
	MOV $26, #$8B
	MOV $27, #$0C
	MOV $28, #$2C
	MOV $29, #$0B
	MOV $2A, #$F4
	MOV $2B, #$09
	MOV $2C, #$DE
	MOV $2D, #$08
	MOV $2E, #$E6
	MOV $2F, #$07
	MOV $D0, #$45
	MOV $D1, #$06
	BRA CODE_3628

CODE_3628:
	CALL CODE_3B7C
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_365A
	CMP A, #$05
	BEQ CODE_3660
	CMP A, #$0A
	BEQ CODE_3666
	CMP A, #$0F
	BEQ CODE_366C
	CMP A, #$14
	BEQ CODE_3672
	CMP A, #$19
	BEQ CODE_3678
	CMP A, #$1E
	BEQ CODE_367E
	CMP A, #$23
	BEQ CODE_3684
	CMP A, #$28
	BEQ CODE_368A
	CMP A, #$2D
	BEQ CODE_3657
	BRA CODE_3694

CODE_3657:
	JMP CODE_3A27

CODE_365A:
	MOV A, $20
	MOV Y, $21
	BRA CODE_368E

CODE_3660:
	MOV A, $22
	MOV Y, $23
	BRA CODE_368E

CODE_3666:
	MOV A, $24
	MOV Y, $25
	BRA CODE_368E

CODE_366C:
	MOV A, $26
	MOV Y, $27
	BRA CODE_368E

CODE_3672:
	MOV A, $28
	MOV Y, $29
	BRA CODE_368E

CODE_3678:
	MOV A, $2A
	MOV Y, $2B
	BRA CODE_368E

CODE_367E:
	MOV A, $2C
	MOV Y, $2D
	BRA CODE_368E

CODE_3684:
	MOV A, $2E
	MOV Y, $2F
	BRA CODE_368E

CODE_368A:
	MOV A, $D0
	MOV Y, $D1
CODE_368E:
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_3694:
	MOV A, #$7F
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B43
	MOV A, #$0E
	RET

;--------------------------------------------------------------------

CODE_36A0:
	MOV $2C, #$78
	MOV $2D, #$78
	BRA CODE_36B6

CODE_36A8:
	MOV $2C, #$5A
	MOV $2D, #$5A
	BRA CODE_36B6

CODE_36B0:
	MOV $2C, #$3C
	MOV $2D, #$3C
CODE_36B6:
	MOV $20, #$07
	MOV $21, #$32
	MOV $22, #$00
	MOV $23, #$05
	MOV $24, #$1E
	MOV $25, #$07
	MOV $26, #$00
	MOV $27, #$01
	MOV $28, #$00
	MOV $29, #$00
	MOV $2A, #$05
	MOV $2B, #$00
	MOV $2E, #$FE
	MOV $2F, #$F0
	MOV $D0, #$16
	MOV $D1, #$12
	MOV $D2, #$00
	JMP CODE_3A5F

;--------------------------------------------------------------------

CODE_36EC:
	CALL CODE_3B7C
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_3724
	CMP A, #$25
	BEQ CODE_372A
	CMP A, #$3D
	BEQ CODE_3730
	CMP A, #$50
	BEQ CODE_3736
	CMP A, #$60
	BEQ CODE_373C
	CMP A, #$6C
	BEQ CODE_3742
	CMP A, #$75
	BEQ CODE_3748
	CMP A, #$80
	BEQ CODE_3721
	CALL CODE_3BD0
	MOV $20, #$FF
	MOV $21, #$00
	SUBW YA, $20
	CALL CODE_3BC9
	BRA CODE_3752

CODE_3721:
	JMP CODE_3A27

CODE_3724:
	MOV A, #$14
	MOV Y, #$0E
	BRA CODE_374C

CODE_372A:
	MOV A, #$4A
	MOV Y, #$0D
	BRA CODE_374C

CODE_3730:
	MOV A, #$8B
	MOV Y, #$0C
	BRA CODE_374C

CODE_3736:
	MOV A, #$D6
	MOV Y, #$0B
	BRA CODE_374C

CODE_373C:
	MOV A, #$2C
	MOV Y, #$0B
	BRA CODE_374C

CODE_3742:
	MOV A, #$8C
	MOV Y, #$0A
	BRA CODE_374C

CODE_3748:
	MOV A, #$F4
	MOV Y, #$09
CODE_374C:
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_3752:
	MOV Y, #$00
	MOV X, #$03
	MOV A, $E2
	DIV YA, X
	MOV $20, A
	MOV A, #$64
	SETC
	SBC A, $20
	MOV X, #$CE
	MOV Y, #$1F
	CALL CODE_3B43
	CALL CODE_3B81
	MOV A, #$0E
	RET

;--------------------------------------------------------------------

CODE_376D:
	MOV $20, #$09
	MOV $21, #$15
	MOV $22, #$00
	MOV $23, #$03
	MOV $24, #$00
	MOV $25, #$06
	MOV $26, #$B0
	MOV $27, #$00
	MOV $28, #$00
	MOV $29, #$30
	MOV $2A, #$00
	MOV $2B, #$01
	MOV $2C, #$78
	MOV $2D, #$58
	MOV $2E, #$FF
	MOV $2F, #$F0
	MOV $D0, #$0C
	MOV $D1, #$0C
	MOV $D2, #$00
	JMP CODE_3A5F

;--------------------------------------------------------------------

CODE_37A9:
	CALL CODE_37F3
	CALL CODE_3B77
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_37BB
	CMP A, #$64
	BEQ CODE_37ED
	BRA CODE_37C4

CODE_37BB:
	MOV A, #$00
	MOV Y, #$0F
	CALL CODE_3BC9
	BRA CODE_37D0

CODE_37C4:
	MOV Y, #$00
	MOV A, $E2
	MOV X, #$1A
	DIV YA, X
	MOV A, Y
	BNE CODE_37D3
	BRA CODE_37BB

CODE_37D0:
	CALL CODE_3BBF
CODE_37D3:
	CALL CODE_3BD0
	MOV $20, #$92
	MOV $21, #$00
	SUBW YA, $20
	CALL CODE_3BC9
	MOV A, #$64
	MOV X, #$FA
	MOV Y, #$F1
	CALL CODE_3B43
	MOV A, #$0D
	RET

CODE_37ED:
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_37F0:
	CALL CODE_3A27
CODE_37F3:
	MOV A, $E3
	BNE CODE_37FD
	MOV A, $02
	AND A, #$80
	BNE CODE_3803
CODE_37FD:
	MOV A, #$01
	MOV $03A5, A
	RET

CODE_3803:
	MOV A, #$01
	MOV $03A6, A
	RET

;--------------------------------------------------------------------

CODE_3809:
	CALL CODE_3851
CODE_380C:
	CALL CODE_3B77
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_381B
	CMP A, #$46
	BEQ CODE_384B
	BRA CODE_3824

CODE_381B:
	MOV A, #$00
	MOV Y, #$06
	CALL CODE_3BC9
	BRA CODE_382E

CODE_3824:
	MOV Y, #$00
	MOV A, $E2
	MOV X, #$06
	DIV YA, X
	MOV A, Y
	BNE CODE_3831
CODE_382E:
	CALL CODE_3BBF
CODE_3831:
	CALL CODE_3BD0
	MOV $20, #$15
	MOV $21, #$00
	ADDW YA, $20
	CALL CODE_3BC9
	MOV A, #$6E
	MOV X, #$FA
	MOV Y, #$F1
	CALL CODE_3B43
	MOV A, #$0D
	RET

CODE_384B:
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_384E:
	CALL CODE_3A27
CODE_3851:
	MOV A, $E3
	BNE CODE_385B
	MOV A, $02
	AND A, #$80
	BNE CODE_3861
CODE_385B:
	MOV A, #$00
	MOV $03A5, A
	RET

;--------------------------------------------------------------------

CODE_3861:
	MOV A, #$00
	MOV $03A6, A
	RET

;--------------------------------------------------------------------

CODE_3867:
	MOV A, #$01
	MOV $03A7, A
	CALL CODE_3B77
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_387B
	CMP A, #$FC
	BEQ CODE_38B9
	BRA CODE_389B

CODE_387B:
	MOV A, #$00
	MOV $E0, A
	MOV A, #$59
	MOV Y, #$16
	MOV X, #$6E
	BRA CODE_3895

CODE_3887:
	MOV A, #$BE
	MOV Y, #$10
	MOV X, #$5A
	BRA CODE_3895

CODE_388F:
	MOV A, #$18
	MOV Y, #$15
	MOV X, #$62
CODE_3895:
	CALL CODE_3BC9
	CALL CODE_3BBF
CODE_389B:
	INC $E0
	MOV A, $E0
	CMP A, #$06
	BEQ CODE_3887
	CMP A, #$0C
	BEQ CODE_388F
	CMP A, #$12
	BEQ CODE_387B
	MOV A, X
	MOV X, #$EE
	MOV Y, #$20
	CALL CODE_3B43
	CALL CODE_3B81
	MOV A, #$0E
	RET

CODE_38B9:
	JMP CODE_3A27

;--------------------------------------------------------------------

CODE_38BC:
	CALL CODE_38C5
	JMP CODE_380C

;--------------------------------------------------------------------

CODE_38C2:
	CALL CODE_3A27
CODE_38C5:
	MOV A, #$00
	MOV $03A7, A
	RET

;--------------------------------------------------------------------

CODE_38CB:
	MOV $2C, #$50
	MOV $2D, #$50
	MOV $20, #$0A
	MOV $21, #$32
	MOV $22, #$00
	MOV $23, #$03
	MOV $24, #$00
	MOV $25, #$06
	MOV $26, #$00
	MOV $27, #$01
	MOV $28, #$00
	MOV $29, #$00
	MOV $2A, #$05
	MOV $2B, #$00
	MOV $2E, #$FE
	MOV $2F, #$F0
	MOV $D0, #$16
	MOV $D1, #$12
	MOV $D2, #$00
	JMP CODE_3A5F

;--------------------------------------------------------------------

CODE_3907:
	MOV $22, #$00
	MOV $23, #$0D
	MOV $24, #$00
	MOV $25, #$15
	MOV $26, #$09
	MOV $27, #$37
	MOV $28, #$00
	MOV $29, #$02
	MOV $2A, #$64
	MOV $2B, #$9E
	MOV $2C, #$ED
	MOV $2D, #$0D
	MOV $2E, #$0D
	MOV $2F, #$00
	JMP CODE_3AD5

;--------------------------------------------------------------------

CODE_3934:
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_3943
	CMP A, #$2D
	BEQ CODE_3940
	BRA CODE_3953

CODE_3940:
	JMP CODE_3A27

CODE_3943:
	MOV A, #$00
	MOV Y, #$10
	CALL CODE_3BC9
	CALL CODE_3BBF
	MOV A, #$00
	MOV $E0, A
	BRA CODE_3973

CODE_3953:
	INC $E0
	BBS2 $E0, CODE_3965
	MOV $20, #$E0
	MOV $21, #$00
	CALL CODE_3BD0
	ADDW YA, $20
	BRA CODE_3970

CODE_3965:
	MOV $20, #$A0
	MOV $21, #$01
	CALL CODE_3BD0
	SUBW YA, $20
CODE_3970:
	CALL CODE_3BC9
CODE_3973:
	MOV A, #$6E
	MOV X, #$FF
	MOV Y, #$E0
	CALL CODE_3B43
	CALL CODE_3B81
	MOV A, #$01
	RET

;--------------------------------------------------------------------

CODE_3982:
	CALL CODE_3B7C
	MOV $2C, #$40
	MOV $2D, #$40
	MOV $20, #$08
	MOV $21, #$46
	MOV $22, #$00
	MOV $23, #$05
	MOV $24, #$00
	MOV $25, #$11
	MOV $26, #$70
	MOV $27, #$01
	MOV $28, #$00
	MOV $29, #$29
	MOV $2A, #$00
	MOV $2B, #$01
	MOV $2E, #$FE
	MOV $2F, #$EE
	MOV $D0, #$10
	MOV $D1, #$10
	MOV $D2, #$01
	CALL CODE_3A5F
	PUSH A
	MOV A, #$40
	MOV $ED, A
	MOV A, #$00
	MOV $EE, A
	MOV A, $E3
	BNE CODE_39E3
	MOV A, $E2
	MOV Y, #$E0
	MUL YA
	MOV $20, Y
	MOV A, $ED
	CLRC
	SBC A, $20
	MOV $ED, A
	MOV A, $EE
	CLRC
	ADC A, $20
	MOV $EE, A
CODE_39E3:
	CALL CODE_1A53
	POP A
	RET

;--------------------------------------------------------------------

CODE_39E8:
	MOV A, $E2
	CMP A, $20
	BEQ CODE_39FE
	CMP A, #$02
	BEQ CODE_39F8
	CMP A, $21
	BEQ CODE_3A27
	BRA CODE_3A11

CODE_39F8:
	MOV A, $22
	MOV Y, $23
	BRA CODE_3A02

CODE_39FE:
	MOV A, $24
	MOV Y, $25
CODE_3A02:
	CALL CODE_3BC9
	MOV A, $2B
	BNE CODE_3A0E
	CALL CODE_3BBF
	BRA CODE_3A11

CODE_3A0E:
	CALL CODE_3BC4
CODE_3A11:
	MOV A, $26
	MOV X, $27
	MOV Y, $28
	CALL CODE_3B43
	MOV A, $E2
	SETC
	SBC A, $20
	BPL CODE_3A24
	MOV A, $29
	RET

CODE_3A24:
	MOV A, $2A
	RET

;--------------------------------------------------------------------

CODE_3A27:
	MOV A, #$01
	MOV $03BC, A
	RET

;--------------------------------------------------------------------

CODE_3A2D:
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_3A39
	CMP A, $20
	BEQ CODE_3A27
	BRA CODE_3A43

CODE_3A39:
	CALL CODE_3BBF
	MOV A, $21
	MOV Y, $22
	CALL CODE_3BC9
CODE_3A43:
	CALL CODE_3BD0
	MOV X, $29
	BNE CODE_3A4E
	ADDW YA, $23
	BRA CODE_3A50

CODE_3A4E:
	SUBW YA, $23
CODE_3A50:
	CALL CODE_3BC9
	MOV A, $25
	MOV X, $26
	MOV Y, $27
	CALL CODE_3B43
	MOV A, $28
	RET

;--------------------------------------------------------------------

CODE_3A5F:
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_3A6F
	CMP A, $20
	BEQ CODE_3A7B
	CMP A, $21
	BEQ CODE_3A27
	BRA CODE_3A8B

CODE_3A6F:
	CALL CODE_3BBF
	MOV A, $22
	MOV Y, $23
	CALL CODE_3BC9
	BRA CODE_3AB4

CODE_3A7B:
	MOV A, $D2
	BNE CODE_3A82
	CALL CODE_3BBF
CODE_3A82:
	MOV A, $24
	MOV Y, $25
	CALL CODE_3BC9
	BRA CODE_3AB4

CODE_3A8B:
	MOV A, $E2
	SETC
	SBC A, $20
	BPL CODE_3AA4
	CALL CODE_3BD0
	MOV X, $28
	BNE CODE_3A9D
	ADDW YA, $26
	BRA CODE_3A9F

CODE_3A9D:
	SUBW YA, $26
CODE_3A9F:
	CALL CODE_3BC9
	BRA CODE_3AB4

CODE_3AA4:
	CALL CODE_3BD0
	MOV X, $2B
	BNE CODE_3AAF
	ADDW YA, $29
	BRA CODE_3AB1

CODE_3AAF:
	SUBW YA, $29
CODE_3AB1:
	CALL CODE_3BC9
CODE_3AB4:
	MOV A, $E2
	SETC
	SBC A, $20
	BPL CODE_3ABF
	MOV A, $2C
	BRA CODE_3AC1

CODE_3ABF:
	MOV A, $2D
CODE_3AC1:
	MOV X, $2E
	MOV Y, $2F
	CALL CODE_3B43
	MOV A, $E2
	SETC
	SBC A, $20
	BPL CODE_3AD2
	MOV A, $D0
	RET

CODE_3AD2:
	MOV A, $D1
	RET

;--------------------------------------------------------------------

CODE_3AD5:
	MOV A, $E2
	CMP A, #$02
	BEQ CODE_3AED
	CMP A, $26
	BEQ CODE_3AFD
	CMP A, $27
	BEQ CODE_3AEA
	SETC
	SBC A, $26
	BPL CODE_3B0D
	BRA CODE_3B25

CODE_3AEA:
	JMP CODE_3A27

CODE_3AED:
	MOV A, $22
	MOV Y, $23
	CALL CODE_3BC9
	CALL CODE_3BBF
	MOV A, #$00
	MOV $E0, A
	BRA CODE_3B25

CODE_3AFD:
	MOV A, $24
	MOV Y, $25
	CALL CODE_3BC9
	MOV A, $2F
	BEQ CODE_3B25
	CALL CODE_3BBF
	BRA CODE_3B25

CODE_3B0D:
	INC $E0
	MOV A, $E0
	MOV $20, A
	BBS2 $20, CODE_3B1D
	CALL CODE_3BD0
	ADDW YA, $28
	BRA CODE_3B22

CODE_3B1D:
	CALL CODE_3BD0
	SUBW YA, $28
CODE_3B22:
	CALL CODE_3BC9
CODE_3B25:
	MOV A, $E2
	LSR A
	MOV $20, A
	MOV A, $2A
	SETC
	SBC A, $20
	MOV X, $2B
	MOV Y, $2C
	CALL CODE_3B43
	MOV A, $E2
	SETC
	SBC A, $26
	BPL CODE_3B40
	MOV A, $2D
	RET

CODE_3B40:
	MOV A, $2E
	RET

CODE_3B43:
	MOV $03A8, X
	MOV $03A9, Y
	MOV $ED, A
	MOV Y, #$00
	MOV X, #$1E
	DIV YA, X
	MOV $EE, A
	RET

;--------------------------------------------------------------------

CODE_3B53:
	MOV $03B6, X
	MOV $03B7, Y
CODE_3B59:
	MOV $03AA, A
	MOV Y, #$00
	MOV X, #$14
	DIV YA, X
	MOV $03AC, A
	RET

;--------------------------------------------------------------------

CODE_3B65:
	MOV $03BE, X
	MOV $03BF, Y
CODE_3B6B:
	MOV $03AB, A
	MOV Y, #$00
	MOV X, #$14
	DIV YA, X
	MOV $03AD, A
	RET

;--------------------------------------------------------------------

CODE_3B77:
	MOV A, #$00
	MOV $1F, A
	RET

;--------------------------------------------------------------------

CODE_3B7C:
	MOV A, #$01
	MOV $1F, A
	RET

;--------------------------------------------------------------------

CODE_3B81:
	PUSH A
	MOV A, $ED
	MOV X, $E3
	BNE CODE_3B8C
	MOV Y, #$88
	MUL YA
	MOV A, Y
CODE_3B8C:
	MOV $ED, A
	MOV $EE, A
	POP A
	RET

;--------------------------------------------------------------------

CODE_3B92:
	MOV $039A, A
	MOV $039C, Y
	RET

;--------------------------------------------------------------------

CODE_3B99:
	MOV $039B, A
	MOV $039D, Y
	RET

;--------------------------------------------------------------------

CODE_3BA0:
	MOV A, $039A
	MOV Y, $039C
	RET

;--------------------------------------------------------------------

CODE_3BA7:
	MOV A, $039B
	MOV Y, $039D
	RET

;--------------------------------------------------------------------

CODE_3BAE:
	MOV A, #$01
	MOV $03C2, A
	RET

;--------------------------------------------------------------------

CODE_3BB4:
	MOV A, #$01
	MOV $03C3, A
	RET

;--------------------------------------------------------------------

CODE_3BBA:
	MOV $20, A
	MOV $21, Y
	RET

;--------------------------------------------------------------------

CODE_3BBF:
	MOV A, #$01
	MOV $EF, A
	RET

;--------------------------------------------------------------------

CODE_3BC4:
	MOV A, #$03
	MOV $EF, A
	RET

;--------------------------------------------------------------------

CODE_3BC9:
	MOV $03B8, A
	MOV $03B9, Y
	RET

;--------------------------------------------------------------------

CODE_3BD0:
	MOV A, $03B8
	MOV Y, $03B9
	RET

;--------------------------------------------------------------------

%SPCDataBlockEnd(!Define_SMK_SPC700_EngineStartAddress)

%SPCDataBlockStart(3C00)
DATA_3C00:
	dw SPC700_Sample00	:	dw SPC700_Sample00+$24
	dw SPC700_Sample01	:	dw SPC700_Sample01+$054F
	dw SPC700_Sample02	:	dw SPC700_Sample02+$1B
	dw SPC700_Sample03	:	dw SPC700_Sample03+$3F
	dw SPC700_Sample04	:	dw SPC700_Sample04+$0465
	dw SPC700_Sample05	:	dw SPC700_Sample05+$1CF8
	dw SPC700_Sample06	:	dw SPC700_Sample06+$D8
	dw SPC700_Sample07	:	dw SPC700_Sample07+$0BA3
	dw SPC700_Sample08	:	dw SPC700_Sample08+$065D
	dw SPC700_Sample09	:	dw SPC700_Sample09+$1B
	dw SPC700_Sample0A	:	dw SPC700_Sample0A+$0EA9
	dw SPC700_Sample0B	:	dw SPC700_Sample0B+$0735
	dw SPC700_Sample0C	:	dw SPC700_Sample0C+$0360
	dw SPC700_Sample0D	:	dw SPC700_Sample0D+$0120
	dw SPC700_Sample0E	:	dw SPC700_Sample0E+$36
	dw SPC700_Sample0F	:	dw SPC700_Sample0F+$03B1
	dw SPC700_Sample10	:	dw SPC700_Sample10+$04BF
	dw SPC700_Sample11	:	dw SPC700_Sample11+$0306
	dw SPC700_Sample12	:	dw SPC700_Sample12+$24
	dw SPC700_Sample13	:	dw SPC700_Sample13+$1B
	dw SPC700_Sample14	:	dw SPC700_Sample14+$1B
	dw SPC700_Sample15	:	dw SPC700_Sample15+$03D5
	dw SPC700_Sample16	:	dw SPC700_Sample16+$049B
	dw SPC700_Sample17	:	dw SPC700_Sample17+$1B
	dw SPC700_Sample18	:	dw SPC700_Sample18+$1B
	dw SPC700_Sample19	:	dw SPC700_Sample19+$02FD
	dw $FFFF		:	dw $FFFF
	dw $FFFF		:	dw $FFFF
%SPCDataBlockEnd(3C00)

%SPCDataBlockStart(4000)
SPC700_Sample00:
	incbin "Samples/00.brr"

SPC700_Sample01:
	incbin "Samples/01.brr"

SPC700_Sample02:
	incbin "Samples/02.brr"

SPC700_Sample03:
	incbin "Samples/03.brr"

SPC700_Sample04:
	incbin "Samples/04.brr"

SPC700_Sample05:
	incbin "Samples/05.brr"

SPC700_Sample06:
	incbin "Samples/06.brr"

SPC700_Sample07:
	incbin "Samples/07.brr"

SPC700_Sample08:
	incbin "Samples/08.brr"

SPC700_Sample09:
	incbin "Samples/09.brr"

SPC700_Sample0A:
	incbin "Samples/0A.brr"

SPC700_Sample0B:
	incbin "Samples/0B.brr"

SPC700_Sample0C:
	incbin "Samples/0C.brr"

SPC700_Sample0D:
	incbin "Samples/0D.brr"

SPC700_Sample0E:
	incbin "Samples/0E.brr"

SPC700_Sample0F:
	incbin "Samples/0F.brr"

SPC700_Sample10:
	incbin "Samples/10.brr"

SPC700_Sample11:
	incbin "Samples/11.brr"

SPC700_Sample12:
	incbin "Samples/12.brr"

SPC700_Sample13:
	incbin "Samples/13.brr"

SPC700_Sample14:
	incbin "Samples/14.brr"

SPC700_Sample15:
	incbin "Samples/15.brr"

SPC700_Sample16:
	incbin "Samples/16.brr"

SPC700_Sample17:
	incbin "Samples/17.brr"

SPC700_Sample18:
	incbin "Samples/18.brr"

SPC700_Sample19:
	incbin "Samples/19.brr"
%SPCDataBlockEnd(4000)

%EndSPCUploadAndJumpToEngine($!Define_SMK_SPC700_EngineStartAddress)
