ivop Posted September 16, 2017 Share Posted September 16, 2017 Hi all! While I'm waiting on parts for the MIDI Interface, I spent the last couple of days working on a new hardware project (and avoiding working on a huge software project I'm also working on ). Prototype: PCB: The SNES connecter's 3D model is a little borked (wild guess: some normals are flipped), but you'll get the idea. Current firmware maps the D-Pad to its four directions, L to up, R to down (handy for diagonal jump games) and all other buttons to fire. This should make any SNES (compatible) controller work like a normal Atari Joystick. There is however an extension. Select/Y/B are connected through 3 resistors to POTA. The same goes for X/A/Start and POTB. The resistors are chosen in such a way that all eight combinations of the three buttons can be clearly determined. Note that this is not a resistor DAC, because that would result in eight different voltages, but Pokey measures current at +5V. The firmware only outputs 5V "into" the resistors if the button is pressed. Otherwise the pin is tri-state (i.e. not connected) and the connected resistor is ignored. That way, eight currents can be measured by Pokey and the values are sufficiently apart. Several factors influence the actual readings, e.g. temperature, resistors used and Pokey itself. Therefore if a game was to be written to utilize these buttons, it has to calibrate itself first. BTW J1 is an Arduino Nano (Clone), which can easily be programmed over USB (connector is already mounted on the Nano's PCB). I have decided to just piggyback it on top of this board, because I can never match its functionality for €2,=, which is what it costs to buy one from China, incl. S&H. All files will be released eventually and will be open source. Regards, Ivo 13 Quote Link to comment Share on other sites More sharing options...
8Bitjunkie Posted September 16, 2017 Share Posted September 16, 2017 looks cool :-) 1 Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 16, 2017 Share Posted September 16, 2017 (edited) Could firmware support a mode by which the A8 configures the button line as an output? When this is low, the 4 joystick lines reflect the Up/Down/Left/Right states as usual. When it is high, the 4 button states are output on the joystick lines instead. [Edit] Start/Select would then be mapped to the two pots, going low when presses.This could use a switch to permit the compatible mode to be used also. Existing s/w could be patched for playing with multi-button support. Edited September 16, 2017 by Wrathchild 2 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 17, 2017 Author Share Posted September 17, 2017 Sadly, the trigger inputs are handled by GTIA and cannot be set as outputs. But I see where's your going. It's way easier to read the buttons without the need to calibrate your POT readings. The firmware could easily support different operating modes though. There's a reset button on the Nano, so pressing reset while holding a button combination could be used to select different modes. A variation on your idea could be that snes2joy alternates between sending UDLR and ABXY, the first one without setting the trigger bit and the second one with the trigger bit set. Alternate, say, every 32 microseconds and the Atari should be able to sync to it and read both values within the duration of one scanline. 1 Quote Link to comment Share on other sites More sharing options...
Level42 Posted September 17, 2017 Share Posted September 17, 2017 (edited) I have always advocated that 2600/A8 games _must_ be played with a joystick but I totally love the SNES controller since it is so wonderful when playing SMW. So I want one What would be really cool is the possibility to make one of the buttons act as the space bar as this is the second action "button" in games like Dropzone. Could a OS hack be made to do that so it is "transparant" for the games ? I guess some games probably scan the keyboard at a very low "level" ? not sure about that. Edited September 17, 2017 by Level42 1 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 17, 2017 Author Share Posted September 17, 2017 (edited) Yeah, I agree that a joystick has more of the period feeling and reminds me of the eighties where I wrecked them (and my arm) by playing Decathlon I also agree that the SNES controller is wonderful and IMHO the best controller up to the 16-bit consoles. They are still easily available. Mostly clones though, with varying level of quality. As for the space bar, it indeed depends on whether the game uses the keyboard handler or not. Well, in the end, everything can be patched Suggestion for other modes of operation (of snes2joy I mean) are welcome! Guess it could be nice to have one with auto-fire, i.e. A = single shot and B, X and Y "press" the fire button repeatedly at various frequencies. Edit: perhaps should add an RGB LED to indicate which mode it is in? I have four GPIO pins left. Edited September 17, 2017 by ivop 2 Quote Link to comment Share on other sites More sharing options...
Level42 Posted September 17, 2017 Share Posted September 17, 2017 Was thinking.....could we create a little PCB inside the A8 machine that registers the value for "space bar" from the POT input and then simply "hard contacts" the space bar ? Should be switchable of course for playing Paddle games..... Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted September 17, 2017 Share Posted September 17, 2017 Probably easier to patch the software Quote Link to comment Share on other sites More sharing options...
Level42 Posted September 17, 2017 Share Posted September 17, 2017 Probably easier to patch the software I'm not too sure about that. Patching each game is going to be a PITA. Patching OS ROMs might only work partially if non-standard ways of scanning the keyboard are used by games. Hardware always works. Quote Link to comment Share on other sites More sharing options...
Level42 Posted September 17, 2017 Share Posted September 17, 2017 Ivo, maybe a stupid question: do you use through-hole parts for a reason ? You assemble the PCB yourself ? I assume that saves money in production ? Quote Link to comment Share on other sites More sharing options...
Mathy Posted September 17, 2017 Share Posted September 17, 2017 Hello guys If you want to switch pins to output, why not use "Multijoy-Technology". The multijoy can select up to 16 joysticks. Let's say you only want 8 SNES-controllers max. That would mean you'll have 8 PIA pins per SNES-controller, 4 for Up, Down, Left and Right and 4 for the extra buttons. Plus two fire button signals. That should be enough for 6 buttons. Ofcourse, the hardware doesn't have to support 8 SNES-controllers. It's just the max you could use using this methode. If you'd make the hardware such that it only supports one SNES-controller (but uses two joystick ports), it should even be possible to use multiple "SNES-adaptors" together with the Multijoy-Interface. Sincerely Mathy 2 Quote Link to comment Share on other sites More sharing options...
Brentarian Posted September 18, 2017 Share Posted September 18, 2017 Robotron would be cool using a SNES controller if the buttons could be mapped to joy1 and joy2 directions. 2 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 18, 2017 Author Share Posted September 18, 2017 Ivo, maybe a stupid question: do you use through-hole parts for a reason ? You assemble the PCB yourself ? I assume that saves money in production ? Yes, having it assembled in China would cost more. But the main reason is that it's fun to build it yourself Also, it makes for a nice beginners project. SMD would not save much space anyway in this design. 3 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 18, 2017 Author Share Posted September 18, 2017 If you want to switch pins to output, why not use "Multijoy-Technology". The multijoy can select up to 16 joysticks. Let's say you only want 8 SNES-controllers max. That would mean you'll have 8 PIA pins per SNES-controller, 4 for Up, Down, Left and Right and 4 for the extra buttons. Plus two fire button signals. That should be enough for 6 buttons. Ofcourse, the hardware doesn't have to support 8 SNES-controllers. It's just the max you could use using this methode. If you'd make the hardware such that it only supports one SNES-controller (but uses two joystick ports), it should even be possible to use multiple "SNES-adaptors" together with the Multijoy-Interface. I have considered using two joystick ports, but decided against it because I want the interface to work out-of-the-box as a "normal" joystick. No patching, just plug and play. In this compatibility mode, the other buttons can be read through the POT inputs. This allows for games to be "slightly patched" to make, let's say, the start button work as expected, but this is not necessary. Non-compatible modes, selectable by holding a certain button when powering on, are of course free to do what they want. I think I'll go with the endless stream idea, synced to a clock signal on the trigger line, which I formulated earlier. This interface, in default mode, should work as a normal joystick through a multijoy BTW. 1 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 22, 2017 Author Share Posted September 22, 2017 Still waiting on parts for the MIDI Interface... Firmware is done, testing succeeded for both modes! 6 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 23, 2017 Author Share Posted September 23, 2017 Hmmm, I really disliked having to calibrate the POT readings for every combination (would be 8 readings per POTx, so 32 if you had two controllers!). So, I changed the circuit a little. Now the compatibility works without callibration, but at the expense of not being able to read B and Y when Select is pressed and A and X if Start is pressed. That's not a big deal IMHO, because why would a game want those combinations anyway? When start or select are pressed, most of the time game pauses or brings up some kind of options menu. I cannot think of any game on any platform where you would have to hold the start or select button while fiddling with other buttons during gameplay. So now you can read B, Y, B+Y, Select on POTA and A, X, A+X, Start on POTB. In extended mode/endless stream mode (how should I call this?) you can still read every combination you manage to press 7 Quote Link to comment Share on other sites More sharing options...
ivop Posted September 29, 2017 Author Share Posted September 29, 2017 I have ordered prototype PCBs. Expected to arrive within 10-14 days. 1 Quote Link to comment Share on other sites More sharing options...
Level42 Posted September 30, 2017 Share Posted September 30, 2017 Cool....if you need a "beta tester" I live close enough ;) Quote Link to comment Share on other sites More sharing options...
ivop Posted October 22, 2017 Author Share Posted October 22, 2017 (edited) 10 PCBs have arrived. BOM: (9p pin header not shown) Solder resistors: Use hacksaw to get two rows of 15 pins/holes: Solder pin headers to Arduino Nano. It's easiest to put the headers in a breadboard, so you can be sure they are solder on straight: Forgot to photograph soldering on the SNES socket. Put finished Arduino in female headers, again, so you can be sure they are solder straight on the PCB: Et voìla: Two small leds (green is compatibility mode, red is alternative mode): 9p male pin header: Flash firmware, finished: Instead of a 9p pin header, you can also solder an old cut-off joystick cable directly to the PCB. They need to have ALL 9 pins connected. Some joysticks only pass through GND, trig and the four directions. Now I'm deliberating on what to offer and at what price. I'm considering: 1) PCB + parts (kit) for those who want to DIY (firmware flashed already) 2) Fully build, except for the joystick cable (or send me one with all 9 pins passed through and I connect it to the PCB) 3) 1 or 2 of the above, including a clone SNES controller (might get a reduced price if I order a bunch at once) plus shipping and handling... BTW yesterday we tested the device on an Atari 2600 and a Commodore C64 and both worked flawlessly. Edited October 22, 2017 by ivop 5 Quote Link to comment Share on other sites More sharing options...
ivop Posted October 22, 2017 Author Share Posted October 22, 2017 (edited) BTW2 I'm also going to draw a PCB with the connector reversed, because all suppliers supply pairs of connectors and one of them is mirrored: Bending the pins to match the other is possible, but a pain in the neck and breaking a pin is too great a risk IMHO. Edit: oh, just took a better look at the connectors and I can easily turn the pins 180 degrees. No need for a second type of PCB Edited October 22, 2017 by ivop Quote Link to comment Share on other sites More sharing options...
Level42 Posted October 22, 2017 Share Posted October 22, 2017 Option 1) for me please Quote Link to comment Share on other sites More sharing options...
gozar Posted October 22, 2017 Share Posted October 22, 2017 10 PCBs have arrived. BOM: (9p pin header not shown) step01.png Solder resistors: step02.png Use hacksaw to get two rows of 15 pins/holes: step03.png Solder pin headers to Arduino Nano. It's easiest to put the headers in a breadboard, so you can be sure they are solder on straight: step04.png Forgot to photograph soldering on the SNES socket. Put finished Arduino in female headers, again, so you can be sure they are solder straight on the PCB: step05.png Et voìla: step06.png Two small leds (green is compatibility mode, red is alternative mode): step07.png 9p male pin header: step08.png Flash firmware, finished: step09.png Instead of a 9p pin header, you can also solder an old cut-off joystick cable directly to the PCB. They need to have ALL 9 pins connected. Some joysticks only pass through GND, trig and the four directions. Now I'm deliberating on what to offer and at what price. I'm considering: 1) PCB + parts (kit) for those who want to DIY (firmware flashed already) 2) Fully build, except for the joystick cable (or send me one with all 9 pins passed through and I connect it to the PCB) 3) 1 or 2 of the above, including a clone SNES controller (might get a reduced price if I order a bunch at once) plus shipping and handling... BTW yesterday we tested the device on an Atari 2600 and a Commodore C64 and both worked flawlessly. I'd be interested in options 2 or 3. Quote Link to comment Share on other sites More sharing options...
ivop Posted October 27, 2017 Author Share Posted October 27, 2017 (edited) Update: Now that I'm also getting into 3D modelling and printing, I'm thinking about creating an enclosure for this project as well. Also, the idea of people sending me 30 y.o. cut-off joystick cables that might or might not work is putting me off.I could modify the board for something like this (idea of SenorRossie), but that still doesn't fit our joystick port correctly. So how about 3D printing DB9 connectors without the mounting flaps/wings/whatever they're called? I've googled around, but no models seem to exist. Only shells for modern DB9 connectors. I think it must doable, so I'm looking into this next week. Edit: hmm, where did I store the Atari joystick patent of which I borrowed an image for my avatar. Perhaps it contains a proper dimensions diagram of the connector, too? Edited October 27, 2017 by ivop 2 Quote Link to comment Share on other sites More sharing options...
Mathy Posted October 27, 2017 Share Posted October 27, 2017 Hello Ivo I believe I read somewhere that you can take the metal part of the modern DB9 connector off. Sincerely Mathy Quote Link to comment Share on other sites More sharing options...
Matej Posted October 28, 2017 Share Posted October 28, 2017 You can buy china megadrive gamepad for 3usd... or contact manufacturer of those.I am sure that joy db9 cable is still in production in Asia... 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.