decoder - Simplify RST command

We can calculate the rst address directly from the op code.
This commit is contained in:
madmaurice 2023-08-28 19:39:18 +02:00
parent ad2334a6af
commit e4a6b1f9b4

View file

@ -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