-
Notifications
You must be signed in to change notification settings - Fork 24
/
Copy pathExecute_xD_Instruction.cs
57 lines (48 loc) · 1.62 KB
/
Execute_xD_Instruction.cs
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// AUTOGENERATED CODE
//
// Do not make changes directly to this (.cs) file.
// Change Execute_xD_Instruction.tt instead.
namespace Konamiman.Z80dotNet
{
public partial class Z80InstructionExecutor
{
private int Execute_DD_Instruction()
{
Inc_R();
var secondOpcodeByte = ProcessorAgent.PeekNextOpcode();
if(secondOpcodeByte == 0xCB)
{
Inc_R();
ProcessorAgent.FetchNextOpcode();
var offset = ProcessorAgent.FetchNextOpcode();
return DDCB_InstructionExecutors[ProcessorAgent.FetchNextOpcode()](offset);
}
if(DD_InstructionExecutors.ContainsKey(secondOpcodeByte))
{
Inc_R();
ProcessorAgent.FetchNextOpcode();
return DD_InstructionExecutors[secondOpcodeByte]();
}
return NOP();
}
private int Execute_FD_Instruction()
{
Inc_R();
var secondOpcodeByte = ProcessorAgent.PeekNextOpcode();
if(secondOpcodeByte == 0xCB)
{
Inc_R();
ProcessorAgent.FetchNextOpcode();
var offset = ProcessorAgent.FetchNextOpcode();
return FDCB_InstructionExecutors[ProcessorAgent.FetchNextOpcode()](offset);
}
if(FD_InstructionExecutors.ContainsKey(secondOpcodeByte))
{
Inc_R();
ProcessorAgent.FetchNextOpcode();
return FD_InstructionExecutors[secondOpcodeByte]();
}
return NOP();
}
}
}