LBZ2_Header:
	sHeaderInit	; Z80 offset is $8DC8
	sHeaderPatch	LBZ2_Patches
	sHeaderCh	$06, $03
	sHeaderTempo	$01, $2F
	sHeaderDAC	LBZ2_DAC
	sHeaderFM	LBZ2_FM1, $00, $0C
	sHeaderFM	LBZ2_FM2, $0C, $08
	sHeaderFM	LBZ2_FM3, $00, $0C
	sHeaderFM	LBZ2_FM4, $00, $0C
	sHeaderFM	LBZ2_FM5, $0C, $0C
	sHeaderPSG	LBZ2_PSG1, $F4, $02, $00, VolEnv_00
	sHeaderPSG	LBZ2_PSG2, $F4, $04, $00, VolEnv_00
	sHeaderPSG	LBZ2_PSG3, $00, $02, $00, VolEnv_00

LBZ2_FM1:
	sPatFM		$02
	dc.b nRst, $60, nRst, nRst, nRst

LBZ2_Jump8:
	dc.b nRst, $60, nRst, nRst, nRst
	sCall		LBZ2_Call12
	sCall		LBZ2_Call13
	dc.b nRst, $60, nRst, nRst, nRst, nRst, nRst, nRst
	dc.b nRst

LBZ2_Loop10:
	sCall		LBZ2_Call13
	sLoop		$00, $02, LBZ2_Loop10
	dc.b nRst, $0C, nC5, nRst, $48
	sJump		LBZ2_Jump8

LBZ2_Call12:
	sPatFM		$02
	dc.b nRst, $60, nRst, nRst, nRst, $48
	sPatFM		$03
	ssModZ80	$06, $01, $12, $01
	dc.b nEb5, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nEb5, $0C
	sRet	

LBZ2_Call13:
	sPatFM		$02
	dc.b nRst, $06, nEb4, nRst, $0C, nEb4, $12, nEb4
	dc.b $06, nRst, $18, nC4, $06, nBb3, nG3, nF3
	dc.b nRst, $18, nEb4, $12, nEb4, $06, nRst, $18
	sPatFM		$03
	ssModZ80	$01, $01, $03, $05
	dc.b nEb5
	ssModZ80	$01, $01, $01, $04
	sPatFM		$02
	dc.b nRst, $06, nEb4, nRst, $0C, nEb4, $12, nEb4
	dc.b $06, nRst, $18, nC4, $06, nBb3, nG3, nF3
	ssModZ80	$01, $01, $01, $04
	dc.b nRst, $18, nEb4, $12, nEb4, $06, nRst, $18
	sPatFM		$03
	ssModZ80	$06, $01, $12, $01
	dc.b nEb5, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nEb5, $0C
	sRet	

LBZ2_FM2:
LBZ2_Loop9:
	sPatFM		$00
	sCall		LBZ2_Call9
	sLoop		$00, $04, LBZ2_Loop9

LBZ2_Jump7:
	dc.b nRst, $60, nRst, nRst, nRst
	sCall		LBZ2_Call10
	sCall		LBZ2_Call11
	sCall		LBZ2_Call10
	sCall		LBZ2_Call10
	dc.b nRst, $60, nRst, nRst, nRst, nRst, nRst, nRst
	dc.b nRst
	sCall		LBZ2_Call10
	sCall		LBZ2_Call11
	sCall		LBZ2_Call10
	sCall		LBZ2_Call10
	dc.b nC2, nC1, nC3, nRst, $4E
	sJump		LBZ2_Jump7

LBZ2_Call9:
	dc.b nG1, $12, nD2, nA2, $1E, nD2, $06, nG2
	dc.b $0C, nD2
	sRet	

LBZ2_Call10:
	dc.b nC2, $06, nRst, nC2, $0C, nBb1, $12, nA1
	dc.b $06, nRst, $2A, nA1, $06, nF1, nRst, nF1
	dc.b $0C, nFs1, $12, nG1, $06, nRst, $18, nD2
	dc.b $0C, nG2, $06, nD2
	sRet	

LBZ2_Call11:
	dc.b nC2, nRst, nC2, $0C, nBb1, $12, nA1, $06
	dc.b nRst, $2A, nA1, $06, nF1, nRst, nF1, $0C
	dc.b nFs1, $12, nG1, $06, nRst, $18, nD2
	sRet	

LBZ2_FM3:
	sPatFM		$03
	dc.b nRst, $60, nRst, nRst, nRst

