DSP debugger: Fix prpage
This commit is contained in:
@@ -8,10 +8,6 @@
|
||||
#include "audio/dsp_binary.hpp"
|
||||
#include "services/dsp.hpp"
|
||||
|
||||
#undef Assert
|
||||
#undef UNREACHABLE
|
||||
#include "teakra/impl/register.h"
|
||||
|
||||
using namespace Audio;
|
||||
|
||||
TeakraDSP::TeakraDSP(Memory& mem, Scheduler& scheduler, DSPService& dspService, EmulatorConfig& config)
|
||||
@@ -322,4 +318,4 @@ void TeakraDSP::unloadComponent() {
|
||||
running = false;
|
||||
}
|
||||
|
||||
u32 TeakraDSP::getPC() { return teakra.GetRegisterState().pc; }
|
||||
void* TeakraDSP::getRegisters() { return &teakra.GetRegisterState(); }
|
||||
@@ -12,8 +12,13 @@
|
||||
#include <span>
|
||||
#include <utility>
|
||||
|
||||
#include "audio/dsp_core.hpp"
|
||||
#include "teakra/disassembler.h"
|
||||
|
||||
#undef Assert
|
||||
#undef UNREACHABLE
|
||||
#include "teakra/impl/register.h"
|
||||
|
||||
// TODO: Make this actually thread-safe by having it only work when paused
|
||||
static int getLinesInViewport(QListWidget* listWidget) {
|
||||
auto viewportHeight = listWidget->viewport()->height();
|
||||
@@ -167,7 +172,7 @@ void DSPDebugger::updateDisasm() {
|
||||
};
|
||||
|
||||
auto& mem = emu->getMemory();
|
||||
u32 pc = DSP->getPC();
|
||||
u32 pc = getPC();
|
||||
|
||||
std::string disassembly;
|
||||
|
||||
@@ -192,8 +197,21 @@ void DSPDebugger::updateDisasm() {
|
||||
disasmListWidget->setCurrentRow(currentRow);
|
||||
}
|
||||
|
||||
// This is only supported on the Teakra core, as other cores don't actually have a register contexts
|
||||
u32 DSPDebugger::getPC() {
|
||||
auto DSP = emu->getDSP();
|
||||
auto dspType = DSP->getType();
|
||||
|
||||
if (dspType == Audio::DSPCore::Type::Teakra) {
|
||||
auto regs = (Teakra::RegisterState*)DSP->getRegisters();
|
||||
return regs->pc | (u32(regs->prpage) << 18);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void DSPDebugger::scrollToPC() {
|
||||
u32 pc = emu->getDSP()->getPC();
|
||||
u32 pc = getPC();
|
||||
verticalScrollBar->setValue(pc);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user