Here:
http://pcedev.net/HuC/Chsync_ver_1_1/chsync_ver1_1.zipHuC mimics the SCD environment for IRQ management, so it follows the same rules. So I manually did this:
/*.......................................................................................*/
EnableCustomHsync()
{
#asm
php
sei
lda irq_m
sta _irq_m_backup
ora #$d0 ;;// disable int hsync handler, enable custom handler. Attach custom vsync handler
sta irq_m
lda #low(cust_hsync.1)
sta hsync_hook
lda #high(cust_hsync.1)
sta hsync_hook+1
lda #low(cust_vsync.1)
sta vsync_hook
lda #high(cust_vsync.1)
sta vsync_hook+1
lda <vdc_crl
ora #$04
sta <vdc_crl
st0 #$06
st1 #$00
st2 #$00
plp
#endasm
}
The actual handler is in the library.asm file. Just modify that as needed, or replace it completely. If you need HuC's vsync functionality, you could always call yours first and then jump to the original (it'll RTI from inside there). Pretty sure you'll need to do this for HuC lib gamepad routines to work (IIRC), unless you call that manually as well or such.