MegaDrive++ : new switchless region + IGR mod

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

  1. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    The correct pin to solder pad port pin 9 is RX0, TX1 must have nothing connected. For some weird reason, TX1 is the first pin on the Nano, and RX0 is the second, but RX0 is still the correct pin to solder to.

    @Stupid Dufus: I have pushed yet some changes for you, can you please try the latest version from the lcd_support branch? BTW, what does the LCD say? Please also test with the LCD disabled (i.e.: Comment out ENABLE_LCD).
     
  2. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Hi, it's me again =P

    Connected wire back to RX0.

    I don't have an LCD, so I can't test that part. Also, when trying to compile with the flag enabled, got this error:
    Arduino: 1.6.13 (Windows 10), Board: "Arduino Nano, ATmega328"

    MegaDrivePlusPlus:226: error: 'POSITIVE' was not declared in this scope

    LiquidCrystal_I2C lcd (0x3f, 2, 1, 0, 4, 5, 6, 7, 3, POSITIVE);

    ^

    H:\megadriveplusplus\MegaDrivePlusPlus\MegaDrivePlusPlus.ino: In function 'void setup()':

    MegaDrivePlusPlus:228: error: no matching function for call to 'LiquidCrystal_I2C::begin(int, int)'

    #define lcd_start() do {lcd.begin (16, 4); lcd.clear (); lcd.home ();} while (0)

    ^

    H:\megadriveplusplus\MegaDrivePlusPlus\MegaDrivePlusPlus.ino:513:2: note: in expansion of macro 'lcd_start'

    lcd_start ();

    ^

    H:\megadriveplusplus\MegaDrivePlusPlus\MegaDrivePlusPlus.ino:228:42: note: candidate is:

    #define lcd_start() do {lcd.begin (16, 4); lcd.clear (); lcd.home ();} while (0)

    ^

    H:\megadriveplusplus\MegaDrivePlusPlus\MegaDrivePlusPlus.ino:513:2: note: in expansion of macro 'lcd_start'

    lcd_start ();

    ^

    In file included from H:\megadriveplusplus\MegaDrivePlusPlus\MegaDrivePlusPlus.ino:213:0:

    C:\arduino-1.6.13\libraries\LiquidCrystal-I2C/LiquidCrystal_I2C.h:76:7: note: void LiquidCrystal_I2C::begin()

    void begin();

    ^

    C:\arduino-1.6.13\libraries\LiquidCrystal-I2C/LiquidCrystal_I2C.h:76:7: note: candidate expects 0 arguments, 2 provided

    exit status 1
    'POSITIVE' was not declared in this scope

    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.

    Still the same results. Not setting the LANGUAGE_PIN setting fast enough.
     
  3. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    Well, I just got Virtua Racing JAP off eBay. I'll do some tests as soon as it gets here.
     
  4. MoockyLoock

    MoockyLoock Robust Member

    Joined:
    Apr 22, 2015
    Messages:
    264
    Likes Received:
    49
    I bought an LCD screen. I hope to get it not so late.
     
  5. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    I don't think it's limited to just that game though. When setting the language to Japanese, the North American copy of Ecco 2 still starts up, though it shouldn't.
     
  6. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    You're probably right, but hopefully the problem is the same for all games. I just need one game that triggers it, as all those I currently have are working fine.

    I am a bit afraid tho, as I am currently setting lang/mode as soon as I can in Arduino. I can still squeeze out some fractions of a second, but I might have to alter some things deep in the Arduino core if that is not enough :(.

    What happens if you press reset when VR displays the wrong region screen?

    @MoockyLoock: It's never too late :). Though your problem is weirder, the wiring looks fine to me.
     
  7. MoockyLoock

    MoockyLoock Robust Member

    Joined:
    Apr 22, 2015
    Messages:
    264
    Likes Received:
    49
    That's the point. My wiring seems good to me too.
    I'll wait for LCD, then swap for a fresh Nano
     
  8. Stupid Dufus

    Stupid Dufus Site Supporter 2017

    Joined:
    Jul 18, 2006
    Messages:
    145
    Likes Received:
    0
    Resetting on VR still brings up the region lock screen when it's set to JP mode.

    Ecco is a bit different. Powers up fine, but if in JP mode and I press reset, it freezes and won't read reset again until I power off and on.
     
  9. MoockyLoock

    MoockyLoock Robust Member

    Joined:
    Apr 22, 2015
    Messages:
    264
    Likes Received:
    49
    'llo here.
    Just for reminder, is gihub up-to-date about your code ?
    U should get my screen soon, and so stat this project with a new step :)
     
  10. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    It's up-to-date, just make sure to get the correct branch and match the wiring. Currently I would recommend the lcd_support branch, it's the one where I have worked most recently. The wiring is the same as 6button but with A2-A5 shifted to A0-A3.
     
  11. jaskamakkara

    jaskamakkara Tinkering in the dark

    Joined:
    Aug 23, 2013
    Messages:
    140
    Likes Received:
    5
    Hi!

    I was hoping someone could help me with my installation - I have made a video to describe my problems so I won't bother to explain them in writing, please take the time to watch the video if you think you are capable of helping :)



    The firmware I used was from the lcd_support branch (retrieved 24/02/2017), one question I have is what is the readpad.S file for? Is it required for something?

    The wiring scheme I used was also from the ino file in the lcd_support branch, for the Arduino Nano:

    [​IMG]

    I tried changing the +5V to the Vin pin, and that made it so the Nano didn't seem to power up (at least the LED never came on).

    I have checked my wiring, it all seems to be correct - I am wondering if it's my Nano that is no good. There seems to be quite a few different versions of this mod, all with different wiring diagrams so I am wondering also if I could simply be using the wrong wiring scheme... Anyway, if someone can help then it would be very much appreciated!
     
  12. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    The readpad.S contains the pad reading routine, which I had to write in assembly language to make it fast enough to read 6-button pads properly, so it is absolutely required, you must place it in the same directory as MegaDrivePlusPlus.ino while compiling/flashing. Please make sure to do so, I think that's your problem.

    If no game is inserted, some buttons (namely A and Start) won't light the button led which, by the way, is NOT the led that lights up when you press C (which is labeled RX, I think), but rather the one labeled L. These buttons won't either light the led when games are not polling the controller. This usually happens during screen transitions and such.

    I know there's a horrible mess at the moment with different versions and wiring. I plan to converge to the lcd_support branch, but it seems everybody is having issues with it, so we must iron those out before that can happen. I'm still waiting for my Virtua Racing JAP to arrive, though :(.

    On a side note, @MoockyLoock: did you get the readpad.S file yourself?
     
  13. jaskamakkara

    jaskamakkara Tinkering in the dark

    Joined:
    Aug 23, 2013
    Messages:
    140
    Likes Received:
    5
    OK, great - I added the readpad.S file to the same folder, compiled and reuploaded it to the Nano and now it works! Thanks! I'm not an expert with Arduino stuff so it was my bad.

    Only problem I'm having now is with the screen positioning - maybe it's just my TV, but it has coped fine with PAL60 signals from my modified SNES and other consoles in the past, so it's strange. I have attached a couple of photos to show what I mean:

    PAL mode:

    [​IMG]

    NTSC (USA) mode:

    [​IMG]

    As you can see, the PAL mode is OK (it's a little off centre), but the NTSC mode is quite far off to the right - is this normal?

    If I change the zoom mode on the TV it doesn't help to show any of the screen that's been cut off, it seems that the actual signal is missing that part of the screen or something.

    Anyway, if anyone has any insight into how this can be remedied I'd be grateful.
     
  14. MoockyLoock

    MoockyLoock Robust Member

    Joined:
    Apr 22, 2015
    Messages:
    264
    Likes Received:
    49
    Holly sh*t, no ! Didn't know it had to be in the same fodler as MegaDrivePlusPlus.ino.
    Thing is, when you open MegaDrivePlusPlus.ino, the soft moves it in a folder named "MegaDrivePlusPlus", but it doesn' t move that readpad.S file.
    So, even if it sounds dumb, it's still a good news.
    I'll give a try hopefully in the week, this WE else.

    May I tell you something ? I think the informations are a bit too spread in the whole thread/PM/Github/Wiki.
    Maybe it would need some summarization. Some mandatory informations like "disconnect your controller for flashing", and readpad.S in the same folder as MegaDrivePlusPlus.ino.

    See ya later, and keep on the good job.
    PS : Still waiting for my screen :)
     
  15. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    @jaskamakkara: I can't help you much with that. MD++ only tells the console to switch to NTSC mode, it has no control on the signal that the console actually generates, so it cannot center the display. Anyway all my consoles generate slightly different signals, luckily I run them through an upscaler so I can correct the image a bit.

    @MoockyLoock: Then it's certainly the issue, please try with readpad.S. You are right that the documentation is quite messy at the moment, but the wiki is up-to-date with the "stable" version from the master branch. Once all issues with the lcd_support branch are solved it will become the master and I will update all docs. Currently it's all work in progress, as we are basically doing development right here :). Let me know if you manage to solve your issue!
     
    jaskamakkara likes this.
  16. MoockyLoock

    MoockyLoock Robust Member

    Joined:
    Apr 22, 2015
    Messages:
    264
    Likes Received:
    49
    AH AH
    So finally, do i follow the master or the LCD branch (so we work in the same direction) ?
     
    Last edited: Feb 27, 2017
  17. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    Please use lcd_support only, master is old and deprecated. But basically, your issue is what is preventing me from making lcd_support the main branch, so the sooner we solve it, the sooner it will all get better ;).
     
  18. jaskamakkara

    jaskamakkara Tinkering in the dark

    Joined:
    Aug 23, 2013
    Messages:
    140
    Likes Received:
    5
    Yeah, that's fine I expected that it wasn't anything to do with the mod. Perhaps I will look into running the video through a processor (like a HDMI converter or something) to see if it makes it better, otherwise it's still perfectly playable. I will also dig around online to see if anyone else has had the same issue.

    Thanks for a great mod, by the way, works brilliantly (once you know how to use an Arduino!). :)
     
  19. SukkoPera

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

    Joined:
    May 6, 2016
    Messages:
    137
    Likes Received:
    25
    What I can't really understand is why the reset button stops working if readpad.S is not included. It doesn't really make sense! I'll look into it.
     
  20. MoockyLoock

    MoockyLoock Robust Member

    Joined:
    Apr 22, 2015
    Messages:
    264
    Likes Received:
    49
    hay SukkoPera, what's up ?
    :]
     

Share This Page