Jump to content


Photo

The 'setvideomode' Hex (480p Patch)


  • Please log in to reply
93 replies to this topic

#1 raydn

raydn

    X-S Senior Member

  • Members
  • PipPip
  • 233 posts

Posted 29 March 2005 - 11:02 PM

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)

#2 jo77

jo77

    X-S Senior Member

  • Members
  • PipPip
  • 164 posts

Posted 29 March 2005 - 11:54 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 ?

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

Edited by jo77, 29 March 2005 - 11:59 PM.


#3 raydn

raydn

    X-S Senior Member

  • Members
  • PipPip
  • 233 posts

Posted 30 March 2005 - 12:09 AM

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

Edited by raydn, 30 March 2005 - 12:10 AM.


#4 dm71

dm71

    X-S Enthusiast

  • Members
  • 28 posts
  • Location:Canada
  • Interests:-computer stuff<br />-xbox stuff<br />-gaming with my nephew<br />-movies<br />-80's heavy metal<br />-mopars<br />-hockey
  • Xbox Version:v1.6

Posted 30 March 2005 - 08:37 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.

#5 twistedsymphony

twistedsymphony

    arrogant beyond belief

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 10,465 posts
  • Gender:Male
  • Location:Almost Canada http://solid-orange.com
  • Interests:Consoles, Computers, Cars, Arcades, Home Theater, and the modding of anything that moves.
  • Xbox Version:v1.0
  • 360 version:v2 (zephyr)

Posted 30 March 2005 - 08:45 PM

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.

View Post




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

#6 raydn

raydn

    X-S Senior Member

  • Members
  • PipPip
  • 233 posts

Posted 30 March 2005 - 10:42 PM

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.

View Post



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

#7 dm71

dm71

    X-S Enthusiast

  • Members
  • 28 posts
  • Location:Canada
  • Interests:-computer stuff<br />-xbox stuff<br />-gaming with my nephew<br />-movies<br />-80's heavy metal<br />-mopars<br />-hockey
  • Xbox Version:v1.6

Posted 30 March 2005 - 10:55 PM

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

View Post



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.

#8 jack2003

jack2003

    X-S Enthusiast

  • Members
  • 29 posts
  • Xbox Version:v1.0
  • 360 version:v1 (xenon)

Posted 30 March 2005 - 11:52 PM

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.

#9 raydn

raydn

    X-S Senior Member

  • Members
  • PipPip
  • 233 posts

Posted 31 March 2005 - 12:18 AM

i guess you could always try 50 8B 47 30 50 8B 47 2C 51 8B 4F 04 90 6A 20 90 for interlaced

#10 dm71

dm71

    X-S Enthusiast

  • Members
  • 28 posts
  • Location:Canada
  • Interests:-computer stuff<br />-xbox stuff<br />-gaming with my nephew<br />-movies<br />-80's heavy metal<br />-mopars<br />-hockey
  • Xbox Version:v1.6

Posted 31 March 2005 - 05:59 AM

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.

#11 Mr Ed

Mr Ed

    Hacking Horse

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPip
  • 6,588 posts
  • Gender:Male
  • Xbox Version:v1.1
  • 360 version:v1 (xenon)

Posted 31 March 2005 - 08:15 AM

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

Edited by Mr Ed, 31 March 2005 - 08:15 AM.


#12 raydn

raydn

    X-S Senior Member

  • Members
  • PipPip
  • 233 posts

Posted 31 March 2005 - 02:31 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.

#13 twistedsymphony

twistedsymphony

    arrogant beyond belief

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 10,465 posts
  • Gender:Male
  • Location:Almost Canada http://solid-orange.com
  • Interests:Consoles, Computers, Cars, Arcades, Home Theater, and the modding of anything that moves.
  • Xbox Version:v1.0
  • 360 version:v2 (zephyr)

Posted 31 March 2005 - 04:38 PM

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

#14 raydn

raydn

    X-S Senior Member

  • Members
  • PipPip
  • 233 posts

Posted 31 March 2005 - 06:47 PM

spose its possible wink.gif will have a look into it

#15 twistedsymphony

twistedsymphony

    arrogant beyond belief

  • Head Moderators
  • PipPipPipPipPipPipPipPipPipPipPipPipPipPipPip
  • 10,465 posts
  • Gender:Male
  • Location:Almost Canada http://solid-orange.com
  • Interests:Consoles, Computers, Cars, Arcades, Home Theater, and the modding of anything that moves.
  • Xbox Version:v1.0
  • 360 version:v2 (zephyr)

Posted 31 March 2005 - 09:49 PM

someone in another thread clued me into this: http://xbox-scene.co...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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users