Yesterday I started to build an adaptor which lets you use PC 4-button gamepads that plug into gameport with MD. Here's the adaptor :
Sorry for the low quality, my scanner is broken, and that "digicam" is without zoom and only 1.3MP :/
It is not compatible with standard control pads, but I thought it is nice for homebrew games...
Schematic (scanner broke, no schematic drawing software):
Analog controller for MD
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Analog controller for MD
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Are you willing to emulate it in Kmod ?
I'm not familiar with USB, but I believe it is not too hard to get USB pad working with MD, maybe a PIC(don't have experience with these either) ?
I used standard 4-button PC gameport gamepad as I know exactly how these work and I've built several for myself, and I was bored and thought that maybe I could hook up one to my MD
I'm not familiar with USB, but I believe it is not too hard to get USB pad working with MD, maybe a PIC(don't have experience with these either) ?
I used standard 4-button PC gameport gamepad as I know exactly how these work and I've built several for myself, and I was bored and thought that maybe I could hook up one to my MD
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
one thing I forgot, the source code
Code: Select all
DetectAnalog1: ; Detects the presence of analog controller
JSR WaitOneFrame ; Wait a little (poll may have been in progress)
MOVE.B ($A10003), D0
AND.B #3, D0 ; First step: axe bits must be unset
BEQ NextAnalogStep1
CLR.L D0
RTS
NextAnalogStep1:
MOVE.B #$40, ($A10003) ; Next step: pulse TH so timers start and axe
NOP #4 ; bits are set
MOVE.B #$00, ($A10003)
MOVE.W #31, D0
AnalogInitLoop1:
DBRA D0, AnalogInitLoop1
MOVE.B ($A10003), D0
AND.B #3, D0 ; Bits must be set now
BNE WeHaveAnalog1
CLR.L D0
RTS
WeHaveAnalog1:
MOVEQ #1, D0
RTS
DetectAnalog2: ; Detects the presence of analog controller
JSR WaitOneFrame ; Wait a little (poll may have been in progress)
MOVE.B ($A10005), D0
AND.B #3, D0 ; First step: axe bits must be unset
BEQ NextAnalogStep2
CLR.L D0
RTS
NextAnalogStep2:
MOVE.B #$40, ($A10005) ; Next step: pulse TH so timers start and axe
NOP #4 ; bits are set
MOVE.B #$00, ($A10005)
MOVE.W #31, D0
AnalogInitLoop2:
DBRA D0, AnalogInitLoop2
MOVE.B ($A10005), D0
AND.B #3, D0 ; Bits must be set now
BNE WeHaveAnalog2
CLR.L D0
RTS
WeHaveAnalog2:
MOVEQ #1, D0
RTS
ReadAnalog1: ; Reads analog gamepad button and axe status
CLR.W D1 ; X counter
CLR.W D2 ; Y counter
MOVE.B #$40, ($A10003)
NOP #4
MOVE.B #$00, ($A10003)
MOVE.B ($A10003), D0
NOT.B D0
MOVE.W D0, (P1CTRL)
PollJoy1:
MOVE.B ($A10003), D0
AND.B #3, D0 ; Check if poll is done
BEQ PollDone1
BTST #0, D0 ; Check X
BEQ DummyAxe11
ADDQ.W #1, D1
BRA NextAxe1
DummyAxe11:
ADDQ.W #1, D3
BRA NextAxe1
NextAxe1:
BTST #1, D0 ; Check Y
BEQ DummyAxe21
ADDQ.W #1, D2
BRA PollJoy1
DummyAxe21:
ADDQ.W #1, D3
BRA PollJoy1
PollDone1:
MOVE.W D1, (JOYX1)
MOVE.W D2, (JOYY1)
RTS
ReadAnalog2: ; Reads analog gamepad button and axe status
CLR.W D1 ; D1=X counter
CLR.W D2 ; D2=Y counter
MOVE.B #$40, ($A10005) ; D3=Dummy counter
NOP #4
MOVE.B #$00, ($A10005)
MOVE.B ($A10005), D0
NOT.B D0
MOVE.W D0, (P2CTRL)
PollJoy2:
MOVE.B ($A10005), D0
AND.B #3, D0 ; Check if poll is done
BEQ PollDone2
BTST #0, D0 ; Check X
BEQ DummyAxe12
ADDQ.W #1, D1
BRA NextAxe2
DummyAxe12:
ADDQ.W #1, D3
BRA NextAxe2
NextAxe2:
BTST #1, D0 ; Check Y
BEQ DummyAxe22
ADDQ.W #1, D2
BRA PollJoy2
DummyAxe22:
ADDQ.W #1, D3
BRA PollJoy2
PollDone2:
MOVE.W D1, (JOYX2)
MOVE.W D2, (JOYY2)
RTS
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
it's not that hard...I made some research and find stuffTmEE co.(TM) wrote:I'm not familiar with USB, but I believe it is not too hard to get USB pad working with MD, maybe a PIC(don't have experience with these either) ?
but i'm not a electronic guy and I don't have the tools to burn eprom or write pic