Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I'm trying to revive an old Win32 game that uses 3DNow! instruction set to make 3D rendering. On modern OSs like Win7 - Win10 instructions like FPADD are not allowed and the program throws an exception.
Since the number of 3DNow! instuctions used by the game is very limited, in my VS2008 MFC program I tried to use vectored exception handling to get the value of MMX registers, emulate the 3DNow! instructions by C code and push the values back to the processor 3DNow! registers.
My problem is that, no matter how I try to update the MMX register values (that is, for this game 8 couples of 32 bit float values, mm0 to mm7) at next exception the register values seem unchanged.

What I have tried:

The coding I used is like this snap:

float fval = emulated_instruction_value();
_asm {
movq fval, mm0
}

The code is probably wrong for improper data types, but what puzzles me is the fact that the mmx values are never updated.

** updated **

Some simpler code showed that apparently when I use moveq to get mmx values I get correct values, but when I reverse the order of the operands and try to update a mmx register value I don't succeed, its value remains unchanged.
Posted
Updated 26-Oct-17 4:05am
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900