×
Spam Prevention - PLEASE READ !! (23 Apr 2021)

Due to a problem with spammers the rules for posting in the forums have changed for new users.

Newly registered users won't have their posts published until a moderator approves them.

Mission Loading Screen

More
7 months 1 week ago #2592 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
Just in case anyone is following along Copy-Cat, myself and S4 are working on this on Teamspeak so the conversation may be hard to follow.

Copy-Cat is completely rewriting the cave code.

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2595 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
I tried the example 1366x768 hack and the good news is it didn't crash.

The bad news is that for some reason my game was still running in 1920x1080 instead of switching over to 1366x768. This caused a few of the screens to be messed up but I suspect this problem may have more to do with dgVoodoo.

I will need to remove dgVoodoo completely from the mix to test properly.

One thing that I have learned is that Swat 3 doesn't seem to like if you have 2 monitors with the desktop set to "extend the displays".

Update1:
My monitor is playing games with me.  Even though it is 1366x768 it displays it full screen at 1920x1080.  I took a screenshot to check and it is indeed 1366x768 but the monitor is auto-stretching it to the native resolution.

Update 2:
If the load screen is 1920x1080 it was only showing a cropped 1366x768 top left corner of the image but shrunk down to 800x600.

If the load screen was 800x600 it was only showing 600x800 of the top left corner of the image (yes, it was confusing x & y ).


Will test more and remove dgVoodoo from the mix.
 

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2596 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
I can't test the highest resolution, my guess is that my game doesn't like the dual monitor setup also, would like to know your fix around this. Im back on TS, game and pizza was good, bama wins.

It was a good run. I just noticed the comparison, and math is wrong for both values, the register edx and edi need to be swapped at the math part. Will try to edit post to reflect the correct comparison and math

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2597 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
I can get it to work with one monitor only active "show only on 1" in Windows settings for "Multiple Displays".   This is on Windows 10 mind you.

I guess maybe the only way is to basically temporarily disable the second monitor with the settings :(

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2598 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
Some potential good news in 2022!

It looks like that your hack alone only works properly on people who run their games with the Swat 3 "-window" flag. Using the window feature in dgVoodoo doesn't help to change that.

Using the "bible" hack of the load screen bitmaps + your hack seems to fix this issue with people like me who are full screen users (and can't even get the game to run in -Window mode without the 16-bit colour mode error).

Now the question is what negative effects will happen to you -Window users if the bible hack is in the mix.

Bonus results:  I tested the process on a 1366x768 game executable.   The 1920x1080 load screen that gets shrunk in your hack looks better than the 800x600 load screen that gets enlarged.

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2599 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
That is good news, just 2 hacks left to do eh?
800 x 600, im on, and can chat and work at the same time.

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2601 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
Warning:  All hacks are done at your own risk.  Don't try them at home

The incoming map loading bitmap 2d size is being stored in 2 registers ebx (x-value) and edi (y-value).
We cannot assign ebx and edi values once they are read into registers, but we can modify them by arithmetic op code.


swat_1920x1080.exe

cmp, edi 00000780 - first we compare the incoming bitmap width to the default LRM mission loading bitmap width of 1920
jne - jump if not equal (the value might be the default mission loading screen width of 800) and we jump to check for 800 x 600 values
if they are equal then we go to next line of op code and check the height
cmp ebx, 00000438 - now we compare the incoming bitmap height to the default LRM mission loading bitmap height of 1080
jne - jump if not equal (the value might be the default mission loading screen height of 600) and we jump to check for 800 x 600 values
if they are equal then we go to next line of op code
jmp, at this point the incoming bitmap size is 1920 x 1080 so we jump to push values of ebx and edi on stack and return.

Check for 800 x 600 values
cmp edi,00000320 - compare the incoming bitmap width to the default mission loading screen width of 800
jne - jump if not equal (the value is not the default loading screen width) so we jump to push values and return.
if they are equal then we go to next line of op code and check the height
cmp ebx,00000258 - compare the incoming bitmap height to the default mission loading screen height of 600
jne - jump if not equal (the value is not the default loading screen height) so we jump to push values and return.
if they are equal then we go to next line of op code
Modify 800 x 600 values
add, edi 00000460 - at this point edi (width) = 800 and we need to add 1120 so that edi (width) = 1920
add, ebx 000001E0 - at this point ebx (height) = 600 and we need to add 480 so that ebx  (height) = 1080

Push the values of ebx and edi on stack and return, this is also the jmp location in the cmp op codes above
push ebx
push edi
push ecx
push eax

lea, eax,[esp+3] - load the address relative from the jump location so we can return after it sets the image to screen
jmp - back to the location we were at before this method call

Jump to new method. offset - 0056B2BC
E9 3F AA 1D 00 90 90 90

New method. offset - 2C2D00
81 FF 80 07 00 00 75 0A 81 FB 38 04 00 00 75 02 EB 1C 81 FF 20 03 00 00 75 14 81 FB 58 02 00 00 75 0C 81 C7 60 04 00 00 81 C3 E0 01 00 00 53 57 51 50 8D 44 24 3C E9 89 55 E2 FF

Here is the explanation of the new method code.
Warning: Spoiler!

 

Please Log in or Create an account to join the conversation.

More
7 months 1 week ago - 7 months 1 week ago #2602 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
Warning:  All hacks are done at your own risk.  Don't try them at home

The incoming map loading bitmap 2d size is being stored in 2 registers ebx (x-value) and edi (y-value).
We cannot assign ebx and edi values once they are read into registers, but we can modify them by arithmetic op code.


swat_800x600.exe

cmp, edi 00000780 - First we compare the incoming bitmap width to the default LRM mission loading bitmap width of 1920
jne - jump if not equal (the value must be the default mission loading screen width of 800) and we jump and Push the values on stack and return
if they are equal then we go to next line of op code
cmp ebx, 00000438 - compare the incoming bitmap height to the default LRM mission loading bitmap height of 1080
jne - jump if not equal (the value must be the default mission loading screen height of 600) and we jump to Push the values on stack and return
if they are equal then we go to next line of op code and Modify the 1920 x 1080 values

Modify the 1920 x 1080 values
sub, edi 00000460 - at this point edi (width) = 1920  and we need to subtract 1120 so that edi (width) = 800
sub, ebx 000001E0 - at this point that ebx (height) = 1080 and we need to subtract 480 so that ebx (height) = 600


Push the values on stack and return, this is also the jmp location in the cmp op codes above
push ebx
push edi
push ecx
push eax
lea, eax,[esp+3] - load the address relative from the jump location so we can return after it sets the image to screen
jmp - back to the location we were at before this method call

Jump to new method. offset - 0056B2BCE9
3F AA 1D 00 90 90 90
New method. offset - 2C2D0081
FF 80 07 00 00 75 14 81 FB 38 04 00 00 75 0C 81 EF 60 04 00 00 81 EB E0 01 00 00 53 57 51 50 8D 44 24 03 E9 9B 55 E2 FF

Here is the explanation of the opcode for the new method:

Warning: Spoiler!

Please Log in or Create an account to join the conversation.

Time to create page: 0.140 seconds
Powered by Kunena Forum