Skip to content

Commit

Permalink
Merge pull request #410 from LukeUsher/master
Browse files Browse the repository at this point in the history
Revert "Implement AvQueryAvCapabilities"
  • Loading branch information
LukeUsher committed Apr 29, 2017
2 parents e250b1f + cf43505 commit 394aee6
Showing 1 changed file with 11 additions and 35 deletions.
46 changes: 11 additions & 35 deletions src/CxbxKrnl/EmuKrnlAv.cpp
Expand Up @@ -61,41 +61,17 @@ PVOID g_pPersistedData = NULL;

ULONG AvQueryAvCapabilities()
{
ULONG Type;
ULONG Result;
ULONG ResultLength;

// TODO: For the AV Pack, read SMC_COMMAND_VIDEO_MODE (or HalBootSMCVideoMode) and convert it to a AV_PACK_*
ULONG Capabilities = AV_PACK_HDTV;

// Read the AV Region
NTSTATUS status = xboxkrnl::ExQueryNonVolatileSetting(
xboxkrnl::XC_FACTORY_AV_REGION,
&Type,
&Result,
sizeof(Result),
&ResultLength);

// If the value was not set, default to NTSC
if (status != STATUS_SUCCESS || ResultLength != sizeof(Result)) {
Result = AV_STANDARD_NTSC_M | AV_FLAGS_60Hz;
}

Capabilities |= Result & (AV_STANDARD_MASK | AV_REFRESH_MASK);

// Read the User's configuration (Set in the Dashboard)
status = xboxkrnl::ExQueryNonVolatileSetting(xboxkrnl::XC_VIDEO,
&Type,
&Result,
sizeof(Result),
&ResultLength);

// If no result, default to no options selected
if (status != STATUS_SUCCESS || ResultLength != sizeof(Result)) {
Result = 0;
}

return Capabilities | Result & ~(AV_STANDARD_MASK | AV_PACK_MASK);
// This is the only AV mode we currently emulate, so we can hardcode the return value
// TODO: Once we allow the user to configure the connected AV pack, we should implement this proper
// This function should first query the AV Pack type, read the user's EEPROM settings and
// return the correct flags based on this.
//
// For the AV Pack, read SMC_COMMAND_VIDEO_MODE (or HalBootSMCVideoMode) and convert it to a AV_PACK_*
//
// To read the EEPROM, call ExQueryNonVolatileSetting() with these config flags :
// XC_FACTORY_AV_REGION; if that fails, fallback on AV_STANDARD_NTSC_M | AV_FLAGS_60Hz
// XC_VIDEO_FLAGS; if that fails, fallback on 0
return AV_PACK_HDTV | AV_STANDARD_NTSC_M | AV_FLAGS_60Hz;
}

// Xbox code will set this address via AvSetSavedDataAddress
Expand Down

0 comments on commit 394aee6

Please sign in to comment.