Qhimm.com Forums

Miscellaneous Forums => Scripting and Reverse Engineering => Topic started by: syLvia on 2008-06-10 13:32:13

Title: ff8 window mode concept?
Post by: syLvia on 2008-06-10 13:32:13
greetings to all. i'm an ff8 lover and ive been trying to make my own ff8 window mode app. i know ff8w does the job but i'd like window mode to be part of my app which will do other stuff in the future.

i opened ff8w.exe in IDA and this is what ive recreated in c++
Code: [Select]
//shellexecute..
//waitforinputidle..

HWND FF8Wnd = FindWindow("DEFAULT CLASS", NULL);
ShowWindow(FF8Wnd, 0);
RECT Rect;
GetWindowRect(FF8Wnd, &Rect);
Rect.right = GetSystemMetrics(SM_CXSIZEFRAME) + 2;
Rect.left = (GetSystemMetrics(SM_CXSCREEN) - Rect.right) / 2;
Rect.bottom = Rect.bottom + GetSystemMetrics(SM_CYCAPTION) + GetSystemMetrics(SM_CYFRAME) + 1;
Rect.top = (GetSystemMetrics(SM_CYSCREEN) - Rect.bottom) / 2;
SetWindowPos(FF8Wnd, HWND_TOPMOST, Rect.left, Rect.top, Rect.right, Rect.bottom, 0x40);

when i run my app, a black window that's not fullscreen did appear for 1 second before the game became fullscreen and showed the sq soft intro. guess i wrongly assumed that dx scales the game to window size. am i missing certain things? must i also hook ddraw&d3d?

here's a copy of ff8w if it helps at all, http://www.filesend.net/download.php?f=5950ed718535736e59ee81f11d0ca5fe
thanks in advance

edit:
if ddraw&d3d hooking is required, please state the relevant functions if it isnt too much work.
i'm unfamiliar with dx so here are my guesses, that ff8 uses ddraw for background and d3d for models?
ddraw's createsurface, and Lock() <-- to draw overlays
d3d's setviewport maybe?

thanks again!
Title: Re: ff8 window
Post by: freezingicekirby on 2008-06-10 14:21:03
Well... I hope you succeed... and though I can't really help, I can cheer you on  :-D

Lets just hope that if it goes into Windows-Mode, the same doesn't happen like when Metal Gear Solid PC goes into Windows Mode...

(http://i113.photobucket.com/albums/n228/freezing_ice_kirby/mgsbadcolors.jpg)
Title: Re: ff8 window
Post by: syLvia on 2008-06-10 15:20:05
thanks  :-) dont think that happens. at least ff8w does it perfect if not for some straight lines turned crooked
Title: Re: ff8 window mode concept?
Post by: Cyberman on 2008-06-10 21:46:40
FF7 uses DX6 or earlier. What you may be dealing with is DX7 or so.  I suggest examining which API set it's using then move from there.  Isn't there a Direct X call dumper? (much like an Open GL data dumper).  This reminds me I should try that on Oblivion (should be interesting).

Erstwhile good fortune I don't know anything about Direct X unfortunately.

Cyb
Title: Re: ff8 window mode concept?
Post by: syLvia on 2008-06-11 14:01:31
thanks your your hint Cyberman. I havent been able to find any DirectX elements in any of the ff8w files, or so i thought. would it be safe to say that it's possible to window mode without touching directx at all? Correct me if i'm mistaken.
Title: Re: ff8 window mode concept?
Post by: Cyberman on 2008-06-12 01:49:52
Actually FF8 uses some weird modes IE palette ed Direct X modes for rendering. This is because the original game uses palettes of data for textures in both background rendering and 3d data rendering.  You need to keep this in mind before you try and run it in a window as well.