| View previous topic :: View next topic |
| Author |
Message |
Skynet Vault Modder


Joined: 05 Jun 2003 Posts: 456 Location: Finland Status: Offline
|
Posted: Tue Feb 15, 2005 10:42 Post subject: Fallout 1/2 windowed mode possible? |
|
|
There is a hack for a game called Trespasser that makes it run in windowed mode. The hack was done by modifying the DirectDraw settings. Since the Fallout 1/2 also uses DirectDraw, would this hack work for it also.
The hack was done by setting the main DirectDraw SetCooperativeLevel with a parameter of DDSCL_NORMAL instead of FULLSCREEN | EXCLUSIVE and removing the main call to SetDisplayMode (CreateWindowEx).
I cannot test this myself, cause I suck in hex editing. Could some hexedit wannabe test this? _________________ #
I am a prototype for a much larger system.
# |
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Tue Feb 15, 2005 13:38 Post subject: |
|
|
The problem is finding the code with this parameter. We only see binary, so we won't see SetDisplayMode, and the DDSCL_NORMAL will be some number. I'd try it if I knew where to edit.
EDIT: here's the constant values for DDSCL flags.
Enum CONST_DDSCLFLAGS
DDSCL_ALLOWMODEX = 64
DDSCL_ALLOWREBOOT = 2
DDSCL_CREATEDEVICEWINDOW = 512
DDSCL_EXCLUSIVE = 16
DDSCL_FULLSCREEN = 1
DDSCL_MULTITHREADED = 1024
DDSCL_NORMAL = 8
DDSCL_NOWINDOWCHANGES = 4
DDSCL_SETDEVICEWINDOW = 256
DDSCL_SETFOCUSWINDOW = 128
End Enum _________________
 |
|
| Back to top |
|
 |
Skynet Vault Modder


Joined: 05 Jun 2003 Posts: 456 Location: Finland Status: Offline
|
Posted: Tue Feb 15, 2005 16:12 Post subject: |
|
|
http://fire.prohosting.com/tpasser/
Look at the MAIN CALLS TO DIRECTDRAW section under MISCELLANEOUS ADDRESSES
Is this info any of use? (should we contact the developer for help?) _________________ #
I am a prototype for a much larger system.
# |
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Tue Feb 15, 2005 16:24 Post subject: |
|
|
| Skynet wrote: |
http://fire.prohosting.com/tpasser/
Look at the MAIN CALLS TO DIRECTDRAW section under MISCELLANEOUS ADDRESSES
Is this info any of use? (should we contact the developer for help?) |
Yeah I found that page earlier. He mentions "Trespasser passes 0x00000011 as flags to this method, indicating it only uses the EXCLUSIVE and FULLSCREEN flags. "
I found 20 occurrances of this value in FO2 exe, but it may be the case that FO2 uses some other value (SetCooperativeMode parameters have multiple flags per the enumerated list I posted above). Also, he didn't say what he changed that value to in order to make it windowed mode.
It would be really interesting to find the SetDisplayMode params because those are setting the resolution. _________________
 |
|
| Back to top |
|
 |
jdoe407 Hideous Freak of Nature


