[XBDM] Added sketchy implementation of DmPMCGetCounterName and DmPMCInstallAndStart

This commit is contained in:
Gliniak
2025-11-01 00:13:08 +01:00
committed by Radosław Gliński
parent 892aa85913
commit efa0a8bb39
4 changed files with 65 additions and 0 deletions

View File

@@ -468,6 +468,23 @@ DECLARE_XBDM_EXPORT1(DmSetDumpMode, kDebug, kStub);
dword_result_t DmIsFastCAPEnabled_entry() { return XBDM_UNSUCCESSFUL; }
DECLARE_XBDM_EXPORT1(DmIsFastCAPEnabled, kDebug, kStub);
dword_result_t DmPMCInstallAndStart_entry(dword_t group_setup) {
// Not initialized, so let's initialize it
if (kernel_state()->xbdm_counters_address[0] == 0) {
kernel_state()->InitializeXbdmCpuCounters();
}
return XBDM_SUCCESSFUL;
}
DECLARE_XBDM_EXPORT1(DmPMCInstallAndStart, kDebug, kSketchy);
dword_result_t DmPMCGetCounterName_entry(dword_t counter_id) {
// This returns pointer to already preallocated string with counter names.
// We should make allocation somewhere during xbdm initialization once
return kernel_state()->xbdm_counters_address
[counter_id < 0x10 ? static_cast<uint32_t>(counter_id) : 0x10];
}
DECLARE_XBDM_EXPORT1(DmPMCGetCounterName, kDebug, kSketchy);
void __CAP_Start_Profiling_entry(dword_t a1, dword_t a2) {}
DECLARE_XBDM_EXPORT1(__CAP_Start_Profiling, kDebug, kStub);

View File

@@ -26,6 +26,7 @@ static constexpr char DmXboxName[] = "Xbox360Name";
#define XBDM_UNSUCCESSFUL 0x82DA0000
#define XBDM_FASTCAPENABLED 0x82DA0007
#define XBDM_ALREADYEXISTS 0x82DA0010
#define XBDM_UNKNOWNFAILURE 0x82DA002C
#define XBDM_ENDOFLIST 0x82DA0104
#define XBDM_BUFFER_TOO_SMALL 0x82DA0105