Games compilation howto on the Pinebook-pro (Manjaro Linux and Debian native)
I posted this on Twitter earlier:

[Image: EXax48-PX0-AAGMl-I.png]

The past weekend we got a fully working PC port of Super Mario 64. This port can either use DirectX 12 or OpenGL, and the OpenGL one runs on Linux just fine. So I got curious and wondered if it would work on the PBP. Turns out it works just fine. My OS of choice is Manjaro, so that's what I'll be using here.

Now, I'm not going to tell you how to get the ROM file that contains the assets needed for this to work. I'm also not going to openly share the code archive, because even though it's completely fine legally, the original author seems to want to keep things underground. I also don't want to cause any issues for Pine64 by listing it here. The one I have is the sm64pc-sdl.7z archive, with md5sum f47a09dc59120d4f422cdabecf2be494. It shouldn't come with any precompiled binaries. I've seen some archives online which do. I'll also be using the US version of the game.

Getting it running was surprisingly not too bad, but did have one issue which I'll mention later. First, to make sure we have what we need to get started:

Code:
sudo pacman -S base-devel python audiofile glfw-x11

Another thing to make sure of is that we have the rom in the right place, and named correctly. It should be in the main folder, in the same level as the main makefile. The rom must also be renamed baserom.$VERSION.z64. Where $VERSION is the region of the rom (eu, us, or jp). So in my case, I have a baserom.us.z64 file.

Next, it's worth noting that the archive already comes with a number of useful tools which it will use during compilation. However, these tools all come precompiled for x86-64, and our first step will be to correct this. So, from the root of the archive:


Code:
cd tools
make clean
make
cd ..



The next step is to modify the makefile. The general idea here is to remove all the -m32 and -march=i686 compiler flags. Particular ones of interest in the version that I have occur on lines 195, 365, and 406:

Code:
else
 OPT_FLAGS := -g -m32
endif



Code:
ifeq ($(shell getconf LONG_BIT), 32)
 # Work around memory allocation bug in QEMU
 export QEMU_GUEST_BASE := 1
else
 # Ensure that gcc treats the code as 32-bit
 CC_CHECK += -m32
endif



Code:
ifeq ($(WINDOWS_BUILD),1)
LDFLAGS := -m32 -march=i686 -Llib -lpthread -lglew32 `sdl2-config --static-libs` -lm -lglu32 -lsetupapi -ldinput8 -luser32 -lgdi32 -limm32 -lole32 -loleaut32 -lshell32 -lwinmm -lversion -luuid -lopengl32 -no-pie -static
else
LDFLAGS := -m32 -march=i686 -lm -lGL `sdl2-config --libs` -no-pie -lpthread `pkg-config --libs libusb-1.0 glfw3` -lasound -lX11 -lXrandr -lpulse
endif

Remove all mentions of -m32 and -march=i686 from here and it should be ready to go. In OPT_FLAGS, it's also possible to remove the debug flag -g, and add the -O2 optimisation flag for better performance .

Once all these flags are removed, we can try to make it with "make -j6". However, in my experience, this fails when compiling on the PBP with a number of sound_player errors. To fix this, the best way I have found is to follow the Linux compilation instructions while using an x86_64 machine, and then to copy the build/sound directory and transfer it over into the build directory on the PBP.

From there, we can try make -j6 again, and it should complete building.

It would be interesting to see if that one issue could be fixed, but I see no issues doing it this way at all!

The game runs well, but there is some stutter especially as you increase the resolution. At default res however, it runs fantastic in my opinion.
  Reply


Messages In This Thread
RE: Games compilation howto on the Pinebook-pro (Manjaro Linux and Debian native) - by Nappael - 05-07-2020, 01:00 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pinebook Pro Initial Impressions kunger 443 590,703 04-16-2024, 07:29 PM
Last Post: KC9UDX
  looking to buy one pinebook pro (mainland China) duanduan 3 2,317 03-21-2024, 07:44 PM
Last Post: wangyukunshan
  Cellular module for Pinebook Pro Lotech 1 406 03-05-2024, 05:40 AM
Last Post: KC9UDX
  Screen on pinebook stays black but can ssh into machine tuxxpine 0 309 02-23-2024, 04:22 PM
Last Post: tuxxpine
  Sale my ANSI PineBook Pro cuthbertdavies 0 295 02-14-2024, 09:12 PM
Last Post: cuthbertdavies
  Compiling with -j6 on the Pinebook Pro (Overheat) KC9UDX 0 231 02-14-2024, 09:01 AM
Last Post: KC9UDX
  Manjaro versions bad and good gilwood 0 258 02-12-2024, 05:03 PM
Last Post: gilwood
  Pinebook Pro in EU for Sale - €90 jan_vdk 2 682 02-07-2024, 02:12 AM
Last Post: 23Ro
  Pinebook Pro for sale tomekdev 2 762 02-01-2024, 11:35 AM
Last Post: tomekdev
  Video Editing Is Possible On The PineBook Pro! ImmyChan 10 7,633 12-17-2023, 09:29 PM
Last Post: insideau786

Forum Jump:


Users browsing this thread: 8 Guest(s)