LBZ2_Jump6:
	dc.b nRst, $60, nRst, nRst, nRst
	sPatFM		$03
	sCall		LBZ2_Call7
	sCall		LBZ2_Call8
	saVolFM		$06
	ssModZ80	$01, $01, $01, $06
	sPatFM		$01
	dc.b nF4, $48, nE4, $18, nD4, $5A, nRst, $06
	dc.b nF4, $48, nG4, $18, nD4, $5A, nRst, $06
	saVolFM		$FA
	dc.b nRst, $60, nRst, nRst, nRst

LBZ2_Loop8:
	sPatFM		$03
	sCall		LBZ2_Call8
	sLoop		$00, $02, LBZ2_Loop8
	sPatFM		$03
	dc.b nRst, $0C, nC4, $0C, nRst, $48
	sJump		LBZ2_Jump6

LBZ2_Call7:
	dc.b nRst, $60, nRst, nRst, $60, nRst, $48
	saVolFM		$03
	ssModZ80	$06, $01, $12, $01
	dc.b nC5, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nC5, $0C
	saVolFM		$FD
	sRet	

LBZ2_Call8:
	dc.b nRst, $60, nRst, $48
	ssModZ80	$01, $01, $03, $05
	dc.b nC5, $18
	ssModZ80	$01, $01, $01, $04
	dc.b nRst, $60, nRst, $48
	saVolFM		$03
	ssModZ80	$06, $01, $12, $01
	dc.b nC5, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nC5, $0C
	saVolFM		$FD
	sRet	

LBZ2_FM4:
	sPatFM		$03
	dc.b nRst, $60, nRst, nRst, nRst

LBZ2_Jump5:
	dc.b nRst, $60, nRst, nRst, nRst
	sPatFM		$03
	sCall		LBZ2_Call5
	sCall		LBZ2_Call6
	saVolFM		$09
	ssModZ80	$01, $01, $01, $06
	sPatFM		$01
	dc.b nRst, $05, nF4, $48, nE4, $18, nD4, $5A
	dc.b nRst, $06, nF4, $48, nG4, $18, nD4, $55
	dc.b nRst, $06
	saVolFM		$F7
	sPatFM		$03
	dc.b nRst, $60, nRst, nRst, nRst

LBZ2_Loop7:
	sCall		LBZ2_Call6
	sLoop		$00, $02, LBZ2_Loop7
	sPatFM		$03
	dc.b nRst, $0C, nC4, $0C, nRst, $48
	sJump		LBZ2_Jump5

LBZ2_Call5:
	dc.b nRst, $60, nRst, nRst, $60, nRst, $48
	ssModZ80	$06, $01, $12, $01
	dc.b nBb4, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nBb4, $0C
	sRet	

LBZ2_Call6:
	dc.b nRst, $60, nRst, $48
	ssModZ80	$01, $01, $03, $05
	dc.b nBb4, $18
	ssModZ80	$01, $01, $01, $04
	dc.b nRst, $60, nRst, $48
	ssModZ80	$06, $01, $12, $01
	dc.b nBb4, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nBb4, $0C
	sRet	

LBZ2_FM5:
	sPatFM		$02
	dc.b nRst, $60, nRst, nRst, nRst

LBZ2_Jump4:
	dc.b nRst, $60, nRst, nRst, nRst
	sCall		LBZ2_Call3
	sCall		LBZ2_Call4
	dc.b nRst, $60, nRst, nRst, nRst, nRst, nRst, nRst
	dc.b nRst

LBZ2_Loop6:
	sCall		LBZ2_Call4
	sLoop		$00, $02, LBZ2_Loop6
	dc.b nRst, $0C, nC4, nRst, $48
	sJump		LBZ2_Jump4

LBZ2_Call3:
	dc.b nRst, $60, nRst, nRst, nRst, $48
	sPatFM		$03
	ssModZ80	$06, $01, $12, $01
	dc.b nG4, $0C
	ssModZ80	$01, $01, $01, $04
	dc.b nG4, $0C
	sRet	

LBZ2_Call4:
	sPatFM		$02
	dc.b nRst, $06, nBb3, $04, nRst, $0E, nBb3, $12
	dc.b nBb3, $06, nRst, $18, nRst, $30, nBb3, $12
	dc.b nBb3, $06, nRst, $18
	sPatFM		$03
	ssModZ80	$01, $01, $03, $05
	dc.b nG4
	ssModZ80	$01, $01, $01, $04
	sPatFM		$02
	dc.b nRst, $06, nBb3, $04, nRst, $0E, nBb3, $12
	dc.b nBb3, $06, nRst, $18, nRst, $30, nBb3, $12
	dc.b nBb3, $06, nRst, $18
	sPatFM		$03
	saVolFM		$05
	ssModZ80	$06, $01, $12, $01
	dc.b nG4, $0C
	ssModZ80	$01, $01, $01, $04
	saVolFM		$FB
	dc.b nG4, $0C
	sRet	

