Thank you for the help
Your code is very clean and helpful. There should be something wrong unfortunately, because there's still the "continuous press" problem AND there's no more view change by using the 0x0010 button... could there be some error in the line removing the fake button bit?
Code:
viewval = (viewval & ~0x10) | (button_pressed << cur_view); // remove the fake button bit and add the correct view bit to the input
return (viewval << 16) | viewval;
I essentially copied and pasted your code and changed the original PORT_START from:
Code:
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) /* view 1 */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_BUTTON3 ) PORT_PLAYER(2) /* view 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_BUTTON4 ) PORT_PLAYER(2) /* view 3 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_BUTTON5 ) PORT_PLAYER(2) /* view 4 */
to
Code:
PORT_BIT( 0x0010, IP_ACTIVE_LOW, IPT_BUTTON2 ) PORT_PLAYER(2) PORT_NAME("View Change") /* view 1 */
PORT_BIT( 0x0020, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2) /* view 2 */
PORT_BIT( 0x0040, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2) /* view 3 */
PORT_BIT( 0x0080, IP_ACTIVE_LOW, IPT_UNUSED ) PORT_PLAYER(2) /* view 4 */
Thanks for the help. I hope i am not annoying with my noob questions