mooz
Deep Blooper
Posts: 29
|
Post by mooz on Feb 6, 2019 21:41:42 GMT
This only works for the Multitap. For example the Twin Commander and Twin Tap will mirror the connected pads. I don't know how the other multitaps behave (Joy Tap 3, Battle Tap, X-HE2)
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Feb 6, 2019 22:53:18 GMT
Kinda like the XE-1AP/J and XHE-3 ... it's only really useful if it is the only joypad, plugged directly into the PCE (with no multitap). Again, I'm not sure if the signal timings are as tight as how the driver for Out Run was built, but just the simple fact that you have to mess with the CLR signal should be enough to make it not work with a tap, even if software is written to take that into account... So, if I'm thinking correctly, a game could try to detect the XE-1AP/J and XHE-3 combo on boot, and then use that specific driver if it is found, or else use a driver that can handle a multitap and a combination of 2-button/6-button/mouse. Yep, you could pretty much do that, and a XE-1A controller on a Turbo Tap should work as a regular 2-button pad since the OE pin on the XHE-3 multiplexer is grounded anyway. The flow of the controller detecting algorithm would be pretty much like you suggested (and it's too bad that the Pachinko controller wasn't built with software detection in mind...). What I really want to do is plug in a controller emulating code into Mednafen/MAME but I tried to check out the source code for MAME yesterday and it's such a confusing project. I'll probably look into Mednafen today. And since we're speaking about peripherals, has anyone ever tried to do an adapter? I have like some PIC16s and a shit ton of resistors, capacitors, leds and stuff that I bought for the sole purpose of making a PS/2 to PCE mouse adapter but I kinda gave up really early on since I couldn't get rid of some weird interference my chips were having where it would reset whenever I'd get close to it, lol. Plus I'm not really a hardware guy anyway. That would be very interesting for current PCE games that allows mouse input, and would make mouse homebrew reach a wider audience. Same thing for a XE-1A adapter but that seems to be much more complex since every analog controller on the market does its own thing via USB, lol.
|
|
|
Post by dshadoff on Feb 6, 2019 23:14:15 GMT
Well, it's really overkill, but a Raspberry PI could probably nicely be the 'glue' between modern wireless controllers/mice and the PC-Engine...
|
|
|
Post by soop on Feb 6, 2019 23:24:50 GMT
Well, it's really overkill, but a Raspberry PI could probably nicely be the 'glue' between modern wireless controllers/mice and the PC-Engine... Definitely overkill, an Arduino would be what you want, but after a prototype, you could make a much simpler circuit with a programable chip. I don't know the whole shebang, but a raspberry pi is.layers and layers more than you need
|
|
|
Post by dshadoff on Feb 6, 2019 23:37:25 GMT
Sure, but I'm just saying "cheap, easy, do-it-yourself, and compatible with existing hardware". The layers are often required for that compatibility.
|
|
|
Post by elmer on Feb 7, 2019 0:09:32 GMT
Well, it's really overkill, but a Raspberry PI could probably nicely be the 'glue' between modern wireless controllers/mice and the PC-Engine... Errrm ... doesn't the RPi run its I/O pins at 3.3V max? Don't you need a 5V device to cheaply-and-easily interface with the PCE's controller port? Teensy (ATmega32u4 USB dev board) 2.0Adafruit ItsyBitsy 32u4 - 5V 16MHz
|
|
|
Post by dshadoff on Feb 7, 2019 1:03:37 GMT
Well, you would want to keep the PI electrically isolated from the PCE in any case, so you would want to have some sort of electrically-isolated solid-state switch (like opto-coupler, etc.). At that point, you're just adding a 74HC157 and switching the inputs between the PCE-supplied Ground and +5V based on the (isolated) GPIO pins from the PI. The devices you mention would be cool, but honestly I think they may not solve what I perceive to the "hard work" - dealing with Bluetooth and/or USB drivers for the "standard" controllers. Of course, I may be overestimating how much of this exists on the PI, and underestimating these other boards... Here's an example of a circuit from the 'net with a quick search... although the roles are reversed (this takes a 5V input and switches the PI's 3.3V input, rather than the PI's 3.3V output triggering a 5V output) - however, the concept is exactly the same. The resistor values might need to be adjusted a bit though (anybody know more than me about this ?) raspberrypihobbyist.blogspot.com/2012/09/gpio-input-circuit_19.htmlDave
|
|
|
Post by theoldman on Feb 7, 2019 2:23:10 GMT
Funny, that's what I was thinking when I posted the Crappy Atari mouse game. A Pi-zero is cheap (<$10).
Why? I'm not a hardware guy, but I tried a voltage divider for the 5->3V drop, and some switching transistors for the 3->5V conversion. Seemed to work. (Subject to another problem)
The pi has a complete working USB stack available. Didn't check out BlueTooth, though. It is a 'bare-bones' implementation, so no stalls/delays due to linux.
The problem I had was the I/O on the pi not switching fast enough. (it takes ~10ms to switch the way I set things up). That was enough to cause the mouse read to flake out. No, I wasn't using the USB stuff, just a simple counter loop for testing.
Apparently, by default the pi zero runs at 300 MHz (iirc), and you havve to manipulate some processor bits to go faster. I never really looked into that. I did get better response-times using the SEL and CLR lines as triggers, but still not quite enough.
|
|
|
Post by elmer on Feb 7, 2019 2:46:25 GMT
Well, you would want to keep the PI electrically isolated from the PCE in any case, so you would want to have some sort of electrically-isolated solid-state switch (like opto-coupler, etc.). At that point, you're just adding a 74HC157 and switching the inputs between the PCE-supplied Ground and +5V based on the (isolated) GPIO pins from the PI. Yep, I hear you. But for me, the whole point of a small microcontroller like the Teensy is that you don't have to opto-isolate it, you just add the 74HC157 and go. Then again, I am not an electrical engineer, so I am out of my depth and probably way off the mark.
|
|
|
Post by dshadoff on Feb 7, 2019 2:46:55 GMT
Why? I'm not a hardware guy, but I tried a voltage divider for the 5->3V drop, and some switching transistors for the 3->5V conversion. Seemed to work. (Subject to another problem) It's because the PCE won't have enough power to drive the PI, so they would have two separate power supplies. Which we would want to keep separated. The PI Zero-W has Bluetooth, and 8BitDo controllers appear to have support for the PI... and costs like $10US. Of course you need a case and an SDCard and a couple of pins and the opto-isolator and the 74HC157.... so like $25 and some work, I think. (The PI Zero-W goes @ 1GHz) Was the delay due to GPIO pins ? Or some other concern ? Personally, I'd set up the GPIO pins to just act as the switches, and use a 74HC157 to do the mux'ing... still, I'd be shocked if they really took more than ~1ms to switch. I was figuring ~120-180 scans per second shouldn't be an issue. Having said all that, this gentleman seems to *NEARLY* (but not quite) have stuff addressing our needs: www.raphnet-tech.com/products.php?category=pcengine#productsDave
|
|
|
Post by elmer on Feb 7, 2019 3:08:15 GMT
|
|
|
Post by elmer on Feb 7, 2019 5:44:02 GMT
Does anyone know if there are any 6-button joypads that do not return the 2nd set of direction bits as %0000? Chris? The games that I've looked at just check bits 0 & 2 (UP and DOWN), and don't care about bits 1 & 3 (LEFT and RIGHT). So if the 6-button joypad returned %1010, then it would still be detected as a 6-button pad. Are there any joypads out there that do that? I'm trying to figure out if there is any *quick* way to detect the difference between a mouse and a 6-button joypad. Otherwise, I'm having trouble coming up with efficient code to read a mouse at the same time as 2-button and 6-button joypads. I can read 2-button and 6-button joypads quickly (approx twice as fast as HuC's code), and I can read a mouse and 2-button joypads quickly, but I just can't think of an elegant method for reading all 3 types of device quickly. I don't think that it's a problem in any reasonable game design scenario ... but it is annoying me.
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Feb 7, 2019 6:35:06 GMT
So... I managed to write code for the controller on mednafen (that build of yours with the large font, elmer) but I have no idea how to compile it back, running make doesn't include my .cpps in the compiler/linker and there's a large amount of files in there.
edit: also I dusted off my electronics stuff, and man is the PIC programmer annoying. Reminds me of why I gave up so easily.
|
|
|
Post by dshadoff on Feb 7, 2019 6:55:31 GMT
Does anyone know if there are any 6-button joypads that do not return the 2nd set of direction bits as %0000? Chris? The games that I've looked at just check bits 0 & 2 (UP and DOWN), and don't care about bits 1 & 3 (LEFT and RIGHT). So if the 6-button joypad returned %1010, then it would still be detected as a 6-button pad. Are there any joypads out there that do that? Remember that these are reverse-sense bits - "button pressed" = 0, because the values float high, and a closed circuit brings it down to ground. ...Which means, bits 0 & 2 (UP & DOWN) are just as valid a check as 1 & 3 (LEFT & RIGHT) -> That is, if it is a "normal" 2-button joypad, having both opposing directions held down simultaneously should be a physical impossibility. So when the 6-button joypad returns all zeroes, that's the sign that it's not a regular joypad. As far as I know, they all return zeroes on that scan, and I can't believe that any 6-button joypad would behave in any other way; they just took a shortcut in the detection code. I'm not sure how you're getting it to be twice as fast, unless you're omitting the mandatory delay (hardware latency) between twiddling the control lines and waiting for the return signal... but as long as that is preserved, more power to you. I'm also not sure whether there's an easy way to differentiate between those two devices (mouse and 6-button), but hopefully my answer above yields a hint. Dave
|
|
Deleted
Deleted Member
Posts: 0
|
Post by Deleted on Feb 7, 2019 7:18:44 GMT
I'm not sure why Elmer is giving such an emphasis on "quick", because those checks should usually be done once per game when talking about such different devices (mouse vs. pad), I'd simply stop the game and ask for the player to reconnect the mouse or simply fall back to a controller when bad data suddenly starts showing up.
|
|