summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoah2021-04-27 20:05:00 -0500
committerNoah2021-04-27 20:05:00 -0500
commit29e4f768da6f4deade1cd85bd0c9b8a2a5259a3b (patch)
tree25433166198eb97d268bf1cbe516de2928784276
downloadaur-29e4f768da6f4deade1cd85bd0c9b8a2a5259a3b.tar.gz
Initial commit
-rw-r--r--.SRCINFO26
-rw-r--r--PKGBUILD68
-rw-r--r--sm64plus-wrapper.sh8
-rw-r--r--sm64plus.desktop8
-rw-r--r--sm64plus.patch101
5 files changed, 211 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..568445efb92
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,26 @@
+pkgbase = sm64plus-git
+ pkgdesc = A standalone fork of the Super Mario 64 PC Port with quality of life improvements
+ pkgver = 1.1.3.1
+ pkgrel = 1
+ url = https://github.com/MorsGames/sm64plus
+ arch = x86_64
+ makedepends = git
+ makedepends = python
+ makedepends = imagemagick
+ depends = sdl2
+ depends = glew
+ provides = sm64plus
+ conflicts = sm64plus
+ source = sm64plus::git+https://github.com/MorsGames/sm64plus
+ source = sm64plus.patch
+ source = sm64plus-wrapper.sh
+ source = sm64plus.desktop
+ source = file://baserom.us.z64
+ sha1sums = SKIP
+ sha1sums = 5ca99550d893044d6f7c915ec5dfc0fa2a958d6f
+ sha1sums = 1d5610570e9a715f08b3024db84b55c0f46d064e
+ sha1sums = d8b8b8065fac319ac095ec2248c0200a9b9d6eb4
+ sha1sums = 9bef1128717f958171a4afac3ed78ee2bb4e86ce
+
+pkgname = sm64plus-git
+
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..c60eb523248
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,68 @@
+# Maintainer: Noah (coolreader18)
+
+# Please fetch this PKGBUILD manually and place a legally obtained ROM of Super Mario 64 in the
+# same directory with the name `baserom.us.z64`. e.g.:
+#
+# git clone https://aur.archlinux.org/sm64plus-git.git
+# # or with the `yay` AUR helper
+# yay -G sm64plus-git
+# cd sm64plus-git
+# cp "/my_sm64_rom.z64" ./baserom.us.z64
+# makepkg -si
+#
+# The ROM will be checksummed to ensure that it's the correct version.
+# The sha1 should be: 9bef1128717f958171a4afac3ed78ee2bb4e86ce
+
+pkgname=sm64plus-git
+pkgver=1.1.3.1
+pkgrel=1
+pkgdesc="A standalone fork of the Super Mario 64 PC Port with quality of life improvements"
+arch=(x86_64)
+url="https://github.com/MorsGames/sm64plus"
+license=('reverse-engineered and unlicensed')
+groups=()
+depends=(sdl2 glew)
+makedepends=(git python imagemagick)
+provides=("sm64plus")
+conflicts=("sm64plus")
+replaces=()
+backup=()
+options=()
+install=
+source=('sm64plus::git+https://github.com/MorsGames/sm64plus' sm64plus.patch sm64plus-wrapper.sh sm64plus.desktop file://baserom.us.z64)
+noextract=()
+sha1sums=('SKIP'
+ '5ca99550d893044d6f7c915ec5dfc0fa2a958d6f'
+ '1d5610570e9a715f08b3024db84b55c0f46d064e'
+ 'd8b8b8065fac319ac095ec2248c0200a9b9d6eb4'
+ '9bef1128717f958171a4afac3ed78ee2bb4e86ce')
+
+# Please refer to the 'USING VCS SOURCES' section of the PKGBUILD man page for
+# a description of each element in the source array.
+
+pkgver() {
+ cd "$srcdir/sm64plus"
+
+ printf "%s" "$(cat README.md | grep -Po '### v\K[0-9\.]+' | head -n1)"
+}
+
+prepare() {
+ cd "$srcdir/sm64plus"
+ patch -p1 -i "$srcdir/sm64plus.patch"
+}
+
+build() {
+ cd "$srcdir/sm64plus"
+ SM64PLUS_BASEROM_us="$srcdir/baserom.us.z64" make -j4
+ convert star.ico[1] star.png
+}
+
+package() {
+ cd "$srcdir/sm64plus"
+ mkdir -p "$pkgdir/opt/sm64plus"
+ cp -r build/us_pc/gfx -t "$pkgdir/opt/sm64plus"
+ install build/us_pc/sm64.us.f3dex2e "$pkgdir/opt/sm64plus"
+ install -D "$srcdir/sm64plus-wrapper.sh" "$pkgdir/usr/bin/sm64plus"
+ install -D "$srcdir/sm64plus.desktop" -t "$pkgdir/usr/share/applications"
+ install -D star.png "$pkgdir/usr/share/pixmaps/sm64plus.png"
+}
diff --git a/sm64plus-wrapper.sh b/sm64plus-wrapper.sh
new file mode 100644
index 00000000000..3efbb45bfb6
--- /dev/null
+++ b/sm64plus-wrapper.sh
@@ -0,0 +1,8 @@
+#!/usr/bin/bash
+
+set -eu
+
+config_dir=${XDG_CONFIG_HOME:-~/.config}/sm64plus
+mkdir -p "$config_dir"
+cd "$config_dir"
+exec /opt/sm64plus/sm64.us.f3dex2e /opt/sm64plus/gfx
diff --git a/sm64plus.desktop b/sm64plus.desktop
new file mode 100644
index 00000000000..4ad201ae9f6
--- /dev/null
+++ b/sm64plus.desktop
@@ -0,0 +1,8 @@
+[Desktop Entry]
+Name=Super Mario 64 Plus
+Comment=Fork of SM64 Desktop with improvements
+Exec=/usr/bin/sm64plus
+Icon=sm64plus
+Terminal=false
+Type=Application
+Categories=Game;
diff --git a/sm64plus.patch b/sm64plus.patch
new file mode 100644
index 00000000000..0e98958f985
--- /dev/null
+++ b/sm64plus.patch
@@ -0,0 +1,101 @@
+diff --git a/FAQ.md b/FAQ.md
+index eddd059..99d5501 100644
+--- a/FAQ.md
++++ b/FAQ.md
+@@ -32,7 +32,7 @@ Also please remember that most of the time these issues are caused by MSYS2, so
+
+ ## **Q:** Some of the textures appear black and purple, how do I fix this?
+
+-**A:** Hold "left", "right", and "backspace" keys down for 5 seconds in the title screen.
++**A:** Hold "left", "right", and "backspace" keys down for 5 seconds in the title screen. On non-windows platforms, you can also try passing the path to the `gfx` directory as the first argument to the executable; by default it's generated at `build/us_pc/gfx`.
+
+ <br>
+
+diff --git a/extract_assets.py b/extract_assets.py
+index 00d72bf..1218018 100755
+--- a/extract_assets.py
++++ b/extract_assets.py
+@@ -55,6 +55,8 @@ def clean_assets(local_asset_file):
+ except FileNotFoundError:
+ pass
+
++def get_baserom_path(lang):
++ return os.environ.get("SM64PLUS_BASEROM_" + lang) or "baserom." + lang + ".z64"
+
+ def main():
+ # In case we ever need to change formats of generated files, we keep a
+@@ -132,7 +134,7 @@ def main():
+ # Load ROMs
+ roms = {}
+ for lang in langs:
+- fname = "baserom." + lang + ".z64"
++ fname = get_baserom_path(lang)
+ try:
+ with open(fname, "rb") as f:
+ roms[lang] = f.read()
+@@ -207,7 +209,7 @@ def main():
+ "-d",
+ "-o",
+ str(mio0),
+- "baserom." + lang + ".z64",
++ get_baserom_path(lang),
+ "-",
+ ],
+ check=True,
+diff --git a/src/pc/gfx/gfx_pc.c b/src/pc/gfx/gfx_pc.c
+index 2dc2ba0..1e69898 100644
+--- a/src/pc/gfx/gfx_pc.c
++++ b/src/pc/gfx/gfx_pc.c
+@@ -663,6 +663,9 @@ static bool import_texture_custom(const char *path) {
+ return TRUE;
+ }
+
++// defined in pc_main.c
++extern const char* GFX_DIR_PATH;
++
+ static void import_texture(int tile) {
+ uint8_t fmt = rdp.texture_tile.fmt;
+ uint8_t siz = rdp.texture_tile.siz;
+@@ -673,7 +676,8 @@ static void import_texture(int tile) {
+
+ // Load the textures
+ char path[1024];
+- snprintf(path, sizeof(path), "gfx/%s.png", (const char*)rdp.loaded_texture[tile].addr);
++ const char* gfx_dir = GFX_DIR_PATH == NULL ? "gfx" : GFX_DIR_PATH;
++ snprintf(path, sizeof(path), "%s/%s.png", gfx_dir, (const char*)rdp.loaded_texture[tile].addr);
+
+ import_texture_custom(path);
+
+diff --git a/src/pc/pc_main.c b/src/pc/pc_main.c
+index bf101e2..a44cbae 100644
+--- a/src/pc/pc_main.c
++++ b/src/pc/pc_main.c
+@@ -184,7 +184,11 @@ static void on_fullscreen_changed(bool is_now_fullscreen) {
+ configFullscreen = is_now_fullscreen;
+ }
+
+-void main_func(void) {
++// used primarily in gfx_pc.c
++const char* GFX_DIR_PATH = NULL;
++
++void main_func(const char* gfx_dir) {
++ GFX_DIR_PATH = gfx_dir;
+ #ifdef USE_SYSTEM_MALLOC
+ main_pool_init();
+ gGfxAllocOnlyPool = alloc_only_pool_init();
+@@ -303,12 +307,12 @@ void main_func(void) {
+
+ #if defined(_WIN32) || defined(_WIN64)
+ int WINAPI WinMain(UNUSED HINSTANCE hInstance, UNUSED HINSTANCE hPrevInstance, UNUSED LPSTR pCmdLine, UNUSED int nCmdShow) {
+- main_func();
++ main_func(NULL);
+ return 0;
+ }
+ #else
+-int main(UNUSED int argc, UNUSED char *argv[]) {
+- main_func();
++int main(int argc, const char *argv[]) {
++ main_func(argc > 1 ? argv[1] : NULL);
+ return 0;
+ }
+ #endif