LBZ2_PSG1:
LBZ2_Jump2:
	sNoteTimeOut	$05
	sVolEnvPSG	VolEnv_11
	dc.b nRst, $60, nRst, nRst
	sCall		LBZ2_Call2

LBZ2_Jump3:
	sCall		LBZ2_Call2
	dc.b nF5, $06, nRst, nG5, nRst, nD5, nRst, nF5
	dc.b nF5, nRst, nF5, nG5, nRst, $1E, nRst, $60
	dc.b nRst, nRst, nRst, nRst, nRst, nRst, nRst, nRst

LBZ2_Loop5:
	dc.b nRst, $60, nRst
	sLoop		$00, $04, LBZ2_Loop5
	dc.b nRst, $60, nRst, nRst, nRst, nRst, nRst, nRst
	dc.b nRst, nRst
	sJump		LBZ2_Jump3

LBZ2_Call2:
	dc.b nF5, $06, nRst, nG5, nRst, nD5, nRst, nF5
	dc.b nF5, nRst, nF5, nG5, nRst, nD5, nRst, nF5
	dc.b nRst, nRst, $60
	sRet	

LBZ2_PSG2:
	dc.b nRst, $01
	sModEnv		ModEnv_01
	sJump		LBZ2_Jump2

LBZ2_PSG3:
	sNoisePSG	$E7

LBZ2_Loop1:
	sCall		LBZ2_Call1
	sLoop		$00, $10, LBZ2_Loop1

LBZ2_Loop2:
LBZ2_Jump1:
	sCall		LBZ2_Call1
	sLoop		$00, $0C, LBZ2_Loop2
	sVolEnvPSG	VolEnv_13
	dc.b nRst, $60

LBZ2_Loop3:
	sCall		LBZ2_Call1
	sLoop		$00, $1C, LBZ2_Loop3
	sVolEnvPSG	VolEnv_13
	dc.b nRst, $60

LBZ2_Loop4:
	sCall		LBZ2_Call1
	sLoop		$00, $40, LBZ2_Loop4
	sVolEnvPSG	VolEnv_02
	dc.b nBb6, $06, nBb6
	sVolEnvPSG	VolEnv_13
	dc.b nRst, $54
	sJump		LBZ2_Jump1

LBZ2_Call1:
	sVolEnvPSG	VolEnv_02
	dc.b nBb6, $06, nBb6
	sVolEnvPSG	VolEnv_13
	dc.b nBb6, $06
	sVolEnvPSG	VolEnv_02
	dc.b nBb6, $06
	sRet	

LBZ2_DAC:
	dc.b dModLooseKick, $12, nRst, dModLooseKick, $3C
LBZ2_Loop11:
	dc.b dModLooseKick, $06, dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, nRst, dModLooseKick
	dc.b dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, dPowerTom, dPowerTom, $18
	sLoop		$00, $02, LBZ2_Loop11
	dc.b dModLooseKick, $0C, dHiWoodBlock, $06, dModLooseKick, dLowWoodBlock, dLowWoodBlock, dModLooseKick
	dc.b dHiWoodBlock, nRst, dHiWoodBlock, dLowWoodBlock, dLowWoodBlock, dLowWoodBlock, dLowWoodBlock, dLowWoodBlock
	dc.b dLowWoodBlock

LBZ2_Jump9:
	sCall		LBZ2_Call14
	dc.b dModLooseKick, $06, dHiHitDrum, nRst, dModLooseKick, dSnareGo, nRst, dModLooseKick
	dc.b dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, dSnareGo, dSnareGo, nRst, dLowWoodBlock
	dc.b dLowWoodBlock
	sCall		LBZ2_Call14
	dc.b dModLooseKick, $06, nRst, dHiWoodBlock, nRst, dLowWoodBlock, dLowWoodBlock, dLowWoodBlock
	dc.b dHiWoodBlock, nRst, nRst, $2A, dModLooseKick, $12, dModLooseKick, $06
	dc.b nRst, $12, dModLooseKick, $1E, dMetalCrashHit, $24, dScratch, $24
	dc.b dPowerTom, $18, dScratch

