Space Invaders running in Stella on my Mac. Jasper loved it!
(He also liked the green light-up USB cable. That's my kid!)
As of last night, I have finished code for the joystick-to-keypress controller, as well as the ability to save the configuration in the EEPROM in the ATmega chip. As usual, the code is all available here on github. What this basically means is that moving the joystick will send down keypress codes to the host computer... so the computer thinks that a keyboard is being used. This means that applications like Stella, an Atari 2600 VCS emulator, which expect you to use the arrow keys and space bar in place of a real joystick, can see those key presses when you move your actual Atari joystick!
You can now pick from a list of keyboard mappings, including:
- Stella (Atari 2600 emulator) (shown above)
- Vice (Commodore 64 emulator)
- Mame (Arcade game emulator)
- WASD (general PC game usage)
- HJKL (vi cursor movements (because why not!))
I have also implemented a basic settings system that saves settings to the EEPROM within the ATmega32u4 chip. It currently has "slots" for a few things, but could be expanded with the above joystick-to-keyboard mapping, to send other keypresses from joystick movements or what have you.
The settings system works with 4 bytes in the EEPROM to determine what's going on with respect to saved settings. The first 3 bytes are a sentinel. If the code does not read the sentinel, it will assume it's on a new device, and will install default values to the EEPROM. The current sentinel are the three hex bytes: { 0x53, 0x44, 0x4c } which are the ASCII string "SDL", my initials. ;) Next at setting slot [3] is the settings version number. Currently this is just '1'. Settings slot [4] contains the usage mode for the interface port. (Mouse/keyboard mapping, etc).
I attempted last week to get an Amiga Keyboard working with this. I wired up an 8 position pin header to the interface board, using the Amiga 500 pinout:
- Data
- Clock
- Reset (toggled when Ctrl-A-A is pressed)
- +5v
- key (missing pin)
- Ground
- Status LED (power)
- In-Use LED (disk access)
I was going to just wire out the Data, Clock, +5 and ground but decided that it made more sense to use the actual A500 pinout. I ran into a problem on this though. The interface can't provide enough power to drive the chips on the interface board. I measured 4.5v at the pin header, then 3.2v down on the interface board itself. This isn't good. I will have to wire up a new interface connector with an external power connector, probably a USB-B jack, to provide dedicated power to the keyboard.
I did however find a phone being discarded, and retrieved the two 4P4C (RJ-22) connectors from it so that I can make a better A1000 keyboard jack. The first one I made used an RJ-45 wall mount jack, which worked somewhat for RJ-22, but it was pretty hacked. ;)
Some thoughts for future additional expansion:
I'm currently going for the "cheap as chips" version of this, which is why there's no interface on it, and you have to connect via serial port to configure it. This was all intentional to keep the build parts list down... to the point where the only necessary part is a D9 connector! However, in using it, a few future revisions may offer more usability at the cost of parts expense:
- Multiple D9 jacks for multiple devices
- Ports dedicated for Mouse, Trackball, Multiple Joysticks, etc
- Could be just 2 that simulate Commodore/Amiga
- Could be 4 to simulate Atari 800 joystick ports
- Could be 1 for mouse, 5 for joysticks, so you never have to disconnect them.
- Would require a parallel-in, serial out shift register, or a port expander
- Expansion at the cost of a few cents, additional wiring, and time to read in the content
- (related) configuration for multiple ports
- User interface - Was thinking that this could be a variety of different methods:
- single pushbutton, Red/Green LED for indication codes (flashing colors)
- single or dual pushbutton, RGB color addressable LED for indication codes
- each could be wired directly to IO pins
- dual pushbutton, 7 segment LED display
- Could indicate use mode(s), etc
- 'C' for commodore mouse, 'A' for atari mouse
- '0'..'7' for joystick mode display
- Could flash multiple digits sequentially for info etc
- Would require LED driver chip
No comments:
Post a Comment