banner
niracler

niracler

长门大明神会梦到外星羊么?
github
email
steam_profiles
douban
nintendo switch
tg_channel
twitter_id

How to Use Apple Game Porting Toolkit to Play Windows Games on M1 Air - v1.1

The goal is to be able to port galgames on Mac too~~

Background or TLDR?#

Am I using this article to prove that I am slightly more tech-oriented rather than ACG-oriented? After all, the previous two articles were just filler using reviews of earlier anime games.

This is actually quite simple, just install the game porting toolkit and run it, which is pretty much the same as the tutorials online. ( Yes, no need to look further, the clickbait worked🐶 ) However, this technology is still not mature, and the timeliness of articles in the evening is quite strong, changing a bit every week. As a result, I encountered some pitfalls. It took me about 6 hours to get this working. The actual time needed is less than 2 hours (including homebrew build).

The reason I am messing with this is that I randomly do some things I am interested in every month. ( Of course, outside of my 996 job, ) I estimate I will write a separate article about this random stuff in the future.

So, researching wine-related technology was the random topic I got last month. But in the end, I got sidetracked and only did this little bit~~ Moreover, this topic is time-sensitive, so I decided to publish it first.

⚠️⚠️⚠️Note the timeliness⚠️⚠️⚠️

If there are issues with the methods in the article, please don't just run away. Please comment, and I will gradually supplement and modify it. After all, I only have one computer and can't predict so many situations~~

  1. Time: 2023-07-20
  2. Device: MacBook Air with M1 chip
  3. Version: macOS Sonoma Public Beta

Mainly the issues I encountered during this process that other articles online did not mention, or were very vague in their solutions.

  1. You need to use x64 homebrew: I initially uninstalled brew on my computer ( burning the boats ). I later realized that uninstalling homebrew was a very foolish action; it was actually unnecessary. You just need to remove the /opt/homebrew/ related directories from the PATH. They can coexist~~
  2. The game porting toolkit currently fails to build with XCode 15 beta 3/4/5: You need to reinstall XCode beta 2 to use it. Each build took over an hour before it told me it failed~~

Let's get started#

Preparation - Download and install Command Line Tools + Game Porting Toolkit#

First, make sure we are using macOS Sonoma, which can be updated directly in Settings. I updated to the Public Beta version.

Then download the following two ( click here to download ), log in to a free Apple developer account. Use your usual details to log in, agree to the terms and conditions, and then we can proceed.

  • Command Line Tools for Xcode 15 beta 2 (Note to download beta 2, beta 3/4/5 will fail to build, this is the first pitfall)
  • Game Porting Toolkit beta 1.0.2

Pasted image 20230801001506

Pasted image 20230801001620

After installing the Game Porting Toolkit, a window will pop up; please ignore it, as no files will perform any operations now.

Pasted image 20230801231132

Homebrew installation of Apple Game Porting Toolkit#

Because the current game porting toolkit does not actually support running on native arm64, errors will occur during the build process of the current homebrew arm64.
(I got an error, haha. This is the second pitfall; I initially deleted the arm64 brew and then installed the x64 brew using rosetta)

Pasted image 20230731102049

But actually, you do not need to uninstall the arm64 brew, because the installation directory for brew x64 is /usr/local/bin/, while the installation directory for brew arm64 is /opt/homebrew/bin.

Then, if you haven't installed rosetta, you should run the following command to install it:

softwareupdate –install-rosetta  

Once you ensure your system has rosetta, enter the x64 version of zsh and remove the brew directory from the current PATH. This is the key to allowing x64 and arm64 homebrew to coexist; removing the /opt/homebrew/bin directory from the PATH environment variable is equivalent to removing arm64 brew.

This way, you can install x64 brew without deleting the arm64 version of brew ( only effective for the current shell session):

arch -x86_64 zsh
dir="/opt/homebrew/bin"
PATH="${PATH//"${dir}:"/}"

