box86 icon indicating copy to clipboard operation
box86 copied to clipboard

Missing opcodes for "Legacy of Kain" games

Open ectorhga opened this issue 3 years ago • 7 comments

Box86 has become my favorite tool for gaming on my Raspberry Pi 4. Usually everything I throw at it just works.

Yet, there are three games, I cannot get to work due to missing opcodes. All three are from the Legacy of Kain series and are only available on Windows or Playstation 2.

I will just post the missing opcodes for now. I you should need anything else, I'm more than willing to help!

  • Legacy of Kain: Soul Reaver 2:
    • 29324|0x45bb54: Unimplemented Opcode (FC) 0F 0E 9B 89 75 FC EB 1C
  • Legacy of Kain: Blood Omen 2:
    • 0594|0x6d325b: Unimplemented Opcode (FC) 0F 0E 89 45 FC EB 1E B8
  • Legacy of Kain: Defiance:
    • 2709|0x4cfabf: Unimplemented Opcode (FC) 0F 0E EB 14 B8 01 00 00

ectorhga avatar Sep 07 '22 09:09 ectorhga

0F 0E is FEMMS opcode from the AMD 3DNow extension. It's not supported in box86 for now. The cpu emulated is an Intel, not AMD, so 3DNow should not be used, that's strange.

ptitSeb avatar Sep 07 '22 09:09 ptitSeb

Huh... Can maybe something like BOX86_ALLOWMISSING_SYMBOLS=1 get around that?

ectorhga avatar Sep 07 '22 10:09 ectorhga

nope. Missing symbol are for library symbols. Here it's an opcode, it's different. The issue is, that particular opcode FEMMS is very simple to emulate, but the rest of 3Dnow is more complex, and I hadn't planed to implement that in box86. So while adding 0F 0E is trivial, it's probably not the solution as more 3Dnow opcodes will probably be used. Isn't there multiple exe in the game folder? optimized for intel or amd for example?

ptitSeb avatar Sep 07 '22 11:09 ptitSeb

I don't think so, but I'll have a closer look tonight!

ectorhga avatar Sep 07 '22 11:09 ectorhga

As I installed the games on a desktop AMD machine and copied the files over to the Pi, I was hoping a new install on an Intel machine would maybe install a different executable.

It does not. I also looked into the GOG installer, and there are no other executables. At least that's the case for Soul Reaver 2

ectorhga avatar Sep 07 '22 16:09 ectorhga

I need to test that on my side and debug stuff here :(

ptitSeb avatar Sep 07 '22 16:09 ptitSeb

If I can help in any way...

ectorhga avatar Sep 07 '22 19:09 ectorhga

Games are now working with commit https://github.com/ptitSeb/box86/commit/b993866defeab36b20b4f28753af0503c39966aa

Excellent work as always! Thank you!

ectorhga avatar Oct 13 '22 21:10 ectorhga