; Voice generators used as entry points
; only used when Sound_InstallVoice is called under the JIT
; NOTE: R14 cannot be used as code is called in IRQ mode


MACRO gen_Voice_Generator VGn:i
{
 ._VG
 B       hv_VG_entries + (VGn * hv_VG_size)
 B       hv_VG_entries + (VGn * hv_VG_size) + (8 * 1)
 B       hv_VG_entries + (VGn * hv_VG_size) + (8 * 2)
 B       hv_VG_entries + (VGn * hv_VG_size) + (8 * 3)
 B       hv_VG_entries + (VGn * hv_VG_size) + (8 * 4)
 B       hv_VG_entries + (VGn * hv_VG_size) + (8 * 5)
 ._voicegenerator	DCD 0		;JIT address of voice generator
 DCD     _name - _VG
 ._name 		DBB 32
}



MACRO gen_Voice_Generator_Entry VGn:i
{
 ._fill
 MOV     R5, #VGn + (0 << 5)
 B       hv_call_voice_handler
 ._update
 MOV     R5, #VGn + (1 << 5)
 B       hv_call_voice_handler
 ._gateon
 MOV     R5, #VGn + (2 << 5)
 B       hv_call_voice_handler
 ._gateoff
 MOV     R5, #VGn + (3 << 5)
 B       hv_call_voice_handler
 ._instantiate
 MOV     R5, #VGn + (4 << 5)
 B       hv_call_voice_handler_setup
 ._free
 MOV     R5, #VGn + (5 << 5)
 B       hv_call_voice_handler_setup
}
