Jump to content
IGNORED

SNES2Atari Adaptor - Programming Interface


wavemotion

Recommended Posts

Greetings programs.

 

So for emulation purposes, I tried (unsuccessfully), to understand how the interface to the SNES2Atari adaptor works. My rough guess from looking at the 7800basic assembly is that it's done serially - clocking in and out bits to the adaptor to figure out what buttons are being pressed. I would imagine similar to how the SaveKey is interfaced. But it was a bit too much and overloaded my feeble circuits. I'm going to have another look at the code today with two cups of coffee to see if that helps improve my understanding.

 

In the meantime - is there a guide or topic (Google failed me) that explains it at a level where mere mortals can understand it?

 

I tried to find the code in A7800 but came up short there too. 

 

Thanks in advance for any help!

 

  • Like 1
Link to comment
Share on other sites

Documenting the SNES2Atari is still on my TO-DO list. I'll try to get it out this weekend.  Presently there's no support in A7800, and there likely won''t be in the short term.

 

You've grokked the driver correctly - it's a serial device, and the button data is latched and clocked in. I've attached @Danjovic's driver, (it's his design) which is simpler and has better comments than the 7800basic one.

 

 

[removed. The driver is now available at the wiki]

  • Like 5
Link to comment
Share on other sites

@RevEng I've got most of it worked out... question: is it expected that the SNES2Atari adaptor will only be used on Port 2?  Are there expectations for using it on Port 1 as well?  Will games generally use the auto-detection on both ports?

 

I'm excited to offer this in the future as a controller choice. A7800DS has the standard classic Nintendo controller layout which is identical to the SNES (D-Pad, ABXY, LSH, RSH, Start and Select) so this works out perfectly.

 

image.png.170f3c5f702d5067afdfd38297560e0d.png

  • Like 5
Link to comment
Share on other sites

That is a stunning development. :D

 

For various reasons, I don't think you can count on the snes2atari being in a particular port. e.g. If a game supports atarivox and snes2atari, then the snes2atari will almost certainly be expected to be plugged into port 1.

 

Does A7800DS pull and use controller info from the a78 header?

 

  • Like 1
Link to comment
Share on other sites

24 minutes ago, RevEng said:

Does A7800DS pull and use controller info from the a78 header?

Yes - though it only supports a few of the controller types right now. I'll be looking for 11 = SNES2Atari for both ports ... however, my emulator only really supports a single controller (being a single-player handheld) so ...  The user can override the controller type on a per-game basis.

 

Let me ask the question another way... if I only (for now) supported SNES2Atari on Port1... would that likely be usable on games supporting the controller scheme?

 

Lastly - the driver provided is well documented but is for Port 2. I assume for Port 1 it's just re-purposing the the UP/DN pins for P1 (instead of P2) and using the low bit in INPT4 instead of INPT5 as the serial shift feedback to the 6502 program?

Link to comment
Share on other sites

 

44 minutes ago, llabnip said:

Let me ask the question another way... if I only (for now) supported SNES2Atari on Port1... would that likely be usable on games supporting the controller scheme?

Yeah, but there may be exceptions. Sometimes authors put optional controllers on port 2, to avoid making the user unplug their main controller from the game. Having an oddball controller plugged into port 1 also makes it difficult or impossible to navigate flashcart menus, depending on the cart.

 

44 minutes ago, llabnip said:

Lastly - the driver provided is well documented but is for Port 2. I assume for Port 1 it's just re-purposing the the UP/DN pins for P1 (instead of P2) and using the low bit in INPT4 instead of INPT5 as the serial shift feedback to the 6502 program?

Yup to all of that, with the slight correction that it's the high-bit of INPT4/5 we're dealing with.

 

  • Like 1
Link to comment
Share on other sites

39 minutes ago, llabnip said:

It's working! Thanks again, @RevEng for the detailed responses and help with this.

 

Mike even went out of his way to provide me a little test program to help me get my logic right. The 7800 Community is lucky to have him!

 

image.png.99f2d4e64b1eda0ac3af458f7230b0f8.png

Well done! And yes we are very lucky to have Mike in our community 👏👏👏

  • Like 8
Link to comment
Share on other sites

  • 1 year later...

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...