mirror of
https://github.com/SourMesen/Mesen2.git
synced 2025-04-02 10:21:44 -04:00
Debugger: Register Viewer - SNES - Added wram register position
This commit is contained in:
parent
6262048b0a
commit
bccdfa2d82
8 changed files with 23 additions and 2 deletions
|
@ -61,7 +61,7 @@ void RegisterHandlerB::Write(uint32_t addr, uint8_t value)
|
|||
{
|
||||
addr &= 0xFFFF;
|
||||
if(addr >= 0x2140 && addr <= 0x217F) {
|
||||
return _spc->CpuWriteRegister(addr & 0x03, value);
|
||||
_spc->CpuWriteRegister(addr & 0x03, value);
|
||||
} if(addr >= 0x2180 && addr <= 0x2183) {
|
||||
switch(addr & 0xFFFF) {
|
||||
case 0x2180:
|
||||
|
@ -78,7 +78,7 @@ void RegisterHandlerB::Write(uint32_t addr, uint8_t value)
|
|||
} else if(addr >= 0x2200 && addr <= 0x22FF && _console->GetCartridge()->GetSa1()) {
|
||||
_console->GetCartridge()->GetSa1()->CpuRegisterWrite(addr, value);
|
||||
} else if(_msu1 && addr <= 0x2007) {
|
||||
return _msu1->Write(addr, value);
|
||||
_msu1->Write(addr, value);
|
||||
} else {
|
||||
_ppu->Write(addr, value);
|
||||
}
|
||||
|
@ -89,6 +89,11 @@ AddressInfo RegisterHandlerB::GetAbsoluteAddress(uint32_t address)
|
|||
return { -1, MemoryType::SnesMemory };
|
||||
}
|
||||
|
||||
uint32_t RegisterHandlerB::GetWramPosition()
|
||||
{
|
||||
return _wramPosition;
|
||||
}
|
||||
|
||||
void RegisterHandlerB::Serialize(Serializer &s)
|
||||
{
|
||||
SV(_wramPosition);
|
||||
|
|
|
@ -34,6 +34,8 @@ public:
|
|||
void Write(uint32_t addr, uint8_t value) override;
|
||||
|
||||
AddressInfo GetAbsoluteAddress(uint32_t address) override;
|
||||
|
||||
uint32_t GetWramPosition();
|
||||
|
||||
void Serialize(Serializer &s) override;
|
||||
};
|
|
@ -513,6 +513,7 @@ void SnesConsole::GetConsoleState(BaseState& baseState, ConsoleType consoleType)
|
|||
|
||||
SnesState& state = (SnesState&)baseState;
|
||||
state.MasterClock = GetMasterClock();
|
||||
state.WramPosition = _memoryManager->GetWramPosition();
|
||||
state.Cpu = _cpu->GetState();
|
||||
_ppu->GetState(state.Ppu, false);
|
||||
state.Spc = _spc->GetState();
|
||||
|
|
|
@ -413,6 +413,11 @@ bool SnesMemoryManager::IsWorkRam(uint32_t cpuAddress)
|
|||
return handler && handler->GetMemoryType() == MemoryType::SnesWorkRam;
|
||||
}
|
||||
|
||||
uint32_t SnesMemoryManager::GetWramPosition()
|
||||
{
|
||||
return _registerHandlerB->GetWramPosition();
|
||||
}
|
||||
|
||||
void SnesMemoryManager::Serialize(Serializer &s)
|
||||
{
|
||||
SV(_masterClock); SV(_openBus); SV(_cpuSpeed); SV(_hClock); SV(_dramRefreshPosition);
|
||||
|
|
|
@ -103,5 +103,7 @@ public:
|
|||
bool IsRegister(uint32_t cpuAddress);
|
||||
bool IsWorkRam(uint32_t cpuAddress);
|
||||
|
||||
uint32_t GetWramPosition();
|
||||
|
||||
void Serialize(Serializer &s) override;
|
||||
};
|
||||
|
|
|
@ -27,4 +27,6 @@ struct SnesState
|
|||
SnesDmaControllerState Dma;
|
||||
InternalRegisterState InternalRegs;
|
||||
AluState Alu;
|
||||
|
||||
uint32_t WramPosition;
|
||||
};
|
|
@ -942,6 +942,8 @@ namespace Mesen.Debugger.ViewModels
|
|||
AluState alu = state.Alu;
|
||||
|
||||
List<RegEntry> entries = new List<RegEntry>() {
|
||||
new RegEntry("$2181 - $2183", "Work RAM Position", state.WramPosition, Format.X24),
|
||||
|
||||
new RegEntry("$4200 - $4201", "IRQ/NMI/Autopoll Enabled"),
|
||||
new RegEntry("$4200.0", "Auto Joypad Poll", regs.EnableAutoJoypadRead),
|
||||
new RegEntry("$4200.4", "H IRQ Enabled", regs.EnableHorizontalIrq),
|
||||
|
|
|
@ -1010,6 +1010,8 @@ namespace Mesen.Interop
|
|||
public SnesDmaControllerState Dma;
|
||||
public InternalRegisterState InternalRegs;
|
||||
public AluState Alu;
|
||||
|
||||
public UInt32 WramPosition;
|
||||
}
|
||||
|
||||
public struct EmptyPpuToolsState : BaseState
|
||||
|
|
Loading…
Add table
Reference in a new issue