.gba
.open "ZM_E.gba","ZM_E_rShot.gba",0x8000000

.definelabel PlaySound,0x8002A6C

; hijack code
.org 0x800820C
	bl      CheckFireBeam
	b       0x8008214

.org 0x8304CE0 ; Croco GFX, unused
; new code
CheckFireBeam:
	push    r14
	ldrb    r0,[r4,5]		; load charge counter
	cmp     r0,0x3F
	bls     @@Return
; fire beam
	mov     r0,0
	strb    r0,[r4,5]		; reset charge counter
	mov     r0,6
	strb    r0,[r4,1]		; set flag to fire charged shot
@@Return:
; replaced code
	mov     r0,0x84
	bl      PlaySound
	pop     r0
	bx      r0
	
.close