MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

any
Lead on, adventurer. Your quest awaits!
Reged: 03/21/06
Posts: 23
Send PM
Re: Need help with Cruis'n World driver
09/06/12 06:04 AM Attachment: test.jpg 19 KB (1 downloads)



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]

Attachment







Entire thread
Subject Posted by Posted on
* Need help with Cruis'n World driver baritonomarchetto 08/27/12 04:12 PM
. * Re: Need help with Cruis'n World driver sz72  08/27/12 08:44 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  08/28/12 09:23 AM
. * Re: Need help with Cruis'n World driver sz72  08/28/12 01:30 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  08/28/12 02:01 PM
. * Re: Need help with Cruis'n World driver sz72  08/28/12 03:51 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  08/28/12 04:19 PM
. * Re: Need help with Cruis'n World driver sz72  08/28/12 06:55 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  08/29/12 02:27 PM
. * Re: Need help with Cruis'n World driver etabeta  08/29/12 04:04 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  08/29/12 04:37 PM
. * Re: Need help with Cruis'n World driver etabeta  08/30/12 07:32 AM
. * Re: Need help with Cruis'n World driver baritonomarchetto  08/30/12 05:54 PM
. * Re: Need help with Cruis'n World driver etabeta  08/31/12 08:27 AM
. * Re: Need help with Cruis'n World driver baritonomarchetto  09/03/12 07:21 PM
. * Re: Need help with Cruis'n World driver any  09/06/12 06:04 AM
. * Re: Need help with Cruis'n World driver baritonomarchetto  09/06/12 02:52 PM
. * Re: Need help with Cruis'n World driver any  09/07/12 05:52 AM
. * Re: Need help with Cruis'n World driver baritonomarchetto  09/10/12 02:19 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  09/13/12 05:05 PM
. * Re: Need help with Cruis'n World driver R. Belmont  09/18/12 05:05 PM
. * Re: Need help with Cruis'n World driver baritonomarchetto  09/18/12 05:28 PM

Extra information Permissions
Moderator:  Pi 
0 registered and 119 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4516