As many of you know, I haven't been able to run VirtuaNES because it requires Windows and DirectX 7 and the Windows emulator*, Wine, for my operating system of choice (Linux) does not run it properly. This is what happens.
Wine complains that it can't instantiate class "3c305196-50db-11d3-9cfe-00c04fd930c5".
As Windows gurues know, this is the "GUID" for IID_IDirectDraw7.
Looking at the system registry file (system.reg) of Winex (a DirectX supporting version of Wine from Transgaming, nowadays known as Cedega), I found out something and decided to try.
Taking model of existing lines in the file, I added these lines to my system.reg file:
[Software\\Classes\\CLSID\\{3c305196-50db-11d3-9cfe-00c04fd930c5}] 1094168877
@="DirectDraw Object"
[Software\\Classes\\CLSID\\{3c305196-50db-11d3-9cfe-00c04fd930c5}\\InprocServer32] 1094168877
@="ddraw.dll"
"ThreadingModel"="Both"
I launched winex, and it worked!
Not.
This time the GUID for complaint was 25e609e0-b259-11cf-bfc7-444553540000.
So I added these lines to my system.reg file:
[Software\\Classes\\CLSID\\{25e609e0-b259-11cf-bfc7-444553540000}] 1094168877
@="DirectInput Object"
[Software\\Classes\\CLSID\\{25e609e0-b259-11cf-bfc7-444553540000}\\InprocServer32] 1094168877
@="dinput.dll"
"ThreadingModel"="Both"
Voila, it worked!
Not.
The complaint did not go away.
Winex started speaking of stubs.
So I went and looked at the Winex source code, and clearly as it was, the dinput code was all just stubs.
So I downloaded the standard Wine for comparison, and to my surprise, the dinput code was complete there.
So I discarded Winex and installed the standard Wine and now VirtuaNES works.
Not.
The complaint changed again.
So I went to have a look at how this Initialize() function works. To my surprise, all it did was that it returned an "already initialized" error code.
So I changed the routine to return D_OK instead and recompiled Wine.
I reinstalled the dinput.dll.so file and ran VIrtuaNES.
Now it works.
So what from now? Now I need to find out how VMV files are constructed and how to record video and sound from VirtuaNES. A quick test revealed that my existing method for Famtasia recording didn't work with VirtuaNES. It must be using some other system call than XPutImage.
*) I know, Wine Is Not an Emulator, but it does not matter in this context.