Qhimm.com Forums

Miscellaneous Forums => Archive => Topic started by: Magus Spirit on 2004-06-21 18:20:10

Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-06-21 18:20:10
I was bored today, so I produced this little patch. This patch is to be used along with the Cetra Windowed Mode patch. When applyed, it will make the window centered when starting the game. The window will also feature a title bar with the usual minimize and close buttons (maximize is also present, but useless). Finally, you will be able to move the window as you would do with any other window.

I'm sorry though, I'm french, so if you do not have a french version, you'll have to manually search for the location in your FF7.EXE file. To do so, open your file in your favourite hex editor and search for a part of one of the following lines of data:
Code: [Select]
__  __  __  __  ______________________  __
8B4DC4518B55CC52680000008068000000808B45D050 (1.00f)
8B45C4508B4DCC51680000008068000000808B55D052 (1.02f)
8B45C4508B4DCC51680000008068000000808B55D052 (1.02us)


Parts that have a line above should be common in all files. I recommend you search for 68000000806800000080, as I'm totally sure this will be present only once and in all versions. Once you found it, adjust it with the above lines so you locate the exact location where you'll have to start patching from.

Right now, I only have these two locations. If you could tell me what location it is for you, and which version you have, it would be great.
Code: [Select]
1.00f:  0x0027699E
1.02f:  0x00275E3B
1.02us: 0x00275E9B


Once you have the location, replace the next 22 bytes of data by one of these lines, depending on your screen resolution (several lines are proposed because the part of the patch that centers the window varies with your screen resolution):

Code: [Select]
680002000068860200006A7F683D010000680000CB00 (1280*1024)
680002000068860200006A7F683D010000680000CB00 (1280*960)
680002000068860200006A7F683D010000680000CB00 (1280*768)
680002000068860200006A68683D010000680000CB00 (1280*720)
680002000068860200006A7F68FD000000680000CB00 (1152*864)
680002000068860200006A7F68BD000000680000CB00 (1024*768)
680002000068860200006A2C684D000000680000CB00 (800*600)


If you have any problem applying the patch, or if I made a mistake, don't hesitate to post.

Enjoy !


P.S: I also made a No-CD patch that I'll be exposing after dinner. Damn, I was really bored today ! XD
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: sfx1999 on 2004-06-21 19:34:10
I can't find either of them.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-06-21 20:28:06
Have you tryed searching only for "68000000806800000080" in your file ? (this is in the hex view, not in the ASCII view).

Anyway, i'm having a look at FF7 1.02us right now. If anybody could upload FF7 1.00us so I can have a look at it too, that would be great.

EDIT: I did find it in FF7 1.02us, at 0x00275E9B. I've updated the first post accordingly.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: ValcroyinX on 2004-06-30 01:27:01
i found it at 0x00275E9C for 1.02 US, and patched it accordingly, but only resulted with an unplesant crash...what a shame...
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: ValcroyinX on 2004-06-30 02:30:20
Well, now i got it working :/ However, you proclaim that you are able to move about the window (with the mouse)? And yet, after you run the patched FF7, the mouse entirely dissapears, never to resurface until the game is exited...is this normal?
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Aaron on 2004-06-30 04:00:19
Did you try pressing Alt+Tab to get the mouse back?
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-07-01 15:41:47
Aaron is right, you have to press Alt-Tab (or the Windows key) in order to make your cursor reappear. Sorry for not mentionning it. I should patch it so it does not capture the mouse.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: OniFLOP on 2004-07-19 00:05:54
I don't know if it was this or you no-cd.

I applied them both to my 1.02us version and when i tried to run it, an error appeared:

Code: [Select]
ERROR: 80070005 Unrecognized error value. in FILE C:\lib\src\input\input.cpp LINE 256

Too strange :-?

