-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathExecute_xD_Instruction.tt
43 lines (38 loc) · 1.31 KB
/
Execute_xD_Instruction.tt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<#@ template debug="false" hostspecific="true" language="C#" #>
<#@ assembly name="System.Core" #>
<#@ import namespace="System.IO" #>
<#@ import namespace="System.Linq" #>
<#@ import namespace="System.Text" #>
<#@ import namespace="System.Collections.Generic" #>
<#@ output extension=".cs" #>
// AUTOGENERATED CODE
//
// Do not make changes directly to this (.cs) file.
// Change <#=Path.GetFileName(Host.TemplateFile)#> instead.
namespace Konamiman.Z80dotNet
{
public partial class Z80InstructionExecutor
{
<# foreach(var op in new[] {"DD","FD"}) { #>
private int Execute_<#=op#>_Instruction()
{
Inc_R();
var secondOpcodeByte = ProcessorAgent.PeekNextOpcode();
if(secondOpcodeByte == 0xCB)
{
Inc_R();
ProcessorAgent.FetchNextOpcode();
var offset = ProcessorAgent.FetchNextOpcode();
return <#=op#>CB_InstructionExecutors[ProcessorAgent.FetchNextOpcode()](offset);
}
if(<#=op#>_InstructionExecutors.ContainsKey(secondOpcodeByte))
{
Inc_R();
ProcessorAgent.FetchNextOpcode();
return <#=op#>_InstructionExecutors[secondOpcodeByte]();
}
return NOP();
}
<# } #>
}
}