2019-04-07 12:25:14 -04:00
|
|
|
|
using Mesen.GUI.Debugger.Controls;
|
2019-05-04 09:33:28 -04:00
|
|
|
|
using Mesen.GUI.Debugger.Integration;
|
2019-04-07 12:25:14 -04:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Mesen.GUI.Debugger.Code
|
|
|
|
|
{
|
2019-04-27 12:10:31 -04:00
|
|
|
|
public class SpcDisassemblyManager : CpuDisassemblyManager
|
2019-04-07 12:25:14 -04:00
|
|
|
|
{
|
2019-05-19 14:58:26 -04:00
|
|
|
|
public override CpuType CpuType { get { return CpuType.Spc; } }
|
2019-04-27 12:10:31 -04:00
|
|
|
|
public override SnesMemoryType RelativeMemoryType { get { return SnesMemoryType.SpcMemory; } }
|
|
|
|
|
public override int AddressSize { get { return 4; } }
|
|
|
|
|
public override int ByteCodeSize { get { return 3; } }
|
2019-05-04 09:33:28 -04:00
|
|
|
|
public override bool AllowSourceView { get { return false; } }
|
2019-04-07 12:25:14 -04:00
|
|
|
|
|
2020-01-21 18:22:27 -05:00
|
|
|
|
public override void RefreshCode(ISymbolProvider symbolProvider, SourceFileInfo file)
|
2019-04-07 12:25:14 -04:00
|
|
|
|
{
|
|
|
|
|
this._provider = new CodeDataProvider(CpuType.Spc);
|
|
|
|
|
}
|
2019-05-24 21:58:05 -04:00
|
|
|
|
|
|
|
|
|
protected override int GetFullAddress(int address, int length)
|
|
|
|
|
{
|
|
|
|
|
SpcState state = DebugApi.GetState().Spc;
|
|
|
|
|
if(length == 2) {
|
|
|
|
|
//Determine address based on direct page flag
|
|
|
|
|
return (state.PS.HasFlag(SpcFlags.DirectPage) ? 0x100 : 0) | address;
|
|
|
|
|
}
|
|
|
|
|
return address;
|
|
|
|
|
}
|
2019-04-07 12:25:14 -04:00
|
|
|
|
}
|
|
|
|
|
}
|