Skip to content

Commit

Permalink
Base: Add the rest of the logging classes and update Hostbridge log s…
Browse files Browse the repository at this point in the history
…ystem.
  • Loading branch information
bitsh1ft3r committed Jan 29, 2025
1 parent 0433f92 commit 2d1f1df
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 12 deletions.
9 changes: 9 additions & 0 deletions Xenon/Base/Logging/Filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,16 @@ bool ParseFilterRule(Filter& instance, Iterator begin, Iterator end) {
SUB(Xenon, PostBus) \
CLS(Xenos) \
CLS(RootBus) \
CLS(HostBridge) \
CLS(PCIBridge) \
CLS(AudioController) \
CLS(EHCI) \
CLS(OHCI) \
CLS(ETH) \
CLS(HDD) \
CLS(ODD) \
CLS(SFCX) \
CLS(XMA) \
CLS(Guest) \
CLS(SMC) \
CLS(UART)
Expand Down
11 changes: 10 additions & 1 deletion Xenon/Base/Logging/Types.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,19 @@ enum class Class : u8 {
Xenon_PostBus, // Xenon Post Bus output messages.
Xenos, // Xenos GPU messages.
RootBus, // RootBus messages. Missing/unmapped memory, etc...
HostBridge, // Hostbridge messages.
PCIBridge, // PCI Bridge messages: Connected devices, failed lookups, etc..
AudioController, // Several devices on the system:
EHCI,
OHCI,
ETH,
HDD,
ODD,
SFCX,
XMA,
SMC, // System Management Controller messages.
UART, // UART output.
Guest, // Guest hardware output. Xbox Kernel Debug Prints.
Guest, // Guest hardware output. Xbox Kernel Debug Prints.
Count // Total number of logging classes.
};

Expand Down
20 changes: 9 additions & 11 deletions Xenon/Core/RootBus/HostBridge/HostBridge.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Copyright 2025 Xenon Emulator Project

#include "HostBridge.h"
#include "Base/Logging/Log.h"

HostBridge::HostBridge() {
xGPU = nullptr;
Expand Down Expand Up @@ -47,8 +48,8 @@ bool HostBridge::Read(u64 readAddress, u64 *data, u8 byteCount) {
*data = biuRegs.REG_E1040000;
break;
default:
std::cout << "HostBridge/BIU: Unknown register being read at address 0x"
<< readAddress << std::endl;
LOG_ERROR(HostBridge, "Unknown register being read at address: {0:#x}.",
readAddress);
*data = 0;
break;
}
Expand Down Expand Up @@ -142,9 +143,8 @@ bool HostBridge::Write(u64 writeAddress, u64 data, u8 byteCount) {
biuRegs.REG_E1040078 = static_cast<u32>(data);
break;
default:
std::cout
<< "HostBridge/BIU: Unknown register being written at address 0x"
<< writeAddress << " data = 0x" << data << std::endl;
LOG_ERROR(HostBridge, "Unknown register being written at address: {0:#x}, data: {0:#x}.",
writeAddress, data);
break;
}
return true;
Expand Down Expand Up @@ -183,9 +183,8 @@ void HostBridge::ConfigRead(u64 readAddress, u64 *data, u8 byteCount) {
xGPU->ConfigRead(readAddress, data, byteCount);
break;
default:
std::cout
<< "BUS 0: Configuration Read to inexistant PCI Device at address 0x"
<< readAddress << std::endl;
LOG_ERROR(HostBridge, "BUS0: Configuration read to inexistant PCI Device at address: {0:#x}.",
readAddress);
break;
}
return;
Expand Down Expand Up @@ -213,9 +212,8 @@ void HostBridge::ConfigWrite(u64 writeAddress, u64 data, u8 byteCount) {
xGPU->ConfigWrite(writeAddress, data, byteCount);
break;
default:
std::cout
<< "BUS 0: Configuration Write to inexistant PCI Device at address 0x"
<< writeAddress << std::endl;
LOG_ERROR(HostBridge, "BUS0: Configuration Write to inexistant PCI Device at address: {0:#x}, data: {0:#x}.",
writeAddress, data);
break;
}
return;
Expand Down

0 comments on commit 2d1f1df

Please sign in to comment.