decoder - Simplify RST command
We can calculate the rst address directly from the op code.
This commit is contained in:
parent
ad2334a6af
commit
e4a6b1f9b4
1 changed files with 2 additions and 14 deletions
|
@ -298,21 +298,9 @@ void Cpu::step()
|
|||
mcycles = 2;
|
||||
}
|
||||
}
|
||||
else if(op & 0xC7 == 0xC7)
|
||||
else if(op & 0xC7 == 0xC7) // RST
|
||||
{
|
||||
u16 rst_addr;
|
||||
switch((op >> 3) & 0x7)
|
||||
{
|
||||
case 0x0: rst_addr = 0x00; break;
|
||||
case 0x1: rst_addr = 0x08; break;
|
||||
case 0x2: rst_addr = 0x10; break;
|
||||
case 0x3: rst_addr = 0x18; break;
|
||||
case 0x4: rst_addr = 0x20; break;
|
||||
case 0x5: rst_addr = 0x28; break;
|
||||
case 0x6: rst_addr = 0x30; break;
|
||||
case 0x7: rst_addr = 0x38; break;
|
||||
}
|
||||
|
||||
u16 rst_addr = op & 0x38;
|
||||
doCall(rst_addr);
|
||||
}
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue