feat: backup plan on PC

This commit is contained in:
2026-11-11 23:01:05 +01:00
parent 2da6670d23
commit 9a30f6af37
4 changed files with 319 additions and 2 deletions
+4
View File
@@ -224,3 +224,7 @@ rasp-install-saves: ## install local saves to remote
.PHONY: rasp-import-saves
rasp-import-saves: ## import remote saves
cp -f $(RASP_PROJECT_PATH)/forge_default_save*.txt* .
.PHONY: run-host
run-host: ## run project locally
RUN_ARGS="--project=project -is=1080 -s=0 -m=1" make forge-run
+2 -2
View File
@@ -83,7 +83,7 @@ TEX_COUNT=6
FRAG_FILE_PREFIX=frag
# Total number of fragment shaders (excluding frag0.glsl)
FRAG_COUNT=7
FRAG_COUNT=8
# To which texture will the shader fragX.glsl will render to
FRAG_1_OUT=1
@@ -95,7 +95,7 @@ FRAG_6_OUT=0
# Which fragment shader renders to output window
FRAG_OUTPUT=7
# Which fragment shader renders to monitor window
FRAG_MONITOR=7
FRAG_MONITOR=8
# ==========
+102
View File
@@ -0,0 +1,102 @@
#version 140
// OUT
in vec2 vUV;
out vec4 fragColor;
#include inc_debug.glsl
uniform sampler2D iTex0;
uniform sampler2D iTex1;
uniform sampler2D iTex2;
uniform sampler2D iTex3;
uniform sampler2D iTex4;
uniform sampler2D iTex5;
uniform int iFPS;
float s(vec2 uv, float x0, float y0) {
return step(x0, uv.x) * step(-x0 - 1, -uv.x) * step(y0, uv.y) *
step(-y0 - 1, -uv.y);
}
const int textSRCA[] = int[5](0x49, 0x4E, 0x20, 0x41, 0x00);
const int textSRCB[] = int[5](0x49, 0x4E, 0x20, 0x42, 0x00);
const int textFXA[] = int[5](0x46, 0x58, 0x20, 0x41, 0x00);
const int textFXB[] = int[5](0x46, 0x58, 0x20, 0x42, 0x00);
const int textAB[] = int[5](0x41, 0x2B, 0x42, 0x00, 0x00);
const int textMFX[] = int[5](0x4D, 0x46, 0x58, 0x00, 0x00);
const int textFPS[] = int[5](0x46, 0x50, 0x53, 0x00, 0x00);
const int textDEMO[] = int[5](0x44, 0x45, 0x4D, 0x4F, 0x00);
const int textLIVE[] = int[5](0x4C, 0x49, 0x56, 0x45, 0x00);
void main() {
vec2 uv0 = vUV.st;
float ratio = iResolution.x / iResolution.y;
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1);
vec2 uv2 = uv0 * 3;
vec2 uv3 = uv1 * 60;
vec4 c = vec4(0);
c += s(uv2, 0, 2) * texture(iTex1, uv2);
c += s(uv2, 1, 2) * texture(iTex3, uv2);
c += s(uv2, 0, 0) * texture(iTex2, uv2);
c += s(uv2, 1, 0) * texture(iTex4, uv2);
c += s(uv2, 0, 1) * debug(mod(uv2, 1));
c += s(uv2, 1, 1) * texture(iTex5, uv2);
c += s(uv2, 2, 1) * texture(iTex0, uv2);
float sel = 0;
sel += iSelected == 1 ? h_rect(uv2, vec2(0.5, 2.5), vec2(0.5), 0.01) : 0;
sel += iSelected == 2 ? h_rect(uv2, vec2(0.5, 0.5), vec2(0.5), 0.01) : 0;
sel += iSelected == 3 ? h_rect(uv2, vec2(1.5, 2.5), vec2(0.5), 0.01) : 0;
sel += iSelected == 4 ? h_rect(uv2, vec2(1.5, 0.5), vec2(0.5), 0.01) : 0;
sel += iSelected == 6 ? h_rect(uv2, vec2(2.5, 1.5), vec2(0.5), 0.01) : 0;
c = mix(c, 1 - c, sel);
float f = 0;
float t = 0;
f += rect(uv3, vec2(-35, 8.5), vec2(2.1, 0.7));
if (iDemo > 0) {
t += write_5(uv3, vec2(-37, 8), textDEMO);
} else {
t += write_5(uv3, vec2(-37, 8), textLIVE);
}
f += rect(uv3, vec2(-35, 28.5), vec2(2.6, 0.7));
f += iActive1 == 1 ? h_rect(uv3, vec2(-35, 28.5), vec2(3, 1), 0.2) : 0;
t += write_5(uv3, vec2(-37.5, 28), textSRCA);
f += rect(uv3, vec2(-35, -11.5), vec2(2.6, 0.7));
f += iActive1 == 2 ? h_rect(uv3, vec2(-35, -11.5), vec2(3, 1), 0.2) : 0;
t += write_5(uv3, vec2(-37.5, -12), textSRCB);
f += rect(uv3, vec2(0, 28.5), vec2(2.1, 0.7));
f += iActive2 == 1 ? h_rect(uv3, vec2(0, 28.5), vec2(2.5, 1), 0.2) : 0;
t += write_5(uv3, vec2(-2, 28), textFXA);
f += rect(uv3, vec2(0, -11.5), vec2(2.1, 0.7));
f += iActive2 == 2 ? h_rect(uv3, vec2(0, -11.5), vec2(2.5, 1), 0.2) : 0;
t += write_5(uv3, vec2(-2, -12), textFXB);
f += rect(uv3, vec2(0, 8.5), vec2(1.6, 0.7));
t += write_5(uv3, vec2(-1.5, 8), textAB);
f += rect(uv3, vec2(35, 8.5), vec2(1.6, 0.7));
f += iActive2 == 3 ? h_rect(uv3, vec2(35, 8.5), vec2(2, 1), 0.2) : 0;
t += write_5(uv3, vec2(33.5, 8), textMFX);
f += rect(uv3, vec2(35, 6.75), vec2(2.8, 0.7));
t += write_int(uv3, vec2(32.4, 6.1), min(99, iFPS), 2);
t += write_5(uv3, vec2(34.9, 6.1), textFPS);
fragColor = mix(c, vec4(min(1, f) - t), min(1, f));
}
+211
View File
@@ -0,0 +1,211 @@
#include inc_magic.glsl
#include inc_functions.glsl
#include inc_write.glsl
#ifndef INC_DEBUG
#define INC_DEBUG
uniform int iDemo;
uniform int iAutoRand;
uniform int iAutoRandCycle;
uniform int iPage;
uniform int iSelected;
uniform int iSeed1;
uniform int iSeed2;
uniform int iSeed3;
uniform int iSeed4;
uniform int iSeed5;
uniform int iSeed6;
uniform int iState1;
uniform int iState2;
uniform int iState3;
uniform int iState4;
uniform int iState6;
uniform int iActive1;
uniform int iActive2;
uniform vec3 iGroup2_1[7];
uniform vec3 iGroup2_2[7];
uniform vec3 iGroup2_3[7];
uniform vec3 iGroup3_1[2];
vec4 debug(vec2 vUV)
{
// start
vec2 uv0 = vUV.st;
float ratio = iResolution.x / iResolution.y;
vec2 uv1 = (uv0 - .5) * vec2(ratio, 1.);
// inputs
int selected_srca = iState1;
bool random_srca = iState1 == 15;
if (random_srca) {
selected_srca = int(randTime(iSeed1 + 100.) * 14.);
}
int selected_srcb = iState2;
bool random_srcb = iState2 == 15;
if (random_srcb) {
selected_srcb = int(randTime(iSeed2 + 100.) * 14.);
}
int selected_fxa = iState3;
bool random_fxa = iState3 == 15;
if (random_fxa) {
selected_fxa = int(randTime(iSeed3 + 100.) * 14.);
}
int selected_fxb = iState4;
bool random_fxb = iState4 == 15;
if (random_fxb) {
selected_fxb = int(randTime(iSeed4 + 100.) * 14.);
}
int selected_mfx = iState6;
bool random_mfx = iState6 == 15;
if (random_mfx) {
selected_mfx = int(randTime(iSeed5 + 100.) * 14.);
}
float fxa_value = magic(iGroup2_1[6].xy, vec3(1., 0., 0.), iSeed3);
bool fxa_invert = magic_trigger(vec3(iGroup2_1[6].z, 0., 0.), iSeed3);
float fxb_value = magic(iGroup2_2[6].xy, vec3(1., 0., 0.), iSeed4);
bool fxb_invert = magic_trigger(vec3(iGroup2_2[6].z, 0., 0.), iSeed4);
float mfx_value = magic(iGroup2_3[6].xy, vec3(1., 0., 0.), iSeed6);
bool mfx_invert = magic_trigger(vec3(iGroup2_3[6].z, 0., 0.), iSeed6);
float mix_value = magic(iGroup3_1[1].xy, vec3(1., 0., 0.), iSeed5);
mix_value = mix(mix_value, mix_value * .9 + .05, iDemo);
bool mix_type = magic_trigger(vec3(iGroup3_1[0].x, 0., 0.), iSeed5 + 10.);
// logic
const int textTEMPO[] = int[5](0x54, 0x45, 0x4D, 0x50, 0x4F);
const int textTIME[] = int[5](0x54, 0x49, 0x4D, 0x45, 0x00);
const int textRAND[] = int[5](0x52, 0x41, 0x4E, 0x44, 0x00);
const int textSRC[] = int[5](0x53, 0x52, 0x43, 0x00, 0x00);
const int textFX[] = int[5](0x46, 0x58, 0x00, 0x00, 0x00);
const int textIN[] = int[5](0x49, 0x4E, 0x00, 0x00, 0x00);
const int textMFX[] = int[5](0x4D, 0x46, 0x58, 0x00, 0x00);
vec2 uv2 = uv1;
uv2 *= 10.;
uv2.x -= .5;
uv2.y += .5;
vec2 uv3 = uv1 * 30.;
// base frame
float f =
h_rect(uv2, vec2(-5., -2.), vec2(1.), .1) +
h_rect(uv2, vec2(-2., -2.), vec2(1.), .1) +
rect(uv2, vec2(-3.5, -2.), vec2(.5, .1)) +
h_rect(uv2, vec2(-5, 2.), vec2(1.), .1) +
h_rect(uv2, vec2(-2, 2.), vec2(1.), .1) +
rect(uv2, vec2(-3.5, 2.), vec2(.5, .1)) +
h_rect(uv2, vec2(2., 0.), vec2(1.), .1) +
h_rect(uv2, vec2(5., 0.), vec2(1.), .1) +
rect(uv2, vec2(3.5, 0.), vec2(.5, .1)) +
rect(uv2, vec2(.55, -2.), vec2(1.5, .1)) +
rect(uv2, vec2(2., -1.55), vec2(.1, .55)) +
rect(uv2, vec2(.55, 2.), vec2(1.5, .1)) +
rect(uv2, vec2(2., 1.55), vec2(.1, .55)) +
rect(uv2, vec2(6.8, 0.), vec2(.75, .1)) +
h_circle(uv2, vec2(7.8, 0.), .3, .1);
// show selected src/fx
f += cp437_at(uv2, vec2(-5.4, 1.45), hex_chars[selected_srca]);
f += random_srca ? circle(uv2, vec2(-4.25, 2.7), .1) : 0.;
f += cp437_at(uv2, vec2(-5.4, -2.55), hex_chars[selected_srcb]);
f += random_srcb ? circle(uv2, vec2(-4.25, -1.3), .1) : 0.;
f += cp437_at(uv2, vec2(-2.4, 1.45), hex_chars[selected_fxa]);
f += fxa_invert ? rect(uv2, vec2(-2., 2.7), vec2(.5, .05)) : 0.;
f += random_fxa ? circle(uv2, vec2(-1.25, 2.7), .1) : 0.;
f += cp437_at(uv2, vec2(-2.4, -2.55), hex_chars[selected_fxb]);
f += fxb_invert ? rect(uv2, vec2(-2., -1.3), vec2(.5, .05)) : 0.;
f += random_fxb ? circle(uv2, vec2(-1.25, -1.3), .1) : 0.;
f += cp437_at(uv2, vec2(4.6, -.55), hex_chars[selected_mfx]);
f += mfx_invert ? rect(uv2, vec2(5., .7), vec2(.5, .05)) : 0.;
f += random_mfx ? circle(uv2, vec2(5.75, .7), .1) : 0.;
// show current selected
f += iSelected == 1 ? h_rect(uv2, vec2(-5., 2.), vec2(1.2), .1) : 0.;
f += iSelected == 2 ? h_rect(uv2, vec2(-5., -2.), vec2(1.2), .1) : 0.;
f += iSelected == 3 ? h_rect(uv2, vec2(-2., 2.), vec2(1.2), .1) : 0.;
f += iSelected == 4 ? h_rect(uv2, vec2(-2., -2.), vec2(1.2), .1) : 0.;
f += iSelected == 6 ? h_rect(uv2, vec2(5., 0.), vec2(1.2), .1) : 0.;
// show selected src/fx
f += iActive1 == 1 ? h_rect(uv2, vec2(-5., .8), vec2(1., 0.), .1) : 0.;
f += iActive1 == 2 ? h_rect(uv2, vec2(-5., -3.2), vec2(1., 0.), .1) : 0.;
f += iActive2 == 1 ? h_rect(uv2, vec2(-2., .8), vec2(1.2, 0.), .1) : 0.;
f += iActive2 == 2 ? h_rect(uv2, vec2(-2., -3.2), vec2(1., 0.), .1) : 0.;
f += iActive2 == 3 ? h_rect(uv2, vec2(5., -1.2), vec2(1., 0.), .1) : 0.;
// show src/fx
f += write_5(uv3 * .75, vec2(-11.6, -1.8), textSRC);
f += write_5(uv3 * .75, vec2(-4.2, -1.8), textFX);
f += cp437_at(uv3 * .5, vec2(-11.5, 3.5), 0x41);
f += cp437_at(uv3 * .5, vec2(-11.5, -6.), 0x42);
f += write_5(uv3 * .75, vec2(10.9, 2.), textMFX);
// show inputs / feedback
float line_a_a = rect(uv2, vec2(-7.5, 2.), vec2(1.5, .1));
float line_a_b = rect(uv2, vec2(-6.5, 2.), vec2(.5, .1)) + rect(uv2, vec2(-8.5, -2), vec2(.5, .1)) + line(uv2, vec2(-7., 2.1), vec2(-8., -2.1), .2);
float line_a_f = rect(uv2, vec2(-6.5, 2.), vec2(.5, .1)) + rect(uv2, vec2(0., 3.6), vec2(7., .1)) + rect(uv2, vec2(-7., 2.8), vec2(.1, .9)) + rect(uv2, vec2(7., 1.8), vec2(.1, 1.9));
if (selected_srca == 1) {
f += line_a_f;
}
float line_b_a = rect(uv2, vec2(-6.5, -2.), vec2(.5, .1)) + rect(uv2, vec2(-8.5, 2.), vec2(.5, .1)) + line(uv2, vec2(-7., -2.1), vec2(-8., 2.1), .2);
float line_b_b = rect(uv2, vec2(-7.5, -2.), vec2(1.5, .1));
float line_b_f = rect(uv2, vec2(-6.5, -2.), vec2(.5, .1)) + rect(uv2, vec2(0., -3.6), vec2(7., .1)) + rect(uv2, vec2(-7., -2.8), vec2(.1, .9)) + rect(uv2, vec2(7., -1.8), vec2(.1, 1.9));
if (selected_srcb == 1) {
f += line_b_f;
}
// show page
f += iPage == 0 ? circle(uv2, vec2(-.75, -4.1), .3) : h_circle(uv2, vec2(-.75, -4.1), .25, .1);
f += iPage == 1 ? circle(uv2, vec2(0., -4.1), .3) : h_circle(uv2, vec2(0., -4.1), .20, .1);
f += iPage == 2 ? circle(uv2, vec2(.75, -4.1), .3) : h_circle(uv2, vec2(.75, -4.1), .20, .1);
// show fx values
float fx_rect = 0;
f = mix(f, 1 - f, rect(uv2, vec2(-2., 1.1 + .9 * fxa_value), vec2(.9, .9 * fxa_value)));
f = mix(f, 1 - f, rect(uv2, vec2(-2., -2.9 + .9 * fxb_value), vec2(.9, .9 * fxb_value)));
f = mix(f, 1 - f, rect(uv2, vec2(5., -.9 + .9 * mfx_value), vec2(.9, .9 * mfx_value)));
// show mix
f += cp437_at(uv2, vec2(1.55, -.6), mix_type ? 0x4B : 0x4D);
f = mix(f, 1 - f, rect(uv2, vec2(2., -.9 + .9 * mix_value), vec2(.9, .9 * mix_value)));
// show debug info
float v = 0.;
float x = 0.;
x = -15.;
f += write_5(uv3, vec2(x - 4.5, 13.), textTEMPO);
f += write_int(uv3, vec2(x + 1.5, 13.), int(iTempo), 3);
v = fract(iBeats);
f += h_rect(uv3, vec2(x, 12.), vec2(4., .5), .2);
f += rect(uv3, vec2(x + 4. * v - 4., 12.), vec2(4. * v, .4));
x = 15.;
if (iAutoRand > 0) {
f += write_5(uv3, vec2(x - 4.5, 13.), textRAND);
f += write_int(uv3, vec2(x - .5, 13.), int(iAutoRandCycle), 5);
v = fract(iBeats / iAutoRandCycle);
} else {
f += write_int(uv3, vec2(x - .5, 13.), int(iTime), 5);
v = fract(iTime);
f += write_5(uv3, vec2(x - 4.5, 13.), textTIME);
}
f += h_rect(uv3, vec2(x, 12.), vec2(4., .5), .2);
f += rect(uv3, vec2(x + 4. * v - 4., 12), vec2(4. * v, .4));
return vec4(f);
}
#endif