Small fixes and improvements
This commit is contained in:
@@ -59,15 +59,15 @@ void Core::Run(float volumeL, float volumeR) {
|
||||
for(; cycles < mem.mmio.vi.cyclesPerHalfline; cycles++, frameCycles++) {
|
||||
u32 taken = cpu->Step();
|
||||
taken += regs.PopStalledCycles();
|
||||
static u32 cpuSteps = 0;
|
||||
cpuSteps += taken;
|
||||
|
||||
regs.steps += taken;
|
||||
if(mmio.rsp.spStatus.halt) {
|
||||
cpuSteps = 0;
|
||||
regs.steps = 0;
|
||||
mmio.rsp.steps = 0;
|
||||
} else {
|
||||
while(cpuSteps > 2) {
|
||||
while(regs.steps > 2) {
|
||||
mmio.rsp.steps += 2;
|
||||
cpuSteps -= 3;
|
||||
regs.steps -= 3;
|
||||
}
|
||||
|
||||
while(mmio.rsp.steps > 0) {
|
||||
|
||||
@@ -271,7 +271,7 @@ template <> void PI::BusWrite<u32, false>(u32 addr, u32 val) {
|
||||
if (val < CART_ISVIEWER_SIZE) {
|
||||
std::string message(val + 1, 0);
|
||||
std::copy(mem.isviewer.begin(), mem.isviewer.begin() + val, message.begin());
|
||||
Util::print("{}", message);
|
||||
Util::always("{}", message);
|
||||
} else {
|
||||
Util::panic("ISViewer buffer size is emulated at {} bytes, but received a flush command for {} bytes!", CART_ISVIEWER_SIZE, val);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ struct Registers {
|
||||
s64 oldPC{}, pc{}, nextPC{};
|
||||
s64 hi{}, lo{};
|
||||
bool prevDelaySlot{}, delaySlot{};
|
||||
int steps = 0;
|
||||
u32 steps = 0;
|
||||
u32 extraCycles = 0;
|
||||
|
||||
void CpuStall(u32 cycles) {
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
|
||||
namespace Util {
|
||||
enum LogLevel : u8 {
|
||||
Trace, Debug, Info, Warn, Error
|
||||
Trace, Debug, Info, Warn, Error, Always
|
||||
};
|
||||
|
||||
#ifndef NDEBUG
|
||||
@@ -26,7 +26,7 @@ constexpr void print(const std::string& fmt, Args... args) {
|
||||
fmt::print(fmt::emphasis::bold | fg(fmt::color::red), fmt, args...);
|
||||
} else if constexpr(messageType == Warn) {
|
||||
fmt::print(fg(fmt::color::yellow), fmt, args...);
|
||||
} else if constexpr(messageType == Info || messageType == Trace) {
|
||||
} else if constexpr(messageType == Info || messageType == Trace || messageType == Always) {
|
||||
fmt::print(fmt, args...);
|
||||
} else if constexpr(messageType == Debug) {
|
||||
#ifndef NDEBUG
|
||||
@@ -76,6 +76,11 @@ constexpr void trace(const std::string& fmt, Args... args) {
|
||||
print<Trace>("[TRACE] " + fmt + "\n", args...);
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
constexpr void always(const std::string& fmt, Args... args) {
|
||||
print<Always>(fmt + "\n", args...);
|
||||
}
|
||||
|
||||
template <typename ...Args>
|
||||
constexpr void panic_trace(const std::string& fmt, Args... args) {
|
||||
#if !defined(NDEBUG) && !defined(_WIN32)
|
||||
|
||||
Reference in New Issue
Block a user