July 17th, 2011, 23:11 Posted By: wraggster
News via http://dsx86.patrickaalto.com/DSblog.html
For the past week I have been implementing FPU opcodes into DS2x86. I have been using X-COM UFO and Destruction Derby for testing the FPU opcodes. The current status is that both of those games seem to run the FPU parts fine, but then crash because of some probably unrelated issues. So, before I can continue with the FPU opcodes I think I need to fix those other issues first. For example, X-COM UFO now allows the rotation of the globe in the GEOSCAPE part, but when you select the home base location it begins to misbehave.
The FPU opcodes consist of 8 actual opcodes, 0xD8..0xDF, each of which has the modrm byte, so there are actually 8*256 FPU opcode variations. I have implemented the first group of 256 variations completely, and then various other opcodes partially. The rarer opcode variations are still missing. I have been using the DOSBox implementation, along with a good FPU reference called Simply FPU by Raymond Filiatreault, to handle the communication between the CPU and FPU. For the FPU internals, I have used the SoftFloat library together with DOSBox sources as a reference. I decided to call the GCC library functions for most of the more complex operations (like the actual arithmetic operations ADD, SUB, MUL, DIV, SQRT, etc), but I coded all the conversion routines between the floating point formats and between integer and floating point values myself in MIPS ASM. That should help with the speed somewhat, as calling the C routines is pretty slow. Another drawback of using the C library routines was that the ds2x86.plg file size increased quite dramatically, first by 150KB when adding atan() call, and by another 90KB when adding sin() call. The basic routines did not increase the file size, as they are probably used by the SDK already.
Anyways, the next step is to fix the other problems in X-COM UFO and Destruction Derby, so that I can continue using them for my FPU tests, and then implementing the remaining FPU opcodes. I have only implemented the FPU handling from protected mode for now, as all the games I know that need FPU are protected mode games. I suppose I need to eventually handle FPU calls from real mode as well.
For more information and downloads, click here!
There are 0 comments - Join In and Discuss Here