Skip to content

Commit

Permalink
Debugger: PCE - Event Viewer - Don't interpret supergrafx VPC writes …
Browse files Browse the repository at this point in the history
…as VDC writes
  • Loading branch information
SourMesen committed Sep 15, 2023
1 parent 5f89c25 commit b11369e
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Core/PCE/Debugger/PceEventManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ PceEventManager::PceEventManager(Debugger *debugger, PceConsole *console)
{
_debugger = debugger;
_emu = debugger->GetEmulator();
_console = console;
_cpu = console->GetCpu();
_vdc = console->GetVdc();
_vpc = console->GetVpc();
Expand All @@ -45,8 +46,18 @@ void PceEventManager::AddEvent(DebugEventType type, MemoryOperationInfo &operati
evt.DmaChannel = -1;
evt.ProgramCounter = _debugger->GetProgramCounter(CpuType::Pce, true);

if(operation.Type == MemoryOperationType::Write && (operation.Address & 0x1FFF) < 0x400 && (operation.Address & 0x03) >= 2) {
evt.RegisterId = _vdc->GetState().CurrentReg; //VDC reg
if(operation.Type == MemoryOperationType::Write && (operation.Address & 0x1FFF) < 0x400) {
if(_console->IsSuperGrafx()) {
if((operation.Address & 0x1A) == 2) {
evt.RegisterId = _vdc->GetState().CurrentReg; //VDC reg
} else {
//TODOv2 - supergrafx VPC writes, not VDC
}
} else {
if((operation.Address & 0x03) >= 2) {
evt.RegisterId = _vdc->GetState().CurrentReg; //VDC reg
}
}
}

_debugEvents.push_back(evt);
Expand Down
1 change: 1 addition & 0 deletions Core/PCE/Debugger/PceEventManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ class PceEventManager final : public BaseEventManager
private:
PceEventViewerConfig _config;
Emulator* _emu;
PceConsole* _console;
PceCpu* _cpu;
PceVdc* _vdc;
PceVpc* _vpc;
Expand Down

0 comments on commit b11369e

Please sign in to comment.