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/30/12 05:54 PM


Thanks for your help

I checked the new code and there still are the same problems: the button is seen as being repeatedly pressed and released. With the new code, anyhow, it works somehow: i can cycle between the views, even if the view button press is not recorded all the times.

Having not practice with bitwise operations, I cannot be of any help to find out a working code actually. Even if i read some basic info with the help of google, i cannot see practical uses of bitwise operators in MAME.

Being this code more or less 10 lines, may i ask you to explain some topical line?

Essentially, if i am correct, we are dealing with a 4 byte long memory region in whitch the current view AND the button position is stored, right?

i.e how this line:


Code:

UINT8 button_pressed = viewval & 0x0010;



defines a button press? because only if the two values are the same it will return 0x0010?

How this line


Code:

 viewval = (viewval & ~0x10) | (button_pressed << cur_view); 


removes the fake button and adds the correct button?

Are there some examples of bitwise common operations used in MAME "out there"?

Thanks, hope this will be of some help to other people approaching MAME coding, not only to me...







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 3 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