[Kernel] Suffix export functions with _entry.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
******************************************************************************
|
||||
* Xenia : Xbox 360 Emulator Research Project *
|
||||
******************************************************************************
|
||||
* Copyright 2013 Ben Vanik. All rights reserved. *
|
||||
* Copyright 2022 Ben Vanik. All rights reserved. *
|
||||
* Released under the BSD license - see LICENSE in the root for more details. *
|
||||
******************************************************************************
|
||||
*/
|
||||
@@ -48,7 +48,7 @@ namespace xboxkrnl {
|
||||
// https://www.microsoft.com/en-za/download/details.aspx?id=5313 -- "Stripped
|
||||
// Down Direct3D: Xbox 360 Command Buffer and Resource Management"
|
||||
|
||||
void VdGetCurrentDisplayGamma(lpdword_t type_ptr, lpfloat_t power_ptr) {
|
||||
void VdGetCurrentDisplayGamma_entry(lpdword_t type_ptr, lpfloat_t power_ptr) {
|
||||
// 1 - sRGB.
|
||||
// 2 - TV (BT.709).
|
||||
// 3 - use the power written to *power_ptr.
|
||||
@@ -104,9 +104,8 @@ struct X_DISPLAY_INFO {
|
||||
};
|
||||
static_assert_size(X_DISPLAY_INFO, 0x58);
|
||||
|
||||
void VdQueryVideoMode(pointer_t<X_VIDEO_MODE> video_mode);
|
||||
|
||||
void VdGetCurrentDisplayInformation(pointer_t<X_DISPLAY_INFO> display_info) {
|
||||
void VdGetCurrentDisplayInformation_entry(
|
||||
pointer_t<X_DISPLAY_INFO> display_info) {
|
||||
X_VIDEO_MODE mode;
|
||||
VdQueryVideoMode(&mode);
|
||||
|
||||
@@ -132,9 +131,9 @@ void VdGetCurrentDisplayInformation(pointer_t<X_DISPLAY_INFO> display_info) {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdGetCurrentDisplayInformation, kVideo, kStub);
|
||||
|
||||
void VdQueryVideoMode(pointer_t<X_VIDEO_MODE> video_mode) {
|
||||
void VdQueryVideoMode(X_VIDEO_MODE* video_mode) {
|
||||
// TODO(benvanik): get info from actual display.
|
||||
video_mode.Zero();
|
||||
std::memset(video_mode, 0, sizeof(X_VIDEO_MODE));
|
||||
video_mode->display_width = 1280;
|
||||
video_mode->display_height = 720;
|
||||
video_mode->is_interlaced = 0;
|
||||
@@ -145,9 +144,13 @@ void VdQueryVideoMode(pointer_t<X_VIDEO_MODE> video_mode) {
|
||||
video_mode->unknown_0x8a = 0x4A;
|
||||
video_mode->unknown_0x01 = 0x01;
|
||||
}
|
||||
|
||||
void VdQueryVideoMode_entry(pointer_t<X_VIDEO_MODE> video_mode) {
|
||||
VdQueryVideoMode(video_mode);
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoMode, kVideo, kStub);
|
||||
|
||||
dword_result_t VdQueryVideoFlags() {
|
||||
dword_result_t VdQueryVideoFlags_entry() {
|
||||
X_VIDEO_MODE mode;
|
||||
VdQueryVideoMode(&mode);
|
||||
|
||||
@@ -160,7 +163,7 @@ dword_result_t VdQueryVideoFlags() {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdQueryVideoFlags, kVideo, kStub);
|
||||
|
||||
dword_result_t VdSetDisplayMode(dword_t flags) {
|
||||
dword_result_t VdSetDisplayMode_entry(dword_t flags) {
|
||||
// Often 0x40000000.
|
||||
|
||||
// 0?ccf000 00000000 00000000 000000r0
|
||||
@@ -179,17 +182,17 @@ dword_result_t VdSetDisplayMode(dword_t flags) {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdSetDisplayMode, kVideo, kStub);
|
||||
|
||||
dword_result_t VdSetDisplayModeOverride(unknown_t unk0, unknown_t unk1,
|
||||
double_t refresh_rate, unknown_t unk3,
|
||||
unknown_t unk4) {
|
||||
dword_result_t VdSetDisplayModeOverride_entry(unknown_t unk0, unknown_t unk1,
|
||||
double_t refresh_rate,
|
||||
unknown_t unk3, unknown_t unk4) {
|
||||
// refresh_rate = 0, 50, 59.9, etc.
|
||||
return 0;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdSetDisplayModeOverride, kVideo, kStub);
|
||||
|
||||
dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback,
|
||||
lpvoid_t arg, lpdword_t pfp_ptr,
|
||||
lpdword_t me_ptr) {
|
||||
dword_result_t VdInitializeEngines_entry(unknown_t unk0, function_t callback,
|
||||
lpvoid_t arg, lpdword_t pfp_ptr,
|
||||
lpdword_t me_ptr) {
|
||||
// r3 = 0x4F810000
|
||||
// r4 = function ptr (cleanup callback?)
|
||||
// r5 = function arg
|
||||
@@ -199,27 +202,28 @@ dword_result_t VdInitializeEngines(unknown_t unk0, function_t callback,
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdInitializeEngines, kVideo, kStub);
|
||||
|
||||
void VdShutdownEngines() {
|
||||
void VdShutdownEngines_entry() {
|
||||
// Ignored for now.
|
||||
// Games seem to call an Initialize/Shutdown pair to query info, then
|
||||
// re-initialize.
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdShutdownEngines, kVideo, kStub);
|
||||
|
||||
dword_result_t VdGetGraphicsAsicID() {
|
||||
dword_result_t VdGetGraphicsAsicID_entry() {
|
||||
// Games compare for < 0x10 and do VdInitializeEDRAM, else other
|
||||
// (retrain/etc).
|
||||
return 0x11;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdGetGraphicsAsicID, kVideo, kStub);
|
||||
|
||||
dword_result_t VdEnableDisableClockGating(dword_t enabled) {
|
||||
dword_result_t VdEnableDisableClockGating_entry(dword_t enabled) {
|
||||
// Ignored, as it really doesn't matter.
|
||||
return 0;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdEnableDisableClockGating, kVideo, kStub);
|
||||
|
||||
void VdSetGraphicsInterruptCallback(function_t callback, lpvoid_t user_data) {
|
||||
void VdSetGraphicsInterruptCallback_entry(function_t callback,
|
||||
lpvoid_t user_data) {
|
||||
// callback takes 2 params
|
||||
// r3 = bool 0/1 - 0 is normal interrupt, 1 is some acquire/lock mumble
|
||||
// r4 = user_data (r4 of VdSetGraphicsInterruptCallback)
|
||||
@@ -228,7 +232,7 @@ void VdSetGraphicsInterruptCallback(function_t callback, lpvoid_t user_data) {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdSetGraphicsInterruptCallback, kVideo, kImplemented);
|
||||
|
||||
void VdInitializeRingBuffer(lpvoid_t ptr, int_t size_log2) {
|
||||
void VdInitializeRingBuffer_entry(lpvoid_t ptr, int_t size_log2) {
|
||||
// r3 = result of MmGetPhysicalAddress
|
||||
// r4 = log2(size)
|
||||
// Buffer pointers are from MmAllocatePhysicalMemory with WRITE_COMBINE.
|
||||
@@ -237,21 +241,22 @@ void VdInitializeRingBuffer(lpvoid_t ptr, int_t size_log2) {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdInitializeRingBuffer, kVideo, kImplemented);
|
||||
|
||||
void VdEnableRingBufferRPtrWriteBack(lpvoid_t ptr, int_t block_size_log2) {
|
||||
void VdEnableRingBufferRPtrWriteBack_entry(lpvoid_t ptr,
|
||||
int_t block_size_log2) {
|
||||
// r4 = log2(block size), 6, usually --- <=19
|
||||
auto graphics_system = kernel_state()->emulator()->graphics_system();
|
||||
graphics_system->EnableReadPointerWriteBack(ptr, block_size_log2);
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdEnableRingBufferRPtrWriteBack, kVideo, kImplemented);
|
||||
|
||||
void VdGetSystemCommandBuffer(lpunknown_t p0_ptr, lpunknown_t p1_ptr) {
|
||||
void VdGetSystemCommandBuffer_entry(lpunknown_t p0_ptr, lpunknown_t p1_ptr) {
|
||||
p0_ptr.Zero(0x94);
|
||||
xe::store_and_swap<uint32_t>(p0_ptr, 0xBEEF0000);
|
||||
xe::store_and_swap<uint32_t>(p1_ptr, 0xBEEF0001);
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdGetSystemCommandBuffer, kVideo, kStub);
|
||||
|
||||
void VdSetSystemCommandBufferGpuIdentifierAddress(lpunknown_t unk) {
|
||||
void VdSetSystemCommandBufferGpuIdentifierAddress_entry(lpunknown_t unk) {
|
||||
// r3 = 0x2B10(d3d?) + 8
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdSetSystemCommandBufferGpuIdentifierAddress, kVideo,
|
||||
@@ -262,7 +267,7 @@ DECLARE_XBOXKRNL_EXPORT1(VdSetSystemCommandBufferGpuIdentifierAddress, kVideo,
|
||||
// r4 = 19
|
||||
// no op?
|
||||
|
||||
dword_result_t VdInitializeScalerCommandBuffer(
|
||||
dword_result_t VdInitializeScalerCommandBuffer_entry(
|
||||
dword_t scaler_source_xy, // ((uint16_t)y << 16) | (uint16_t)x
|
||||
dword_t scaler_source_wh, // ((uint16_t)h << 16) | (uint16_t)w
|
||||
dword_t scaled_output_xy, // ((uint16_t)y << 16) | (uint16_t)x
|
||||
@@ -302,7 +307,7 @@ void AppendParam(StringBuffer* string_buffer, pointer_t<BufferScaling> param) {
|
||||
uint16_t(param->fb_width), uint16_t(param->fb_height));
|
||||
}
|
||||
|
||||
dword_result_t VdCallGraphicsNotificationRoutines(
|
||||
dword_result_t VdCallGraphicsNotificationRoutines_entry(
|
||||
unknown_t unk0, pointer_t<BufferScaling> args_ptr) {
|
||||
assert_true(unk0 == 1);
|
||||
|
||||
@@ -313,13 +318,13 @@ dword_result_t VdCallGraphicsNotificationRoutines(
|
||||
DECLARE_XBOXKRNL_EXPORT2(VdCallGraphicsNotificationRoutines, kVideo,
|
||||
kImplemented, kSketchy);
|
||||
|
||||
dword_result_t VdIsHSIOTrainingSucceeded() {
|
||||
dword_result_t VdIsHSIOTrainingSucceeded_entry() {
|
||||
// BOOL return value
|
||||
return 1;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdIsHSIOTrainingSucceeded, kVideo, kStub);
|
||||
|
||||
dword_result_t VdPersistDisplay(unknown_t unk0, lpdword_t unk1_ptr) {
|
||||
dword_result_t VdPersistDisplay_entry(unknown_t unk0, lpdword_t unk1_ptr) {
|
||||
// unk1_ptr needs to be populated with a pointer passed to
|
||||
// MmFreePhysicalMemory(1, *unk1_ptr).
|
||||
if (unk1_ptr) {
|
||||
@@ -334,23 +339,25 @@ dword_result_t VdPersistDisplay(unknown_t unk0, lpdword_t unk1_ptr) {
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT2(VdPersistDisplay, kVideo, kImplemented, kSketchy);
|
||||
|
||||
dword_result_t VdRetrainEDRAMWorker(unknown_t unk0) { return 0; }
|
||||
dword_result_t VdRetrainEDRAMWorker_entry(unknown_t unk0) { return 0; }
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdRetrainEDRAMWorker, kVideo, kStub);
|
||||
|
||||
dword_result_t VdRetrainEDRAM(unknown_t unk0, unknown_t unk1, unknown_t unk2,
|
||||
unknown_t unk3, unknown_t unk4, unknown_t unk5) {
|
||||
dword_result_t VdRetrainEDRAM_entry(unknown_t unk0, unknown_t unk1,
|
||||
unknown_t unk2, unknown_t unk3,
|
||||
unknown_t unk4, unknown_t unk5) {
|
||||
return 0;
|
||||
}
|
||||
DECLARE_XBOXKRNL_EXPORT1(VdRetrainEDRAM, kVideo, kStub);
|
||||
|
||||
void VdSwap(lpvoid_t buffer_ptr, // ptr into primary ringbuffer
|
||||
lpvoid_t fetch_ptr, // frontbuffer Direct3D 9 texture header fetch
|
||||
lpunknown_t unk2, // system writeback ptr
|
||||
lpunknown_t unk3, // buffer from VdGetSystemCommandBuffer
|
||||
lpunknown_t unk4, // from VdGetSystemCommandBuffer (0xBEEF0001)
|
||||
lpdword_t frontbuffer_ptr, // ptr to frontbuffer address
|
||||
lpdword_t texture_format_ptr, lpdword_t color_space_ptr,
|
||||
lpdword_t width, lpdword_t height) {
|
||||
void VdSwap_entry(
|
||||
lpvoid_t buffer_ptr, // ptr into primary ringbuffer
|
||||
lpvoid_t fetch_ptr, // frontbuffer Direct3D 9 texture header fetch
|
||||
lpunknown_t unk2, // system writeback ptr
|
||||
lpunknown_t unk3, // buffer from VdGetSystemCommandBuffer
|
||||
lpunknown_t unk4, // from VdGetSystemCommandBuffer (0xBEEF0001)
|
||||
lpdword_t frontbuffer_ptr, // ptr to frontbuffer address
|
||||
lpdword_t texture_format_ptr, lpdword_t color_space_ptr, lpdword_t width,
|
||||
lpdword_t height) {
|
||||
// All of these parameters are REQUIRED.
|
||||
assert(buffer_ptr);
|
||||
assert(fetch_ptr);
|
||||
|
||||
Reference in New Issue
Block a user