4 Player InterfaceThis section is under construction.4 Player Interface building and programming instructions
|
| Parts | Tools |
|---|---|
|
|
|
First create a drawing using the Sub-D connectors. Take a knife and cut it out. Now you can set marks on the case so that you know where to screw holes in. For the holes, use the drilling machine and saw. Then work it out with the file until the sub-D fits in. Do this for all sub-Ds and screws, and the last thing you should do on the case is file out a hole for the cable.
Take the circuit board and solder in the IC-socket, then tin the contacts for the cable. Put the IC in. Prepare the cables: We need one 9-lined cable for the userport (about 70cm), two 5-lined for internal joystick connections (about 8cm, important: they should have the *same* length) and one single-lined cable (about 10cm). De-Isolating and tinning the cable-ends beforehand makes work later on much easier. Connect the cables then (see pictures). The best order in soldering the cables is Joy 1, Joy 2, Userport. Then Chip Select (CS) to Ground (GND). Now you can close the case around the userport connector, but mark the upper side!! Plugging it in upside down can harm the C64. Now you're almost through! Test the interface: Deplug the powersupply, plug two joysticks to the interface, and then the interface to the C64. Power it on and run the JoyTester. If something is wrong, turn it off at once, deplug the interface and test the connections with a checksummer (always before the IC). Fix the sub-Ds first, then the circuit board. To ensure a long life for the interface, put some isolation tape inside both cases where the userport-cable is leaving the case. Test everything again and repeat previous steps until all directions and fire buttons work. Now have fun!! Using the 4 player interface in your own productionsNext to providing more joy for you and your friends, Protovision designed the 4 player interface with the coder in mind. Programming the interface and thus using it in your own productions is very simple! Let's take a look at this source code! It represents a driver for the connected joysticks.First, initialize the driver by calling the INIT function. From then on, you can call the READ function to get values from all the joysticks - those connected to the Protovision 4 Player Interface and the ones connected to the standard C64 control ports. This implementation only uses the accu and stores the 4 joystick status values to the label PORT. All the 4 values have the same pattern for the joystick direction and fire button status. This means that they can easily be checked, for example in a little loop. Look at the comments in the source code to see how it's done!
PORT
.BY $00,$00,$00,$00
INIT
LDA #$80
STA $DD03 // CIA2 PortB Bit7 as OUT
LDA $DD01 // force Clock-Stretching (SuperCPU)
STA $DD01 // and release Port
RTS
READ
LDA $DC01 // read Port1
AND #$1F
STA PORT+$00
LDA $DC00 // read Port2
AND #$1F
STA PORT+$01
LDA $DD01 // CIA2 PortB Bit7 = 1
ORA #$80
STA $DD01
LDA $DD01 // read Port3
AND #$1F
STA PORT+$02
LDA $DD01 // CIA2 PortB Bit7 = 0
AND #$7F
STA $DD01
LDA $DD01 // read Port4
PHA // Attention: FIRE for Port4 on Bit5, NOT 4!
AND #$0F
STA PORT+$03
PLA
AND #$20
LSR
ORA PORT+$03
STA PORT+$03
RTS
|
© Copyright 2001-2008 PROTOVISION