{"id":21196292,"url":"https://github.com/neildavis/mgpr-pi","last_synced_at":"2025-07-10T05:30:34.247Z","repository":{"id":146251648,"uuid":"585715488","full_name":"neildavis/mgpr-pi","owner":"neildavis","description":"Shell script to automate install of Ben Geeves' Monaco GP Remake on Raspberry Pi OS using box86/box64 userspace emulation","archived":true,"fork":false,"pushed_at":"2024-11-28T12:05:06.000Z","size":36,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-14T21:49:48.251Z","etag":null,"topics":["arcade","box64","box86","emulation","game","linux","monacogp","raspberry-pi","raspberrypi","sega","shell-script"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/neildavis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-05T22:09:50.000Z","updated_at":"2024-11-28T12:06:40.000Z","dependencies_parsed_at":null,"dependency_job_id":"71d0d480-dd87-4e25-8210-3e475b52ddba","html_url":"https://github.com/neildavis/mgpr-pi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/neildavis/mgpr-pi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neildavis%2Fmgpr-pi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neildavis%2Fmgpr-pi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neildavis%2Fmgpr-pi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neildavis%2Fmgpr-pi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/neildavis","download_url":"https://codeload.github.com/neildavis/mgpr-pi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/neildavis%2Fmgpr-pi/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264535988,"owners_count":23624404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arcade","box64","box86","emulation","game","linux","monacogp","raspberry-pi","raspberrypi","sega","shell-script"],"created_at":"2024-11-20T19:35:19.595Z","updated_at":"2025-07-10T05:30:34.242Z","avatar_url":"https://github.com/neildavis.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mgpr-pi #\n\n## Play Monaco GP Remake on a Raspberry Pi ##\n\n[![Video](https://img.youtube.com/vi/LI3msMjCAkY/maxresdefault.jpg)](https://www.youtube.com/watch?v=LI3msMjCAkY)\n\n## STATUS: OBSOLETE ##\n\nSince I developed this script I have had the opportunity to work with Ben to develop a fully native version of MGPr\nfor the latest Raspberry Pi OS which, as well as a slew of additional updates, will run with superior performance\nPlease see the [MGPr homepage](https://forum.arcadecontrols.com/index.php?topic=134445.0) for more details.\n\nThis project now is useful ONLY as a study/example of how to run x86/x64 binaries on ARM architecture devices like\nthe Raspberry Pi using user space emulation tools like box86/box64.\n\n## Overview ##\n\nThis repo contains a shell script to automate installation of Ben Geeves' amazing\n[Monaco GP Remake](http://forum.arcadecontrols.com/index.php?topic=134445.0)\ngame on [Raspberry Pi OS](https://www.raspberrypi.com/software/).\n\nBen only released binaries of this game for Windows \u0026 Linux systems using Intel/AMD x86/x64 CPUs.\nSince the Raspberry Pi uses an ARM CPU, the game will not run on Raspberry Pi OS - at least not natively.\n\nSince source code is not available, I decided to see if it was possible to use emulation to run the\ngame on a Pi, and was delighted to discover that it is indeed possible, thanks in a large part to the magic of\n[box86](https://github.com/ptitSeb/box86) and [box64](https://github.com/ptitSeb/box64).\n\nThe process of getting it running was still not simple though, due to the requirement to hunt down x86/x64 versions of\nseveral libraries that the game depended on, but are not yet natively 'wrapped' by box86.\nAlso, the game requires X11, and whilst that means it will run fine in the Desktop version of Raspberry Pi OS,\nI wanted to run it from the CLI, which is possible using [xinit](https://en.wikipedia.org/wiki/Xinit) but\nrequires yet more configuration.\n\nSo I decided to put this script together to automate the process in hope that that it helps others to enjoy this\namazing game on their Pis.\n\n## Limitations ##\n\n* Only Raspberry Pi 2, 3 \u0026 4 models are currently supported with 1GB or more of RAM.\nThe original Pi and Pi Zero use an ARM chip that is not supported by box86's 'DynaRec' (dynamic recompiler)\nso performance would suffer.\nThe Pi Zero 2 may work, but the 512 MB RAM is likely to be a problem building box86/box64 and I don't have one to test on.\n* box64 build is unstable on devices with \u003c 2GB RAM (e.g. RPi3). You may want to use a 32-bit OS for these devices.\n* It has only been tested against the 'Bullseye' release.\n* It requires the use of the KMS GL driver to get playable performance.\n\n## DISCLAIMER - **USE AT YOUR OWN RISK** ##\n\nThis script necessarily makes use of [`sudo`](https://en.wikipedia.org/wiki/Sudo)\nfor some operations.\nSome of these will make changes to your Pi that you may not want and/or may break other software.\ne.g. it may increase the size of the\n[swap file](https://www.linux.com/news/all-about-linux-swap-space/).\n\nI do not claim to be an expert in Linux/Raspberry Pi OS. This works for me, but I am unable to test this script with every combination of hardware \u0026 software environment.\nIt's possible that I have made an error that will cause unrecoverable damage to your Pi system image and leave it 'bricked'.\nI will not be held responsible for any loss resulting from the use of this script, as per the conditions\ncontained in the [LICENSE](LICENSE). I encourage you to read and understand the script contents prior to running it.\n\nI **do not** recommend you use this script if you have valuable data on your Pi and/or the Pi is already in use for\nsomething important to you.\n\nI **do** recommend you backup your data and use a fresh install of Raspberry Pi OS 'Bullseye' on a spare SD card\nto run this script.\n\n## Installation ##\n\n### Prerequisites ###\n\nThe following steps should be done **BEFORE** using the script to prepare your Pi.\nThese assume a fresh install of Raspberry Pi OS 'Bullseye' Lite edition.\nYour Pi must also have internet access for this whole process.\n\n1. If your Pi has less than 4 GB of RAM (all Pis pre v4 and some v4s), reduce the GPU share to 16 MB:\n\n     `sudo raspi-config` -\u003e Performance Options -\u003e GPU Memory\n\n    This is done to give as much RAM as possible to the CPU when building box86\n\n2. Expand the file system to use all of the SD card if you didn't already:\n\n     `sudo raspi-config` -\u003e Advanced Options -\u003e Expand Filesystem\n\n3. Enable the KMS GL driver:\n\n     `sudo raspi-config` -\u003e Advanced Options -\u003e GL Driver -\u003e (Full KMS)\n\n     This option might not be present on latest Bullseye since KMS is enabled by default now. \n     You probably want 'Fake KMS' if running on 'Buster' but this hasn't been thoroughly tested.\n\n4. (Optional) Enable SSH if you want to and know how to use it!\n\n     `sudo raspi-config` -\u003e Interface Options -\u003e SSH\n\n5. Update your system:\n\n    `sudo apt update \u0026\u0026 sudo apt -y upgrade`\n\n6. Reboot!\n\n### Getting the Script ###\n\nYou may copy the [install_mgpr_pi.sh](install_mgpr_pi.sh) script from this repo to your Pi anyway you wish\n(e.g. using `scp` if you enabled SSH). This is the only file from this repo required to install `mgpr`.\nAlternatively, clone direct from GitHub on your Pi:\n\n```shell\nsudo apt install git\ngit clone https://github.com/neildavis/mgpr-pi.git\ncp mgpr-pi/*.sh ~/\ncd\n```\n\n### Configuring the Script ###\n\nThe script makes certain assumptions about the display and orientation of the game.\nThese can be overridden by changing the variables at the top of the script to match\nyour setup. In particular you may want to change some/all of the variables prefixed\n`mgpr_cfg_` and `mgpr_display_` to suit your needs. See the comments in the script\nfor more details.\n\nYou may also want to change `debian_package_mirror` to a\n[server nearer to you](https://www.debian.org/mirror/list).\n\n### Running the Script ###\n\n```shell\n./install_mgpr_pi\n```\n\nWait for the script to finish. It will take some time as box86/box64 take a while to build,\nespecially if you have less than 4GB of RAM where only one core witll be used.\n\n### Post-install ###\n\nAfter installation, you'll probably want to reset your GPU memory to 64+ MB using `raspi-config` if you reduced it earlier.\n\nAnother reboot is also advised.\n\n## Running MGPR ##\n\n### Running from CLI mode ###\n\nIf you're using the 'Lite' version of Raspberry Pi OS and/or booting directly into the CLI console\nthe game needs to run under `xinit`. The install script generated two files to enable this:\n\n1. `mgpr_v1_4_6_linux/.xinitrc`\n\n    A `xinit` config file for the X11 server used to run the game.\n    You may need to edit the this file to match your particular display if you didn't configure the script\n    variables beforehand (See [Configuring the script](#configuring-the-script)).\n\n2. `~/bin/mgpr.sh`\n\n     A convenience script to launch the game.\n\n```shell\n~/bin/mgpr.sh\n```\n\n### Running under the X11 Desktop ###\n\nIf you're using the full Desktop version of Raspberry Pi OS, you should just be able to launch the `mgpr` executable\nfrom the `mgpr_v1_4_6_linux` directory directly. e.g. from a new Terminal window:\n\n```shell\ncd mgpr_v1_4_6_linux\n./mgpr\n```\n\nThe convenience script should also work since it will detect the X11 $DISPLAY\n\n```shell\n~/bin/mgpr.sh\n```\n\n## Known Issues ##\n\n1. On the 32-bit install only, some characters may be missing from the text in the intro screen\nand also in the menu and banner text for 'time', 'score' etc in the game.\nI'm not sure what causes this but it's something to do with the KMS rendering pipeline\nsince it doesn't happen with the 'Legacy' GL driver, but the game is unbearably slow\nunder that driver without full GL acceleration support.\n\n2. On systems with less than 2 GB RAM the box86/box64 builds may fail due to memory exhaustion.\nIf this happens you can usually just start the script again.\n\n## Troubleshooting ##\n\nIf the installation succeeds but the game doesn't run, try running it directly but prefixing\nthe command with `BOX86_LOG=1` (`BOX64_LOG=1` on 64-bit systems). This will cause box86 to spit put lots of debug info that\nmay be helpful in resolving the issue. e.g.\n\n```shell\ncd mgpr_v1_4_6_linux\nBOX86_LOG=1 ./mgpr\n```\n\n## TODO: ##\n\n1. Make configuration more friendly. Perhaps interactive?\n2. Add support for Pi Zero 2 by building box86 for RPi3 and/or forking box86 to add (-DRPIZ2) support.\n3. Build \u0026 host prebuilt `.deb` package builds for box86 \u0026 box64 to save time and build/RAM issues.\n\n## Contributing ##\n\nPlease feel free to fork and send pull requests.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneildavis%2Fmgpr-pi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneildavis%2Fmgpr-pi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneildavis%2Fmgpr-pi/lists"}