The way mame's windows OSD (OS Dependent) code is written, directX is only showing 4 buttons. This can be changed fairly easily by using DIMOUSESTATE2 instead of DIMOUSESTATE. This change will give you 8 buttons.
I'm not sure with the current coding, but I think that's all that's needed to be able to use the extra mouse buttons; Notice how linux AdvanceMame can use the 5+ buttons with only different OSD code. But I'm not sure if ctrlr files and the like will work seamlessly without other changes since ctrlr also involves OSD code.
Yes, but it seems limited by the Rawstructure structure (see
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winui/winui/windowsuserinterface/userinput/rawinput/rawinputreference/rawinputstructures/rawmouse.asp) to only 5 buttons.
For me it's enough:
Button1: Trigger of the gun
Button2: Reload, pressing Button B of the gun or shooting offscreen (All with Smog driver, of course).
Button3: Button A and Button C (second trigger) of the gun
Button4: Credits. Select button of the gun
Button5: Start. Start button of the gun.
You only need to remap the credit and start keys in Mame.
The changes (in bold) I have made are in scr/windows/input.c:
{ JOYCODE(0, CODETYPE_MOUSEBUTTON, 0), MOUSECODE_1_BUTTON1 },
{ JOYCODE(0, CODETYPE_MOUSEBUTTON, 1), MOUSECODE_1_BUTTON2 },
{ JOYCODE(0, CODETYPE_MOUSEBUTTON, 2), MOUSECODE_1_BUTTON3 },
{ JOYCODE(0, CODETYPE_MOUSEBUTTON, 3), MOUSECODE_1_BUTTON4 },
{ JOYCODE(0, CODETYPE_MOUSEBUTTON, 4), MOUSECODE_1_BUTTON5 }, { JOYCODE(0, CODETYPE_MOUSEAXIS, 0), MOUSECODE_1_ANALOG_X },
{ JOYCODE(0, CODETYPE_MOUSEAXIS, 1), MOUSECODE_1_ANALOG_Y },
{ JOYCODE(0, CODETYPE_MOUSEAXIS, 2), MOUSECODE_1_ANALOG_Z },
-------------------------------------------------------------------------------------
// add mouse buttons
for (button = 0; button <
5; button++)
{
-------------------------------------------------------------------------------------
// Update the button values for the specified mouse
if (button_flags & RI_MOUSE_BUTTON_1_DOWN) buttons[0] = 0x80;
if (button_flags & RI_MOUSE_BUTTON_1_UP) buttons[0] = 0;
if (button_flags & RI_MOUSE_BUTTON_2_DOWN) buttons[1] = 0x80;
if (button_flags & RI_MOUSE_BUTTON_2_UP) buttons[1] = 0;
if (button_flags & RI_MOUSE_BUTTON_3_DOWN) buttons[2] = 0x80;
if (button_flags & RI_MOUSE_BUTTON_3_UP) buttons[2] = 0;
if (button_flags & RI_MOUSE_BUTTON_4_DOWN) buttons[3] = 0x80;
if (button_flags & RI_MOUSE_BUTTON_4_UP) buttons[3] = 0;
if (button_flags & RI_MOUSE_BUTTON_5_DOWN) buttons[4] = 0x80;
if (button_flags & RI_MOUSE_BUTTON_5_UP) buttons[4] = 0;