Joined: 18 Feb 2005 Posts: 30
Status: Offline
|
Posted: Fri Feb 18, 2005 21:23 Post subject: |
|
|
FALLOUT2.EXE (Version 1.02 U.S) also passes 0x00000011 to the function, i believe this is what it kind of looks like with comments. One thing to be aware of is that I barely know anything about assembly or DirectX and just kind of guestimating some of this
| Code: |
Address Hex Assembly My crappy explination
004CAFDF 52 PUSH EDX ; / null
004CAFE0 68 B0E25100 PUSH FALLOUT2.0051E2B0 ; |
004CAFE5 52 PUSH EDX ; | null
004CAFE6 FF15 28E45100 CALL NEAR DWORD PTR DS:[51E428] ; \ DirectDrawCreate
004CAFEC 85C0 TEST EAX, EAX ; if error...
004CAFEE 0F85 AB010000 JNZ FALLOUT2.004CB19F ; ... show error message
004CAFF4 6A 08 PUSH 11 ; / EXCLUSIVE | FULLSCREEN
004CAFF6 8B1D 34E45100 MOV EBX, DWORD PTR DS:[51E434] ; |
004CAFFC A1 B0E25100 MOV EAX, DWORD PTR DS:[51E2B0] ; |
004CB001 53 PUSH EBX ; | hWnd
004CB002 8B10 MOV EDX, DWORD PTR DS:[EAX] ; |
004CB004 50 PUSH EAX ; |
004CB005 FF52 50 CALL NEAR DWORD PTR DS:[EDX+50] ; \ SetCooperativeLevel
004CB008 85C0 TEST EAX, EAX ; if error...
004CB00A 0F85 8F010000 JNZ FALLOUT2.004CB19F ; ... show error message
004CB010 56 PUSH ESI ; / Colors ( 8 = 256 color? )
004CB011 55 PUSH EBP ; | Resolution Height
004CB012 A1 B0E25100 MOV EAX, DWORD PTR DS:[51E2B0] ; |
004CB017 57 PUSH EDI ; | Resolution Width
004CB018 8B10 MOV EDX, DWORD PTR DS:[EAX] ; |
004CB01A 50 PUSH EAX ; |
004CB01B FF52 54 CALL NEAR DWORD PTR DS:[EDX+54] ; \ SetDisplayMode?
004CB01E 85C0 TEST EAX, EAX ; if error...
004CB020 0F85 79010000 JNZ FALLOUT2.004CB19F ; ... show error message
|
looks like fallout supports resolutions up to 1024x1280 by default - chosen by this call statement which can be simply overridden to choose a different setting or make up your own setting. Changing the to call an exact location requires more space so I just removed the error checking for the call as you can see below which isn't too good at al, but whatever.
| Code: |
Address Hex Assembly
004D5D02 FF1424 CALL NEAR DWORD PTR SS:[ESP]
004D5D05 89C6 MOV ESI, EAX
004D5D07 83F8 FF CMP EAX, -1
004D5D0A 74 05 JE SHORT FALLOUT2.004D5D11
004D5D0C 83F8 08 CMP EAX, 8
changed to very the nasty...
004D5D02 E8 B550FFFF CALL FALLOUT2.004CADBC
004D5D07 90 NOP
004D5D08 90 NOP
004D5D09 90 NOP
004D5D0A 8BF0 MOV ESI, EAX
004D5D0C 83F8 08 CMP EAX, 8
|
the only problem with the resolution changing is that the HUD is still in the 640x480 position and the chat dialogs are screwed up so you will get displays such as
http://www.jdoe407.com/images/scr00033.png
http://www.jdoe407.com/images/scr00036.png
http://www.jdoe407.com/images/scr00037.png
http://www.jdoe407.com/images/scr00038.png |
|
| Back to top |
|
 |
Skynet Vault Modder


Joined: 05 Jun 2003 Posts: 456 Location: Finland Status: Offline
|
Posted: Mon Feb 21, 2005 12:33 Post subject: |
|
|
Temp solution would be like deleting all the hud graphics and the dialog mode graphics (result should be like a arcanum style dialog system!). Finding the hud position infos in EXE would be better. _________________ #
I am a prototype for a much larger system.
# |
|
| Back to top |
|
 |
Shadowbird Where'd That 6th Toe Come From?


Joined: 20 Jul 2003 Posts: 442 Location: Latvia Status: Offline
|
Posted: Mon Feb 21, 2005 13:17 Post subject: |
|
|
Wow! The possibilities of this look great! But what about the windowed mode? _________________
| Quote: |
| Mankind is condemned to be free and must accept the responsibility. |
| George Orwell, in "1984" wrote: |
| In our society, those who have the best knowledge of what is happening are also those who are furthest from seeing the world as it is. In general, the greater the understanding, the greater the delusion; the more intelligent, the less sane. |
|
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Mon Feb 21, 2005 13:30 Post subject: |
|
|
I tried making the iface.frm transparent, and unfortunately it doesn't render the map as background for the interface.
http://home.cogeco.ca/~desolation/iface.jpg
I wonder if we can move the interface or run in 1024x480 or 1280x480 resolution? _________________
 |
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Mon Feb 21, 2005 17:04 Post subject: |
|
|
| Skynet wrote: |
| Temp solution would be like deleting all the hud graphics and the dialog mode graphics |
You'd have to make a new master.dat to delete those, and my guess is that the engine will crash if it doesn't find them.
| Skynet wrote: |
| Finding the hud position infos in EXE would be better. |
Yeah if that could be moved it would be great, but its more than just the position of the interface, there's also the mouse click trapping code for each of the buttons. They are likely hardcoded to a specific place.
The 1280x1024 is probably too big ... I'd like to try 800x600. _________________
 |
