any |
Lead on, adventurer. Your quest awaits!
|
|
|
Reged: 03/21/06
|
Posts: 23
|
|
|
Send PM
|
|
|
Quote:
with this code somehow works even if it doesn’t cycle in a predictable way
you cannot prevent this, the game read the input faster then you finger can release the key, so the game read that you are pressing the button more than one time and cycle through the views
UGLY code, but working
static READ32_HANDLER( port1_r ) { static UINT8 cur_view = 0; UINT16 viewval = readinputport(1); //total actual values stored in memory UINT8 button_pressed = viewval & 0x0010;
if (!button_pressed) // check if button is pressed { cur_view++; if (cur_view == 4) cur_view = 0; viewval = (viewval | 0xf0); switch (cur_view){ case 0: viewval = viewval & 0xef; break; case 1: viewval = viewval & 0xdf; break; case 2: viewval = viewval & 0xbf; break; case 3: viewval = viewval & 0x7f; break; } } return (viewval << 16) | viewval; }
there is something wrong in that table the correct one is the follow
[ATTACHED IMAGE]
|
|