diff --git a/src/xenia/kernel/xboxkrnl_video.cc b/src/xenia/kernel/xboxkrnl_video.cc index 7dfab0387..bc73b29ce 100644 --- a/src/xenia/kernel/xboxkrnl_video.cc +++ b/src/xenia/kernel/xboxkrnl_video.cc @@ -39,37 +39,50 @@ void VdGetCurrentDisplayGamma(lpdword_t arg0_ptr, lpfloat_t arg1_ptr) { } DECLARE_XBOXKRNL_EXPORT(VdGetCurrentDisplayGamma, ExportTag::kVideo); -struct X_DISPLAY_INFO { - xe::be unk00; - xe::be unk02; - xe::be unk04; - xe::be unk05; - xe::be unk08; - xe::be unk0C; - xe::be unk10; - xe::be unk14; - xe::be unk18; - xe::be unk1C; - xe::be unk20; - xe::be unk24; - xe::be unk28; - xe::be unk2C; - xe::be unk30; - xe::be unk34; - xe::be unk38; - xe::be unk3C; - xe::be unk40; - xe::be unk42; - xe::be unk44; - xe::be unk46; - xe::be unk48; - xe::be unk4A; - xe::be unk4C; - xe::be unk50; - xe::be unk54; - xe::be unk56; +struct X_D3DPRIVATE_RECT { + xe::be x1; // 0x0 + xe::be y1; // 0x4 + xe::be x2; // 0x8 + xe::be y2; // 0xC }; -static_assert_size(X_DISPLAY_INFO, 88); +static_assert_size(X_D3DPRIVATE_RECT, 0x10); + +struct X_D3DFILTER_PARAMETERS { + xe::be nyquist; // 0x0 + xe::be flicker_filter; // 0x4 + xe::be beta; // 0x8 +}; +static_assert_size(X_D3DFILTER_PARAMETERS, 0xC); + +struct X_D3DPRIVATE_SCALER_PARAMETERS { + X_D3DPRIVATE_RECT scaler_source_rect; // 0x0 + xe::be scaled_output_width; // 0x10 + xe::be scaled_output_height; // 0x14 + xe::be vertical_filter_type; // 0x18 + X_D3DFILTER_PARAMETERS vertical_filter_parameters; // 0x1C + xe::be horizontal_filter_type; // 0x28 + X_D3DFILTER_PARAMETERS horizontal_filter_parameters; // 0x2C +}; +static_assert_size(X_D3DPRIVATE_SCALER_PARAMETERS, 0x38); + +struct X_DISPLAY_INFO { + xe::be front_buffer_width; // 0x0 + xe::be front_buffer_height; // 0x2 + xe::be front_buffer_color_format; // 0x4 + xe::be front_buffer_pixel_format; // 0x5 + X_D3DPRIVATE_SCALER_PARAMETERS scaler_parameters; // 0x6 + xe::be display_window_overscan_left; // 0x40 + xe::be display_window_overscan_top; // 0x42 + xe::be display_window_overscan_right; // 0x44 + xe::be display_window_overscan_bottom; // 0x46 + xe::be display_width; // 0x48 + xe::be display_height; // 0x4A + xe::be display_refresh_rate; // 0x4C + xe::be display_interlaced; // 0x50 + xe::be display_color_format; // 0x54 + xe::be actual_display_width; // 0x56 +}; +static_assert_size(X_DISPLAY_INFO, 0x58); void VdQueryVideoMode(pointer_t video_mode); @@ -78,26 +91,24 @@ void VdGetCurrentDisplayInformation(pointer_t display_info) { VdQueryVideoMode(&mode); display_info.Zero(); - display_info->unk00 = (xe::be)mode.display_width; - display_info->unk02 = (xe::be)mode.display_height; - display_info->unk08 = 0; - display_info->unk0C = 0; - display_info->unk10 = mode.display_width; // backbuffer width? - display_info->unk14 = mode.display_height; // backbuffer height? - display_info->unk18 = mode.display_width; - display_info->unk1C = mode.display_height; - display_info->unk20 = 1; - display_info->unk30 = 1; - display_info->unk40 = 320; // display_width / 4? - display_info->unk42 = 180; // display_height / 4? - display_info->unk44 = 320; - display_info->unk46 = 180; - display_info->unk48 = - (xe::be)mode.display_width; // actual display size? - display_info->unk4A = - (xe::be)mode.display_height; // actual display size? - display_info->unk4C = mode.refresh_rate; - display_info->unk56 = (xe::be)mode.display_width; // display width + display_info->front_buffer_width = (uint16_t)mode.display_width; + display_info->front_buffer_height = (uint16_t)mode.display_height; + + display_info->scaler_parameters.scaler_source_rect.x2 = mode.display_width; + display_info->scaler_parameters.scaler_source_rect.y2 = mode.display_height; + display_info->scaler_parameters.scaled_output_width = mode.display_width; + display_info->scaler_parameters.scaled_output_height = mode.display_height; + display_info->scaler_parameters.horizontal_filter_type = 1; + display_info->scaler_parameters.vertical_filter_type = 1; + + display_info->display_window_overscan_left = 320; + display_info->display_window_overscan_top = 180; + display_info->display_window_overscan_right = 320; + display_info->display_window_overscan_bottom = 180; + display_info->display_width = (uint16_t)mode.display_width; + display_info->display_height = (uint16_t)mode.display_height; + display_info->display_refresh_rate = mode.refresh_rate; + display_info->actual_display_width = (uint16_t)mode.display_width; } DECLARE_XBOXKRNL_EXPORT(VdGetCurrentDisplayInformation, ExportTag::kVideo); diff --git a/vsdebuggervis.natvis b/vsdebuggervis.natvis index 6d15009e8..7bf54d0d8 100644 --- a/vsdebuggervis.natvis +++ b/vsdebuggervis.natvis @@ -31,4 +31,24 @@ ((value & 0x00FF) << 8))} + + + + {value} + + + + + {value} + + + + + + + {host_ptr_} + + host_ptr_ + + \ No newline at end of file