cpu/decoder - Fix build errors

This commit is contained in:
madmaurice 2023-08-29 23:13:23 +02:00
parent 517577d546
commit ef2615c1a7

View file

@ -176,7 +176,7 @@ void Cpu::executeInstruction()
{ {
u16 rhs = state.reg16((op >> 4) & 0x3); u16 rhs = state.reg16((op >> 4) & 0x3);
u16 res12 = (state.HL & 0x0FFF) + (rhs & 0x0FFF); u16 res12 = (state.HL & 0x0FFF) + (rhs & 0x0FFF);
state.halfcarry = (res11 & 0x1000); state.halfcarry = (res12 & 0x1000);
u32 res32 = (u32)state.HL + (u32)rhs; u32 res32 = (u32)state.HL + (u32)rhs;
state.carry = (res32 & 0x10000); state.carry = (res32 & 0x10000);
state.subtract = false; state.subtract = false;
@ -457,6 +457,7 @@ void Cpu::executeInstruction()
break; break;
case 0xE8: // ADD SP, e8 case 0xE8: // ADD SP, e8
{
u32 lhs = state.SP; u32 lhs = state.SP;
s32 rhs = (s8)readPC8(); s32 rhs = (s8)readPC8();
u32 low_add = (lhs & 0x0FFF) + (rhs & 0x0FFF); u32 low_add = (lhs & 0x0FFF) + (rhs & 0x0FFF);
@ -467,6 +468,8 @@ void Cpu::executeInstruction()
state.subtract = false; state.subtract = false;
state.zero = false; state.zero = false;
mcycles = 4; mcycles = 4;
}
break;
default: default:
panic("Unknown opcode 0x%x\n",op); panic("Unknown opcode 0x%x\n",op);