EDIT: I tried again, and it worked, but when i do Alt-TAB the error happens, and I can't control the game anymore, althought It's still running...
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: savage-xp on 2004-07-20 01:25:17
Detonators  up to version 53.04 will show graphic errors on the window.Please check if this got solution.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CForrester on 2004-07-28 23:18:11
Hey, I managed to patch it properly. The program launches, but I get no display. Just a black screen. What I did was:

Install FFVII
Install the 1.02 patch
Install the Cetra windowedmode patch
Edit ff7.exe and change the bytes that you said to change.

If it'll help:
Pentium 4 1.8 GHz
1024 MB DDR RAM
40 GB hard drive
ATI Radeon 9000 with the latest Omega drivers
Windows XP Pro
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-07 20:58:22
Hmm, let's see...
Does the game work properly in a window, without my patch ? If yes, then, are you using the original Windows XP theme ? I'm asking this because, if the client area of the window becomes larger than 640x480, the display turns black.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CForrester on 2004-08-10 00:51:37
If I use just the Cetra patch, it does work, except for a weird bug... When a video plays, it appears seperated... Here, like this:
(http://www.gorgerush.net/chris/ffviibug.jpg)

It works fine if I let it go fullscreen. I'm not using the original XP theme. I'm using "Windows Classic" in the Windows 2000 style.

[EDIT 3:] See Edit 3 at the bottom of my post!
I've just tried your patch again and this is what I get:
(http://www.gorgerush.net/chris/ffviibug2.jpg)
This repeats itself. So, as soon as I click OK, it pops up another one. The first one that pops up says:
"ERROR: 80070057 One or more of the parameters passed to the function are incorrect. in FILE C:\lib\src\graphics\directx.cpp LINE 2698". After that, all the following errors are the one in the screenshot. I can hear the audio while this is happening. I'm going to try hexing it again, maybe I did something wrong.

Just some other notes that might help: I am now using the ATI Catalyst 3.9 Beta drivers. I'm using Hex Workshop as my Hex Editor. I'm running in 1152*864 screen resolution at 75 Hz on a Dell E773c monitor. I've used RefreshForce to lock my refresh rates to get around the XP bug, but that shouldn't make a difference since I'm running it windowed.

[EDIT:] I just checked my second screenshot and it seems that it makes the playing area 640*487. Did you get the bytes for 1152*864 wrong, maybe? I'm going to try hexing it for 1024*768 and running in that resolution.

[EDIT 2:] I just tried it. It does the same thing at 1024*768 with the EXE hexxed for that, and it's still 640*487.

[EDIT 3:] I figured out why it gives those errors: It's incompatible with the FF7Music patch. If I don't have the FF7Music patch installed, it goes back to my original symptoms.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-10 21:49:56
Two things.

1) Video playback problem: you have to set your screen to 16-bit (if you already tryed the 32-bit fullscreen patch, you may have noticed the same behaviour already).

2) Black screen and Evil messagebox: you need details about that one. Even if you play in windowed mode, the client area of the window cannot be greather than 640x480. When I made the patch, I was using the Windows XP original theme, which features taller application title bars than the Classic Windows theme. Now that you're using this theme, the title bar is smaller, resulting in a client area greather than 640x480. Oh BTW, I made the patch for different resolution only to have the window centered correctly, as I specified its coordinates manually. It has nothing to do with changing the window size.

Here are new patches that should work with the Classic Windows theme:
Code: [Select]
68F901000068860200006A7F683D010000680000CB00 (1280*1024)
68F901000068860200006A7F683D010000680000CB00 (1280*960)
68F901000068860200006A7F683D010000680000CB00 (1280*768)
68F901000068860200006A68683D010000680000CB00 (1280*720)
68F901000068860200006A7F68FD000000680000CB00 (1152*864)
68F901000068860200006A7F68BD000000680000CB00 (1024*768)
68F901000068860200006A2C684D000000680000CB00 (800*600)


EDIT: they will also work with the original Windows XP theme, but you will lose 7 lines of pixels at the bottom of the screen.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: fa_pa on 2004-08-10 23:00:53
great work! is there such a patch for ff8?
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CForrester on 2004-08-11 08:07:14
Ahh! Thank you so much! It works perfectly now, even with the FF7Music patch. :D

