[Kernel] Added VdQueryRealVideoMode

This commit is contained in:
Gliniak
2025-10-16 23:36:41 +02:00
committed by Radosław Gliński
parent 7f359f3654
commit 777c394e25
4 changed files with 34 additions and 13 deletions

View File

@@ -34,12 +34,27 @@ class Emulator;
namespace xe {
namespace gpu {
inline const std::vector<std::pair<uint16_t, uint16_t>>
internal_display_resolution_entries = {
{640, 480}, {640, 576}, {720, 480}, {720, 576}, {800, 600},
{848, 480}, {1024, 768}, {1152, 864}, {1280, 720}, {1280, 768},
{1280, 960}, {1280, 1024}, {1360, 768}, {1440, 900}, {1680, 1050},
{1920, 540}, {1920, 1080}};
constexpr std::array<std::pair<uint16_t, uint16_t>, 17>
internal_display_resolution_entries = {{{640, 480},
{640, 576},
{720, 480},
{720, 576},
{800, 600},
{848, 480},
{1024, 768},
{1152, 864},
{1280, 720},
{1280, 768},
{1280, 960},
{1280, 1024},
{1360, 768},
{1440, 900},
{1680, 1050},
{1920, 540},
{1920, 1080}}};
constexpr std::array<std::pair<uint16_t, uint16_t>, 3>
driver_display_resolution = {{{1440, 900}, {1280, 720}, {1680, 1050}}};
class CommandProcessor;

View File

@@ -25,9 +25,9 @@ enum X_VIDEO_CAPABILITIES : uint32_t {
void XGetVideoMode_entry(pointer_t<X_VIDEO_MODE> video_mode) {
// TODO(benvanik): actually check to see if these are the same.
xboxkrnl::VdQueryVideoMode(video_mode);
xboxkrnl::VdQueryVideoMode(video_mode, false);
}
DECLARE_XAM_EXPORT1(XGetVideoMode, kVideo, ExportTag::kSketchy);
DECLARE_XAM_EXPORT1(XGetVideoMode, kVideo, kSketchy);
dword_result_t XGetVideoCapabilities_entry() {
uint32_t capabilities = 0;

View File

@@ -175,7 +175,7 @@ static_assert_size(X_DISPLAY_INFO, 0x58);
void VdGetCurrentDisplayInformation_entry(
pointer_t<X_DISPLAY_INFO> display_info) {
X_VIDEO_MODE mode;
VdQueryVideoMode(&mode);
VdQueryVideoMode(&mode, false);
display_info.Zero();
display_info->front_buffer_width = (uint16_t)mode.display_width;
@@ -200,7 +200,8 @@ void VdGetCurrentDisplayInformation_entry(
}
DECLARE_XBOXKRNL_EXPORT1(VdGetCurrentDisplayInformation, kVideo, kStub);
void VdQueryVideoMode(X_VIDEO_MODE* video_mode) {
void VdQueryVideoMode(X_VIDEO_MODE* video_mode,
[[maybe_unused]] bool is_internal_resolution) {
// TODO(benvanik): get info from actual display.
std::memset(video_mode, 0, sizeof(X_VIDEO_MODE));
@@ -217,14 +218,19 @@ void VdQueryVideoMode(X_VIDEO_MODE* video_mode) {
video_mode->widescreen_flag = cvars::widescreen ? 0x01 : 0x03;
}
void VdQueryRealVideoMode_entry(pointer_t<X_VIDEO_MODE> video_mode) {
VdQueryVideoMode(video_mode, true);
}
DECLARE_XBOXKRNL_EXPORT1(VdQueryRealVideoMode, kVideo, kStub);
void VdQueryVideoMode_entry(pointer_t<X_VIDEO_MODE> video_mode) {
VdQueryVideoMode(video_mode);
VdQueryVideoMode(video_mode, false);
}
DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoMode, kVideo, kStub);
dword_result_t VdQueryVideoFlags_entry() {
X_VIDEO_MODE mode;
VdQueryVideoMode(&mode);
VdQueryVideoMode(&mode, false);
uint32_t flags = 0;
flags |= mode.is_widescreen ? 1 : 0;

View File

@@ -16,7 +16,7 @@ namespace xe {
namespace kernel {
namespace xboxkrnl {
void VdQueryVideoMode(X_VIDEO_MODE* video_mode);
void VdQueryVideoMode(X_VIDEO_MODE* video_mode, bool is_internal_resolution);
} // namespace xboxkrnl
} // namespace kernel