This commit is contained in:
ASNiVOR 2024-11-02 11:11:05 +00:00
parent 7559e22603
commit 9884488bf0
1 changed files with 18 additions and 3 deletions

View File

@ -1,4 +1,6 @@

using BizHawk.Common;
namespace BizHawk.Emulation.Cores.Components.vr6502
{
public partial class vr6502
@ -6,6 +8,8 @@ namespace BizHawk.Emulation.Cores.Components.vr6502
private VrEmu6502State _6502s;
private readonly VrEmu6502Model _model;
public long TotalExecutedCycles;
public vr6502(VrEmu6502Model model, VrEmu6502MemRead readFn, VrEmu6502MemWrite writeFn)
{
_model = model;
@ -21,13 +25,24 @@ namespace BizHawk.Emulation.Cores.Components.vr6502
}
public void ExecuteTick()
{
{
VrEmu6502Interop.vrEmu6502Tick(ref _6502s);
TotalExecutedCycles++;
}
public void ExecuteInstruction()
public byte ExecuteInstruction()
{
VrEmu6502Interop.vrEmu6502InstCycle(ref _6502s);
int cycles = VrEmu6502Interop.vrEmu6502InstCycle(ref _6502s);
TotalExecutedCycles += cycles;
return (byte)cycles;
}
public void SyncState(Serializer ser)
{
ser.BeginSection("vrEmu6502");
ser.Sync(nameof(TotalExecutedCycles), ref TotalExecutedCycles);
ser.EndSection();
}
}
}