×
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
1 year 6 months ago - 1 year 6 months ago #1996 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
So instead of it switching to 800x600 resolution for the load screen it just stretches to your selected size. Interesting.

This of course limits you from selecting other resolutions in Last Resort. Not a big deal unless to want to test other resolutions.

In an ideal world some smart guy would figure out how to move the text printed on the loadscreen so we can make a better hack :p

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

More
7 months 2 weeks ago - 7 months 2 weeks ago #2583 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
After speaking to Copy-Cat and S4 on Teamspeak I wanted to clarify in writing what I am hoping to achieve with this hack.

Right now we only have 3 resolutions that we care about.  These resolutions are the same as the 2D menus that are used in Last Resort mod.   One of our goals is to have less resolution switching in the game so in the perfect world the movies, the 2D menus, and the load screens will all match the same resolution.


swat_800x600.exe
No hacked required.   All load screens are already 800x600.
The Last Resort mod takes care of activating the graphics so the game only sees 800x600 resolution load screen graphics.



swat_1366x768.exe
There are two resolutions that this game executable needs to deal with for the mission load screens.  The original 800x600 and new AI upscaled 1366x768 resolution bitmaps.

The Last Resort mod takes care of activating the 1366x768 graphics so the game only sees this resolution for the new AI upscaled textures.
  • If a community-made map uses the old-fashioned 800x600 load screen size it will be stretched to full-screen 1366x768.
  • If the game loads one of the new AI upscaled 1366x768 load screens it displays it full-screen 1366x768.



swat_1920x1080.exe:

There are two resolutions that this game executable needs to deal with for the mission load screens.  The original 800x600 and new AI upscaled 1920x1080 resolution bitmaps.

The Last Resort mod takes care of activating the 1920x1080 graphics so the game only sees this resolution for the new AI upscaled textures.
  • If a community-made map uses the old-fashioned 800x600 load screen it will be stretched to full screen 1920x1080.
  • If the game loads one of the new AI upscaled 1920x1080 load screens it displays it full-screen 1920x1080.






Now here comes the complicated part that is only to be considered "in a perfect world situation":

Question:  What happens in the future if someone releases a community made map that wants to use a higher resolution load screen (greater than 800x600)?

Can the code be flexible enough to also shrink the load screen down to the resolution of the given executable?   For instance if someone releases a 1920x1080 load screen with their map can it be automatically shrunk if down to 800x600 if someone is using the 800x600 game executable?

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

More
7 months 2 weeks ago - 7 months 2 weeks ago #2584 by Copy-Cat
Replied by Copy-Cat on topic Mission Loading Screen
Here is the logic for the resolutions given:

swat_800x600.exe
  • if loading image width size doesn't equal 800, image size equals 800 x 600
  • else image size equals 800 x 600
swat_1366x768.exe
  • if loading image width size doesn't equal 1366, image size equals 1366 x 768
  • else image size equals 1366 x 768
swat_1920x1080.exe:
  • if loading image width size doesn't equal 1920, image size equals 1920 x 1080
  • else image size equals 1920 x 1080

Choose a resolution other than 800 x 600 that the mod Last Resort will support for Map Loading Screen size.

UPDATE: After this has been implemented The Last Resort Mod will only support Map Loading Screens 800 x 600 or 1920 x1080

 

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

More
7 months 2 weeks ago #2585 by Slippery Jim
Replied by Slippery Jim on topic Mission Loading Screen
To further clarify,

The load screens can either be 800x600 or 1920x1080.

Each hacked game executable will shrink or enlarge these load screens depending on the 3 game resolutions chosen.

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

More
7 months 2 weeks ago - 7 months 2 weeks 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
7 months 2 weeks ago - 7 months 1 week 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
Change - 53 57 51 50 8D 44 24 3C
To - E9 3F AA 1D 00 90 90 90

New method. offset - 2C2D00
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
7 months 1 week ago - 7 months 1 week 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
7 months 1 week 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.

Time to create page: 0.270 seconds
Powered by Kunena Forum