Suddenly KEGA is slow

Discussion in 'Technical Discussion' started by redhotsonic, Apr 26, 2017.

  1. Mask of Destiny

    Mask of Destiny

    Tech Member
    87
    0
    6
    Kega has problems on Windows 8 and later because it uses old deprecated APIs like DirectDraw. DirectDraw has been deprecated for ages now. I think DirectX 7, which predates Windows XP, was the last version to include it. The reason for this is that graphics hardware has changed drastically since DirectDraw was designed. The fastest way to do 2D graphics on modern hardware is using a 3D API to draw textured quads whereas DirectDraw dates to an era when 2D blitting was king. While I'm not a huge fan of Windows 10 (or 8) some regressions in a really old, long deprecated API are not a particularly good reason not to like it.

    There are Genesis/MD emulators that are being actively maintained and don't use these old APIs. Is there some reason one of those wouldn't meet your needs?
     
  2. winterhell

    winterhell

    Member
    1,160
    0
    16
    If the problem is just poor support of DirectX7 / DirectDraw, would that mean that running Kega Fusion in an older OS in a virtual machine is going to run fast? Its not an ideal solution, but considering there are many classic DirectDraw games that required 10-100 time slower hardware why not.
     
  3. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,586
    7
    18
    United Kingdom
    YouTuber
    You know, I had a feeling DirectX (Draw) would be involved. I had to download a DirectX fix for Sonic Heroes to get that to run in solid 60fps.

    I use KEGA mainly because it's one of the few emulators that is closest to actual hardware but has the proper ratio (320x224). Regen is my 2nd choice which actually runs 60fps solid, but it's unable to display the correct ratio (okay, only by a few vertical pixels around 320x230, but for live streaming, I want everything to fit nicely and to not artificially stretch). Other emulators are either not great accuracy (Gens) or just too slow in general (Exodus).

    I've hacked Sonic 2 and literally drew a white background with a few black vertical lines to test the ratio. KEGA displays them perfectly, whereas Regen stretches it on a few vertical lines (perfectionist, I know!). When I get home tonight, I will post these pictures to demonstrate what I mean.


    So, using another emulator may solve the KEGA issue, but it still doesn't solve some fan games that I play (even Sonic ones like Sonic Time Twisted or Sonic Classic). Doing a quick Google search, changing the compatibility mode to Windows XP should help solve these issues... but it doesn't. Any other suggestions?


    winterhell, as for setting up a virtual machine, it may be okay for recording a video from time to time, but when it comes to live streaming where I need everything right there right now, it's too much of a hassle. But if it really does come down to this, then I may just try to downgrade to Windows 7 legitimately (last resort).
     
  4. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,586
    7
    18
    United Kingdom
    YouTuber
    Sorry for the double post, but it's in case people have already read and wanted to see what I meant with the ratio:

    KEGA:
    [​IMG]

    Regen:
    [​IMG]


    In fact, after examining it, Regen is stretching because even though I picked 640x480, it's actually displaying 650x488. No wonder why it doesn't look right.


    Also, after doing a lot of Googling, it seems like my only option to fix this (not just for KEGA), is to either downgrade or use a VM. But I don't know if ShadowPlay works on VMs...


    EDIT: Unless it's good luck so far, putting compatibility mode to Windows XP SP3 AND "Disable display scaling on high DPI settings" is giving me solid 60fps on KEGA so far. And on Sonic Time Twisted. It might just be the PC playing ball today and will report back if anything changes (seeming as I don't know how the "Display scaling" would actually help...
     
  5. winterhell

    winterhell

    Member
    1,160
    0
    16
    ShadowPlay can record anything you see on the desktop. It actually grabs the buffer/screen that is going to be sent to the GPU and encodes it. It supports Twitch streaming as well.

    Do you know if there is a way to increase the window resolution of Kega Fusion above 1600x1200? I prefer to play windowed but my screen has a high resolution.
     
  6. Mask of Destiny

    Mask of Destiny

    Tech Member
    87
    0
    6
    Regen and vanilla Gens (i.e. not a fork like Gens/GS as some of those have seen updates much more recently) are just as old and unmaintained as Kega. The two most actively maintained Genesis emulators at this point are probably Genesis Plus GX (already mentioned earlier in the thread by Shalpp) and BlastEm (which in the interest of full disclosure I am the author of). Genesis Plus GX is an excellent emulator that supports everything Kega does with the exception of the 32X. While it only has a line-based renderer, it is otherwise very accurate (more so than Kega or Regen). BlastEm has a slot-based renderer and is in some ways more accurate than Genesis Plus GX, but is also a bit less mature so it is slightly less compatible at the moment. It also only supports the Genesis and SMS (specifically a Genesis in SMS mode). If you do decide to try it, I recommend grabbing the latest nightly build (should be dated May 5th) as the last stable release is quite old now.

    Neither of those require a particularly fast machine.

    Seems like you may have a solution now, but if that doesn't work you can try grabbing this DirectDraw re-implementation. It's oriented towards the C&C series, but it might work with other DirectDraw software.
     
  7. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,586
    7
    18
    United Kingdom
    YouTuber
    Sorry, very busy weekend!

    Well, since enabling Windows XP and disabling DPI, Kega has been a solid 60fps 99% of the time. It eventually goes to 55fps for about 15 seconds then goes back to 60fps (sounds like a service in the BG slows it down temporarily). Otherwise, it seems to have been fixed. This has also fixed Sonic Time Twisted, but Sonic Heroes was still losing frames. So it seems to work for some games. At least that's something.

    Thanks for the other emulator suggestions. I will give them a try and will see how they turn out. And for the directdraw thing, that's cool that exists, and I will try it on Sonic Heroes this week and will see if that helps (it's close to my wedding so it's a matter of finding time to do this now) :)
     
  8. Just weighing in here, but personally I still use Kega still for one reason; all the options contained in the various menus. The main options that interest me are are in regards to using and creating cheat codes (Game Genie or Pro Action Replay). I have a ton of .pat files for Kega containing lots and lots of various cheats. Now, I'm fully aware of all other emulators (Exodus, Genesis Plus GX, BlastEm, higan, etc.) and have explored them all, but none of them is good enough (on the PC) to satisfy my needs for an emulator. The closest thing that can is Genesis Plus GX running on a Nintendo Wii, which works out great! On the PC? Nope, for any meaningful gameplay it requires a frontend like RetroArch (I really, really hate frontends - I like menus with options, configuration windows with tabs, etc.). There is an exception here; BizHawk. From what I can tell, it's the closest thing to Kega in terms of having a crap ton of options and configuration, but it's not perfect. For example, I can't use the Kega generated .pat files in BizHawk - it would require me to manually port all cheats over to BizHawk (there's no converter, sadly). I just don't have the time to do this! Secondly it uses a forked, semi-out-of-date version of Genesis Plus GX that hasn't got any of the improvements and fixes Eke has done to the main branch (except for SVP fixes).

    Bottom line for me: Frontends are unacceptable, being able to use cheat codes and/or create cheat codes is an absolute, the more options the better, so I'm stuck. I just really hope Snake comes back some day and updates Kega again or somebody releases a Genesis emulator that can properly rival and replace Kega completely.
     
  9. Brainulator

    Brainulator

    Regular garden-variety user Member
    229
    0
    0
    Would it be wise to seek troubleshooting for a different problem with Kega Fusion here or in a separate thread?
     
  10. nineko

    nineko

    I am the Holy Cat Tech Member
    To be honest, I actually wondered why this topic is in E&RE and not in General Gaming or in Technical Discussion, since it doesn't relate to Sonic hacking but it's rather about Kega and Windows 10 themselves, I kinda wanted to post about it since a few days ago, but I also didn't want to minimod so I never did. I don't know about RHS's stance on this matter, but now, with Brainulator's potential question out there, I'm even more convinced that this topic should be moved to either General Gaming or Technical Discussion (probably the latter).
     
  11. Brainulator

    Brainulator

    Regular garden-variety user Member
    229
    0
    0
    I'd say the latter would be more appropriate, since we are discussing the technical side of a desktop application. Truthfully, I don't think it's mini-modding if you phrase it as a suggestion or question and not a command.

    EDIT (so as to annoy no one: redhotsonic answered my question via PM :specialed: )
     
  12. I was wondering that myself. Also the Regen on Windows 10 topic could probably be moved as well.
     
  13. Chibisteven

    Chibisteven

    Member
    1,293
    6
    18
    US
    It runs a solid 60 FPS full screen on my computer (using an i5 7500 Processor, 16 GB RAM, AMD Radeon RX 480 8GB).

    Some settings to try in the config file:
    ForceCompatibleGFX=0
    CompatibleGFXOpt=0
    EnhancedGFXOpt=0
    ForceFullScreen32=1
    VistaAeroIgnore=1
    VistaNoWndVSync=1
    DebugFlags=0,0,2,2

    Under options make sure both "High Priority" and "Alternate Timing" are enabled.
     
  14. DarkVDee

    DarkVDee

    Duke of Tiles and Palettes Member
    314
    1
    18
    California
    Sonic DVD [CD2]
    This works really well for me. Now it's playing like how it's suppose to be :) Thanks man
     
  15. redhotsonic

    redhotsonic

    Also known as RHS Tech Member
    1,586
    7
    18
    United Kingdom
    YouTuber
    But are you using Windows 10? =P I've had these settings already (except for the Aero bit so thanks for that). But when I tried messing around with the ini before, nothing would work.


    But I will say my earlier suggestion:


    This has been working for everything except Sonic Heroes. Kega, Sonic fan games, old Windows 95 games, etc, etc, all work fine. In the extreme rare case, it will lose some frames again and go to 55fps for a few seconds then go back to a solid 60fps. So I think I can safely say, I'm now satisfied :)

    Thanks for all the advice, guys!
     
  16. While I had perfect frame rates on Windows 10 already, the above settings did allow my Kega Wine on Linux copies to obtain full speed without issues so thank you for that. Sadly, that performance increase didn't apply to Wine on macOS (yet, I think it's the Wine version at fault here).

    EDIT: Fixed Kega on macOS, YAY! Kega running on Windows, macOS (with Wine), Arch Linux (with Wine) and Ubuntu (with Wine) run perfectly now.
     
  17. Herm the Germ

    Herm the Germ

    Hmm, not bad. Well done, doctor! Member
    1,482
    0
    0
    Dresden, Saxony, Germany
    MIDI-to-SMPS-conversions, mostly. Takin' requests, too.
    Might be interesting to some people on here to know what you did to do so. o3o
     
  18. Use PlayOnMac, download and install 2.5-staging (via Manage Wine versions), create a new virtual drive for Kega/emulators, don't use any Winetricks, add Kega's folder of executables and needed files somewhere on the virtual drive (I use Program Files - also set the settings above in Fusion.ini if one is created), under Configure Wine for the virtual drive go to the Staging tab and enable all three available settings.

    From there, open Kega, enable alternate timing and high priority and go to the races. Works great.
     
  19. Meat Miracle

    Meat Miracle

    Researcher
    1,654
    4
    18
    The only problem I have with Kega on Win10 is that windowed mode seems to skip a ton of frames despite saying 60fps, and that fullscreen switching takes something like 5 seconds. I chalk up both of these to videocard drivers, since it affects quite a bunch of other stuff too. Other than that it works perfect, no compatibility options are used at all, everything works properly.

    An updated with proper direct2d window mode and borderless fullscreen would be indeed great.
     
  20. ashthedragon

    ashthedragon

    Dragon Team Researcher
    1,340
    2
    18
    Spain
    Sonic Paradise & Sonic Ages
    Sorry to bump this but I'm having some trouble with Kega Fusion, running under Win 7. I put Kega on a fresh Win 7 install, but for some reason it is skipping frames. Also, half of the video options are gone, you can only select between TV mode, Scanlines mode, double and normal rendering modes. No force NTSC aspect or any other video options. I tried Chibisteven's config commands and it runs at 60hz now ( it was stuttering between 58-60) but it is still missing frames for some reason. Any help?