Jump to content
IGNORED

Joystick multiplexer help


gauauu

Recommended Posts

4 minutes ago, gauauu said:

I tried your chaser.zip on the physical quadtari, and it ignored joysticks 1 and 2, instead joysticks 3 and 4 controlled two characters each. (Don't have time right now to do any debugging, need to do my day job at the moment)

Sounds like your required delay is larger than what John found out. Interesting.

Link to comment
Share on other sites

Just now, Thomas Jentzsch said:

Sounds like your required delay is larger than what John found out. Interesting.

Yup. My guess (without further experimentation) is that it's based on the exact manufacturer/part of the multiplexers. I bet the slightly cheaper bulk order I did had slightly worse characteristics.

Link to comment
Share on other sites

30 minutes ago, gauauu said:

I tried your chaser.zip on the physical quadtari, and it ignored joysticks 1 and 2, instead joysticks 3 and 4 controlled two characters each. (Don't have time right now to do any debugging, need to do my day job at the moment)

Did you try the earlier one I posted that used 3 WSYNCs as a delay, or the most recent I posted to demonstrate the issue in stella with two WSYNCs?

Link to comment
Share on other sites

1 minute ago, Karl G said:

id you try the earlier one I posted that used 3 WSYNCs as a delay, or the most recent I posted to demonstrate the issue in stella with two WSYNCs?

I tested the 2 WSYNC version. Will try the other one later when I get a chance.

Link to comment
Share on other sites

I cannot assemble bBasic asm code, it is not DASM compatible ("unknown Mnemonic RETURN"). So you have to post the binaries. Or all files needed to assemble.

 

Warning: Unable to open '2600basic.h'
Warning: Unable to open '2600basic_variable_redefs.h'
Warning: Unable to open '4scores.asm'

 

The one ROM your posted (with two WSYNCs) behaves like gaugau described.

Edited by Thomas Jentzsch
Link to comment
Share on other sites

9 minutes ago, Thomas Jentzsch said:

I cannot assemble bBasic asm code, it is not DASM compatible ("unknown Mnemonic RETURN"). So you have to post the binaries. Or all files needed to assemble.

 

The one ROM your posted (with two WSYNCs) behaves like gaugau described.

 

My apologies. There were two dependencies that come with bB that were not included with my zip. This zip contains the binary as well as all the files needed to assemble with DASM only, I think.

 

 

chaser-two-wsync-and-dependancies.zip

Link to comment
Share on other sites

On real hardware, is the required delay the same no matter if you're setting or clearing VBLANK bit 7?


I would expect the delay to be longer when clearing the bit before you can read controller 1 and 3, compared to setting it to read controller 2 and 4, because  in the first case the 68 pF paddle cap inside the console needs to charge through the pullup resistor in the Quadtari (and on 6 switch and junior models there's an additional 1k8 resitor in series inside the console itself) until it reaches a high enough voltage for a logic "1", while in the latter the transistor inside the TIA pulls down the paddle lines directly.

 

 

Link to comment
Share on other sites

5 hours ago, alex_79 said:

On real hardware, is the required delay the same no matter if you're setting or clearing VBLANK bit 7?


I would expect the delay to be longer when clearing the bit before you can read controller 1 and 3, compared to setting it to read controller 2 and 4, because  in the first case the 68 pF paddle cap inside the console needs to charge through the pullup resistor in the Quadtari (and on 6 switch and junior models there's an additional 1k8 resitor in series inside the console itself) until it reaches a high enough voltage for a logic "1", while in the latter the transistor inside the TIA pulls down the paddle lines directly.

 

 

Hi Alex,

 

I'll have to test that; I was not aware that the delay could be different clearing or setting DUMPPORTS, but what you said makes sense.  For Galagon, WoW and ZK (which have been released with QuadTari support), I read controller 1 and 2 (those are read with DUMPPORTS=0) during Overscan and controller 3 and 4 (those are the additional joysticks available connected to a QuadTari) during VBlank, so all 4 controllers get read every frame and there is at least 30+ scanlines between reads.  I will try to do some tests this weekend to see if there is any difference going from 0->1 or 1->0 for DUMPPORTS when reading all 4 controls one after the other.

 

Thanks for the tips!

John

 

Link to comment
Share on other sites

On 2/4/2021 at 1:55 PM, Thomas Jentzsch said:

OK, got it working. Now I am going to analyze why Stella needs two full WSYNCs

 

tl;dr: Clearing bit 7 of VBLANK right after setting it may cause issues,

 

I think I may have figured it out. The batari Basic standard kernel (which I used for my test program) actually sets bit 7 as well when it turns on blanking after the visible screen, and right before it executes bB code in overscan. So, when I set VBLANK to 2, it still hasn't had the full scanline after setting bit 7 of VBLANK when I'm clearing it. I can kludge it by putting 2 WSYNCs before clearing bit 7 of VBLANK, then two after. For alternate frames where I'm setting bit 7 of VBLANK, I can just do the two WSYNCs without writing again to VBLANK.

 

As for the hardware test, perhaps there is an issue with clearing bit 7 of VBLANK very shortly after setting that bit, causing the hardware to not recognize it? I can test when I get my unit.

 

At any rate, it sounds like the proper way to fix it is at the kernel level, perhaps adding a kernel option for QuardTari that would alternate setting and clearing of this flag on alternate frames when starting overscan. I'll see if I'm up to that task. ? 

Link to comment
Share on other sites

7 minutes ago, Thomas Jentzsch said:

Stella also has a problem. The timing is not 100% precise here. We are working at it.

 

For now, make sure that there are at least 2 full scanlines between the write and the first read.

What I was saying is that I think the problem in Stella could be related to the fact that my demo ends up writing to VBLANK twice in a short period of time (once right before OS starts setting bits 6 and 7, then once almost right afterwards in my Basic code). If I remove one of these, the timing is as you described, needing only one full scanline to wait. Maybe that's a red herring, but I thought I'd mention it just in case.

Link to comment
Share on other sites

FYI, I have resolved my issues with batari Basic with a small kernel modification that will be rolled into a future release of bB. In short different versions of the bB kernel set VBLANK differently before overscan (where bB code runs), and setting then clearing bit 7 of VBLANK in a short time seems to cause issues. I've added the ability for a bB programmer to set what mode the controllers will be in for the next frame for consistency and simplicity.

 

Anyway, here's a small 4-player game that I'll document more in the bB forum. I've tested successfully in Stella and on real hardware as well. 

 

raindrops.bin

 

Edited by Karl G
Bugfix
Link to comment
Share on other sites

  • 2 weeks later...

Has anyone done a 7800 sample for the QuadTari yet? For that matter, does anyone else have both a QuadTari and a 7800 multicart?

 

I made a demo game, and the joysticks work fine, but the buttons do not. Button 0 does not register, and button one always seems to register as pressed. Maybe only the joysticks themselves are possible on the 7800, after all?

 

Anyway, here's my sample for the 7800 in progress so far. If the button worked, it could be used to restart the game if any player reaches 9 points (ending the game).

 

I'm pretty sure no 7800 emulator yet supports the QuadTari, but I have tested it on my 7800 with a Concerto cart.

 

1832355427_ScreenShot2021-02-20at2_48_16PM.thumb.png.30d94fb61a3b881b26f2fa4980088bc1.png

 

raindrops.a78

raindrops.bin

  • Like 1
Link to comment
Share on other sites

1 hour ago, Karl G said:

Has anyone done a 7800 sample for the QuadTari yet? For that matter, does anyone else have both a QuadTari and a 7800 multicart?

I have a QuadTari and plan to integrate it into 7800basic.

 

Are you setting the sticks to one-button mode? QuadTari doesn't support the paddle lines, which the two-button sticks use for the fire buttons.

Link to comment
Share on other sites

15 minutes ago, RevEng said:

I have a QuadTari and plan to integrate it into 7800basic.

 

Are you setting the sticks to one-button mode? QuadTari doesn't support the paddle lines, which the two-button sticks use for the fire buttons.

I have tried the default as well as explicitly setting one-button mode with no luck. Perhaps I'm just jumping the gun here and should wait for support to be integrated?  ?  Here's my source in case you would want to look at it (7800basic).

 

raindrops78.zip

Link to comment
Share on other sites

7 minutes ago, RevEng said:

Thanks, I'll have a look at it when I get a chance. This weekend is full of family obligations.

 

It may be a matter of the weird wiring on prolines just being incompatible, which would be unfortunate.

Thanks. This is definitely low priority in any case. I tried one button joysticks as well, and genesis compatible gamepads, both with and without a Seagull78 adapter. 

  • Like 1
Link to comment
Share on other sites

18 hours ago, Karl G said:

Has anyone done a 7800 sample for the QuadTari yet? For that matter, does anyone else have both a QuadTari and a 7800 multicart?

Hi Karl, thanks for the work testing 7800 games with the QuadTari! :thumbsup:  I do have a 7800 and an old CuttleCart that I haven't used in years but I'll dig it out and see if I can get it working.

18 hours ago, Karl G said:

I made a demo game, and the joysticks work fine, but the buttons do not. Button 0 does not register, and button one always seems to register as pressed. Maybe only the joysticks themselves are possible on the 7800, after all?

 

Anyway, here's my sample for the 7800 in progress so far. If the button worked, it could be used to restart the game if any player reaches 9 points (ending the game).

 

I'm pretty sure no 7800 emulator yet supports the QuadTari, but I have tested it on my 7800 with a Concerto cart.

 

 

Hmmm, unfortunately I don't know anything about 7800 programming but I figured that in 1 button mode the ports would be read the same as single button joysticks, especially sine Pro-line joysticks work fine with a QuadTari (single button only) for a 2600 game.  I'm not sure why it would behave differently for a 7800 in single button mode. ?  Pin 9 from the Atari is used as the select PIN and PIN 5 is disconnected (this allows you to detect a QuadTari at startup since PIN 9 is high and PIN 5 is low); perhaps having pin 5 disconnect is causing the issue?  Of course regular CX-40s don't even have pin 5 and pin 9 hooked up but still work on a 7800 game, so the only thing 'different' that the 7800 is seeing with a quadtari would be pin 5 being low instead of high.  I'm not a hardware expert but maybe that info will help figure out the issue. ?

  • Like 1
Link to comment
Share on other sites

  • 2 weeks later...

@Karl G  Hi Karl!  Were you able to make any progress with the joystick button for 7800 games in 1 button mode using the QuadTari?  I saw your raindrops game was played on ZPH but didn't get a chance to watch the show.

 

On my end, I dug out my 7800 and did a few tests; as expected, 2600 games in a 7800 work with any controller (included the Prolines, although only the left button works).  I was not able to find my Cuttlecart (it's been at least 10 years since I've seen it) but I did find Pole Position II (the only 7800 game I own) and similar to what you experienced, the button for the gas seems to be pressed all the time, the brake (button 2?) doesn't work but the joystick directions all work as expected.  Are there any 1-button 7800 games that anyone knows of (those that explicitly set it to 1 button mode) so we can at least see if the button works in that situation?

 

I did do a last test, and for that I disconnected pin 9 from the QuadTari and that stops the button from being pressed all the time.  This is with Prolines and regular CX-40's.  

 

Hopefully I can find my Cuttlecart and do some more testing, but if there are any 7800 software/hardware experts out there that know how the joysticks are hooked up physically and read internally that would be most helpful.  Obviously CX-40' s work on a 7800 but only button 1 registers (obviously) so that's being read from pin 6; I'm not sure how pin 5 and pin 9 are utilized in 1 button mode on the 7800.  

 

Anyway, hopefully this can be resolved or perhaps there's an adapter that can be added to wire the pins properly but keep the functionality of the QT.

 

Thanks,

John

Link to comment
Share on other sites

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...