LBZ2_Loop12:
	dc.b dModLooseKick, $0C, dModLooseKick, nRst, $12, dModLooseKick, $06, nRst
	dc.b $2A, dModLooseKick, $06, dModLooseKick, $0C, dModLooseKick, nRst, $12
	dc.b dModLooseKick, $06, nRst, $30
	sLoop		$00, $02, LBZ2_Loop12
	dc.b dModLooseKick, $0C, dModLooseKick, nRst, $12, dModLooseKick, $06, nRst
	dc.b $2A, dModLooseKick, $06, nRst, $36, dQuietGlassCrash, $12, dMetalCrashHit
	dc.b $0B, dMetalCrashHit, $0D

LBZ2_Loop13:
	dc.b dModLooseKick, $06, nRst, dHiHitDrum, dModLooseKick, dLowHitDrum, dLowHitDrum, dModLooseKick
	dc.b dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, dPowerTom, dPowerTom, nRst, dLowHitDrum
	dc.b nRst, dModLooseKick, $0C, dHiWoodBlock, $06, dModLooseKick, dLowWoodBlock, dLowWoodBlock
	dc.b dModLooseKick, dHiWoodBlock, nRst, dHiWoodBlock, dLowWoodBlock, dLowWoodBlock, dLowWoodBlock, dLowWoodBlock
	dc.b dLowWoodBlock, dLowWoodBlock
	sLoop		$00, $02, LBZ2_Loop13
	dc.b dModLooseKick, $06, dHiHitDrum, nRst, dModLooseKick, dSnareGo, nRst, dModLooseKick
	dc.b dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, dPowerTom, dSnareGo, nRst, dLowWoodBlock
	dc.b dLowWoodBlock, dModLooseKick, nRst, dHiWoodBlock, dModLooseKick, dSnareGo, nRst, dModLooseKick
	dc.b dHiWoodBlock, nRst, dHiWoodBlock, dLowWoodBlock, dSnareGo, dSnareGo, nRst, dLowWoodBlock
	dc.b dLowWoodBlock, dModLooseKick, $06, dHiHitDrum, nRst, dModLooseKick, dSnareGo, nRst
	dc.b dModLooseKick, dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, dPowerTom, dSnareGo, nRst
	dc.b dLowWoodBlock, dLowWoodBlock, dModLooseKick, nRst, dHiWoodBlock, dModLooseKick, dSnareGo, nRst
	dc.b dModLooseKick, dHiWoodBlock, nRst, dSnareGo, nRst, dSnareGo, dSnareGo, nRst
	dc.b dSnareGo, nRst, nRst, $60, nRst, dModLooseKick, $0C, dModLooseKick
	dc.b nRst, $48, nRst, $60, dModLooseKick, $06, nRst, dGo
	dc.b nRst, dModLooseKick, nRst, dGo, dModLooseKick, nRst, nRst, dGo
	dc.b nRst, nRst, nRst, dGo, dModLooseKick, dModLooseKick, $06, nRst
	dc.b dGo, nRst, dModLooseKick, nRst, dGo, dModLooseKick, nRst, nRst
	dc.b dGo, nRst, nRst, nRst, dGo, dModLooseKick, dModLooseKick, nRst
	dc.b dGo, nRst, dSnareGo, nRst, dGo, dModLooseKick, nRst, nRst
	dc.b dGo, nRst, dSnareGo, nRst, dGo, dModLooseKick, dModLooseKick, nRst
	dc.b dGo, nRst, dSnareGo, nRst, dGo, dModLooseKick, dModLooseKick, dSnareGo
	dc.b dGo, dSnareGo, dSnareGo, nRst, dSnareGo, nRst, dModLooseKick, dModLooseKick
	dc.b dSnareGo, nRst, $4E
	sJump		LBZ2_Jump9

LBZ2_Call14:
	dc.b dModLooseKick, $06, dHiHitDrum, nRst, dHiHitDrum, dSnareGo, nRst, dModLooseKick
	dc.b dHiHitDrum, nRst, dHiHitDrum, dLowHitDrum, dPowerTom, dSnareGo, nRst, dLowWoodBlock
	dc.b dLowWoodBlock
	sRet	
	; Unused
	dc.b $A8, $0C, $AB, $12, $A8, $06, $AC, $12
	dc.b $AB, $06, $AB, $18, $F9, $80, $80, $AB
	dc.b $80, $80, $80, $AB, $80, $80, $80, $AB
	dc.b $80, $80, $80, $AB, $80, $A8, $06, $80
	dc.b $AB, $80, $A8, $80, $AB, $A8, $80, $80
	dc.b $AB, $80, $80, $80, $AB, $A8

