Gens doesn't do this in a hardware accurate way, just in a way that works with games. Looking at the source you posted in another thread I can tell you how to make this work reliably on real hardware.Chilly Willy wrote:What's REALLY weird is that the six button code doesn't work on Kega Fusion - I'd REALLY like to know why that fails.
You shouldn't need, and don't really want, a seperate 3 button/6 button selection, the code should be detecting the pad and using whatever is there. How its supposed to be done is something like this:
Code: Select all
00->a10003, read START, A.
40->a10003, read C,B,R,L,D,U
loop for something like 8 counts:
{
00->a10003, read, if val&0x0f==0, goto PAD6
40->a10003
}
PAD3:
set M,X,Y,Z as not pressed.
this is a 3 button pad, done.
PAD6:
40->a10003, read M,X,Y,Z
00->a10003, read to temp
40->a10003.
if temp&0x0f!=0x0f, goto PAD3.
this is a 6 button pad, done.
I also noticed your code was doing a final move.b #0x40,(a0) in your get_input routine, this might interfere with the timing in the pad. You really want to toggle TH off and on and avoid doing extra writes. Ideally there should be around 16 cycles between TH writes, to make sure everything works fine with third party controllers and the 'arcade stick'.
Yeah, Stef probably did that because it just worked better in Gens. Of course, a real 6 button pad is not going to know when you issue a bus request.Eke wrote:Also, in Gens, the TH cycle counter is reseted at the start of each line AND when a bus request is issued...