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
I'm not looking foward to rewriting the op code, but here is what I was thinking.
There are 2 push instructions that push the image-x and image-y values on to the stack before the Call to SetRect. These 2 values will stretch the image if increased.
swat.exe+16B2BC - 53 - push ebx // y-value (600) swat.exe+16B2BD - 57 - push edi // x-value (800)
these combined is 2 bytes enough to call a jump short. There is empty space below the function that could be used as the offset.
We should insert a unconditional jmp short and check values with our known image resolution of 800 x 600 and if they equal modify the values and return
if ebx == 600 and edi == 800, set the values to our screen resolution and return.
Otherwise push ebx and edi and return
This way only 2 locations for each additional screen resolution could be updated in the future.
Hopefully there are no other calls to this function with images with the size of 800 x 600 and it should work.
I've worked on this long enough... Here is the fix!
:::: This willl stretch the image to any predetermined resolution :::::
This is the jump to new method.
16B2BC Change - 53 57 51 50 8D 44 24 3C To - E9 3F AA 1D 00 90 90 90
Here is an explanation of the above opcode.
16B2BC - 53 - push ebx y = 600 16B2BD - 57 - push edi x = 800 16B2BE - 51 - push ecx 0 16B2BF - 50 - push eax 0 16B2C0 - 8D 44 24 3C - lea eax,[esp+3C] Load effective address(for return)
16B2BC - E9 3FAA1D00 - jmp 345D00 jump to New method 16B2C1 - 90 - nop blank 16B2C2 - 90 - nop blank 16B2C3 - 90 - nop blank
Here is the new opcode for the method
Offset - 2C2D00
81 FB 58 02 00 00 75 14 81 FF 20 03 00 00 75 0C 81 C3 A8 00 00 00 81 C7 36 02 00 00 53 57 51 50 8D 44 24 3C E9 9B 55 E2 FF
2C2D00 - 81 FB 58020000 - cmp ebx,00000258 if y doesn't = 600 75 14 - jne swat.exe+345D1C jump 81 FF 20030000 - cmp edi,00000320 if x doesn't = 800 75 0C - jne swat.exe+345D1C jump 81 C3 A8000000 - add ebx,000000A8 otherwise y = 600 + 168 81 C7 36020000 - add edi,00000236 otherwise x = 800 + 566 53 - push ebx y = 768 57 - push edi x = 1366 51 - push ecx 0 50 - push eax 0 8D 44 24 3C - lea eax,[esp+3C] Load effective address(for return) E9 9B55E2FF - jmp swat.exe+16B2C4 jump back
I'm running some extensive tests to see if any crashes occur during game play, or map building activities.
Please post your crashes here, and please provide the following:
1. What you were doing when it crashed?
2. Single or Multiplayer?
3. In-game or in Debrief or menu screens?
4. What Resolution your running your game in LRM?
6. if in-game what is the map name?[/li]
- Slippery Jim
- Posts: 709
So if we are to set the new standard for the Last Resort mod at 1920x1080 for map load screens with map makers and then hack the code it will shrink the image to whatever resolution we want?
For instance if the map maker has the load image at 1920x1080 but the player chooses 1366x768 as their 2D setting we can hack the proper game executable to display the load image in 1366x768? Also will it be able to display the original community made 800x600 map load screens that haven't been upgraded in 1366x768 at the same time?
I haven't tested shrinking the image just stretching the default 800 x 600. The 800 x 600 in my previous post are variables passed in from the image.
hack the code it will shrink the image to whatever resolution we want?
I will run a test in a minute and throw a 1920 x 1080 image at it just to see if it will resize it to 1366 x 768.
The only problem I see is trying to use the mov instruction to modify the registers. The add and sub instructions modify the registers indirectly. With the current method of implementing the change, we cannot use any of the registers for variables and we must preserve (keep up with) the stack.
The new code can be what ever we want, since we are not trying to squeeze it in-between other functions. It is located in a code cave towards the end of the exe.
- Slippery Jim
- Posts: 709
It may be that it can't be as flexible as we hope. It may just have to be that the 800x600 is still the standard but we have the option of including replacement high-res load screens. This feature won't be available to map makers unless they submit new graphics to be included in future updates of the mod.
This will be a large undertaking to get quality images that will be suitable replacement load screens.
- What you come up with has to be flexible enough to allow us to still use 800x600 load screens (specifically for community made maps).
- The Sierra load maps can be enlarged and included in each of the Last Resort .RES files and then used in conjunction with hacked game executables.
01.res (800x600 textures) that indirectly uses swat_800x600.exe 02.res (1366x768 textures) that indirectly uses swat_1366x768.exe 03.res (1920x1080 textures) that indirectly uses swat_1920x1080.exe
Gonna run some test now to see if it shrinks the image... Any ideas on how to handle the image resolutions?
we coud just continue checking and jumping. Remember it checks for the y-value first and exits if no match, so we technically could do it again for the LR standard..
Update: I just noticed, the Loading Text is still in the same spot..
UPDATE #2: It shrinks it..... Kewl, started with a 1920 x 1080 and shrunk it to 800 x 600. It also appears to be working with the mov instruction which is less bytes. That opens up some head room on the handling of Map_Loading Images.
No checks for 800 x 600 just allow them thru
LR Map loading screens 1920 x 1080 set them to 800 x 600
Check for 800 x 600 and set them to 1366 x 768
Check for LR Map Loading Screens and set them to 1366 x 768
Only check for 800 x 600 abd set them to 1920 x 1080
Does that sound right?
- Topic Author
While not an ideal solution since it looks rough it is a nice little benefit of dgVoodoo if already using it and it achieves the goal I personally wanted out of higher res loading screens, to stop my desktop flickering just for this one screen.
Stumbled across this when I thought about testing dgVoodoo with its resolution function on Raven Shield, wanted the menus to be outputted to 1080 which worked so figured it would for these loading screens as well.