• Welcome to Valhalla Legends Archive.
 

Increasing a resoluton?

Started by Blaze, January 03, 2006, 11:30 PM

Previous topic - Next topic

Blaze

Hello, I'm trying to increase the resolution of a fullscreen application that uses DirectDraw.  I've been able to do it, but the screen goes black.  I'm thinking its because I'm creating a new object and injecting it, and thats taking over.  I'm not trying to increase the draw area, or anything, I'm just trying to create some extra room to add some 'hud info'.

Has anyone here successfully made starcrafts resolution larger?  I remember reading Stwong? doing the same thing so I'm pretty sure its possible.

Am I doing something wrong by the method I talked about in the first paragraph, if so, does anyone have any suggestions on a better way to do this?
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Kp

Bear in mind that Starcraft was designed to run at 640x480, and raising the resolution will make everything else appear a bit smaller.  IMO, you'd be better off drawing directly on Starcraft's canvas (and leaving it at 640x480), or using ScWnd and just putting the HUD info in a normal MS-Windows window that you float near the window containing Starcraft.
[19:20:23] (BotNet) <[vL]Kp> Any idiot can make a bot with CSB, and many do!

Blaze

#2
Yeah, I had thought about that and figured that there would be a point where I have room, and its still nice and visible.

It's a shame the starcraft screen is so small.  Removing even a small part of the screen can be blinding.

Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Blaze

Okay, I've disassembled starcraft, and done some scans on the memory and figured out where the locations are for the resolutions, I'm now trying to change them before they are executed and I wrote the following program, which isn't working.


#include <windows.h>
#include <stdlib.h>
#include <stdio.h>

int main()
{
HWND star = 0;
DWORD prcID;
HANDLE prcHandle;

printf("Starcraft Resolution Changer\n\n");
while (star == 0)
{
star = FindWindow(NULL, "Brood War");
}
GetWindowThreadProcessId(star, &prcID);
prcHandle = OpenProcess(0x1F0FFF, false, prcID);
while (1)
{
WriteProcessMemory(prcHandle, (LPVOID)0x0014F6FC, "600", 4, NULL);
WriteProcessMemory(prcHandle, (LPVOID)0x0015F700, "800", 4, NULL);
}
return 0;
}


Is there an error in the code, or am going about this all wrong?
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Skywing

#4
This is a complicated project that will require significant modifications to SC, btw.

As I recall from my work on ScWnd, you will probably need to do something alone the lines of these:

- change the resolution set via ChangeDisplaySettings
- change the window size
- change the size of the appropriate surfaces created via DirectDraw
- scale the blts to the main display surface appropriately (up to your chosen resolution from 640x480) [optional, depending on what you are planning on doing]
- scale all input events (back down to 640x480 coordinates) [or silently discard all input events for coordinates outside of this range, depending on what you are planning on doing]

I would expect that you will need to inject a dll into Starcraft to do this as changes as extensive as this will be impractical to do via simply patching in manually chosen opcodes.

There are a fair number of other modifications you will need to do in order to get this to work with Starcraft, especially the battle.snp chat channel / game selection UI.

iago

Quote from: Kp on January 03, 2006, 11:38 PM
or using ScWnd and just putting the HUD info in a normal MS-Windows window that you float near the window containing Starcraft.

That's what I've been saying to him! :)
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Blaze

Well, as much as I want to pursue this, I'm just doing to draw it onto the window, now that Kp suggested it.  I might try moving the window so that it on the the screen, like X-Fire does since I don't really like playing while in DxWnd, or anything not full-screened.  I plan to continue trying later on, when I have more free time, so thank you very much Skywing, I'm sure everything you provided will be invaluable.  Thanks Kp, if all else fails I guess I'll do it the classic way. ::)
Quote
Mitosis: Haha, Im great arent I!
hismajesty[yL]: No

Skywing

Quote from: Blaze on January 07, 2006, 01:48 AM
Well, as much as I want to pursue this, I'm just doing to draw it onto the window, now that Kp suggested it.  I might try moving the window so that it on the the screen, like X-Fire does since I don't really like playing while in DxWnd, or anything not full-screened.  I plan to continue trying later on, when I have more free time, so thank you very much Skywing, I'm sure everything you provided will be invaluable.  Thanks Kp, if all else fails I guess I'll do it the classic way. ::)

Remember that unless you synchorinze with Starcraft's redraw cycle you're going to have a lot of ugly flicker that way.