Cycle accurate Mega Drive emulation

Discussion in 'General Sega Discussion' started by Nemesis, Apr 9, 2013.

  1. The Taxman

    The Taxman

    Tech Member
    673
    2
    0
    Retro Engine & Related Projects
    Working great now, thanks. I figured I already had the runtime since I have a newer version of Visual Studio but I guess not :v:
     
  2. Nemesis

    Nemesis

    Tech Member
    Just checked this out, this is happening because I haven't emulated the bankswitching hardware yet for games that map SRAM into the same region as ROM data, and this Sonic 3 prototype is 4MB in size. You can correct this manually in order to get the game to load if you want.

    When you load a ROM file using the "Open Mega Drive ROM" option, what actually happens is that an xml module definition is automatically generated and saved into your "Modules" folder, under the "AutoGenerated" directory. You'll find the module definition for the Sonic 3 prototype ROM there. Open the xml file up, and remove the last two "BusInterface.MapDevice" lines from the file. Now load this file using "File->Load System/Module" instead. The game should now run, albeit without SRAM support. You'll also have to unload the ROM manually using "File->Manage Modules" before you can open another game using the "Open Mega Drive ROM" option.
     
  3. Namo

    Namo

    take a screenshot of your heart Member
    2,912
    0
    0
    Aw, sadly it doesn't run at full speed on my PC. I got about 55 FPS average on Ecco. Oh well, I don't really need a perfect emulator anyway, the only rom I personally know of that has noticeable problems on the big two emulators is Pacman 2.

    I don't mean to undercut what you've done here though, it's incredible and important work. Hopefully someday emulators with perfect accuracy will be the norm.
     
  4. Nemesis

    Nemesis

    Tech Member
    I think you'll find that's actually correct. A six button control pad is being loaded by default, and this is one of the few Mega Drive games that doesn't behave correctly with the 6 button control pad I believe. On the real hardware, you can hold down the "Mode" button when powering the system on to make it act like a 3 button controller to work around this problem. I haven't fully emulated that feature of the six button pad yet, so for now, you'll have to either load a 3 button controller instead, or just struggle through with the 6-button pad. To load a 3 button controller, go to "File->Manage Modules", unload the 6 button controller, and select the 3 button controller module and load that instead, mapping it to the first control port.
     
  5. winterhell

    winterhell

    Member
    1,165
    7
    18
    Thanks but I still cant go left/right on the Character select screen.
    Also is there a way to enforce Nearest Neighbor filtering?
     
  6. I don't believe so, since it's trying to accurately emulate the Genesis/Mega Drive and not alter the image in any way like that. [​IMG]
     
  7. Nemesis

    Nemesis

    Tech Member
    Is that true even when a 3 button controller is loaded? I'll take a look, see if there's anything unusual going on here.

    There's no control over filtering right now, and no advanced filtering options. I'm relying on the graphics hardware to perform bilinear filtering to scale the image to the correct size.

    You might not actually want nearest neighbor filtering though. One thing you may not realize is that in H32 mode, the VDP effectively has non-square pixels. These can't be represented on a normal PC monitor. If you want to keep the correct image aspect ratio in H32 mode, you need to perform some kind of resampling. The real video signal is also inherently "blurred" in the horizontal direction too, and many games rely on this blurring effect. You'll see a lot of games, like Aladdin, that use dither patterns extensively, and rely on the analog nature of the video output to blur these pixels together to produce an apparent even colour. In reality, a filtered image is more true to the hardware than a simple dump of the raw pixels.

    All that said, there is a need for much more extensive image filtering options. I'm planning to allow shader-based filters to be applied to the image output, so basically any kind of filtering you want could be added, and new filters could easily be written by anyone and loaded in. If this is something you really want to see happen, feel free to add it to the suggestions page.
     
  8. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    Seems like my hack doesn't want to know with this emulator, same with my other hack "Sonic 2 Time Attack". S3 and S3K doesn't want to know either. So guessing this is an SRAM issue. I don't want to switch SRAM off for any of these games so these are un-playable.



    I tried Sonic 2 and Sonic 3D blast and World Cup Italia '90 and it loads, but goes around 15fps, and my laptop is no slow-bug. I couldn't see a setting to change the fps?


    Also, when I load any game, there is a very high pitched sound permanently there, even after you've closed the ROM. The noise will go when the emulator has been closed.
     
  9. Aerosol

    Aerosol

    FML and FU2 Moderator
    10,619
    83
    28
    Not where I want to be.
    Sonic (?): Coming summer of 2055...?
    My Pentium P6100 equipped laptop crumbles at the might have Exodus. Which is fine, of course. Checking out all the debug was fascinating!
     
  10. Infiniti

    Infiniti

    ↑ & ↓ & ↻ Member
    476
    0
    0
    UK
    I'll be checking it out later on my i5 laptop, I can't wait to see how far this project has come since the 07 release. Hopefully everything will run smoothly. Joined the forums for now though.
     
  11. Techokami

    Techokami

    For use only on NTSC Genesis systems Researcher
    1,319
    10
    18
    HoleNet!
    Sonic Edge
    What the heck?! I have a Core i7 860 Quad Core CPU clocked at 2.80GHz per core, with 8GB RAM, and Exodus chugs! There goes any idea of playing games on this thing.
     
  12. An i5? What clock speed? I suspect you won't get full speed in Sonic 2, sadly.

    Yeah, it'd probably need to be around 3.5GHz. High requirements indeed!
     
  13. Meat Miracle

    Meat Miracle

    Researcher
    1,654
    4
    18
    Sorry, that was just my professional side talking. I consider Joomla to be waaaay too huge for a site with only a few small pages, newsposts, and an image gallery... It's more suited for big, multi-user managed portals from my experience. However, it might be a good foundation for the future if your emulator ends up as big as it has the potential to.

    You can upsample it to 1280x960 minus borders, which would be (4x horizontal) x (4x vertical) in H40 mode but (5x horizontal) x (4x vertical) for H32 mode.
     
  14. Aesculapius Piranha

    Aesculapius Piranha

    つづく Oldbie
    4,323
    32
    28
    Unknown
    Diva
    Still looking forward to one day playing Saturn games on this via supercomputer. XD

    Anyway I can't wait till later to fiddle with all the debug stuff. That is what is exciting about this. Well, that and accurate sound emulation.
     
  15. That's about what you'd need for cycle accurate Saturn emulation.
     
  16. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,587
    9
    18
    United Kingdom
    YouTuber
    I have i7 quad core 2670QM at 3.1GHz per core, 8GB RAM and a SSD instead of a HDD, and I struggle to get 18fps! So you're not the only one =/
     
  17. winterhell

    winterhell

    Member
    1,165
    7
    18
    I wonder how many cores can it use. I'm with a tri-core i5 2500K at 4.0GHz and don't always have full speed.
     
  18. Meat Miracle

    Meat Miracle

    Researcher
    1,654
    4
    18
    You might have a core disabled there. 2500K is quad core, and at 4ghz it should be able to run everything full speed (my 3570k at 3.8ghz can do that).
     
  19. Overlord

    Overlord

    Now playable in Smash Bros Ultimate Moderator
    17,976
    236
    43
    Berkshire, England
    Learning Cymraeg
    Core2Quad Q8300 at 2.5GHz per core with 4GB of RAM and I get a more-or-less solid 33fps, so yeah, you're not the only one in this boat. =P To be fair, this machine I have had over 3 years now, so isn't exactly what you'd call cutting edge. Not unexpected for something at this accuracy level, mind.
     
  20. winterhell

    winterhell

    Member
    1,165
    7
    18
    Yeah I know, one of the cores bit the dust. Was over 6 months at 5.0GHz Turbo Boost stable(idle at 1.6).