Now let's install x64 homebrew and load it into the current session using eval (if there are access issues, you may need to enable terminal proxy):

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
eval "$(/usr/local/bin/brew shellenv)"

At this point, which brew should output /usr/local/bin/brew.

Next, we will actually install the Game Porting Toolkit:

brew tap apple/apple http://github.com/apple/homebrew-apple  
brew -v install apple/apple/game-porting-toolkit

And then? Then you can take a break; it took me over an hour to install. Then run the following two commands. ( TODO: Actually, I still haven't figured out the relationship between the game-porting-toolkit downloaded from the official website and the one installed via brew):

ditto /Volumes/Game\ Porting\ Toolkit-1.0/lib/ /usr/local/opt/game-porting-toolkit/lib/
cp /Volumes/Game\ Porting\ Toolkit*/gameportingtoolkit* /usr/local/bin

Setting up the Game Porting Toolkit#

Our first goal here is to initialize a wine prefix environment for steam, where WINEPREFIX specifies a folder to store the wine runtime environment.

WINEPREFIX=~/steam /usr/local/opt/game-porting-toolkit/bin/wine64 winecfg

This environment will prepare some directories and dlls for running Windows files. (as shown below)

image

After running, a window will pop up to initialize the environment. Select Windows 10 from the dropdown list. Click "Apply" and then click "OK" to close the window.

Pasted image 20230802000312

Next, we go to the official steam website to download the x64 version of steam, click here to download.

First, install it:

gameportingtoolkit ~/steam ~/Downloads/SteamSetup.exe

After installation, you can start running it; the path C:\Program Files (x86)/Steam/steam.exe is the path for steam in wine after installation.

gameportingtoolkit ~/steam 'C:\Program Files (x86)/Steam/steam.exe' 

(Successful, cheers🍻)
Pasted image 20230802074002

Finally - I recorded a video#

Just testing the video effect of xLog

Using Apple Game Porting Toolkit to run Windows X64 games on M1 Air, one is "Take Me to the Dungeon," and the other is "Octopath Traveler 2."

3A game demonstration "NieR: Automata"

Collapsed image used for the cover

image

Postscript - About why I am interested in this technology#

Why am I interested in this technology? To be able to port galgames on Mac? Although as a Mac user, I haven't been able to touch galgames for a long time.

Mainly because I bought a steam deck recently. First, I really like archlinux, then I really like steam, and also, I really like handhelds, and I don't particularly like using Windows). And steam deck = archlinux + steam + handheld - windows, it is Proton/Wine that made this possible, so I have wine research on my TODO list.

Then coincidentally, there was that shocking Apple Vision Pro launch event and the accessory Game Porting Toolkit. I believe that the Game Porting Toolkit is Apple's Proton moment. It gave me confidence in Apple making a gaming platform, especially the gaming platform on Vision Pro.

Finally, I feel that because xLog's UI layout is quite nice, it gives me the illusion that my writing level has improved~~ I don't particularly like writing dry technical articles. But overall, I still feel like my writing lacks depth. For example, there are many details and concepts in this article that are not clearly explained. But this article is time-sensitive, and after multiple debugging, I decided to publish it first and will revise it later.


Modifications#

  • 2023-08-02 23:33 v0.2 Modified tags and some descriptions
  • 2023-08-03 07:35 v0.3 Updated the video recording with sound, recorded using CleanShot, which was pretty good.
  • 2023-08-03 22:06 v0.4 XCode 15 beta 5 also failed, no need to look, see reference link 2 for details
  • 2023-08-04 19:43 v0.5 After being criticized for clickbait, I changed the title from " How to use Apple GPT to play Win X64 games on M1 Air " ==> " How to use Apple Game Porting Toolkit to play Windows games on M1 Air "
  • 2023-08-06 14:56 v1.0 Updated 3A game demonstration "NieR: Automata"
  • 2023-08-06 22:04 v1.1 Moved the paragraph Differences between this article and others up. Also updated reference materials

References#

Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.