ptitSeb / box86

Box86 - Linux Userspace x86 Emulator with a twist, targeted at ARM Linux devices
https://box86.org
MIT License
3.36k stars 233 forks source link

Wheel of Time on RPi5/64 #956

Open ectorhga opened 7 months ago

ectorhga commented 7 months ago

This game is very fragile and the setup with wine (I'm using 6.0.2, 32bit) isn't very easy. After a long time I managed to get it to run on a RPi4 some months ago, but now I have a RPi5 with aarch64 and the fun began anew. With the latest master build, I can't get the game to run: I get an ingame errror message (general protection fault or something).

After some testing I managed to get the game running with older builds (<=0.3.0), but I wanted to get to the bottom of the problem and made a bisect. And here is the result:

commit 99310cc9c6a34a08d4acf04c296a5fe8397f2acf
Author: ptitSeb <sebastien.chev@gmail.com>
Date:   Sun Jan 21 10:26:10 2024 +0100

    Change memory tracking to use rbtree (backported from box64)

 CMakeLists.txt            |   1 +
 docs/USAGE.md             |  10 -
 src/custommem.c           | 389 +++++++-------------
 src/dynarec/dynablock.c   |  18 -
 src/dynarec/dynarec_arm.c |   7 -
 src/elfs/elfloader.c      |   2 +-
 src/include/custommem.h   |   5 +-
 src/include/rbtree.h      |  18 +
 src/libtools/signals.c    |  10 -
 src/main.c                |  21 --
 src/tools/rbtree.c        | 902 ++++++++++++++++++++++++++++++++++++++++++++++
 src/tools/rcfile.c        |   4 +-
 12 files changed, 1057 insertions(+), 330 deletions(-)
 create mode 100644 src/include/rbtree.h
 create mode 100644 src/tools/rbtree.c

Now, this is only one part of the problem: The game uses Quicktime for its FMV sequences (ugh!). Usually this needs Quickime Light to be installed. But there is an "easier" fix: put the needed library files into the games System folder (attention: the patched QT libraries of this fix are expecting ddwne.dll to be present, which is just a renamed ddraw.dll from wine. I unpatched the files to load the wine build-in ddraw.dll again.) But from the following commit of box86, the videos get very laggy:

e8fabe23ecccee317d3ade2c3bfeadbf40bfc160 is the first bad commit
commit e8fabe23ecccee317d3ade2c3bfeadbf40bfc160
Author: ptitSeb <sebastien.chev@gmail.com>
Date:   Wed Nov 29 10:50:38 2023 +0100

    [DYNAREC] Fixed some rare issue with flags not correctly updated on a forward jump

 src/dynarec/dynarec_arm_functions.c | 32 ++++++++++++--------------------
 src/dynarec/dynarec_arm_helper.c    |  8 +++-----
 2 files changed, 15 insertions(+), 25 deletions(-)

I don't know if this helps you make box86 better, or if the outcome doesn't justify the amount of work you'd have to put into it, but I wanted to tell you anyways. I love this game and Legend (the company that made it) and I just want to have it running (which I sort of have with box86 0.3.0).

ptitSeb commented 3 months ago

Can you try latest box86 to see if it works better?