Using standard joysticks

Discuss the CreatiVision hardware: models, revisions, fixing, hacking and modding.
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Using standard joysticks

Post by kevgal » Thu Mar 17, 2016 9:23 am

Here's a little circuit to connect standard joysticks to the Creativision. Probably could have done it with a couple of 74XX's but I had a heap of transistors lying around.
You do not have the required permissions to view the files attached to this post.
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Re: Using standard joysticks

Post by kevgal » Thu Mar 17, 2016 10:21 am

Here are the keyboard scan codes. Handy for fault finding dodgy controllers.
You do not have the required permissions to view the files attached to this post.
User avatar
Scouter3d
Posts: 646
Joined: Mon Jun 28, 2010 7:02 am
Location: Wien
Contact:

Re: Using standard joysticks

Post by Scouter3d » Thu Mar 17, 2016 11:30 am

I am amazed! congratulations!

Is it possible to build this circiuit "plug and play" without any internal soldering?

Using standard Joysticks one may lose the diagonal movements?... (not sure if the commercial carts check for the respective codes...)
Would need to check on the Laser or Salora...

TOM:0)
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Re: Using standard joysticks

Post by kevgal » Thu Mar 17, 2016 12:45 pm

Should be able to use this externally, certainly if the start buttons weren't required. This is one advantage of transistors over ICs - no need for VCC.
Can't remember why I soldered straight to pin 12 of the PIA for the start buttons, maybe my multi console setup was loading the circuit? Too much drop with forward bias?
The circuit I use actually has a few more components so I could accomodate that damned tank game!
Diagonals should be no different, seems to work okay with planet defender, don't think any of the other games use diagonal?
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Re: Using standard joysticks

Post by kevgal » Thu Mar 17, 2016 1:15 pm

Here it is in circuit
You do not have the required permissions to view the files attached to this post.
kevgal
Posts: 71
Joined: Mon Aug 04, 2014 9:19 pm

Re: Using standard joysticks

Post by kevgal » Thu Mar 17, 2016 10:22 pm

My circuit is only needed for a ground 'common' connection for multiple joysticks and buttons. If you want to connect a 1 fire button joystick you can wire directly without any circuit. Second fire button requires a second separate 'common' line and letters would need a 2 pole push button. The scan codes PDF posted previously shows which pins are connected for various letters.
Eg left controller:
Common - pin 2
Up - pin 6
Down - pin 4
Left - pin 10
Right - pin 5
Right button - pin 8
Left button - Common pin 1 and button pin 8
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: Using standard joysticks

Post by carlsson » Mon Mar 21, 2016 11:56 am

Creativision joysticks though have 16 directions: Up, Up-Up-Left, Up-Left, Up-Left-Left, Left, Down-Left-Left, Down-Left, Down-Down-Left, Down etc. When converting an Atari style joystick, games that only use the "regular" 8 directions will work.
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: Using standard joysticks

Post by @username@ » Mon Mar 21, 2016 10:16 pm

Which games use 16 positions? The joy function in CV basic can only see the standard 8, so would be interesting to look at the 16 position code.
User avatar
carlsson
Posts: 507
Joined: Fri Jun 13, 2008 7:39 am
Location: Västerås, Sweden

Re: Using standard joysticks

Post by carlsson » Tue Mar 22, 2016 11:32 am

Mobsie wrote that his Color Maze uses all directions, for improved diagonal movement.

As far as I understood, there are two sets of values to read:

$11 and $13 = Values $40 - $4F representing each of the 16 directions on respective joysticks
$18 and $1A = Values $02, $04, $08, $20 represent down, right, up, left and can be combined into 8 directions

Also the keyboard is decoded twice, first at $12 and $14 (excluding columns 1 and 7), then at $19 and $1B (entirely combined with $18 and $1A). Same about the fire buttons, decoded at $15 or $16-$17. Exactly which of these addresses the BASIC uses, I can't recall. There may be additional ways to read the joysticks too, if not relying on the BIOS to decode input into zeropage locations. I haven't disassembled any of the existing games to find out how they do it.
User avatar
@username@
Posts: 320
Joined: Tue Oct 22, 2013 6:59 pm
Location: Scotland

Re: Using standard joysticks

Post by @username@ » Tue Mar 22, 2016 5:36 pm

OK - I think I see the confusion.

The low bit of bytes $11 and $13 should be discarded.

The read functions do the following

Code: Select all

ROM:AB2F loc_AB2F:                               ; CODE XREF: sub_BDC3-12A4j
ROM:AB2F                 LDA     $11
ROM:AB31
ROM:AB31 loc_AB31:                               ; CODE XREF: sub_BDC3-1284j
ROM:AB31                 BEQ     loc_AB46
ROM:AB33                 AND     #$F
ROM:AB35                 LSR     A
ROM:AB36                 STA     $2D
ROM:AB38                 INC     $2D
ROM:AB3A                 JMP     loc_AB48
ROM:AB3D ; ---------------------------------------------------------------------------
ROM:AB3D
ROM:AB3D loc_AB3D:                               ; CODE XREF: sub_BDC3-12A1j
ROM:AB3D                 LDA     $13
ROM:AB3F                 JMP     loc_AB31
This is simply, and off the lower nibble - shift it right 1 (so only 3 significant bits) then increment for BASIC.

So direction is only 3 bits, which in my book == 8 positions.
Post Reply