Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyboard controller support #91

Open
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

DChristianson
Copy link

This PR adds support for keypad controllers. I have tested this branch in my own embedded stellerator project (https://github.com/dchristianson/vcs-lisp) - there could be be gaps in testing for general use...

TLDR
* keypad controllers have 12 buttons arranged into 4 rows and 3 columns
* only one row can be read at a time for each controller by sending pulses via SWCHA
* discussion of the controllers + generic test rom here: https://forums.atariage.com/topic/247615-trying-to-figure-out-keyboard-controllers-inpt/

There is an additional change to add peek/poke methods for embedded client, this is used in my current homebrew project to be able to read/write to VCS RAM from outside stellerator

@DirtyHairy
Copy link
Member

Wow, what I nice and thorough merge request! I just read through it, and it looks like everything is there, even the Elm bits for the frontend. I am familiar with the keypad from my work on Stella, but I never bothered to add it to 6502.ts myself.

I'll take a closer look at a few pieces the next days when I find more time, but this is really good work. I'll do a new release once i merge it --- I am afraid I have done preciously little work on 6502.ts over the last years, but this warrants one 😏

@DChristianson
Copy link
Author

Thanks! I saw that I could basically follow the same patterns as the existing controllers, happy to make adjustments in case I misinterpreted anything. The elm bits in particular I did in my first pass through, before I really started testing with real ROMs, I believe they aren’t thoroughly tested..

@DirtyHairy
Copy link
Member

Sorry for the late reply, real life was keeping me busy for the last two weeks. I have started to play with your code now and have found a few issues that still need sorting out, nothing big. My first findings:

  • We need a data migration to support the new fields, otherwise old records are silently filtered out.
  • For some reason I can't get the keypad to work in Stellerator. I haven't debugged in depth yet, but it looks like the keyboard driver is using the wrong mappings.
  • There is a conflict between p as in "pause" and as a keypad key. Maybe it would be better to move the keypad mappings one column to the left
  • We should get rid of the "emulate paddles" option, it is superseded by your new controller settings
  • Talking about paddles, maybe this is a good time to finally support clicks as the paddle button 😏

I can support you and implement some or all of those things myself on the PR, but we can also share the load, or you can take over it completely. What would prefer.

@DChristianson
Copy link
Author

I'll take a look - I definitely didn't test out keyboard binding (was driving with click events) and yes it's not working for me either..

I might need some extra pointers wrt migration - is that about having for instance Cartridge metadata be backwards compatible, or updateing the data (somewhere) automatically?

@DirtyHairy
Copy link
Member

I might need some extra pointers wrt migration - is that about having for instance Cartridge metadata be backwards compatible, or updateing the data (somewhere) automatically?

The easiest way is to register a new version with dexie.js and add a migration step that adjust the records accordingly. The corresponding code is here, and there is already a similar migration (that added TV settings).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants