Hello,
After some experiments, I finally managed to map properly this controller:
HORI Battle Pad (Zelda)
at least for the main buttons.
So this is the content of my es_input.cfg:
<inputConfig type="joystick" deviceGUID="03001f830d0f0000dc00000000010000" deviceNbAxes="4" deviceNbHats="1" deviceNbButtons="13">
<input name="joystick2up" type="axis" id="3" value="-1" code="4" />
<input name="joystick2left" type="axis" id="2" value="-1" code="3" />
<input name="joystick1up" type="axis" id="1" value="-1" code="1" />
<input name="joystick1left" type="axis" id="0" value="-1" code="0" />
<input name="left" type="hat" id="0" value="8" code="-1" />
<input name="down" type="hat" id="0" value="4" code="-1" />
<input name="right" type="hat" id="0" value="2" code="-1" />
<input name="up" type="hat" id="0" value="1" code="-1" />
<input name="r3" type="button" id="12" value="1" code="318" />
<input name="l3" type="button" id="11" value="1" code="317" />
<input name="r2" type="button" id="7" value="1" code="313" />
<input name="l2" type="button" id="6" value="1" code="312" />
<input name="r1" type="button" id="5" value="1" code="311" />
<input name="l1" type="button" id="4" value="1" code="310" />
<input name="y" type="button" id="1" value="1" code="305" />
<input name="x" type="button" id="3" value="1" code="308" />
<input name="b" type="button" id="0" value="1" code="304" />
<input name="a" type="button" id="2" value="1" code="307" />
<input name="hotkey" type="button" id="10" value="1" code="316" />
<input name="select" type="button" id="8" value="1" code="314" />
<input name="start" type="button" id="9" value="1" code="315" />
</inputConfig>
which works well on Dolphin (GC) games.
I just wanted to share with whoever is interested.