ptitSeb / box64

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

Unimplemented Opcode (66 66 2E 0F) #1457

Closed LilleAila closed 5 months ago

LilleAila commented 5 months ago

Hello,

I'm trying to run factorio through box64 on asahi, running nixOS. When running box64, it gives me this error:

710467|0x20f3450: Unimplemented Opcode (66 66 2E 0F) 1F 84 00 00 00 00 00 0F 1F 84 00 00 00 00 00

Here is the full output from box64:

# box64 bin/x64/factorio
Dynarec for ARM64, with extension: ASIMD AES CRC32 PMULL ATOMICS SHA1 SHA2 USCAT FLAGM FLAGM2 FRINT PageSize:16384 Running on Icestorm-M1-Pro Firestorm-M1-Pro with 10 Cores
Will use Hardware counter measured at 24.0 MHz emulating 768 MHz
Params database has 13 entries
Box64 with Dynarec v0.2.7 nogit built on Jan  1 1980 00:00:00
BOX64: Detected 48bits at least of address space
Counted 147 Env var
BOX64 LIB PATH: /run/opengl-driver/lib/:/run/opengl-driver-32/lib/:./:lib/:lib64/:x86_64/:bin64/:libs64/
BOX64 BIN PATH: ./:bin/:/run/wrappers/bin/:/usr/bin/:/usr/sbin/:/nix/store/ciw0pvaqjffnvary60p0gcvfsc7plq2z-bash-interactive-5.2p26/bin/:/nix/store/zgjzrx42nji68ypaz0nl3i6akqas6hip-patchelf-0.15.0/bin/:/nix/store/ask2ry8k4y0603g95rmcxq0mds2mjcq6-coreutils-9.4/bin/:/nix/store/b6vzfkd37p1srw1hkq92s0kqnpq6y9zn-findutils-4.9.0/bin/:/nix/store/0vm9ajhh3y3lsh8pqwn51qfkj0sf3i48-diffutils-3.10/bin/:/nix/store/5sp5mh914cnq72j6mc17y2flji5sj0vm-gnused-4.9/bin/:/nix/store/97fjy58w7l9q0qkwig0ilk4vxj7ncfr7-gnugrep-3.11/bin/:/nix/store/flaqh5qdn9y18bglpkx5inx8i27j164k-gawk-5.2.2/bin/:/nix/store/n77ysc0vzx107g8kgr382l5zx3n8y4m8-gnutar-1.35/bin/:/nix/store/lc4fhc2xhpdiscwcry09z5fzyx30ghik-gzip-1.13/bin/:/nix/store/s4d69r766r6y5ivx3ia5gaxzs5wcpww9-bzip2-1.0.8-bin/bin/:/nix/store/gllwhajbyfz7rnbydglmyd33vlzdar5n-gnumake-4.4.1/bin/:/nix/store/q36009ll4v7ay3xv4na856w715nfrbn8-bash-5.2p26/bin/:/nix/store/j87160bigr3zs78yb7pnjajpam6jknsd-patch-2.7.6/bin/:/nix/store/1m5sgjjb9qqffvrjchra7m2231zy2d6s-xz-5.4.6-bin/bin/:/nix/store/avxc978l3kbf8vzbw4pvbcjvapgd1xnl-file-5.45/bin/:/nix/store/sdw5pv3f78mb01k95markarjacawiyh0-kitty-0.34.0/bin/:/nix/store/k7f2n4w4w2bc9xa1m9fmdy990w9m9psb-imagemagick-7.1.1-29/bin/:/nix/store/1r1xdw3xkkv88zwn9yy05bz4inx3fk2s-ncurses-6.4-dev/bin/:/run/wrappers/bin/:/home/olai/.nix-profile/bin/:/nix/profile/bin/:/home/olai/.local/state/nix/profile/bin/:/etc/profiles/per-user/olai/bin/:/nix/var/nix/profiles/default/bin/:/run/current-system/sw/bin/:/nix/store/x519iya8ywmapflfqydkshwx7h2n3fid-gcc-wrapper-13.2.0/bin/:/nix/store/nixrnab9i9ns541dz81yg3xy4acn6d12-binutils-wrapper-2.41/bin/:/nix/store/h14vqnn6jwnmvf214051f52j0n10qfr9-pciutils-3.11.1/bin/:/nix/store/h0qg50wf127d4rgn4fr4kazvjxbl53la-pkgconf-wrapper-2.1.1/bin/
Looking for bin/x64/factorio
Apply RC params for factorio
Applying BOX64_DYNAREC_FASTROUND=0
Warning: cannot create memory map (@0x3ff000 0x2510150) for elf "/home/olai/Downloads/factorio/bin/x64/factorio" got 0x3fc000
Rename process to "factorio"
Using native(wrapped) libdl.so.2
Using native(wrapped) librt.so.1
Using native(wrapped) libresolv.so.2
Using native(wrapped) libX11.so.6
Using native(wrapped) libxcb.so.1
Using native(wrapped) libXau.so.6
Using native(wrapped) libXdmcp.so.6
Using native(wrapped) libXext.so.6
Using native(wrapped) libGL.so.1
Using native(wrapped) libXinerama.so.1
Using native(wrapped) libXrandr.so.2
Using native(wrapped) libXrender.so.1
Using native(wrapped) libXcursor.so.1
Using native(wrapped) libXfixes.so.3
Using native(wrapped) libasound.so.2
Using native(wrapped) libpulse.so.0
Using native(wrapped) libpulse-simple.so.0
Using native(wrapped) libm.so.6
Using native(wrapped) libpthread.so.0
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
Look for __res_nquery in loaded elfs
Found symbol with version GLIBC_2.17, value = 0xfffecf1d4380
Look for __dn_expand in loaded elfs
Found symbol with version GLIBC_2.17, value = 0xfffecf1cccf0
710467|0x20f3450: Unimplemented Opcode (66 66 2E 0F) 1F 84 00 00 00 00 00 0F 1F 84 00 00 00 00 00
ptitSeb commented 5 months ago

I tested factorio on my M1 a few days ago (running Asahi Fedora Remix), and didn't had any issue. It ran correctly. Also, that opcode seems wrong, and looks like a loop alignement opcode with 4 skipped bytes, wich looks strange. Is this the latest factorio version?

LilleAila commented 5 months ago

This was with factorio version 1.1.104. I can test later if the latest version 1.1.107 works. Also, box64 was compiled with these flags:

cmakeFlags = [
  "-DNOGIT=ON"
  "-DARM64=true"
  "-DARM_DYNAREC=true"
  "-D M1=1"
];
LilleAila commented 5 months ago

I tried downloading the latest version, and that launched and ran perfectly. Maybe the old one somehow got corrupted ¯_(ツ)_/¯. Anyways, thanks for making this amazing project! Now I can play factorio again!

ptitSeb commented 5 months ago

Nice! Glad it works :)

The ticket can be closed right?

LilleAila commented 5 months ago

Yes, i got it to work