MegaDrive++ : new switchless region + IGR mod

Discussion in 'Sega Discussion' started by keropi, Apr 26, 2016.

  1. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
    I looked through the code and I plan to use the ATTINY2313A-SU in my build and just wondering if there is any modifications needed to the code like you mentioned above or is that specifically for the Nano board?
     
  2. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    @Stupid Dufus: If you can help testing the 6-button version it would be great. I'll have a look at your pics ASAP, can't see them from work :(

    @Helder: I would recommend against that. On the 6-button branch I have dropped support for all ATtiny's, I will only support the Nano if that branch gets stable, so you wouldn't get updates with the 2313A. If you go that way, there is no modification needed, just use the code from the master branch, but keep in mind that it has issues with 6-button pads and games, so only use it if you're not going to play those. Maybe I could add a way to disable MD++ (like "keep B pushed at power-up") to avoid issues with problematic games.
     
  3. Helder

    Helder Site Supporter 2014,2015

    Joined:
    Apr 6, 2013
    Messages:
    981
    Likes Received:
    54
    So what is the problem with the 6 button pads? is it the delay in reading the buttons? I read alot of the info on the 2 different controller configs and the 6 button is definitely more complex. Would holding the MODE button affect the function? Some problematic games with the 6 button pads would work if the MODE button was held on bootup.
     
  4. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    The only problem is that MD++ does not correctly detect button presses when a 6-button pad is used with a 6-button game. This means it can switch video modes or reset the console unexpectedly (although only the former has been reported). This is why I proposed a method to turn it off at power-on.

    Holding MODE would help as well, since that basically turns the 6-button pad into a 3-button one, but of course you lose the extra buttons. Besides that, some cheap 3rd-party 6-button controllers do not have the MODE button at all.
     
    Last edited: Dec 5, 2016
  5. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    OK, so, I've been doing some more optimization tonight, I think now what we need is that some more people try out the 6button branch. Any volunteers? ;)

    For those, the new Nano wiring diagram is as follows:
    Code:
                                     +-----+
                        +------------| USB |------------+
                        |            +-----+            |
         (Built-in LED) | [ ]D13/SCK        MISO/D12[ ] |
                        | [ ]3.3V           MOSI/D11[X]~| LED Blue
                        | [ ]V.ref     ___    SS/D10[X]~| LED Green
                        | [ ]A0       / N \       D9[X]~| LED Red
                        | [ ]A1      /  A  \      D8[ ] |
              Reset Out | [X]A2      \  N  /      D7[X] | Pad Port Pin 1
               Reset In | [X]A3       \_0_/       D6[X]~| Pad Port Pin 2
     JP3/4 (Video Mode) | [X]A4/SDA               D5[X]~| Pad Port Pin 3
       JP1/2 (Language) | [X]A5/SCL               D4[X] | Pad Port Pin 4
                        | [ ]A6              INT1/D3[X]~| Pad Port Pin 6
                        | [ ]A7              INT0/D2[X] | Pad Port Pin 7
                    +5V | [X]5V                  GND[X] | GND
                        | [ ]RST                 RST[ ] |
                        | [ ]GND   5V MOSI GND   TX1[ ] |
                        | [ ]Vin   [ ] [ ] [ ]   RX0[X] | Pad Port Pin 9
                        |          [ ] [ ] [ ]          |
                        |          MISO SCK RST         |
                        | NANO-V3                       |
                        +-------------------------------+

    @Stupid Dufus: Your console doesn't look much different from the PAL VA4 version, so I think you can follow these instructions.
     
    Last edited: Dec 6, 2016
    zeruel85 likes this.
  6. Koritha

    Koritha Member

    Joined:
    Nov 16, 2016
    Messages:
    16
    Likes Received:
    1
    Haven't had much time to look over this lately, or troubleshoot the previous instructions. However I am pleased to say the latest optimizations you've done work very well. Not sure if it was a mistake in my wiring the last time, but everything seems to work now.

    Tested SF2 with an official 6 button pad, works well with changing video mode and resetting. No weird glitches so far when I press multiple buttons together. Sonic 1 also works fine with the 6 button pad and 3 button pad. Will post if I do find any bugs from further testing. Have just done a quick initial test so far.

    Would just like to say thanks for the update to get this working better on 6 button pads. :)
     
  7. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    @SukkoPera , thanks for the reply.

    I wired it up using an Arduino nano, but it seems to be stuck in North America mode. The nano seems to get power, lights up, flashes a bit depending on buttons pushed. Currently only have Ecco Tides of Time to test for a NA cartridge. Plays just fine though otherwise.

    My 6-button is JP Virtua Racing, so can't comment on how that works yet.

    Holding reset or using button combinations doesn't seem to do anything. I'm guessing it's something to do with my wiring though. I'll have to check it out after work.
     
  8. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    Great to hear that, @Koritha! It's a bit weird, as I didn't expect this to solve your particular problems, but I guess that the final result is all that matters ;). Let me know if you stumble upon any bugs or weird behaviors.

    @Stupid Dufus: Does the L led light up for every single button you press on the controller? Making sure of that is the first step in debugging, which will tell you at least if the controller port pins are soldered correctly. I'll recheck your pictures ASAP. Also, did you use the above wiring? In that case, make sure that you flash the code from the 6button branch. Otherwise use the standard wiring with the master branch.
     
    Last edited: Dec 6, 2016
  9. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    I checked the wiring. I have controller pins connected, 5V, ground, reset in and out, JP2. I'm ignoring the RGB led and JP3/4 settings. Definitely using the 6-button branch with the wiring above.

    Now all D-pad directions, Start, A, B activate the L light. C activates the L and RX lights. XYZ and Mode don't make anything light up.

    Start+B+Left and Right seem to change something.

    Ecco Tides of Time US:
    Plays fine. IGR works. However, if I press Start+B+Left, then reset, it shows on screen in garbled text on top of the game screen the region-lock text. However, if I power off then on, it will still load and works fine... until I reset. Setting back to Start+B+Right fixes that and runs perfect.

    Virtua Racing JP:
    Hangs right away at the region-lock screen. When that happens, only the C button will activate any lights on the Arduino. Have to switch back to Ecco to change the region. Regardless of the setting, it doesn't help this game.

    Any suggestions on how to get VR working?

    I appreciate all the work everyone's put into this so far!
     
    Last edited: Dec 6, 2016
  10. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    X/Y/Z/Mode will only light the L led when a 6-button game is used.

    Can you try Sonic? That should work regardless of video/language modes, so you can see if the video mode actually changes.
     
  11. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Virtua Racing is a 6-button game. XYZ are used to adjust camera angles in-game. Can be played without them though on a 3-button pad.

    Unfortunately, I only have these two games at the moment with me. I should have the Sonic games arriving at the end of the year though.
     
  12. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    @Stupid Dufus: Are you sure you followed the instructions correctly? It looks like you didn't solder the JP1/2/3/4 points as per the instructions.
     
  13. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Sorry, should've mentioned the pics included my old physical switch mod! I'll get a pic up in the next day or so that should my current wiring for the MegaDrive++
     
  14. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    Well, if it worked with the manual switch mod, it has to work with MD++ as well!
     
  15. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Sorry for the delay! Busy past few days.

    [​IMG]

    JP1 White - A5
    JP4 Yellow - 5V
    JP3 White - GND
    JP1 Black - not connected
     
  16. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    So you're not connecting the video mode signal? What region was your console, originally?
     
  17. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Nah, not too concerned about 50/60hz PAL/NTSC switching.

    It's a Japanese console, and I think I'll only ever play JP/N.American games on it.
     
  18. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    OK, it should work nevertheless.

    I think the only way we can sort this out is that you enable debug mode and check on the serial monitor what is going on, see this post.

    At least, you should solder a (maybe temporary) led+resistor on pin A1 (or any free pin) and enable MODE_LED_SINGLE_PIN, so we can at least understand what mode MD++ is trying to impose.
     
  19. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Well, that was interesting. Plugged in to the serial monitor, everything all input shows up as random ascii characters, and they're never the same when a button is pressed.

    However, when connected with USB, the MegaDrive++ seems to work as intended. I can start up Virtua Racing and Ecco in their respective regions now, all buttons work. IGR works. Region-change with controller and reset work. And I get the appropriate region lock screens as I should.

    But when I re-attach 5V and disconnect the USB, it's back to acting weird.
     
  20. SukkoPera

    SukkoPera MegaDrive++/SMS++/NES++ Mastermind

    Joined:
    May 6, 2016
    Messages:
    152
    Likes Received:
    27
    Did you set the serial baud rate in the bottom right corner to 57600?

    Mmmmh, this is weird. I would suggest to check that there is actually 5V between the GND and +5V wires.
     
sonicdude10
Draft saved Draft deleted
Insert every image as a...
  1.  0%

Share This Page