Sunday, September 16, 2018

SEGA Mega Drive & Genesis Classics




3D Vision fix for SEGA Mega Drive & Genesis Classics. It includes useful extra features.

Update (2018-09-17): added the "h", "j" and "k" hotkeys for black frame insertion blending.

Update (2018-09-16): added the "n" hotkey for the new black frame insertion feature. I have noticed that the fix can't get your current resolution automatically if 3D Vision is completely disabled, so now I've added the possibility of a manual configuration that will be used in that case if resolution can't be detected automatically.

Update (2018-06-13): added the "3" and "4" hotkeys to handle games with diffent internal resolutions. You'll most likely never need to use "4". Just "3" for games with 256 horizontal pixels.


Fixed
- Thanks to DarkStarSword's Unity template and some little tweaks done by me, the game room is now fixed. This game uses Unity 2017.
- The emulator screen is now stereoized in fullscreen mode.
- Added scaling features.


Installation
- Download this file and extract its contents in the "Sega Classics" folder, where "SEGAGameRoom.exe" is.
- In the "SEGAGameRoom.exe" file, check the "Disable fullscreen optimizations" checkbox. If you don't do it, the Windows 10 1803 update (or later, maybe) will make the game crash.
- IMPORTANT FOR THE SCALING FEATURES: if 3D Vision is disabled in the Nvidia Control Panel, the fix can't calculate your resolution automatically. Open "d3dx.ini", lines 110 and 113, and change the "x3" and "y3" values to the horizontal and vertical resolution you are going to use. If 3D Vision is enabled in the Nvidia Control Panel, these values will be ignored.
- Launch the game, but not using the old game launcher. You need to use the virtual game room, which runs in DirectX 11. Make sure you're running it in fullscreen.
IMPORTANT: after the room has loaded, press F5 to fix some shadows (pressing it again will break them again. It's a toggle). I couldn't find a way to not depend on a hotkey. You need to do this every time you boot the game or every time you press F10 to restore default settings. But after that, the game is perfect.


Scaling features
Sega published this new virtual room recently, but there's something I missed compared to emulators like RetroArch: more scaling options. To be specific, perfect integer scaling. With the number keys from 3 to 9 you unlock and use these features that I made.

First of all, your aspect ratio has to be 4:3 or wider. My code can't handle correctly aspect ratio less wide than this.

My scaling options are made to only work when you use the emulator in fullscreen unless you press the "9" key. If you use that, you can affect the game room TV image, with funny results like this.

The first and simplest thing you need to do to make the emulator use a size and aspect ratio that is a perfect multiple of the native resolution of the console, just press the "6" key. The rest of keys are just extras.

With the first "7" key press, the emulator screen size is divided by 3 or 4 (the first it can find that is a perfect divisor), and with the second press you put the game at native resolution. Keep in mind that you need the "6" key too to achieve pixel perfection.

The "8" key is probable more interesting that the previous one. This one is about manual native resolution multipliers (remember that it depends on the "6" key too for perfect pixels) in case you want to play at some specific sizes. It goes one by one from x1 to x10. After that, it goes back to default. You can cycle backwards with shift + 8.

Some games have an internal resolution of 256x223.25 instead of 320x223.25. Some examples are Shining Force and Wonder Boy in Monster World. To have proper 1:1 pixel aspect ratio in these games, first have the "6" key enabled and then press "3". It toggles between assumed 256px wide and back to 320px wide. The "4" key can be used to assume 240 vertical pixels instead of 223.25, although I don't know if any game in this collection needs it.

If searching around wikis you still can't find if a game uses 256x223.25 resolution, using the x1 size multiplier you will notice right away (pixels will create a wave effect as you move).


Hotkeys (the numbers are not from the numpad)
- F1 or XB_RIGHT_THUMB: convergence presets. One of them will put the emulator screen at screen depth when you use fullscreen mode.
- F4 or XB_LEFT_THUMB: bloom presets that are in this order x0, x0.5, x1, x1.5, x2, x3, x4. The default preset is x1.
- 3: toggle to assume 256px wide instead of 320px. Not used by default.
- 4: toggle to assume 240px tall instead of 223.25px. Not used by default.
- 6: integer scaling toggle. Not used by default.
- 7: emulator image divisors (/3 or /4, and then native resolution). Not used by default.
- 8: native resolution multipliers. Not used by default.
- 9: this toggle unlocks emulator image modifications in the game room.
- n: black frame insertion, intended for 2D 120Hz users that can handle 120fps in the game room preferably (using fullscreen in the virtual TV massively reduces GPU requirements). Three presets (disable one frame, the other, and disabled), and it's disabled by default. This is possible because the emulator inside the virtual room creates duplicate frames to match your maximum fps. As with the PCSX2 fix, it can't know which frame is the original or the repeated one, so you have a preset for each frame. Video demonstration: https://youtu.be/VeaCrCfcKwM
- h: black frame insertion blending presets (10%, 20%, 30%, 40%, 50%, 60%, 70%, 80%, 90%, 100%, 0%). It's 0% by default. This feature uses a reduced brightness image instead of a totally black frame (when it isn't at 0%) to counter image retention. 10% and 20% do a good job about that, at the cost of some "ghosting" caused by the darker image.
- j: black frame insertion blending decrease when you hold this key, over a period of 3.33s if you are playing at 120fps. It's more granular than the "h" presets.
- k: black frame insertion blending increase when you hold this key, over a period of 3.33s if you are playing at 120fps. It's more granular than the "h" presets.


If you liked the fix and want to contribute for more future fixes, you can donate to this PayPal account: masterotakusuko@gmail.com

3 comments:

  1. When i saw the title of this game, i though "i'm sure Master otaku made it" and i was right^^ when i saw the autor.
    i know you are the specialist of emulation & "special" indie games :)

    Thank you

    ReplyDelete
    Replies
    1. Fix updated, in case you're using it already.

      If by "special" indie games you mean platformers or metroidvanias, yes :p.
      I wish there were more emulators to do 3D things with. There's something I have done about a 3D GBA emulator (that's where I first made most of my scaling code), but the emulator will supposedly be integrated into RetroArch soon (I don't know the date). That's where I'll check again my code again and release the fix on the blog (the standalone emulator has terrible sound quality).

      Delete
  2. hehe, yeah this needs to be played definitely in 3D ;D

    ReplyDelete