|
| Back to top |
|
 |
Shadowbird Where'd That 6th Toe Come From?


Joined: 20 Jul 2003 Posts: 442 Location: Latvia Status: Offline
|
Posted: Mon Feb 21, 2005 17:20 Post subject: |
|
|
| dude_obj wrote: |
| You'd have to make a new master.dat to delete those, and my guess is that the engine will crash if it doesn't find them. |
Not neccessarily. You could just make them transparent. Don't know about the mouse click trapping though. It would make more sense if the mouse was "watched" in the area dynamically set by button position and size, instead of manual coordinates. Dunno. Disassembling is not my thing .
| dude_obj wrote: |
| The 1280x1024 is probably too big ... I'd like to try 800x600. |
Look at the pictures. They're clearly 1024x768 - 1024x1280 was a typo, IMO. And if the location of the resolution is known, then everyone can have their own, can't they? _________________
| Quote: |
| Mankind is condemned to be free and must accept the responsibility. |
| George Orwell, in "1984" wrote: |
| In our society, those who have the best knowledge of what is happening are also those who are furthest from seeing the world as it is. In general, the greater the understanding, the greater the delusion; the more intelligent, the less sane. |
|
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Mon Feb 21, 2005 17:21 Post subject: |
|
|
| Shadowbird wrote: |
| Not neccessarily. You could just make them transparent. |
I tried that ... look above ... it didn't render the map. _________________
 |
|
| Back to top |
|
 |
jdoe407 Hideous Freak of Nature


Joined: 18 Feb 2005 Posts: 30
Status: Offline
|
Posted: Mon Feb 21, 2005 19:38 Post subject: |
|
|
| Shadowbird wrote: |
| And if the location of the resolution is known, then everyone can have their own, can't they? |
whoops, forgot to post that part :/
| Code: |
default is 256 colors, some assign it manually (such as 320x200) and others use the default function (such as 800x600) to gain 256 colors. The way I used to manually change the resolution may be causing errors or may cause errors in the future because I never really looked hard enough to find out what made the switch between these resolutions. I just figured 1024x768 would be as good as it gets until everything is too small to see (and its the resolution I use on just about everything). I can only test resolutions from 640x480 - 1024x768 because that's all my monitor supports in this list
004CAD08 ;320x200 @ 256 colors
004CAD24 ;320x240 @ 256 colors
004CAD40 ;320x400 @ 256 colors
004CAD64 ;640x480
004CAD78 ;640x480 @ 16bit color mode (don't think movies work)
004CAD94 ;640x400
004CADA8 ;800x600
004CADBC ;1024x768
004CADD0 ;1280x1024
|
I would rather want to be able to reposition all the elements on the interface. For example, IFACE.frm (and all of its buttons and stuff) going down to the bottom center and having the inventory/save game/load game/etc screens center. This is probably too much work to do by manually editing the fallout2.exe - unless there is a shortcut somewhere
--edit--
it looks like the address of 004B9217 would probably be a better place to change the resolution at instead of removing the error checking in my frist post.
| Code: |
address hex assembly
004B9217 8B049D BCDC5100 MOV EAX, DWORD PTR DS:[EBX*4+51DCBC]
change to the following ( where 004CADBC is changed to something in the list of resolutions above )
address hex assembly
004B9217 B8 BCAD4C00 MOV EAX, fallout2.004CADBC
004B921C 90 NOP
004B921D 90 NOP
the two NOP's because the original statement took up 14 bytes and the new statement (the one right above this text) only uses 10 bytes, so the last 4 bytes get 90 90
|
|
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Mon Feb 21, 2005 21:28 Post subject: |
|
|
| jdoe407 wrote: |
| address 004B9217 |
I'm confused about the addresses you are listing. The hex offsets in my executable end at 1227FF (that's the last byte, file size 1189888 bytes). Why is your address 4B9217 way out of this range?
I managed to do your other hack by searching for occurance of code, and it displayed in 1024x768. And I can find this occurance in the exe too, but this change gives memory out of range errors.
So what's the deal with the address differences, and which version of the executable are you using? (US,UK,? and Version) Is yours 1189888 bytes? _________________
 |
