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