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:
adelikat 2013-04-11 02:04:13 +00:00
parent 85571fe0ca
commit e8eeb7f4fa
2 changed files with 7 additions and 0 deletions

View File

@ -4,6 +4,7 @@ using System.Diagnostics;
using System.Globalization;
using System.IO;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using BizHawk.Emulation.CPUs.M6502;
#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_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;
[MethodImpl(MethodImplOptions.AggressiveInlining)]
protected void RunCpuOne()
{
cpu_stepcounter++;
@ -333,6 +336,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public byte ReadReg(int addr)
{
switch (addr)

View File

@ -4,6 +4,7 @@ using System;
using System.Globalization;
using System.IO;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using BizHawk.Emulation.CPUs.M6502;
@ -143,6 +144,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
idleSynch = true;
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
void TriggerNMI()
{
nes.cpu.NMI = true;
@ -163,6 +165,7 @@ namespace BizHawk.Emulation.Consoles.Nintendo
}
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
void runppu(int x)
{
//run one ppu cycle at a time so we can interact with the ppu and clockPPU at high granularity