Stub XamVoiceSubmitPacket Stubs for __CAP_Start_Profiling/End_Profiling/Enter_Function/Exit_Function add a note about io_status_block in NtDeviceIoControlFile, change the param's type move the X_IOCTL_ constants from NtDeviceIoControlFile's body into xbox.h add X_STATUS_INVALID_IMAGE_FORMAT to xbox.h Implement XexLoadImageHeaders Much more correct version of IoCreateDevice, properly initializes/allocates device extension data Stub version of IoDeleteDevice Open the quickstart guide in the browser the first time a user opens the emulator Add some persistent flags that are stored in the registry on windows, not in the config. These are just used to indicate whether one-time tasks have run, like showing the quickstart guide. On non-windows platforms a default value is returned that skips any of these tasks so they don't run every single time. If the user opens a .iso file, show a warning telling them that we do not condone or support piracy. If the user closes the messagebox within two seconds set a sticky flag that will show them the warning every time instead. Otherwise the warning is never shown again. The Beep function is used to spook them a bit, to hopefully make them less likely to skip the message If a user opens an archive file, which we do not support, explain to them that they're dumb. Removed messages intended to "catch" pirates. If they're out there, we don't want to know about them. A huge chunk of the discourse on our discord is now about piracy. Hopefully these changes will deter them from coming to us for now, but some of these messages may backfire
143 lines
4.9 KiB
C++
143 lines
4.9 KiB
C++
/**
|
|
******************************************************************************
|
|
* Xenia : Xbox 360 Emulator Research Project *
|
|
******************************************************************************
|
|
* Copyright 2022 Ben Vanik. All rights reserved. *
|
|
* Released under the BSD license - see LICENSE in the root for more details. *
|
|
******************************************************************************
|
|
*/
|
|
|
|
#include "xenia/base/logging.h"
|
|
#include "xenia/kernel/kernel_state.h"
|
|
#include "xenia/kernel/util/shim_utils.h"
|
|
#include "xenia/kernel/xbdm/xbdm_private.h"
|
|
#include "xenia/kernel/xthread.h"
|
|
#include "xenia/xbox.h"
|
|
//chrispy: no idea what a real valid value is for this
|
|
static constexpr const char DmXboxName[] = "Xbox360Name";
|
|
namespace xe {
|
|
namespace kernel {
|
|
namespace xbdm {
|
|
#define XBDM_SUCCESSFULL 0x02DA0000
|
|
#define MAKE_DUMMY_STUB_PTR(x) \
|
|
dword_result_t x##_entry() { return 0; } \
|
|
DECLARE_XBDM_EXPORT1(x, kDebug, kStub)
|
|
|
|
#define MAKE_DUMMY_STUB_STATUS(x) \
|
|
dword_result_t x##_entry() { return X_STATUS_INVALID_PARAMETER; } \
|
|
DECLARE_XBDM_EXPORT1(x, kDebug, kStub)
|
|
|
|
MAKE_DUMMY_STUB_PTR(DmAllocatePool);
|
|
|
|
void DmCloseLoadedModules_entry(lpdword_t unk0_ptr) {}
|
|
DECLARE_XBDM_EXPORT1(DmCloseLoadedModules, kDebug, kStub);
|
|
|
|
MAKE_DUMMY_STUB_STATUS(DmFreePool);
|
|
|
|
dword_result_t DmGetXbeInfo_entry() {
|
|
// TODO(gibbed): 4D5307DC appears to expect this as success?
|
|
// Unknown arguments -- let's hope things don't explode.
|
|
return XBDM_SUCCESSFULL;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmGetXbeInfo, kDebug, kStub);
|
|
|
|
dword_result_t DmGetXboxName_entry(const ppc_context_t& ctx) {
|
|
uint64_t arg1 = ctx->r[3];
|
|
uint64_t arg2 = ctx->r[4];
|
|
if (!arg1 || !arg2) {
|
|
return 0x80070057;
|
|
}
|
|
char* name_out = ctx->TranslateVirtualGPR<char*>(arg1);
|
|
|
|
uint32_t* max_name_chars_ptr = ctx->TranslateVirtualGPR<uint32_t*>(arg2);
|
|
|
|
uint32_t max_name_chars = xe::load_and_swap<uint32_t>(max_name_chars_ptr);
|
|
strncpy(name_out, DmXboxName, sizeof(DmXboxName));
|
|
|
|
|
|
return XBDM_SUCCESSFULL;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmGetXboxName, kDebug, kImplemented)
|
|
|
|
dword_result_t DmIsDebuggerPresent_entry() { return 0; }
|
|
DECLARE_XBDM_EXPORT1(DmIsDebuggerPresent, kDebug, kStub);
|
|
|
|
void DmSendNotificationString_entry(lpdword_t unk0_ptr) {}
|
|
DECLARE_XBDM_EXPORT1(DmSendNotificationString, kDebug, kStub);
|
|
|
|
dword_result_t DmRegisterCommandProcessor_entry(lpdword_t name_ptr,
|
|
lpdword_t handler_fn) {
|
|
// Return success to prevent some games from crashing
|
|
return X_STATUS_SUCCESS;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmRegisterCommandProcessor, kDebug, kStub);
|
|
|
|
dword_result_t DmRegisterCommandProcessorEx_entry(lpdword_t name_ptr,
|
|
lpdword_t handler_fn,
|
|
dword_t unk3) {
|
|
// Return success to prevent some games from stalling
|
|
return X_STATUS_SUCCESS;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmRegisterCommandProcessorEx, kDebug, kStub);
|
|
|
|
MAKE_DUMMY_STUB_STATUS(DmStartProfiling);
|
|
MAKE_DUMMY_STUB_STATUS(DmStopProfiling);
|
|
// two arguments, first is num frames i think, second is some kind of pointer to
|
|
// where to capture
|
|
dword_result_t DmCaptureStackBackTrace_entry(const ppc_context_t& ctx) {
|
|
uint32_t nframes = static_cast<uint32_t>(ctx->r[3]);
|
|
uint8_t* unknown_addr =
|
|
ctx->TranslateVirtual(static_cast<uint32_t>(ctx->r[4]));
|
|
return X_STATUS_INVALID_PARAMETER;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmCaptureStackBackTrace, kDebug, kStub);
|
|
|
|
MAKE_DUMMY_STUB_STATUS(DmGetThreadInfoEx);
|
|
MAKE_DUMMY_STUB_STATUS(DmSetProfilingOptions);
|
|
|
|
dword_result_t DmWalkLoadedModules_entry(lpdword_t unk0_ptr,
|
|
lpdword_t unk1_ptr) {
|
|
// Some games will loop forever unless this code is returned
|
|
return 0x82DA0104;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmWalkLoadedModules, kDebug, kStub);
|
|
|
|
void DmMapDevkitDrive_entry(const ppc_context_t& ctx) {
|
|
// games check for nonzero result, failure if nz
|
|
ctx->r[3] = 0ULL;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmMapDevkitDrive, kDebug, kStub);
|
|
|
|
dword_result_t DmFindPdbSignature_entry(lpdword_t unk0_ptr,
|
|
lpdword_t unk1_ptr) {
|
|
return X_STATUS_INVALID_PARAMETER;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmFindPdbSignature, kDebug, kStub);
|
|
|
|
dword_result_t DmGetConsoleDebugMemoryStatus_entry() {
|
|
return X_STATUS_SUCCESS;
|
|
}
|
|
DECLARE_XBDM_EXPORT1(DmGetConsoleDebugMemoryStatus, kDebug, kStub);
|
|
|
|
void __CAP_Start_Profiling_entry(dword_t a1, dword_t a2) {}
|
|
|
|
DECLARE_XBDM_EXPORT1(__CAP_Start_Profiling, kDebug, kStub);
|
|
|
|
void __CAP_End_Profiling_entry() {}
|
|
|
|
DECLARE_XBDM_EXPORT1(__CAP_End_Profiling, kDebug, kStub);
|
|
|
|
void __CAP_Enter_Function_entry() {}
|
|
|
|
DECLARE_XBDM_EXPORT1(__CAP_Enter_Function, kDebug, kStub);
|
|
|
|
void __CAP_Exit_Function_entry() {}
|
|
|
|
DECLARE_XBDM_EXPORT1(__CAP_Exit_Function, kDebug, kStub);
|
|
|
|
} // namespace xbdm
|
|
} // namespace kernel
|
|
} // namespace xe
|
|
|
|
DECLARE_XBDM_EMPTY_REGISTER_EXPORTS(Misc);
|