NESHawk - threw .net 4.5's aggressive inline attribute on some hot functions, seems to give me about a 3-5% speedup
This commit is contained in:
parent
85571fe0ca
commit
e8eeb7f4fa
|
@ -4,6 +4,7 @@ using System.Diagnostics;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using BizHawk.Emulation.CPUs.M6502;
|
using BizHawk.Emulation.CPUs.M6502;
|
||||||
|
|
||||||
#pragma warning disable 162
|
#pragma warning disable 162
|
||||||
|
@ -299,6 +300,8 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
static ByteBuffer cpu_sequence_NTSC = new ByteBuffer(new byte[]{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
|
static ByteBuffer cpu_sequence_NTSC = new ByteBuffer(new byte[]{3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3,3});
|
||||||
static ByteBuffer cpu_sequence_PAL = new ByteBuffer(new byte[]{4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3});
|
static ByteBuffer cpu_sequence_PAL = new ByteBuffer(new byte[]{4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3,4,3,3,3,3});
|
||||||
public int cpu_step, cpu_stepcounter, cpu_deadcounter;
|
public int cpu_step, cpu_stepcounter, cpu_deadcounter;
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
protected void RunCpuOne()
|
protected void RunCpuOne()
|
||||||
{
|
{
|
||||||
cpu_stepcounter++;
|
cpu_stepcounter++;
|
||||||
|
@ -333,6 +336,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public byte ReadReg(int addr)
|
public byte ReadReg(int addr)
|
||||||
{
|
{
|
||||||
switch (addr)
|
switch (addr)
|
||||||
|
|
|
@ -4,6 +4,7 @@ using System;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
using BizHawk.Emulation.CPUs.M6502;
|
using BizHawk.Emulation.CPUs.M6502;
|
||||||
|
|
||||||
|
|
||||||
|
@ -143,6 +144,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
idleSynch = true;
|
idleSynch = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
void TriggerNMI()
|
void TriggerNMI()
|
||||||
{
|
{
|
||||||
nes.cpu.NMI = true;
|
nes.cpu.NMI = true;
|
||||||
|
@ -163,6 +165,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
void runppu(int x)
|
void runppu(int x)
|
||||||
{
|
{
|
||||||
//run one ppu cycle at a time so we can interact with the ppu and clockPPU at high granularity
|
//run one ppu cycle at a time so we can interact with the ppu and clockPPU at high granularity
|
||||||
|
|
Loading…
Reference in New Issue