Automatic video mode switching when loading game
i allways seem to get the odd game or prog that won't run at all, or won't run properly in pal-50 mode.
to make them work properly i need to switch the xbox to pal-60, which on my tv squashes the picture and deforms the top and bottom, or rarely ntsc, which on my tv plays squashed and in black and white.
would it be possible to set individually (in a default.txt file even) to switch outputs on program launch, and then revert back when xbmc opens again (which would be after a cold or warm reboot)?
so when i boot xbmc it stays in pal-50 mode, but if i boot say, hitman contracts ntsc (which doesn't work in pal-50 mode) then xbmc will automatically switch to pal-60 just before launching the game. this would take slightly longer to launch i think, however it's much easier than going into the ms dash everytime i want to play hitman. for other games which haven't been set to change, it would be the same loading time.
is this possible?
thanks
morien
Changes made in Application.cpp
Below the line g_graphicsContext.SetGUIResolution(initialResoluti on);
// See if we can go to 480p - RH
BYTE currentCableMode = 0;
HalReadSMBusValue(XKUtils::SMBDEV_PIC16L, XKUtils::PIC16L_CMD_AV_PACK, 0, (LPBYTE)¤tCableMode);
if((currentCableMode == XKUtils::AV_PACK_HDTV) && XGetVideoStandard() == XC_VIDEO_STANDARD_PAL_I)
{
// We're in PAL mode, but connected to HDTV so switch to NTSC for 480p
F_VIDEO ForceVideo = VIDEO_NTSCM;
F_COUNTRY ForceCountry = COUNTRY_USA;
char temp[1024];
helper.GetXbePath(temp);
char temp2[1024];
char temp3[2];
temp3[0] = temp[0]; temp3[1] = ' ';
helper.GetPartition((LPCSTR)temp3,temp2);
CStdString strTemp(temp+2);
int iLastSlash = strTemp.rfind('\');
strcat(temp2,strTemp.substr(0,iLastSlash).c_str()) ;
Destroy();
CUtil::LaunchXbe(temp2,("D:\"+strTemp.substr(iLastSlash+1)).c_str(),NULL,ForceV ideo,ForceCountry);
}
Following code
else if ((DWVideo == XKEEPROM::VIDEO_STANDARD::PAL_I) && ((XGetVideoStandard() == XC_VIDEO_STANDARD_NTSC_M) (XGetVideoStandard() == XC_VIDEO_STANDARD_NTSC_J) initialResolution < 6))
{
CLog::Log(LOGINFO, "Rebooting to change resolution from %s back to PAL_I", (XGetVideoStandard() == XC_VIDEO_STANDARD_NTSC_M) ? "NTSC_M" : "NTSC_J");
ForceVideo = VIDEO_PAL50;
ForceCountry = COUNTRY_EUR;
bNeedReboot = true;
fDoPatchTest = true;
}
changed to
else if ((DWVideo == XKEEPROM::VIDEO_STANDARD::PAL_I) && ((XGetVideoStandard() == XC_VIDEO_STANDARD_NTSC_M) (XGetVideoStandard() == XC_VIDEO_STANDARD_NTSC_J) initialResolution < 6))
{
// See if we can go to 480p - RH
BYTE currentCableMode = 0;
HalReadSMBusValue(XKUtils::SMBDEV_PIC16L, XKUtils::PIC16L_CMD_AV_PACK, 0, (LPBYTE)¤tCableMode);
if(currentCableMode == XKUtils::AV_PACK_HDTV)
{
// Do nothing
bNeedReboot = false;
fDoPatchTest = false;
}
else
{
CLog::Log(LOGINFO, "Rebooting to change resolution from %s back to PAL_I", (XGetVideoStandard() == XC_VIDEO_STANDARD_NTSC_M) ? "NTSC_M" : "NTSC_J");
ForceVideo = VIDEO_PAL50;
ForceCountry = COUNTRY_EUR;
bNeedReboot = true;
fDoPatchTest = true;
}
}
perhaps i accidentially uploaded the wrong version. will check it out this evening, i was might tired yesterday
spiff
edit: had a look at the uploaded code. everything looks correct from here. are you sure that you added all necessary files to the project? perhaps a clean is required. no bool cutil::launchxbe(...) exists in the cvs tree anyway, it's a void function.
will try to apply it to a vanilla cvs tree when i get back home
i figure that this means that i should alter the patch to ignore pal60 settings and launch pal games in pal.
unless someone shouts, i'll upload a new version soon. also, i'll add a parameter to force which mode to launch in, if somebody decides to add it to the context menu (i could always add it, however it should be stored in the db which i think should be done by somebody with the experience..)
edit: done
spiff
all cred/blame to cherry for sharing his code :)
spiff
i designed it like it is because that's the way i like it... you are of course welcome to do alterations to the source code.
and may i ask: why would you like it to work that way?
Bizarely, the code I posted worked fine on Saturday, then failed to work on Sunday - it just constantly rebooted XBMC, suggesting that the NTSC shadow copy patch thing hadn't worked.
I'll try to get my code working reliably, then take a look at making it configurable. I like the idea of a config file, but I don't think it's possible to detect if digital audio is present - anyone confirm this??
loading XBMC twice is actually much quicker than you'd expect, and not really noticable.. I suspect XBMC spends most of it's time loading the graphics and other DLLs - my patch was run before all this was done.
why do you need to switch back to pal for pal framerate films? i'm running it in ntsc at 720p and find it plays pal movies without any artifacts of any kind.
60fps instead 50fps, 20% faster
then runs like us/jap version speedwise
but i'll tell you that it should be doable. you could use the same trick that we use to setup the game region, that is patching the in-memory eeprom copy.
should just be a matter of adjusting the offsets.
maybe an unofficial dev could code a patch for this from that?, (as i don't think any devs on team-xbmc prioritise this?)
i got a pal xbox and when i run a ntsc games it now cherry switches it to ntsc. but when i igr and my dash (xbmc) restarts, my xbox is now in ntsc mode. it would be nice if xbmc could detect and change back to pal (as pal is my preferred choice for ui, higher resolution)
a600 said:
i also have a pal xbox but don't have that problem. when i igr after playing a ntsc game, xbmc is set, as always, to pal60.
the autoregion option do not write to the eeprom, instead the copy in the ram is patched?
so i'm at no risk render my eeprom useless if sh.t happens.
kk
if you have pal60 enabled in the ms dash, then it is up to the game to choose to use it (or give you the option of using it).
there is a "forced-pal60" mode, but it is unavailable in the ms dash, and is not documented at all in the xdk docs. this hasn't stopped modchip makers + software writers employing it, however. basically it is equivalent to running in ntsc as far as resolutions + timings go.
cheers,
jonathan
and a pretty please... :) as at the moment the only way is to transfer the dvd to harddisk and run that way. (very long winded) and i don't like eprom switching to much with enigmah.
thank you guy if you can take a look. and thank again spiff for the help with my bios.
How about this instead? Add on-the-fly video-mode switching of the EEPROM shadow-copy in RAM before launching a specific XBE to the Team-XBMC's shortcut tool (http://www.xboxmediacenter.com/wiki/index.php?title=As_a_Dashboard#Option_1_-_Using_the_Team_XBMC_Shortcut.xbe_.28Recommended.2 9), with the option of cable auto-detect (for both video and audio), configurable via a .cfg file (or xml). Maybe also add GetXbePath to is and make is pass that information along as a parameter to XBMC so if an option to edit that .cfg file (or xml) from XBMC's GUI was implemented then XBMC would automaticly know where that XBE and it's matching cfg file (or xml) is located. That XBE program would still be small and fast to load, and there would be no need to ever load the same XBE twice. The audio option would be nice if like myself use digital-audio when in NTSC-mode (connected to a Xbox HD cable-adapter and HDTV display-device) and analog-audio when in PAL mode (connected to a standard definition Xbox composite video cable and analog stereo to CRT TV built-in speakers).
Suggested .cfg file (or xml) example:
true
digital
stereo
analog
mono
PS! Note that all this should only touch the EEPROM shadow-copy in RAM and never write to the EEPROM!
The EEPROM it's only capable of aprox. 1000 erase/write cycles so will get damaged if write to it too often.
i was wondering if it was possible to do something in xbmc where i can set up games (or emulators) to only run in 480i mode while the rest can still run in 480p without having to constantly switch these in my mod's bios. (somehow stop the games xbe from seeing that 480p is an option for it to run?) that would be an awesome feature, i think, for 1.6 hdtv xbmc users, though i realize that the number of us may be quite small and this wouldn't exactly be a priority. ;)
does anyone else with an ntsc box (particularly japanese) have a similar problem?
So I'm after some way of getting XBMC to boot & play video in 480p, but games to work in PAL50 / PAL60. Any ideas?Not currently possible with XBMC, (or any other Xbox software for that matter).
In believe that in theory it should be possible to enhance the Video Mode Switching code for My Programs, if combined cherry's videomode code with nkpatcher to patch a EEPROM shadow copy in RAM when starting a game, ...I think?
Problem is finding a skilled programmer/developer with the time and inerest to take on a such project :sniffle:
currently the only way is to keep switching back and forth in enigma.
and no its not a good solution to leave the console always in ntsc, as then one has to keep switching back for pal framerate movies
i would think this a comparatively simple thing to add, as there is already a switch to force already 60hz games in ntsc or pal60.
if fact i owe the entire xbmc team a huge thank for the great media center your have created amongst yourselves.
thank guys. :thumbsup:
I have a projector hooked up via component, and a standard PAL TV via composite, with a box off ebay that switches between the two.
I can put the xbox into NTSC and get the 480p mode working ok, but the TV can't handle the NTSC signal and goes into black and white.
So I'm after some way of getting XBMC to boot & play video in 480p, but games to work in PAL50 / PAL60.
Any ideas????
edit: i just tried it and seems to work very well but i think it also should be added to the context menu to choose between ntsc, pal50 and pal60 modes because some games, for example pal version of halo, are very choppy with pal60.
why do you need to switch back to pal for pal framerate films? i'm running it in ntsc at 720p and find it plays pal movies without any artifacts of any kind.
runs jerky
pal = 25fps
ntsc = 23.3 or 29.9fps
pal50 and pal60 autoswitching (which is already in the program) resolves this perfectly, so no manual switching neccesary
dont really see the big issue adding this feature, as its a comparitively easy thing to add considering the complexity of xbmc
i have never had a pal game with video run jerky in ntsc, with 100s of games i have run, there just isnt the issue you mention
adding this feature is a neccesity, and there's no logical evidence not to have it
most games are meant for 60hz ntsc and only converted to pal later for european users
cheers,
jonathan
i did look for a xbe to changed it and then load the original renamed xbe, but never found it :(
hope some one can implement this :thumbsup:
if you put my console in ntsc i dont get this benefit
a simple 'force 50hz games in 60hz' and visa versa would fix this, as my post already explained
if you want to run your games pal games in ntsc, and your ntsc games in ntsc (obviously), you don't need any switching.
unless there's something i haven't thought of?
and there's always manual override.
i actually wondered why cherry's code enabled pal60. i'd reckon that the switch from pal->pal60 would be something handled by the game.
do anybody know the behaviour of the msdash? mine is non-startable (damn starwars dvd's) and i don't feel like fixing it today..
xbmc already does that if you in the video-settings selected "enable pal60", there are also options for:
"play ntsc videos at pal rates"
"play pal videos at ntsc rates"
"play ntsc videos in pal60"
ps! don't compare/confuse videos with games, it's not the same on the xbox; it is not possible to switch between ntsc and pal for videos like you can for games, you can only switch between pal(50) and pal60 on a pal box without using a third-party application like enigmah-video-switch (or avalaunch) to switch between pal and ntsc in the eeprom (which do require a restart or the xbe).
lots of those around and nothing 'automatic' to do about it. i have been plundering adding 'launch in pal' 'launch in ntsc' to a contextmenu in xbmc, but haven't gotten around to it yet..
this is my first post here. because there is only one option i am missing in xbmc.
i know that i can change the region setting for games to start with the default region. this is great so far. but would it be possible to do this only for specific games???
like i start all my games with the dash-default region when i hit the "a" button. when using the "white" button (or any else) a menu could pop asking asking for starting the game in it's own default region (like the switch i can enable in the settings). would something like that be possible?! it doesn't need to be stored or anything else... just for the game i just started.
if any more explenation is needed just ask!
thx for your patience!
i'm probably responsible for this mess :) i never had a ntsc-j box to test with.. will have a look at the src now
I'm not that up on the internals of the xbox, but am a software & hardware developer so know a fair bit about video etc..
Can xbmc not just bash some new values into the video hardware registers to enable different video modes??
If so, does anyone have any idea how to do this - I might be up for downloading the xbmc source (and xdk) and seeing if I can tweak it.
morien
setting the "auto switch ...." to "off" and then rebooting works fine.
deleting the contents of the 0face008 folders under tdata and udata fixes the problem (until the next time "auto switch...." is selected).
xbmc is running as dashboard. i've been using xbmc as dashboard for around 6 months with little problem. everything is in its standard location (.xbe and xboxmediacenter.xml on c:, everything else in e:/apps/xbmc/ and "home" tag set accordingly). as i said, everything's fine if the "auto switch based on game region" flag isn't set.
have tried about 4 different recent versions of xmbc including the 07-15 cvs, 06-04 pimped and 05-30. all installs have been as clean as possible (deleted e:/cache, x:, y:, z:, 0face008 folders and all of e:/apps/xbmc). the only edit to the xboxmediacenter.xml has been to set the "home" location to e:/apps/xbmc/.
system details:
ntsc (japan) system
xecuter x2 4977 bios
matrix modchip
any thoughts would be appreciated. have a feeling it's related to the xbox being ntsc.
i can post the contents of 0face008 folders, xboxmediacenter.xml and xbmc.log if they would help.
many thanks for all the hard work on xbmc.
this is my first post here. because there is only one option i am missing in xbmc.
i know that i can change the region setting for games to start with the default region. this is great so far. but would it be possible to do this only for specific games???
like i start all my games with the dash-default region when i hit the "a" button. when using the "white" button (or any else) a menu could pop asking asking for starting the game in it's own default region (like the switch i can enable in the settings). would something like that be possible?! it doesn't need to be stored or anything else... just for the game i just started.
if any more explenation is needed just ask!
thx for your patience!
sorb, i don't fully understand what you are trying to do. when you use the override menu(pressing the white button on a specific game), your launch setting is remembered and if you need to know the default video mode, just select "launch in" and it will tell you the default.
util.obj : error lnk2019: unresolved external symbol "bool cdecl cutil::launchxbe(char *,char *,char *)" (?launchxbe@cutil@@saxpad00@z)
Maybe you could 'just' create a small xbe program with a matching .cfg file (or xml) which only quickly preforms video-mode switching on the EEPROM in RAM before launching a specific xbe, ...so kind of like how Team-XBMC's shortcut tool (http://www.xboxmediacenter.com/wiki/index.php?title=As_a_Dashboard#Option_1_-_Using_the_Team_XBMC_Shortcut.xbe_.28Recommended.2 9) (source code available in the SVN (https://svn.sourceforge.net/svnroot/xbmc/trunk/XBMC/tools/ShortcutXBE/)) works but with the addition of on-the-fly video-mode switching. That way you could use that xbe to launch XBMC each time, and maybe even add an option to edit that cfg (or xml) file from XBMC settings in the GUI. (The source code from nkpatcher (http://www.xbox-scene.com/xbox1data/sep/EEpFAZZyFAlOzQiFJa.php) and/or cherry's videomode code could possible be of help, more information here (http://xguides.xbox-scene.com/tikiwiki/tiki-index.php?page=nkpatcher10))
Xbox is put in to NTSC, and 480p enabled. Xbox then put back to PAL.
Following blunder code added to CApplication::Create, just after the GetModes() command:
// See if we can go to 480p - RH
BYTE currentCableMode = 0;
HalReadSMBusValue(0x20, 0x4, 0, (LPBYTE)¤tCableMode);
if((currentCableMode == 1)/*AV_PACK_HDTV*/ && g_videoConfig.HasPAL())
{
// We're in PAL mode, but connected to HDTV so switch to NTSC for 480p
char temp[1024];
helper.GetXbePath(temp);
char temp2[1024];
char temp3[2];
temp3[0] = temp[0]; temp3[1] = ' ';
helper.GetPartition((LPCSTR)temp3,temp2);
CStdString strTemp(temp+2);
int iLastSlash = strTemp.rfind('\');
strcat(temp2,strTemp.substr(0,iLastSlash).c_str()) ;
Destroy();
CUtil::LaunchXbe(temp2,("D:\"+strTemp.substr(iLastSlash+1)).c_str(),NULL,VIDEO_ NTSCM,COUNTRY_USA);
}
Basically, each time xbmc starts, it check to see if the HD component lead is connected (or in my case, the switch on the HD / Scart box) and if so, quits and re-runs itself in NTSC.
Must admit that XBMC looks a lot better in 480p (my projectors native resolution) than normal PAL.
Big thanks to the XBMC guys for making the thing compile 1st first time, and actually documenting the code :)
i like to have this because some of my games only run under ntsc..like psychonauts (i must run video disc switch and switch to ntsc for this game to work)
my xbox is pal
#If you have any other info about this subject , Please add it free.# |
Posted by mike under xn--6kr096akncb2j.comedit