ptitSeb / box64

Box64 - Linux Userspace x86_64 Emulator with a twist, targeted at ARM64 Linux devices
https://box86.org
MIT License
3.75k stars 267 forks source link

Missing SDL_RWsize wrapped function to sdl2 for Engine: Adventure Game Studio (AGS) #1224

Closed ricoazzurro closed 8 months ago

ricoazzurro commented 8 months ago

The game I tested is,

Blackwell Legacy, v3.4 (70529), Linux x64, GOG, Engine: Adventure Game Studio (AGS)

Box64 with Dynarec v0.2.7 c40e31f

Rock 5B, LFS, BSP kernel 5.10.198 rkr7.1, Gnome 45.3 PAN_MESA_DEBUG=gofaster,gl3 1080p, default game setting

https://github.com/ptitSeb/box86-compatibility-list/issues/357

and updated error log with box64 git c40e31f.

rico [ /opt/games/blackwell_legacy ]$ ./box64-start.sh 
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A55 Cortex-A76 with 8 Cores
Params database has 54 entries
Box64 with Dynarec v0.2.7 c40e31f built on Jan 28 2024
BOX64: Didn't detect 48bits of address space, considering it's 39bits
Counted 66 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/opt/rustc/bin/:/usr/local/bin/:/usr/bin/:/opt/ant/bin/:/opt/jdk/bin/:/opt/bin/
Looking for ./ags64
Rename process to "ags64"
Using native(wrapped) libogg.so.0
Using emulated /opt/games/blackwell_legacy/lib64/libtheora.so.0
Using native(wrapped) libvorbis.so.0
Using native(wrapped) libSDL2-2.0.so.0
Using native(wrapped) libdl.so.2
Using native(wrapped) libm.so.6
Using native(wrapped) librt.so.1
Using native(wrapped) libpthread.so.0
Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6
Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1
Using native(wrapped) libc.so.6
Using native(wrapped) ld-linux-x86-64.so.2
Using native(wrapped) libutil.so.1
Using native(wrapped) libbsd.so.0
Warning: Global Symbol _ZN9__gnu_cxx21zoneinfo_dir_overrideEv not found, cannot apply R_X86_64_GLOB_DAT @0x3f0124e268 ((nil)) in /lib/x86_64-linux-gnu/libstdc++.so.6
Adventure Game Studio v3.6 Interpreter
Copyright (c) 1999-2011 Chris Jones and 2011-2023 others
Engine version 3.6.0.50, 64-bit LE

Initializing backend libs
SDL Version: 2.28.5
Initializing game data
Located game data pak: /opt/games/blackwell_legacy/Blackwell Legacy.ags
Opened game data file: game28.dta
Game data version: 3060021
Compiled with: 3.6.0.50
Startup directory: /opt/games/blackwell_legacy
Data directory: /opt/games/blackwell_legacy/
Setting up game configuration
Voice pack found: speech.vox
audio.vox found and initialized.
Initializing TTF renderer
Initializing mouse: number of buttons reported is 3
Install timer
Audio driver: pulseaudio
AudioCore: opened device "Default OpenAL playback device"
Supported sound decoders:
 - Play modules through ModPlug : 669,AMF,AMS,DBM,DMF,DSM,FAR,GDM,IT,MDL,MED,MOD,MT2,MTM,OKT,PTM,PSM,S3M,STM,ULT,UMX,XM,
 - MPEG-1 Audio Layer I-III : MP3,MP2,MP1,
 - Microsoft WAVE audio format : WAV,
 - Audio Interchange File Format : AIFF,AIF,
 - Sun/NeXT audio file format : AU,
 - Ogg Vorbis audio : OGG,
 - Creative Labs Voice format : VOC,
 - Raw audio : RAW,
 - Shorten-compressed audio data : SHN,
 - Free Lossless Audio Codec : FLAC,FLA,