|
| Back to top |
|
 |
jdoe407 Hideous Freak of Nature


Joined: 18 Feb 2005 Posts: 30
Status: Offline
|
Posted: Mon Feb 21, 2005 22:15 Post subject: |
|
|
my fallout.exe is also 1,189,888 bytes Version 1.02 U.S
I use ollydbg for all of my editing and such which is why all of the addresses differ from what you will see in a regular hex editor. http://home.t-online.de/home/Ollydbg/ "OllyDbg is a 32-bit assembler level analysing debugger for Windows-systems", in other words, its great for "hacking"/debugging programs. It can take a bit to get use to, but once you get the hang of it - everything is easier
http://www.jdoe407.com/images/odbg/ for an example of what to do ( was hoping to make a gif animation with words and all, but that didn't go too well )
| Code: |
this is the address of 004B9217 that I was talking about in hex editor format
Address Hex
000A9617 8B049DBCDC5100
changed to
Address Hex
000A9617 B8xxAD4C009090
Make sure to notice that the first two bytes were changed (From 8B to B8) because they look alike. Failure to change them will result in a crash
xx is replaced with...
08 for 320x200 @ 256 colors
24 for 320x240 @ 256 colors
40 for 320x400 @ 256 colors
64 for 640x480
78 for 640x480 @ 16bit color mode (don't think movies work)
94 for 640x400
A8 for 800x600
BC for 1024x768
D0 for 1280x1024
|
|
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Tue Feb 22, 2005 0:44 Post subject: |
|
|
Here's a 16-bit color mode shot with image from the troika game:
 _________________
 |
|
| Back to top |
|
 |
jdoe407 Hideous Freak of Nature


Joined: 18 Feb 2005 Posts: 30
Status: Offline
|
Posted: Tue Feb 22, 2005 2:20 Post subject: |
|
|
| what the hell is that thing? |
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Tue Feb 22, 2005 2:30 Post subject: |
|
|
What do you mean what is it ... I just wanted to see how higher color depth graphics would look. It's a peice of this screenshot made into FRM, and then made into scenery, and placed on the map.
http://www.nma-fallout.com/forum/album_pic.php?pic_id=682 _________________
 |
|
| Back to top |
|
 |
jdoe407 Hideous Freak of Nature


Joined: 18 Feb 2005 Posts: 30
Status: Offline
|
Posted: Tue Feb 22, 2005 2:35 Post subject: |
|
|
| ah nifty - I'm looking forward to that game. I don't think 16bit does anything more to the images because they were probably put into the game as 256 color images (or less) |
|
| Back to top |
|
 |
dude_obj Code Warrior


Joined: 19 Oct 2004 Posts: 1064 Location: North Exit Grid Status: Offline
|
Posted: Tue Feb 22, 2005 2:45 Post subject: |
|
|
| jdoe407 wrote: |
| I'm looking forward to that game. |
Don't get too excited ... read the news forum ... troika is in trouble.
| jdoe407 wrote: |
| I don't think 16bit does anything more to the images because they were probably put into the game as 256 color images (or less) |
It won't do anything for the existing images, but 16-bit mode would allow me to add new scenery of greater color depth, the above was a test to see how it looks. Now if I could figure out how to make those damn tile FRMs I could have entirely new background too. _________________
 |
|
| Back to top |
|
 |
Skynet Vault Modder


Joined: 05 Jun 2003 Posts: 456 Location: Finland Status: Offline
|
Posted: Tue Feb 22, 2005 19:08 Post subject: |
|
|
| jdoe407 wrote: |
| ah nifty - I'm looking forward to that game. I don't think 16bit does anything more to the images because they were probably put into the game as 256 color images (or less) |
256 color images could be formatted to 16-bit palette, but the visual look wouldn´t get much better. _________________ #
I am a prototype for a much larger system.
# |
|
| Back to top |
|
 |
|