paulguy wrote:So, how does it work? Source code would be nice.
in case anyone cares....
ok, so it changes a DLL in zsnesw.exe (shell32.dll) to make zsnesw load my DLL instead (MULTMON.dll) that's more friendly to AV's instead of injecting into the app or something.... (and zsnesw only has one function from that shell32.dll so i just had to wrap it)
then it DETOURS.... DirectDrawCreateEx function... so that i can select a DISPLAY device to use (as the emulator is heavily tied to a single display device). all the info about resoluton and which display device to use (by partial name) is stored on zsnesw.cfg (i reused one of the graphic pack PATH's to store the display name... sorry if you would require that... i didnt wanted to save setting on registry or create a INI file just for a single setting).
so now i can move the window to the secondary screen and it will work... but if you're on windowed and try to move it will move on the main display... i couldnt really fix that, so instead i just "blocked" moving, by make it thinks the size of the screen is the same as the size of the window (by Detouring GetSystemMetrics). also i had to ClipCursor to reside inside the window only (otherwise when you leave the window it doesnt easily go back. because the zsnes emulates the mouse cursor inside it's window in a different way that again was not friendly to the secondary monitor.)
and last if you change the window (alt+tab) or something, i then disable the mouse clipping to the window, so you can use a different program hehee also if the window is moved to a different place, i will move it back to the correct display, because otherwise it will hang the emulator.
last... but not really necessary for this hack, i just had it for myself and ended being released along.... i detoured the DirectDraw::WaitForVerticalBlank... and "emulated" it slight different, so that waiting for vsync will not use 100% of a core (by using DirectDraw::GetScanLine), and that way allowing the emulator to work more smoothly with vsync even at "RealTime" priority without being too hard on the system.
i will update the third post to include the source code, since you asked... (and sorry if my explaining was too technical hehehe), it's made in Freebasic (which gives a hint on why i avoided just modifying zsnesw source or something (maybe?)), just need to clean up the code a bit, is still in a "hurry" state eheheh
