Help - Search - Members - Calendar
Full Version: The 'setvideomode' Hex (480p Patch)
Scenyx Entertainment Community > Xbox1 Forums > Hardware Forums > Xbox Audio/Video Technical
Pages: 1, 2
raydn
The 'SetVideoMode' Hex


This hex patch as those of you following the '480p Games Hex List' thread will know allows many interlaced games to run in 480p that were previously unpatched.

Replace:

8B 57 28 50 8B 47 30 50 8B 47 2C 51 8B 4F 04 52

with:

50 8B 47 30 50 8B 47 2C 51 8B 4F 04 90 6A 00 90


*Please always backup your original xbe*

Background

The majority of games call CreateDevice(x,x,x,x,x,x,x). A struct _D3DPRESENT_PARAMETERS_ is passed to the 6th x.
This describes the presentation parameters for the game. _D3DPRESENT_PARAMETERS_ contains among other things a Dword - 'Flags'. Flags is what all previous 480i -> 480p patches have been patching (20h (interlaced) to 00 (autoselect) or 40 (progressive). Within the CreateDevice call the _D3DPRESENT_PARAMETERS_ struct is broken down, 'Flags' being the 11th value is stored at +28h.

Below you can see that the original XBE moves +28h to edx (mov edx, [edi+28h]), this however isn't 'pushed' (push edx)
until just before the SetVideoMode call, this means the the 1st arg of the SetVideoMode call is the Dword value for 'Flags'.
So changing the code to 'push' a value of 0 instead of the original edx / +28h value it will cause 480i / p autoselect.

To do this I had to first 'nop' (do nothing) out 8B 57 28 with 90 90 90 and then move everything around. From the original XBE you can see that push edx (52 as hex) is one hex32 value. However Push 0 is (6A 00) so requires 2 hex32 values. I was not possible to simple do a push 0 at the location of 90 90 90 since it needed to be in the same place as the original push edx.


CODE


Original XBE

8B 57 28           mov     edx, [edi+28h]
50                 push    eax
8B 47 30           mov     eax, [edi+30h]
50                 push    eax
8B 47 2C           mov     eax, [edi+2Ch]
51                 push    ecx
8B 4F 04           mov     ecx, [edi+4]
52                 push    edx


8B 57 28 50 8B 47 30-50 8B 47 2C 51 8B 4F 04 52


Patched XBE

50                push    eax
8B 47 30           mov     eax, [edi+30h]
50                 push    eax
8B 47 2C           mov     eax, [edi+2Ch]
51                 push    ecx
8B 4F 04           mov     ecx, [edi+4]
90                 nop
6A 00              push    0
90                 nop
             

50 8B 47 30 50 8B 47 2C 51 8B 4F 04 90 6A 00



Compatabilty

Some titles already have a fix I recommend this fix only if there isn't an already working fix.
The 480p Games Hex List


Thanks to everyone who has helped test the fix.



*Working*

Broken Sword: The Sleeping Dragon (PAL)
Headhunter: Redemption
I-Ninja
Mashed Fully Loaded
Outlaw Golf 2 (PAL)
Puyo Pop Fever (NTSC?)
Shell Shock: NAM'67
SpongeBob SquarePants: Battle for Bikini Bottom
Stacey Jones Rugby League *
Street Racing Syndicate
Teenage Mutant Ninja Turtles
Teenage Mutant Ninja Turtles 2: Battle Nexus (PAL)
Vietcong: Purple Haze
XGRA: Extreme Racing (NTSC)


*Not working*

Some games don't have the search hex, or simply switch back to 480i.


Chessmaster (NTSC)
Haunted House
Kung-Fu Chaos (MIX)
Scooby Doo Night of 100 Frights
Star Wars: Republic Commando
V8 supercars (PAL)
jo77
I have V8 Supercars (Toca Race Driver 1 )Pal version since along time ago and it always worked in 480p mode blink.gif were there 2 different versions ?

If someone sends me there non-480p default.xbe I will do a compare and see what bytes are different.

jo_hardie@yahoo.co.nz
raydn
QUOTE(jo77 @ Mar 29 2005, 10:00 PM)
I have V8 Supercars (Toca Race Driver 1 )Pal version since along time ago and it always worked in 480p mode  blink.gif  were there 2 different versions ?



Dreamcazman tested it on his pal version and posted that the hex wasn't found.

Also for example my playboy mansion runs 480p no problem but another member with a retail copy posted that his ran 480i, a comparison of both xbes is in the 480p hex thread
dm71
Is there any way to use this or a variation to switch a 480P game down to 480I? I know this is an oddball request but I have an annoying issue that I've rounded down to this.
twistedsymphony
QUOTE(dm71 @ Mar 30 2005, 02:43 PM)
Is there any way to use this or a variation to switch a 480P game down to 480I?  I know this is an oddball request but I have an annoying issue that I've rounded down to this.
*




blink.gif what's you're situation that you can't just disable 480p in the MS Dash?

I suppose it would be possible to permanently set games to 480i but I have enough trouble getting them to play in 480p tongue.gif
raydn
QUOTE(dm71 @ Mar 30 2005, 06:43 PM)
Is there any way to use this or a variation to switch a 480P game down to 480I?  I know this is an oddball request but I have an annoying issue that I've rounded down to this.
*



Don't think so, at least not by modifying this hex as far as i know wink.gif

you would need to push a vaule of 20 instead of 0
dm71
QUOTE(twistedsymphony @ Mar 30 2005, 01:51 PM)
blink.gif what's you're situation that you can't just disable 480p in the MS Dash?

I suppose it would be possible to permanently set games to 480i but I have enough trouble getting them to play in 480p  tongue.gif
*



I don't want 480P disabled totally. Only for a few specific games. I should explain. An example would be the game 'Serious Sam' which is 480p. It works just fine when I play from the game disc with my chip disabled. Here's the weird part. If I play it with my chip on and launching from avalaunch or unleashx, the video becomes scrambled. If I disable 480p like you said twisted, then it indeed works BUT I still want 480P for all my other games.
I discovered that 480P was the problem when I did the hex edit to enable 480p in Metal Slug 3. When I launched it, it scrambled the exact same way that serious sam did. I obviously undid the hex-edit after that. This is my quandry.
jack2003
QUOTE
(dm71 Posted Today, 10:01 PM)
When I launched it, it scrambled the exact same way that serious sam did


What do you mean with scrambled: absolutely no recognizable picture, or artifacts that increase when there is motion.

If the latter is the case, than you probably refer to "de-interlace" problems, given by the fact that most video's are interlaced (i.e. 480i) by nature. When they are played back in progressive scan (i.e. 480p) the result is that adjacent lines have a temporal difference of 30 miliseconds as they originate from two different fields, resulting in "sawtooth" edges.
raydn
i guess you could always try 50 8B 47 30 50 8B 47 2C 51 8B 4F 04 90 6A 20 90 for interlaced
dm71
QUOTE(jack2003 @ Mar 30 2005, 04:58 PM)
What do you mean with scrambled


This is the Serious Sam main menu:
user posted image


I can't find any matching hex strings so I have no idea where to try to edit.

I'm just going to stick with the workaround of disabling 480p in the dash.
I apologize raydn for jacking your thread.
Mr Ed
QUOTE(raydn @ Mar 29 2005, 02:08 PM)
Background

The majority of games call CreateDevice(x,x,x,x,x,x,x). A struct _D3DPRESENT_PARAMETERS_ is passed to the 6th x.
This describes the presentation parameters for the game. _D3DPRESENT_PARAMETERS_ contains among other things a Dword - 'Flags'. Flags is what all previous 480i -> 480p patches have been patching (20h (interlaced) to 00 (autoselect) or 40 (progressive).



So raydn, is there any parameter there that specifies 720p or 1080i modes? I realize changing the actual resolution may cause many issues with a game, including scaling issues, collision detection problems, slow framerates, etc. however I'd still like to try it and see for myself. rolleyes.gif
raydn
The first two values of D3DPRESENT_PARAMETERS specify the height and width of the backbuffer. This would be 640 (280h) x 480 (1E0h) for 480i/p. You would need to change the 280h to 500h and 1E0h to 2D0h for 720p. It is unlikely it will be possible to make it work by patching at this location simply because many games rely on these two values for placement of menus and text amoung other things.

I would recommend searching the xbe for 280h followed by 1E0h, and changing them at that location. Using this ^ method i did get I-Ninja to run at 720p, looked very crisp, only noticble problem was with the in game text and and intro vids. SuperMonkey ball worked at 720p until the game started at which point it crashed out with a blue screen displaying an out of memory error.
twistedsymphony
ohmy.gif That's really friggin cool!

Any chance you know where the string is for how much memory the game uses? 720p patches along with 128MB memory patches could make for some kick ass patches for popular games

You would be a God among men if you were able to 720p & 128MB patch Halo 2, PGR 2, or Splinter Cell 3
beerchug.gif
raydn
spose its possible wink.gif will have a look into it
twistedsymphony
someone in another thread clued me into this: http://xbox-scene.com/tools/tools.php?page...VplyEpujTqBIzpD

I always thought it just allowed games to function with the added ram, not actually use it. Perhaps with 720p SuperMonkeyBall and this patch we could have SMB HD goodness beerchug.gif

at very least you could compare the output from that to see what it changes wink.gif
aceboomer
so what values in the patch would we need to switch to see if 720p was possible?
50 8B 47 30 50 8B 47 2C 51 8B 4F 04 90 6A 00 90
what would need to be changed?
oh and i have a challenge for ya. i wonder if its possible to make soul calibur 2 switch to full widescreen in 720p mode with your patches
thanks for all the hard work
raydn
QUOTE(aceboomer @ Mar 31 2005, 11:48 PM)
so what values in the patch would we need to switch to see if 720p was possible?
50 8B 47 30 50 8B 47 2C 51 8B 4F 04 90 6A 00 90
what would need to be changed?
*



It's not quite as simple as that.
aceboomer
question about the 280h etc.. search
are those text or hex searches?
raydn
its a text search in ida

the hex would be 80 02
shadowlord_kt
I don't know if this is an appropriate place to post, but I got this patch to work with Teenage Mutant Ninja Turtles 2: Battle Nexus NTSC. That's TMNT2 in 480p for you people trying to find this post via the forum Search engine biggrin.gif

Thanks, raydn!
Dreamcazman
You can add Stolen to the list of shitty PAL games that won't run in 480p.

Doesn't work with the setvideomode patch either...
Foe-hammer
QUOTE(raydn @ Mar 31 2005, 01:37 PM)
The first two values of D3DPRESENT_PARAMETERS specify the height and width of the backbuffer. This would be 640 (280h) x 480 (1E0h) for 480i/p. You would need to change the 280h to 500h and 1E0h to 2D0h for 720p. It is unlikely it will be possible to make it work by patching at this location simply because many games rely on these two values for placement of menus and text amoung other things.

I would recommend searching the xbe for 280h followed by 1E0h, and changing them at that location. Using this ^ method i did get I-Ninja to run at 720p, looked very crisp, only noticble problem was with the in game text and and intro vids. SuperMonkey ball worked at 720p until the game started at which point it crashed out with a blue screen displaying an out of memory error.
*


This is too cool. This would be the first major breakthrough in the video section, since the vga bios were released. I would look into upgrading my xbox ram if 720p were possible via hex editing. Keep up the good work raydn, i'm extremely excited to see where you take this.
ninjatech
I just got Dead to Rights 2 and was so very disappointed to see it is 480i. What I don't get is that the first one was 480p for certain... Silly Namco, they made iNinja 480i and you guys get it running in 720p, haha.

Anyhow I looked at the files and there is actuall an xbox.cgf file on the disc, and it has the following lines:
SetBkInt32 MODE_WIDTH 640
SetBkInt32 MODE_HEIGHT 480
SetBkInt32 MODE_COLOR_DEPTH 32
SetBkInt32 MODE_Z_DEPTH 32
SetBkBool FULLSCREEN TRUE
SetBkBool INTERLACED TRUE
SetBkInt32 MODE_REFRESH_RATE 60

I thought this was really odd for an Xbox game... must be very PC-ish in nature. Anyhow, changing interlaced to false makes the game crash before it even boots, and commenting it out defaults it to interlaced mad.gif

Any ideas? I didn't check for the hex yet, because at this point I am assuming this file is the key.

Edit: I tried changing the word to PROGRESSIVE, but that had no effect.
Foe-hammer
QUOTE(raydn @ Apr 1 2005, 02:25 PM)
its a text search in ida

the hex would be 80 02
*



I do not have ida, but use workshop to hex edit.

Raydn, would you also please convert 500h, 1E0h, and 2D0h to hex?

I want to mess around with these setting, and see what i can get for 720p.

Thanks again
raydn
QUOTE(Dreamcazman @ Apr 9 2005, 08:31 AM)
You can add Stolen to the list of shitty PAL games that won't run in 480p.

Doesn't work with the setvideomode patch either...
*



oh another to look at - we need a thread with a list of all the unpatched titles (inc game region)
raydn
QUOTE(ninjatech @ Apr 15 2005, 12:46 AM)
Any ideas? I didn't check for the hex yet, because at this point I am assuming this file is the key.

Edit: I tried changing the word to PROGRESSIVE, but that had no effect.
*




prob a check on the crc thingy of the file to see if it was changed best thing to do is modify the xapi calls to return a good value for these

XCalculateSignatureUpdate
XCalculateSignatureBegin
XCalculateSignatureEnd

ref: Generic Reversing of Hacked Save Game checks.

QUOTE(Foe-hammer @ Apr 15 2005, 02:34 AM)
I do not have ida, but use workshop to hex edit.

Raydn, would you also please convert 500h, 1E0h, and 2D0h to hex?

I want to mess around with these setting, and see what i can get for 720p.

Thanks again
*



you can do this easyily with windows calulator

500h is 1280
1E0h is 480
and 2D0h is 720

720p is 1280 x 720 wink.gif

interesting side note - though pal games are 'suposed to be higher res' than ntsc and this is listed in the xdk help. pal = 720 x 576, ntsc 640 x 480 it often the case that all games are 640 x 480
Foe-hammer
QUOTE(raydn @ Apr 15 2005, 02:48 PM)
500h is 1280
1E0h is 480
and 2D0h is 720

720p is 1280 x 720 wink.gif

interesting side note - though pal games are 'suposed to be higher res' than ntsc and this is listed in the xdk help.  pal = 720 x 576, ntsc 640 x 480 it often the case that all games are 640 x 480
*


I understand what resolutions each stand for, my question is what to search for. When i do a text search for 280h, i find nothing. Someone else asked this question earlier to you, and you said it is a text search in ida, and that the hex equivalent is 80 02. I've tried search for both but cannot find it. What is ida? Is it not software like hex workshop?

Anyway, all i want to do is search for the 640 x 480 res, and change it to 720 x 1280. You mentioned to change the 280h to 500h and 1E0h to 2D0h for 720p.
I cannot even find these values to change them.

I realize that there is problems when changing these setting, and it will more then likely crash, but i would like to mess with it some.

Thanks again......
raydn
oki maybe i wasn't as helpful as i thought.

IDA is a 'Windows or Linux hosted multi-processor disassembler and debugger'. Take a look here. It's helpful since it supports XBE files. Using an xbox 'FLIRT' file (its on the web somewhere) it will display most of the xapi functions.

A search for 280 will turn up nothing in a normal hex editor simple reason is that from a debuger to a hex editor the value is reversed. So 280 is 80 20 in hex. If you just want to change the backbuffer size try searching in a hex editor for somthing similar to 66 C7 46 04 80 02 66 C7 46 06 E0 01 since 280h is nearly always followed by 1E0h in the XBE (note: the hex not in bold will not be the same in other XBE files).

In IDA select 'IDA View-A' search (, 280h) wink.gif


QUOTE
Raydn, would you also please convert 500h, 1E0h, and 2D0h to hex?


sorry, must have misread that

500h = 00 05
1E0h = E0 01
2D0h = D0 02
280h = 80 02
raydn
Another tip....

.text:00157BE6 mov dword ptr [esi], 280h
.text:00157BEC mov dword ptr [esi+4], 1E0h

look for this in IDA as this is a D3D struct... 1st value being 640 and 2nd value (esi+4) being the 480.
raydn
Going a bit off topic i have made a new thread over in game hacking http://forums.xbox-scene.com/index.php?act...=0#entry2518269
jack2003
QUOTE
(raydn @ Mar 31 2005, 01:37 PM)

SuperMonkey ball worked at 720p until the game started at which point it crashed out with a blue screen displaying an out of memory error



Raydn, I did find a only 1 similar string in the hex file at position 5691Ah, which I changed accordingly:

00 7E 05 BE 80 02 00 00 81 FF E0 01
00 7E 05 BE 00 05 00 00 81 FF D0 02

But this did not give the 720p as you mentioned (I double checked my Xbox settings and did a check with Enter the Matrix in 720p)

At which position did you change the XBE?

raydn
Opps. Since it didnt work correctly i never recorded the changes i made to super monkey ball. So can't help much atm.

Just a quick word - the setvideomode patch is only intended to patch to 480i/p from interlaced not to other resolutions. I never used anything as complex as this patch to fiddle with that.

changing the res with this patch will most likely not work since something earlier in the code will reqire the display dimentions eg rendering. It would be wrong to think you can patch the game to 720p with this patch imo.
jack2003
You are right raydn, this was a long shot.

But since I have 128Mb in my box, I thought I should give it a try.

Keep on the good work!
raydn
QUOTE(ninjatech @ Apr 15 2005, 12:46 AM)
I just got Dead to Rights 2 and was so very disappointed to see it is 480i. What I don't get is that the first one was 480p for certain... Silly Namco, they made iNinja 480i and you guys get it running in 720p, haha.




jester.gif LOL

I just had a look the XBE of Dead To Rights 2 - I have never seen an XBE like this one before. Don't expect this to be patched anytime soon!


The mad thing is that the xbox.cfg has the values in it.

SetBkInt32 MODE_WIDTH 640
SetBkInt32 MODE_HEIGHT 480
SetBkInt32 MODE_COLOR_DEPTH 32
SetBkInt32 MODE_Z_DEPTH 32
SetBkBool FULLSCREEN TRUE
SetBkBool INTERLACED TRUE
SetBkInt32 MODE_REFRESH_RATE 60

...but this crashes the game before it loads. I couldnt find any signiture check on the cfg file.


Have to say I think only hope will be a look at the PC version when that comes out or mayb someone else has more luck.

petermac
yes, i also noticed this , i got the default.xbe, checked several hex edits, none were successful for dead to rights 2, i hope it gets a hex edit!
mechabim
Pls let me know progressive Code for Dead to Rights 2
twistedsymphony
Is this code supposed to set the video mode permanently to 480p or should it auto select 480p/i?

I ask because I just picked up Headhunter redemption this is the first game I've tried to patch with this. it works great in 480p but it locks up when I try to run in 480i... a shame there isn't an easy patch available.
Hitcher
QUOTE(twistedsymphony @ Apr 26 2005, 02:32 AM)
Is this code supposed to set the video mode permanently to 480p or should it auto select 480p/i?

QUOTE(raydn @ Mar 29 2005, 10:08 PM)
So changing the code to 'push' a value of 0 instead of the original edx / +28h value it will cause 480i / p autoselect.
Vejita
raydn,

I grabbed the default.xbe from I-Ninja and ran it through IDA Pro with the Xbox flirt (Xbox.sig in sig folder) loaded up and I do a text search for 280h and it comes up with nothing.

What am I doing wrong?

I want to patch the game to 720p to see how it looks.

I'm new to using IDA so go easy on me jester.gif
raydn
At the weekend if I get time ill try attempt the I-Ninja 720p patch again and post it here for anyone interested.

basically make sure you are in IDA View-A and do a search (ALT-T) for , 280h
Vejita
QUOTE(raydn @ May 13 2005, 04:10 PM)
At the weekend if I get time ill try attempt the I-Ninja 720p patch again and post it here for anyone interested.

basically make sure you are in IDA View-A and do a search (ALT-T) for , 280h
*



Yep, I was tabbed into the IDA View-A and it didn't find anything for , 280h
jack2003
Hi,

just to let you know that the 'SetVideoMode' Hex also works for Madagascar
Hitcher
QUOTE(jack2003 @ May 27 2005, 06:12 PM)
Hi,

just to let you know that the 'SetVideoMode' Hex also works for Madagascar

Thanks, it does indeed. biggrin.gif

Here's one that doesn't work though -

Medal of Honour: European Assault

Tried the old hex edits and nothing, then tried this one and it did infact find and change the code but when I ran the game it was still in 480i. sad.gif

Well done EA. mad.gif
Dreamcazman
QUOTE(Hitcher @ Jun 10 2005, 07:45 AM)
Here's one that doesn't work though -

Medal of Honour: European Assault

Tried the old hex edits and nothing, then tried this one and it did infact find and change the code but when I ran the game it was still in 480i. sad.gif

Well done EA. mad.gif
*



I got the US version and it runs in 480p, I take it you have the PAL version?

This seems to be a common trend with EA, do they have something against the PAL market or something? huh.gif
Hitcher
QUOTE(Dreamcazman @ Jun 17 2005, 06:54 AM)
I got the US version and it runs in 480p, I take it you have the PAL version?

This seems to be a common trend with EA, do they have something against the PAL market or something?  huh.gif

NTSC game, PAL Xbox.

It just seemed wierd that, of all the hex codes for prog scan, only this one actually found the string but it still ran in 480i.
Dreamcazman
QUOTE(Hitcher @ Jun 27 2005, 01:48 AM)
NTSC game, PAL Xbox.

It just seemed wierd that, of all the hex codes for prog scan, only this one actually found the string but it still ran in 480i.
*



It must be seeing that the Xbox is from a PAL region. Try changing the region code to 1 using configmagic and see how you go.
raydn
QUOTE(Hitcher @ Jun 27 2005, 01:48 AM)
NTSC game, PAL Xbox.

It just seemed wierd that, of all the hex codes for prog scan, only this one actually found the string but it still ran in 480i.
*




just check that 480p is enables in the dash, seems obvious but ...
Hitcher
QUOTE(Dreamcazman @ Jun 28 2005, 08:40 AM)
It must be seeing that the Xbox is from a PAL region. Try changing the region code to 1 using configmagic and see how you go.

Yeah, I think I'll give that a go.
Hitcher
This is really strange.

Ran Configmagic and changed the region from 4 to 1, played MoH:EA and it was in prog scan. Changed the region back to 4, tried it again and it was still in prog scan.

I can't explain it.
silvermax
Hi Guys!!! I just patched Chessmaster 10000 !!!!!!! Finally i can play it in my vga monitor !!!!!!!! :smile.gif))))


Only one byte to change:

0x33d2ah from 20h to 00h


smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.