;JavaKeyToneVolume By NeO_2kX(c)

;Var
.equ kvm_backup_keytone_alert 			0x015C860C
.equ gv_keytone_alert					0x016DF2B0
;Func
.equ KvmSetAndRestoreKeytoneForJava		0x00054318

KvmSetAndRestoreKeytoneForJava:
	PUSH	{LR}
	LDR		R1, =kvm_backup_keytone_alert
	LDR		R2, =gv_keytone_alert
	
	CMP		R0, #0
	BEQ		RestoreKeytone
	
	LDRB	R0, [R2]
	STRB	R0, [R1]
	
	CMP		R0, #0
	BEQ		Exit_KvmSetAndRestoreKeytoneForJava
	
	MOV		R0, #1
	STRB	R0, [R2]	;gv_keytone_alert = 1
	B		Exit_KvmSetAndRestoreKeytoneForJava

RestoreKeytone:	
	LDRB	R0, [R1]
	STRB	R0, [R2]

Exit_KvmSetAndRestoreKeytoneForJava:	
	POP		{R3}
	BX		R3
.data
.setbyte 0x00054414