Final Fantasy Forums => Scripting and Reverse Engineering => Topic started by: DLPB on 2017-03-18 04:26:56
I know I can cheat using something like dxwnd, but I want to do this properly. I have spent a lot of time looking at the apis (like destroy / createwindow, which aali seems to use), setwindowpos, setwindowlong... you name it. But I clearly have no idea what I am doing. It's like the blind leading the blind.
The game starts full screen and I have no idea how to make the game work in a window. Aali's driver seems to destroy the initial window, and recreate it - but it's not as simple as that, since that alone just leaves a black window. So how is it done?
If anyone can help, then please do. Set ff7config to software mode (using nvidia tnt seems to work ok for me) or hardware nvidia tnt - and have a look at 6786bf.
For Direct3D, I guess you'd want to hook onto the IDirect3D9::CreateDevice method and edit the parameter passed into the D3DPRESENT_PARAMETERS struct, see:
I did have the offsets for the creation somewhere but I have no idea where they are at the moment.
As for the software rendering, I don't really know without looking at it.
Except this was created when DirectX 5 was the latest version. You'll have to find docs to those methods and replicate it with DX9 methods.
A lot of the mechanics of drawing seem to be related to absolute positioning on the screen. I don't know how well that'd translate to windowed coordinates.
oh god, I forgot it's that old xD.
All the DirectDraw/D3D init stuff starts at 0x00678079, no idea what the functions calls for the ancient versions look like though.
I'd guess you'd need the directx 5 SDK since I doubt there's much information around the internet still.
A long time ago in a galaxy far far away there was a patch for ff7 that made it windowed, what it was was patch the following bytes
RAW Offset | Old Byte | New ByteHope that helps. I no longer have the original patch i just have the patched EXE but i'm sure it exists out there somewhere.
002775A2 83 C7
002775A3 B9 82
002775A8 00 01
002775A9 75 00
002775AA 0D 00
002775AB 8B 00
002775AC 55 90
002775AD 08 90
002775B4 01 00
PS. Sorry i haven't been around much but depression and health problems have really gotten to me recently but trying to get back into things again.
After all these years, you're still solving issues :P
For testing purposes, the above will work well enough. The initial window remains open in the corner. The changes you gave me force it to stay on screen windowed.
Resizing this window to be larger than 640*480 using setwindowpos will result in invalid triangle error, though, because it still has everything set to that resolution.
The fix above is for D3D and not software mode.
doesnt ff7 work currently in windowed mode? Pretty sure that is how i run it.. (its been a while )
Only with aali's driver.