MAC-42 Posted February 21, 2014 Share Posted February 21, 2014 (edited) Here's something that crossed my mind just now. Let me see what you folks think of it. The 8-bit computers have the ability to use the XG-1 light gun for games. The 8-bits use DB-9 connectors for input from controllers like the XG-1 or the CX-40, etc. The 5200 uses the DB-15 connector for input from devices, but one can use an adapter to connect a CX-40 (which, again, uses a DB-9 connector) into it and use it as a joystick. I don't really know anything about the pinouts for the XG-1, so this question may be answered with a simple, "No, you can't." If so, pardon my musing. With those premises in place, though, here's the question. Given the fact that the 8-bits and 5200 are relatively compatible with each other, taking into account alterations in a program for changes in the hardware registers, and given that the 5200 can use controllers with DB-9 connectors via an adapter, is it possible to create/port a game for the 5200 that makes use of the XG-1? Can an adapter deliver a usable signal to the joystick pins on the 5200? And if it can be adapted in a hardware sense, does a coder need to write code for the gun input differently due to this altered method of input? Again, just a sudden musing that hit me. Holds no meaning beyond that. Thanks to anyone who can enlighten me. Edited February 21, 2014 by MAC-42 Quote Link to comment Share on other sites More sharing options...
+Allan Posted February 21, 2014 Share Posted February 21, 2014 A few years back somebody was trying to do the same thing. If you look in the 5200 section there was a thread about it. I don't know if they were ever successful. I don't think the user has posted much since. Allan Quote Link to comment Share on other sites More sharing options...
MAC-42 Posted February 21, 2014 Author Share Posted February 21, 2014 Thanks, Allan. I'll take a look. This really is just a whimsical thought that struck me suddenly with no rhyme or reason. As I'm not qualified to do anything about this whether or not, if it can't be done, all it will do is satisfy my curiosity. Quote Link to comment Share on other sites More sharing options...
MAC-42 Posted February 22, 2014 Author Share Posted February 22, 2014 For any folks who might care, I did a search of the 5200 area and found several threads related to this idea. The most interesting post that I could find was this one. Contains possible wiring instructions and a code example. Nothing that has been implemented practically, just some discussion. Interesting reading nonetheless. Thanks again to Allan for pointing me in the right direction. Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 22, 2014 Share Posted February 22, 2014 What I gather from the posts is that the ANTIC light pen sensor is not actually connected to a port in the 5200. The proposal discussed is to wire a light sensor to the joystick trigger instead. Looks very hackish and problematic. Maybe it would be easier to connect ANTIC pin 4 to a pin on the 5200 port. (Clueless about what is really required for this... is there anything else between ANTIC and the joystick port in a regular 800?) Then get the right pin on the light gun's DB9 connector to hook up to that 5200 port pin. Of course, then you still need the software written to the 5200 to test/use it. Quote Link to comment Share on other sites More sharing options...
Bryan Posted February 22, 2014 Share Posted February 22, 2014 It can be done... You would need to adapt it to the 5200's port. Then, when the trigger is pulled, you would need to take 1 full frame to "find" the gun. This would be like the flash many gun games do when you fire. During that frame you would continually poll the sensor input as fast as you can on every line. The speed of your code will determine the horizontal resolution of the gun. Quote Link to comment Share on other sites More sharing options...
kenjennings Posted February 22, 2014 Share Posted February 22, 2014 It can be done... You would need to adapt it to the 5200's port. Then, when the trigger is pulled, you would need to take 1 full frame to "find" the gun. This would be like the flash many gun games do when you fire. During that frame you would continually poll the sensor input as fast as you can on every line. The speed of your code will determine the horizontal resolution of the gun. Well, yeah, that could be done. (But there are no follow-ups on that post, so it looks like nobody pulled it off.) But ANTIC can handle all of the X and Y determination with a light sensor on pin 4. And there is an ANTIC in the 5200. Quote Link to comment Share on other sites More sharing options...
Bryan Posted February 22, 2014 Share Posted February 22, 2014 Most people wouldn't hack their 5200 to add support, though. If you turn off DMA and just flash for a frame, I believe you could do a decent enough job. If the sensor were connected to the trigger input, you could set the trigger to latch and then continually ADD TRIG0 it to A. At the end of the line, the value in A would give you the position. For more precision, you could do it again on the next line (since the gun will respond over a vertical range) but this time shift all the ADDs by a couple cycles. Then you've narrowed down the position a bit. Quote Link to comment Share on other sites More sharing options...
Rybags Posted February 22, 2014 Share Posted February 22, 2014 (edited) Isn't the fire button of the gun returned on a joystick axis ? Since an adaptor would be required, wiring reassignments are no problem anyway. I think possibly the detection could be made more efficient, and the need to blank the screen mostly eliminated. Since an adaptor is required, how about a little extra electronics inside - if pressing fire also disconnected a POT line from +5V. On the computer, the Pot lines can be used as scanline counters since POTGO occurs at a known time. A similar technique could be used on 5200 to determine approximate Y coordinate when the light sensor is activated on the gun. Using the CPU to determine PENH - Even with DMA turned off things get messed up thanks to Refresh. If the sensor triggers over at least 2 lines then possibly some extra precision could be had by using variable delay over each sampling period. e.g. first scanline, straight up hit WSYNC then sit their polling TRIG0. Next scanline introduce extra delay of a couple of cycles such that the polling is offset a little. Even with that though, we're probably looking at accuracy that should be normal in the Y axis but probably still in the 8-16 colour-clock range in the X axis. Another though re determinimg PENH. A PMG collision could be set up - with 2 objects in a known position a delay loop until the collision registers can approximate where the beam was when detected. Edited February 22, 2014 by Rybags 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.