Joypads 3/6 Button Response Timings
Posted: Wed Jan 20, 2016 12:01 am
Hooray! I made this nice ROM powered with SGDK. (edit: ROM updated)
edit2: Now it outputs even numbers. There is no way to wait odd count of cycles. And, now instead of 1/2/3 it shows 4 because smallest is NOP = 4 cycles.
edit3: ROM updated, added 4 more variants for test: using new move.w a2,(a0) trick. Old fixed ROM here.
It does read responses. I have recieved one feedback already.
Responses for that 6 joypad was 0,0,0,0,0x35,0,0,0,0x35,0,0,0x3C70. (edit: this was caused by bug)
Hmmm... I guess I need to put some explanation, what it does.
It does figure out minimum cycles of M68k timeouts needed between
to achieve correct data read. It starts from phase 0x40, then 0x00 and then altering until end of joypad reading process.
No Reset means, that it ends up in state where 0x00 was writen last time into port.
So, for 6 button pad it is 15 delays. And, last one, is delay that counts expiration time of reset-timer inside of 6 button pad.
Stef, if you see this, I can share sources if you wanna include it into SGDK samples.
I would like to see as many as possible other results.
Notes:
1) Port should be selected correctly!
2) Joypad type should be selected correctly!
3) "No Reset" mode - I'm unsure about it, but as far as I see, it works.
Please write:
1) what model of Genesis was used for test.
2) is it official console or clone.
3) what joypad used, and again, is it official or nope.
edit2: Now it outputs even numbers. There is no way to wait odd count of cycles. And, now instead of 1/2/3 it shows 4 because smallest is NOP = 4 cycles.
edit3: ROM updated, added 4 more variants for test: using new move.w a2,(a0) trick. Old fixed ROM here.
It does read responses. I have recieved one feedback already.
Responses for that 6 joypad was 0,0,0,0,0x35,0,0,0,0x35,0,0,0x3C70. (edit: this was caused by bug)
Hmmm... I guess I need to put some explanation, what it does.
It does figure out minimum cycles of M68k timeouts needed between
Code: Select all
move.b #p,(a0) ; p = current phase.
<delay>
move.b (a0),d0
<delay>
No Reset means, that it ends up in state where 0x00 was writen last time into port.
So, for 6 button pad it is 15 delays. And, last one, is delay that counts expiration time of reset-timer inside of 6 button pad.
Stef, if you see this, I can share sources if you wanna include it into SGDK samples.
I would like to see as many as possible other results.
Notes:
1) Port should be selected correctly!
2) Joypad type should be selected correctly!
3) "No Reset" mode - I'm unsure about it, but as far as I see, it works.
Please write:
1) what model of Genesis was used for test.
2) is it official console or clone.
3) what joypad used, and again, is it official or nope.