From 7fb6c86d9dc2719aae554bcd5873fa15a8e9b780 Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Sat, 5 Sep 2015 17:10:41 -0400 Subject: [PATCH] Okay, it looks like colour 3 is approximately phase offset 0, and the palette wraps around after 14 entries, not 16. Also got a bit less dependent on floating point accuracy for the step. --- Machines/Atari2600.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Machines/Atari2600.cpp b/Machines/Atari2600.cpp index 5dafc6fcc..2947f1f2e 100644 --- a/Machines/Atari2600.cpp +++ b/Machines/Atari2600.cpp @@ -158,8 +158,8 @@ const char *Machine::get_signal_decoder() "{\n" "vec2 c = texture(texID, coordinate).rg;" "float y = 0.1 + c.x * 0.91071428571429;\n" - "float aOffset = 6.283185308 * c.y;\n" - "return y + step(0.0625, c.y) * 0.1 * sin(phase + aOffset);\n" + "float aOffset = 6.283185308 * (c.y - 3.0 / 16.0) * 1.14285714285714;\n" + "return y + step(0.03125, c.y) * 0.1 * sin(phase + aOffset);\n" "}"; }