all: a9lh patch external
.PHONY: full
-full: all out/corbenik/locale
+full: all contrib out/corbenik/locale
cp README.md LICENSE.txt out/
cd out && zip -r9 release.zip *
+.PHONY: contrib
+contrib:
+ make -C contrib
+
.PHONY: external
external:
make -C external
--- /dev/null
+.PHONY: all
+all: build install
+
+.PHONY: build
+build: clean $(patsubst %.pco, %.vco, $(wildcard *.pco))
+ mkdir -p ../out/corbenik/patch
+ cp *.vco ../out/corbenik/patch/
+
+.PHONY: install
+install: build
+ mkdir -p ../out/contrib
+ cp *.vco ../out/contrib/
+
+%.vco: %.pco
+ ../host/bytecode_asm.py $< $@
+
+clean:
+ rm -f *.vco
--- /dev/null
+Contributed patches
+----------------------
+
+This directory is for any patches not part of the official distribution and potentially contributed by users. Anything in here must be distributed under the GPLv3, otherwise it cannot be included. I'll make an effort to maintain these as part of the official release zips, but these may not have the same quality standards as `patches/` due to being non-essential to operation.
+
+If you want your patch in the release zips, submit a PR! As long as it does what it says on the tin can and uses GPLv3 as the license, I'll merge it. ;P I can only hope someday this becomes a useful repository of patches for people.
+
+Current contrib patches:
+
+ * mysterymachine.pco - Patches mystery gift in ORAS/XY to point to SALT servers (Original patch: @Wolfvak)
--- /dev/null
+# $name MysteryMachine Patcher
+# $desc Patches Mystery Gift to point to SALT servers
+# $title 000400000011C400 000400000011C500 0004000000055D00 0004000000055E00
+# $ver 01
+# $uuid 0010
+
+# This is for current-gen pokemon games, and points mystery gift
+# to SALT's servers. See here:
+# http://mys.salthax.org/
+# This performs the same patching done by the official HANS-based
+# patcher here:
+# https://github.com/shinyquagsire23/MysteryMachine-Patcher
+# You do not need to use HBLauncher to use this, either. ;P
+
+# This patch was originally created by @Wolfvak although there's
+# really only one way to implement it. Forward all kudos to him.
+
+# I extended it to the other games using newer VM features - that's
+# about it.
+
+rel exe_ro
+
+find "https://3ds1-fushigi.pokemon-gl.com/api/"
+jmpf seturl
+
+rewind
+find "https://3ds2-fushigi.pokemon-gl.com/api/"
+abortnf
+
+seturl:
+
+set "http://mys.salthax.org/api/"
+set 00
+rewind
+
+find "https://npdl.cdn.nintendowifi.net/p01/nsa/%s/%s/%s"
+abortnf
+set "http://mys.salthax.org/p01/nsa/%s/%s/%s"
+set 00
+rewind
+
+find "https://npfl.c.app.nintendowifi.net/p01/filelist/"
+abortnf
+set "http://mys.salthax.org/p01/filelist/"
+set 00