MEGA65 / mega65-core

MEGA65 FPGA core
Other
240 stars 85 forks source link

Complete paddle support #584

Closed dansanderson closed 1 year ago

dansanderson commented 2 years ago

Test Environment (required) You can use MEGA65INFO to retrieve this.

Describe the bug Someone in the Discord mentioned that paddle support is incomplete. I did a quick test and am opening this issue to track completion of this feature. (I don't know if this is core or ROM.) Issues I noticed:

  1. Paddles connected to joystick port 1 register direction and fire on JOY(1) and JOY(2). They also register direction but not fire on JOY(3) and JOY(4).
  2. Paddles connected to joystick port 2 only register the fire buttons on JOY(3) and JOY(4), and do not register a direction.
  3. There is about a quarter turn at the end of the counterclockwise direction that all reads as 255, so the entire range of motion is not reported across 0-255. (I don't know if this might be an issue with my paddles or if this is expected for Commodores.)

To Reproduce Steps to reproduce the behavior:

  1. Use this BASIC program: 10 PRINT JOY(1), JOY(2), JOY(3), JOY(4):GOTO 10
  2. Connect Atari-style paddles to joystick port 1. Run the program, and adjust both paddles all the way clockwise and counterclockwise. Press the fire buttons.
  3. Connect Atari-style paddles to joystick port 2. Run the program, and adjust both paddles all the way clockwise and counterclockwise.

I'm happy to test candidate fixes, just let me know.

dansanderson commented 2 years ago

(ROM code looks ready on visual inspection, so I'm guessing this is a CIA paddle port wiring issue in the core.)

lydon42 commented 1 year ago

As paddles do work with the C64 Core, it certainly should be fixable.

dansanderson commented 1 year ago

I'm going to nuke this and convert it to a ROM issue. I'm not aware that more wiring is needed to support paddles connected to port 2. The POT() function is not working to spec but the cause is not clear. (I don't know why I said "JOY" above, I clearly meant "POT". But no matter. :) )

Also, I only recently just learned that the "missing" quarter turn is because I'm using Atari paddles. Commodore paddles use a different potentiometer value. I acquired some Commodore paddles today and they correctly register 0-255 across the entire turn.