MAMEWorld >> Programming
View all threads Index   Flat Mode Flat  

baritonomarchetto
MAME Fan
Reged: 11/22/10
Posts: 18
Send PM
Re: Need help with Cruis'n World driver
08/28/12 09:23 AM


Thanks for the answer

If i insert the "return" between braces, like


static READ32_HANDLER( port1_r )
{
UINT16 viewval = readinputport(1);
UINT16 viewdiff = viewval ^ last_port1;
if ((viewdiff & 0x0010) && !(viewval & 0x0010))
{
if (view_state==0) {view_state = 4;} //1st view
else if (view_state==4) {view_state = 2;} //2nd view
else if (view_state==2) {view_state = 1;} //3rd view
else if (view_state==1) {view_state = 4;} //1st view
last_port1 = viewval;
viewval = (viewval | 0x00f0) ^ (view_state << 4);
return (viewval << 16) | viewval;
}
}

While compiling it reports an error to the last line (that with the closing brace): "control reaches end of non-void function"

How should i write it? Maybe it needs something to be returned before closing ?

Thanks a lot







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 4 anonymous users are browsing this forum.
You cannot start new topics
You cannot reply to topics
HTML is enabled
UBBCode is enabled
Thread views: 4369