To get accurate 4-way restriction in firmware was not as easy as I had first expected.
In all actuality, you still haven't.
To do it. I take the current position and work out the most probable indended direction based on the movement.
Without knowing what is happening in the game, and analyzing it, or having more information available from the stick itself (i.e. more than 4 pieces of information), there is
no way to make a determination of what is the "probable intended" direction with an accuracy level higher than a "coin toss". As this is pretty much the accuracy one gets by default, the actual net gain is zero.
e.g.
If you have stick in "up" position.
If joystick move to down/right: It is most likely that you intended to move down. The stick has travelled further than the mid-point.
This sounds good in theory, but in practice, it doesn't deliver. Picture a common situation where the player intends to move directly from the vertical to right, and goes too far, thus hitting the down-right diagonal. Your assumption with the above logic will be that he intended to move down, which will screw the player up royally.
If joystick move to up/right: It is most likely that you intend to move right because you are already "up" and a direction change was made.
Again, this really doesn't deliver. Another common issue with an 8-way stick is "user drift". In the heat of the action, they may be vertical, but very close to actuating either the right or left switch. A slight horizontal movement from their current position to either one of the horizontals, thereby making the diagonal, will then throw them to the horizontal cardinal of that diagonal, which is not the "probable intention" of the player when this scenario occurs.
Another issue is "extended roll through". If the user rolls from the vertical to right, and goes a little too far, the logic above will assume the desire to then go down, when in fact this isn't the case.
One more issue with this type of approach is that when you get it wrong, the following assumption tends to fall apart as well.
I have this working in my arcade cabinet and it plays really really well on 4-way games. It gives a significant improvement to my play on Rally-X and Ms Pacman and definitely has a better feel.
Feedback has been good from our beta-testers.
The same has been claimed from at least one other individual who basically was doing the same thing, but it proves in use to be not much better, if any at all, from the default condition. I've experimented with the same algorithms in the past and the result was not a "significant improvement". There is a bit of a placebo effect when testing something like this, which makes the player more aware of what they are doing when they know they are testing the hardware, and it sometimes results in a somewhat better performance. However, once this wears off, and the player actually focuses on playing the games, they become less concerned about the controls and run into the same old problems. The proper way to test the efficacy of something like this is a dual-blind test, with a number of different individuals, and comparing performance. I think you will find, based on my experience, that you are simply trading one set of problems for a different, but equal set. Without physical restriction, or more information available from the control itself, there is no reliable way to determine the player's probable intentions.
RandyT