LBZ2_Patches:
	; Patch $00
	; $03
	; $62, $40, $44, $31,	$1F, $1F, $1F, $1C
	; $0B, $0A, $02, $01,	$08, $0B, $04, $06
	; $1F, $1F, $1F, $1F,	$2A, $1A, $2B, $80
	spAlgorithm	$03
	spFeedback	$00
	spDetune	$06, $04, $04, $03
	spMultiple	$02, $04, $00, $01
	spRateScale	$00, $00, $00, $00
	spAttackRt	$1F, $1F, $1F, $1C
	spAmpMod	$00, $00, $00, $00
	spDecayRt	$0B, $02, $0A, $01
	spSustainRt	$08, $04, $0B, $06
	spSustainLv	$01, $01, $01, $01
	spReleaseRt	$0F, $0F, $0F, $0F
	spTotalLv	$2A, $2B, $1A, $00

	; Patch $01
	; $3D
	; $01, $02, $02, $02,	$1F, $08, $8A, $0A
	; $08, $08, $08, $08,	$00, $01, $00, $00
	; $0F, $1F, $1F, $1F,	$1F, $88, $88, $87
	spAlgorithm	$05
	spFeedback	$07
	spDetune	$00, $00, $00, $00
	spMultiple	$01, $02, $02, $02
	spRateScale	$00, $02, $00, $00
	spAttackRt	$1F, $0A, $08, $0A
	spAmpMod	$00, $00, $00, $00
	spDecayRt	$08, $08, $08, $08
	spSustainRt	$00, $00, $01, $00
	spSustainLv	$00, $01, $01, $01
	spReleaseRt	$0F, $0F, $0F, $0F
	spTotalLv	$1F, $08, $08, $07

	; Patch $02
	; $3A
	; $31, $7F, $61, $0A,	$9C, $DB, $9C, $9A
	; $04, $08, $03, $09,	$03, $01, $00, $00
	; $1F, $0F, $FF, $FF,	$23, $25, $1B, $84
	spAlgorithm	$02
	spFeedback	$07
	spDetune	$03, $06, $07, $00
	spMultiple	$01, $01, $0F, $0A
	spRateScale	$02, $02, $03, $02
	spAttackRt	$1C, $1C, $1B, $1A
	spAmpMod	$00, $00, $00, $00
	spDecayRt	$04, $03, $08, $09
	spSustainRt	$03, $00, $01, $00
	spSustainLv	$01, $0F, $00, $0F
	spReleaseRt	$0F, $0F, $0F, $0F
	spTotalLv	$23, $1B, $25, $04

	; Patch $03
	; $3A
	; $01, $07, $31, $11,	$8E, $8E, $8D, $53
	; $0E, $0E, $0E, $03,	$00, $00, $00, $07
	; $1F, $FF, $1F, $0F,	$18, $28, $17, $82
	spAlgorithm	$02
	spFeedback	$07
	spDetune	$00, $03, $00, $01
	spMultiple	$01, $01, $07, $01
	spRateScale	$02, $02, $02, $01
	spAttackRt	$0E, $0D, $0E, $13
	spAmpMod	$00, $00, $00, $00
	spDecayRt	$0E, $0E, $0E, $03
	spSustainRt	$00, $00, $00, $07
	spSustainLv	$01, $01, $0F, $00
	spReleaseRt	$0F, $0F, $0F, $0F
	spTotalLv	$18, $17, $28, $02

	; Patch $04
	; $F5
	; $24, $30, $10, $32,	$1F, $1F, $1F, $1F
	; $05, $18, $09, $02,	$06, $0F, $06, $02
	; $1F, $2F, $4F, $2F,	$0F, $0E, $0E, $80
	spAlgorithm	$05
	spFeedback	$06
	spDetune	$02, $01, $03, $03
	spMultiple	$04, $00, $00, $02
	spRateScale	$00, $00, $00, $00
	spAttackRt	$1F, $1F, $1F, $1F
	spAmpMod	$00, $00, $00, $00
	spDecayRt	$05, $09, $18, $02
	spSustainRt	$06, $06, $0F, $02
	spSustainLv	$01, $04, $02, $02
	spReleaseRt	$0F, $0F, $0F, $0F
	spTotalLv	$0F, $0E, $0E, $00
