Skip to content

Instantly share code, notes, and snippets.

View yuriks's full-sized avatar

Yuri Kunde Schlesner yuriks

View GitHub Profile
@yuriks
yuriks / vshader.v.pica
Created January 22, 2016 07:03
Nested loop test
.constf foo0(0.1 , 0.0, 0.0 , 1.0)
.constf foo1(0.0 , 0.0, 0.0 , 1.0)
.constf foo2(0.0 , 0.0, 0.0 , 1.0)
.constf foo3(0.0 , 0.0, 0.11, 1.0)
.constf foo4(0.0 , 0.0, 0.0 , 1.0)
.constf foo5(0.0 , 0.0, 0.0 , 1.0)
.consti loopParams1(2, 0, 1, 0)
.consti loopParams2(2, 3, 1, 0)
7134a17fc6cb7ab8ae46dae04f005bb72e0af88e is the first bad commit
commit 7134a17fc6cb7ab8ae46dae04f005bb72e0af88e
Author: archshift <[email protected]>
Date: Mon Aug 31 18:29:23 2015 -0700
Split up FileUtil::ScanDirectoryTree to be able to use callbacks for custom behavior
Converted FileUtil::ScanDirectoryTree and FileUtil::DeleteDirRecursively
to use the new ScanDirectoryTreeAndCallback function internally.
GLuint uniform_id = glGetUniformLocation(shader->shader.handle, "tex[0]");
if (uniform_id != -1) glUniform1i(uniform_id, 0);
uniform_id = glGetUniformLocation(shader->shader.handle, "tex[1]");
if (uniform_id != -1) glUniform1i(uniform_id, 1);
uniform_id = glGetUniformLocation(shader->shader.handle, "tex[2]");
if (uniform_id != -1) glUniform1i(uniform_id, 2);
diff --git a/src/video_core/renderer_opengl/gl_shaders.h b/src/video_core/renderer_opengl/gl_shaders.h
index a8cb2f5..c18bb65 100644
--- a/src/video_core/renderer_opengl/gl_shaders.h
+++ b/src/video_core/renderer_opengl/gl_shaders.h
@@ -144,7 +144,7 @@ struct TEVConfig
uniform TEVConfig tev_cfgs[NUM_TEV_STAGES];
-vec4 g_combiner_buffer;
+vec4 g_combiner_buffer = vec4(0.0);
@yuriks
yuriks / mutex.cpp
Last active September 29, 2015 22:28
3DS lightweight mutex
Handle arbiter;
struct Mutex {
// 1 = unlocked
// 0 = locked
// -n = contended
s32 val = 1;
void acquire() {
while (__atomic_fetch_sub(&val, 1, __ATOMIC_ACQUIRE) != 1) {
commit 7de688601d4702d68099034988ff90f20640a555
Author: Yuri Kunde Schlesner <[email protected]>
Date: Sat Sep 5 16:44:19 2015 -0300
GPU: Fix GPU_Reset function not correctly submitting commandlist
Related to PR #143
diff --git a/libctru/source/gpu/gpu.c b/libctru/source/gpu/gpu.c
index 45f4c4e..1e07095 100644
@yuriks
yuriks / gist:2a5a5aa4878206e39589
Last active September 2, 2015 19:14
PICA f32 -> f31/f24 conversion
u32 f31FromFloat(float f) {
u32 i;
memcpy(&i, &f, 4);
u32 mantissa = (i << 9) >> 9;
s32 exponent = (i << 1) >> 24;
u32 sign = (i << 0) >> 31;
// Re-bias exponent
exponent = exponent - 127 + 63;
@yuriks
yuriks / mini-debugger.patch
Created August 28, 2015 02:17
Citra debugger hack
diff --git a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
index f4b3c47..ede71f6 100644
--- a/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
+++ b/src/core/arm/dyncom/arm_dyncom_interpreter.cpp
@@ -20,6 +20,10 @@
#include "core/arm/skyeye_common/armmmu.h"
#include "core/arm/skyeye_common/vfp/vfp.h"
+#include "boost/container/flat_set.hpp"
+#include <iostream>
@yuriks
yuriks / gist:29fff19e9a6cc54d9d18
Created August 23, 2015 06:19
PICA200 fp behavior
any multiply by 0 inside an instruction -> 0
inf - inf -> NaN
rsq(rcp(-inf)) -> +inf
rcp(0) -> +inf
rcp(inf) -> 0
rcp(nan) -> nan
rsq(-0) -> +inf
@yuriks
yuriks / main.cpp
Created August 22, 2015 02:06
Stencil Test
#include <cstdint>
#include <cstdio>
#include <algorithm>
#include <memory>
#define GLFW_INCLUDE_NONE
#include <GLFW/glfw3.h>
#include "gl_3_2_core.h"