Install exit handler
Initialize path finder library
Game title: 'Blackwell Legacy'
Game uid (old format): `1156699375`
Game guid: '{b93ce7bf-5d2c-4811-858d-e015b9a0f773}'
Game GUI version: 119
Requested script API: v3.5.1 (8), compat level: v3.2.1 (0)
WARNING: font 'agsfnt7.wfn' has mistakes in data format, some characters may be displayed incorrectly
WARNING: font 'agsfnt9.wfn' has mistakes in data format, some characters may be displayed incorrectly
Using emulated /opt/games/blackwell_legacy/lib64/libagsgalaxy.so
Using emulated /opt/games/blackwell_legacy/lib64/libGalaxy64.so
Plugin 'agsgalaxy' loaded from 'libagsgalaxy.so', resolving imports...
Checking for disk space
Game native resolution: 320 x 240 (32 bit)
Graphic settings: driver: D3D9, windowed: no, screen size: 0 x 0, game scale: proportional
Graphic settings: refresh rate (optional): 0, vsync: 0
Requested graphics driver 'D3D9' not found, will try existing drivers instead
Using native(wrapped) libGL.so.1
Running OpenGL: 4.5
Graphics mode set: 1920 x 1080 (32-bit) fullscreen desktop
Graphics mode set: refresh rate (optional): 60, vsync: 0
Mouse speed control: enabled, unit: 1.000000, user value: 1.000000
Touch-to-mouse motion mode: absolute
Multitasking mode set: 0
Setting up window
Multitasking mode set: 0
Initialize sprites
Engine initialization complete
Starting game
Error: PltResolver: Symbol SDL_RWsize(ver 0: SDL_RWsize) not found, cannot apply R_X86_64_JUMP_SLOT 0xa36a08 (0x4c9936) in /opt/games/blackwell_legacy/ags64
Error: the program has exited without requesting it.
Program pointer: +1004  (write this number down), engine version 3.6.0.50
If you see a list of numbers above, please write them down and contact
developers. Otherwise, note down any other information displayed.
terminate called without an active exception
NativeBT: ./ags64() [0x34a1359c]
NativeBT: linux-vdso.so.1(__kernel_rt_sigreturn+0) [0x7f8904e7cc]
NativeBT: /usr/lib/libc.so.6(+0x849b8) [0x7f88ee49b8]
NativeBT: /usr/lib/libc.so.6(raise+0x1c) [0x7f88e9b0ac]
NativeBT: /usr/lib/libc.so.6(abort+0xf4) [0x7f88e86e00]
NativeBT: [0x7f765a69a4]
EmulatedBT: ??? [0x901a0]
EmulatedBT: /opt/games/blackwell_legacy/ags64+3223ee [0x7223ee]
EmulatedBT: ??? [(nil)]
2200|SIGABRT @0x7f88ee49b8 (???(/usr/lib/libc.so.6+0x849b8)) (x64pc=0x901a0/???:"???", rsp=0x7f88ccf968, stack=0x7f884d2000:0x7f88cd2000 own=(nil) fp=0x7f88ccf9d0), for accessing 0x3e800000898 (code=-6/prot=0), db=(nil)((nil):(nil)/(nil):(nil)/???:clean, hash:0/0) handler=(nil)
RSP-0x20:0x0000003f010af294 RSP-0x18:0x000000003848ada0 RSP-0x10:0x00000000373880f0 RSP-0x08:0x0000000000000078
RSP+0x00:0x0000003f010a09db RSP+0x08:0x0000000000ce3710 RSP+0x10:0x0000000000ce36f8 RSP+0x18:0x0000000000ce3480
RAX:0x000000000000002d RCX:0x0000007f890014f0 RDX:0x0000007f89002620 RBX:0x0000000000ce3480 
RSP:0x0000007f88ccf968 RBP:0x0000007f88ccf9d0 RSI:0x0000000000000001 RDI:0x0000003f011b84b0 
 R8:0x00000000005fe590  R9:0x0000000000000001 R10:0x0000000000000003 R11:0x0000000000000001 
R12:0x0000007f88ccfb00 R13:0x000000000078c15f R14:0x0000000000140925 R15:0x0000000000000001 
ES:0x002b CS:0x0033 SS:0x002b DS:0x002b FS:0x0043 GS:0x0053 
./box64-start.sh: line 11:  2200 Aborted                 (core dumped) ALLEGRO_MODULES=./lib64 box64 ./ags64

As AGS engine is using by a lot of Wadjet Eye Games (adventure, mystery, point.and.click), I hope the SDL_RWsize will be wrapped. https://en.wikipedia.org/wiki/Adventure_Game_Studio

ptitSeb commented 8 months ago

Use the BOX64_PREFER_EMULATED=1 env. var. for this game maybe? If it works, it might ned a profile for this binayr in box64.box64rc.

ricoazzurro commented 8 months ago

Now it's working! Thank you <3 How come you locate the issue so accurate and correct :) Super awesome!


  1. The game comes with a start script. But even using box64's bash, it failed.
    • the game's original script:
      
      #!/bin/sh
      SCRIPTPATH="$(dirname "$(readlink -f "$0")")"

if test "x$@" = "x-h" -o "x$@" = "x--help" then echo "Usage:" "$(basename "$(readlink -f $0)")" "[]" echo "" fi

chmod +x "$SCRIPTPATH/ags64" "$SCRIPTPATH/ags32"

if test $(uname -m) = x86_64 then export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${SCRIPTPATH}/lib64" export LIBGL_DRI3_DISABLE=true ALLEGRO_MODULES="$SCRIPTPATH/lib64" "$SCRIPTPATH/ags64" "$@" > "$SCRIPTPATH/log.txt" 2>&1 else export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}":"${SCRIPTPATH}/lib32" export LIBGL_DRI3_DISABLE=true ALLEGRO_MODULES="$SCRIPTPATH/lib32" "$SCRIPTPATH/ags32" "$@" > "$SCRIPTPATH/log.txt" 2>&1 fi

- I tried run it with box64 bash trick, `export BOX64_PREFER_EMULATED=1 && BOX64_BASH=~/box64/tests/bash ~/box64/tests/bash ./Start.sh` , but it didn't work:
```bash
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A55 Cortex-A76 with 8 Cores
Params database has 54 entries
Using bash "/home/rico/box64/tests/bash"
Box64 with Dynarec v0.2.7 c40e31f built on Jan 28 2024 04:38:05
BOX64: Didn't detect 48bits of address space, considering it's 39bits
BOX64: Prefering Emulated libs
Counted 64 Env var
BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
BOX64 BIN PATH: ./:bin/:/opt/rustc/bin/:/usr/local/bin/:/usr/bin/:/opt/ant/bin/:/opt/jdk/bin/:/opt/bin/
Looking for /home/rico/box64/tests/bash
bash detected, disabling banner
Apply RC params for bash
./Start.sh: line 21:  1437 Aborted                 (core dumped) ALLEGRO_MODULES="$SCRIPTPATH/lib64" "$SCRIPTPATH/ags64" "$@" > "$SCRIPTPATH/log.txt" 2>&1
  1. Then I reviewed the script and avoid those variables and currency, run with

    export BOX64_PREFER_EMULATED=1
    export LIBGL_DRI3_DISABLE=true
    ALLEGRO_MODULES=./lib64 box64 ./ags64

    and it launches!

  2. The working log,

    
    rico [ /opt/games/blackwell_legacy ]$ ./box64-start.sh 
    Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 PageSize:4096 Running on Cortex-A55 Cortex-A76 with 8 Cores
    Params database has 54 entries
    Box64 with Dynarec v0.2.7 c40e31f built on Jan 28 2024 04:38:05
    BOX64: Didn't detect 48bits of address space, considering it's 39bits
    BOX64: Prefering Emulated libs
    Counted 66 Env var
    BOX64 LIB PATH: ./:lib/:lib64/:x86_64/:bin64/:libs64/:/lib/x86_64-linux-gnu/:/usr/lib/x86_64-linux-gnu/
    BOX64 BIN PATH: ./:bin/:/opt/rustc/bin/:/usr/local/bin/:/usr/bin/:/opt/ant/bin/:/opt/jdk/bin/:/opt/bin/
    Looking for ./ags64
    Rename process to "ags64"
    Using emulated /opt/games/blackwell_legacy/lib64/libogg.so.0
    Using emulated /opt/games/blackwell_legacy/lib64/libtheora.so.0
    Using emulated /opt/games/blackwell_legacy/lib64/libvorbis.so.0
    Using emulated /opt/games/blackwell_legacy/lib64/libSDL2-2.0.so.0
    Using native(wrapped) libdl.so.2
    Using native(wrapped) libpthread.so.0
    Using emulated /lib/x86_64-linux-gnu/libstdc++.so.6
    Using native(wrapped) libm.so.6
    Using emulated /lib/x86_64-linux-gnu/libgcc_s.so.1
    Using native(wrapped) libc.so.6
    Using native(wrapped) ld-linux-x86-64.so.2
    Using native(wrapped) libutil.so.1
    Using native(wrapped) librt.so.1
    Using native(wrapped) libbsd.so.0
    Warning: Global Symbol _ZN9__gnu_cxx21zoneinfo_dir_overrideEv not found, cannot apply R_X86_64_GLOB_DAT @0x3f0424e268 ((nil)) in /lib/x86_64-linux-gnu/libstdc++.so.6
    Adventure Game Studio v3.6 Interpreter
    Copyright (c) 1999-2011 Chris Jones and 2011-2023 others
    Engine version 3.6.0.50, 64-bit LE

Initializing backend libs SDL Version: 2.24.1 Using native(wrapped) libdbus-1.so.3 Using native(wrapped) libX11.so.6 Using native(wrapped) libXext.so.6 Using native(wrapped) libxcb.so.1 Using native(wrapped) libXau.so.6 Using native(wrapped) libXdmcp.so.6 Using native(wrapped) libXcursor.so.1 Using native(wrapped) libXi.so.6 Using native(wrapped) libXfixes.so.3 Using native(wrapped) libXrandr.so.2 Using native(wrapped) libXrender.so.1 Using native(wrapped) libXss.so.1 Using native(wrapped) libudev.so.1 Initializing game data Located game data pak: /opt/games/blackwell_legacy/Blackwell Legacy.ags Opened game data file: game28.dta Game data version: 3060021 Compiled with: 3.6.0.50 Startup directory: /opt/games/blackwell_legacy Data directory: /opt/games/blackwell_legacy/ Setting up game configuration Voice pack found: speech.vox audio.vox found and initialized. Initializing TTF renderer Initializing mouse: number of buttons reported is 3 Install timer Using native(wrapped) libpulse-simple.so.0 Using native(wrapped) libpulse.so.0 Audio driver: pulseaudio AudioCore: opened device "Default OpenAL playback device" Supported sound decoders:

ricoazzurro commented 8 months ago

Blackwell Legacy-1 Blackwell Legacy-2

Yahooooo~