I've made some Cetra patches for this. Make sure you read the readme, first: http://12.22.230.41/MicroTech/Hosted/Files-D/movablewindow.zip
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: savage-xp on 2004-08-12 09:36:40
As a new request please try to do an FFVIII patch, my monitor sucks in 640x480 mode

[[]]`s
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-12 09:58:52
Well, I'll have a look at FF8 then. Though I can't promise anything.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CloudSquall on 2004-08-12 11:28:07
Quote from: Magus Spirit
Well, I'll have a look at FF8 then. Though I can't promise anything.

Can i please ask u how u do it?
Where do u start looking?
How can u know that Code u found is the right one?

And the thing i know about hexing is just find and replace thats all.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-12 20:57:10
Well, making such a patch is not an easy thing, also, there is no real method. Usually, you have to disassemble the program file, then to have a look at the function calls and string references in order to know where you have to examine the code, and once you're there, you can start patching, depending on what you find... It may be replacing a value, a parameter in a function call, or even rewriting a bit of code... In any case, knowing assembler (or at least the basis) is highly recommended.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CloudSquall on 2004-08-12 22:52:46
Damn I knew it would be hard :(

Can u pls give me link for an assembler (or at least the basis) tutorials?

And is it possible for u to find the 32bit hex codes for 1.00? If u like i can send it to u, myn is english btw
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-12 23:20:10
Yep, you may send me you 1.00 english version. That's an important one I'm missing.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CloudSquall on 2004-08-13 03:30:55
Glad u asked.

I have uploaded 2 of em, one is untouched wich is a direct copy from cd and other one has nocd and chocobo fix.

UNTOUCHED:
http://members.chello.nl/r.khazraji/ff7v1.00en-untouched.zip

NOCD&CHOCOBO FIX:
http://members.chello.nl/r.khazraji/ff7v1.00en-chocobo&nocd.zip
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-13 11:19:29
BTW, I've been wondering about something. Are the English and US versions program file the same ?
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CloudSquall on 2004-08-13 11:23:07
Quote from: Magus Spirit
BTW, I've been wondering about something. Are the English and US versions program file the same ?

i dont know that sorry, but my ff7 game version is from here:
http://forums.qhimm.com/viewtopic.php?t=3183
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: xephiros on 2004-08-13 22:10:53
For some reason If i Move the window, or Alt+tab to another window
The game just..freezes! The music still plays though..

Im running it in 16Bit and have version 1.02 Hardware mode on a Radeon..
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CloudSquall on 2004-08-13 23:27:31
Quote from: xephiros
For some reason If i Move the window, or Alt+tab to another window
The game just..freezes! The music still plays though..

Im running it in 16Bit and have version 1.02 Hardware mode on a Radeon..

I dont think it freezes. But game controls wont work anymore.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: xephiros on 2004-08-14 20:01:25
You're right.., The timer still counts...

But..how do I fix this?
What use is a windowed version if you cant switch between windows  :P
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-14 20:36:02
Well, I can't help you here, since it works well on my computer, and I can reduce the window or switch between applications.
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: CloudSquall on 2004-08-17 12:02:52
Quote from: xephiros
You're right.., The timer still counts...

But..how do I fix this?
What use is a windowed version if you cant switch between windows  :P

do u have classic or windows xp theme?
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: xephiros on 2004-08-21 21:36:21
Hm... Problem Kind of Fixed...
It seems that Only my keyboard doesnt react, but i can still play my joypad ;)
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: Magus Spirit on 2004-08-22 23:09:36
Hmm, this makes me think about something. Does it work if, after moving the window, you reduce and then restore it ?
Title: Patch: Centered and movable window in FF7 windowed-mode
Post by: xephiros on 2004-08-25 22:28:14
Nope, Keyboard still doesnt work, Joypad works though..