Last active
April 18, 2020 05:48
-
-
Save infval/8e44427fa1ef78cb2fb235e579a2255a to your computer and use it in GitHub Desktop.
yuzu | Color fix for 'Blaster Master Zero 2' [Switch]
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Dirty color fix for 'Blaster Master Zero 2' [Switch] | |
OpenGL ONLY! | |
Tested version: yuzu 228 | |
""" | |
import sys | |
# \src\video_core\renderer_opengl\renderer_opengl.cpp | |
shader_text = b"void main() {\n color = vec4(texture(color_texture, frag_tex_coord).rgb, 1.0f);\n}" | |
new_shader = b"void main() {\n color = vec4(texture(color_texture, frag_tex_coord).bgr, 1.0f);\n}" | |
with open("yuzu.exe", "rb") as f: | |
b = bytearray(f.read()) | |
start_ind = b.find(shader_text) | |
end_ind = start_ind + len(shader_text) | |
if start_ind == -1: | |
print("Shader not found") | |
input("Press any key...") | |
sys.exit(1) | |
b[start_ind:end_ind] = new_shader.ljust(end_ind - start_ind) | |
with open("yuzu_bgra.exe", "wb") as f: | |
f.write(b) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment