Last resort logo

SWAT 3 - LAST RESORT GAME MODIFICATION


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
2 years 3 months ago - 2 years 3 months ago #2586 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
After this has been implemented
The Last Resort Mod will only support Map Loading Screens 800 x 600 or 1920 x 1080.
There will be no logic to handle any other sizes, and it will not display properly.




 

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

More
2 years 3 months ago - 2 years 3 months ago #2588 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_1366x768.exe

cmp, edi 00000780 - 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 to Modify 800 x 600 values
if they are equal then we go to next line of op code
cmp ebx, 00000438 - First we 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 Modify 800 x 600 values
if they are equal then we go to next line of op code to Modify 1920 x 1080 Values

Modify 1920 x 1080 Values
sub, ebx 00000138 - we can assume at this point that ebx = 1080 and we need to subtract 312 from ebx (height) so that ebx = 768
sub, edi 00000022A - we can assume at this point that edi = 1920 and we need to subtract 554 from edi (width) so that edi = 1366
jmp, jump to push values of ebx and edi on stack and return.

Modify 800 x 600 values
add, ebx 000000A8 - we can assume at this point that ebx = 600 and we need to add 168 to ebx (height) so that ebx = 768
add, edi 00000236 - we can assume at this point that edi = 800 and we need to add 566 to edi (width) so that edi = 1366

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

This is the jump to new method.
Offset - 16B2BC
Code:
Change - 53 57 51 50 8D 44 24 3C
Code:
To - E9 3F AA 1D 00 90 90 90

New method. offset - 2C2D00
Code:
81 FF 80 07 00 00 75 16 81 FB 38 04 00 00 75 0E 81 EF 2A 02 00 00 81 EB 38 01 00 00 EB 1C 81 FF 20 03 00 00 75 14 81 FB 58 02 00 00 75 0C 81 C7 36 02 00 00 81 C3 A8 00 00 00 53 57 51 50 8D 44 24 3C E9 7D 55 E2 FF

Explanation of the new method:

Warning: Spoiler!



 

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

More
2 years 3 months ago - 2 years 3 months ago #2590 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
Damn, son. I didn't expect you to have something by the next day, lol.

Let me get my morning coffee and then I will visit you on TS.

Great work!

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

More
2 years 3 months ago #2591 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
Working on the opcode now...

It's a slow process, because i'm being especially careful not to crash the game too many times. Windows 10 has a nasty habit of permanently locking me out from using Swat.

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

More
2 years 3 months 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
2 years 3 months ago - 2 years 3 months 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.

Moderators: DarkSynopsis
Time to create page: 0.172 seconds
Powered by Kunena Forum