diff --git a/DevTools/UserspaceEmulator/SoftCPU.cpp b/DevTools/UserspaceEmulator/SoftCPU.cpp index ba667afb33..19d63cfe28 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.cpp +++ b/DevTools/UserspaceEmulator/SoftCPU.cpp @@ -1412,7 +1412,12 @@ void SoftCPU::FCHS(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FABS(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FTST(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FXAM(const X86::Instruction&) { TODO_INSN(); } -void SoftCPU::FLDCW(const X86::Instruction&) { TODO_INSN(); } + +void SoftCPU::FLDCW(const X86::Instruction& insn) +{ + m_fpu_cw = insn.modrm().read16>(*this, insn); +} + void SoftCPU::FLD1(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FLDL2T(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FLDL2E(const X86::Instruction&) { TODO_INSN(); } @@ -1429,7 +1434,12 @@ void SoftCPU::FXTRACT(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FPREM1(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FDECSTP(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FINCSTP(const X86::Instruction&) { TODO_INSN(); } -void SoftCPU::FNSTCW(const X86::Instruction&) { TODO_INSN(); } + +void SoftCPU::FNSTCW(const X86::Instruction& insn) +{ + insn.modrm().write16(*this, insn, m_fpu_cw); +} + void SoftCPU::FPREM(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FYL2XP1(const X86::Instruction&) { TODO_INSN(); } void SoftCPU::FSQRT(const X86::Instruction&) { TODO_INSN(); } diff --git a/DevTools/UserspaceEmulator/SoftCPU.h b/DevTools/UserspaceEmulator/SoftCPU.h index 16b3c140a6..43a0a2eaba 100644 --- a/DevTools/UserspaceEmulator/SoftCPU.h +++ b/DevTools/UserspaceEmulator/SoftCPU.h @@ -1112,6 +1112,8 @@ private: u32 m_eip { 0 }; u32 m_base_eip { 0 }; + ValueWithShadow m_fpu_cw { 0, 0 }; + const u8* m_cached_code_ptr { nullptr }; const u8* m_cached_code_end { nullptr };