From 623dea884f71bf1d0db0f273b8c1af1d924e114f Mon Sep 17 00:00:00 2001 From: s-hadinger <49731213+s-hadinger@users.noreply.github.com> Date: Sat, 18 Oct 2025 19:09:16 +0200 Subject: [PATCH] Berry animation add SINE transition in rich_color_palette and add WLED palettes (#24029) --- .../compiled/compilation_summary.md | 1634 ++++++++-------- .../compiled/template_cylon_generic.be | 57 + .../compiled/test_shutter_rainbow_central.be | 110 ++ ...neric.anim => template_cylon_generic.anim} | 10 +- .../test_shutter_rainbow_central.anim | 79 +- .../docs/ANIMATION_CLASS_HIERARCHY.md | 15 +- lib/libesp32/berry_animation/src/animation.be | 2 - .../berry_animation/src/animation_dsl.be | 3 + .../all_wled_palettes.anim | 0 .../{animations => dsl}/all_wled_palettes.be | 0 .../providers/rich_palette_color_provider.be | 57 +- .../src/solidify/solidified_animation.h | 1714 +++++++++-------- .../src/solidify/solidified_animation_dsl.h | 480 +++-- .../src/tests/rich_palette_animation_test.be | 113 +- 14 files changed, 2367 insertions(+), 1907 deletions(-) create mode 100644 lib/libesp32/berry_animation/anim_examples/compiled/template_cylon_generic.be create mode 100644 lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be rename lib/libesp32/berry_animation/anim_examples/{test_cylon_generic.anim => template_cylon_generic.anim} (60%) rename lib/libesp32/berry_animation/src/{animations => dsl}/all_wled_palettes.anim (100%) rename lib/libesp32/berry_animation/src/{animations => dsl}/all_wled_palettes.be (100%) diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/compilation_summary.md b/lib/libesp32/berry_animation/anim_examples/compiled/compilation_summary.md index 3a8ef29bd..1d3ded9ed 100644 --- a/lib/libesp32/berry_animation/anim_examples/compiled/compilation_summary.md +++ b/lib/libesp32/berry_animation/anim_examples/compiled/compilation_summary.md @@ -4,94 +4,7 @@ This document contains a summary of the DSL compilation process, including symbol tables and compilation outputs for all processed files. -## heartbeat_pulse.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------|----------------------------|---------|-----------|------------| -| `background` | animation | | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `center_pulse` | animation | | | | -| `heart_bg` | color | | | | -| `heart_glow` | animation | | | | -| `heartbeat1` | animation | | | | -| `heartbeat2` | animation | | | | -| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## twinkle_stars.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|-----------------------|---------|-----------|------------| -| `background` | animation | | | | -| `bright_flash` | animation | | | | -| `night_sky` | color | | | | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `stars` | animation | | | | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## sequence_assignments_demo.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|-----------------------|----------------------------|---------|-----------|------------| -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `blue` | color | ✓ | | | -| `brightness_demo` | sequence | | | | -| `brightness_high` | variable | | | | -| `brightness_low` | variable | | | | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `color_cycle` | color_constructor | ✓ | ⚠️ | ✓ | -| `cosine_osc` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `cosine_val` | value_provider | | | | -| `cylon_eye` | sequence | | | | -| `eye_color` | color | | | | -| `eye_palette` | palette | | | | -| `green` | color | ✓ | | | -| `main_demo` | sequence | | | | -| `multi_change` | sequence | | | | -| `pulsating_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `pulse_demo` | animation | | | | -| `red_eye` | animation | | | | -| `red` | color | ✓ | | | -| `repeat_demo` | sequence | | | | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `triangle_val` | value_provider | | | | -| `triangle` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `violet` | color | ✓ | | | -| `yellow` | color | ✓ | | | - -### Compilation Output - -``` -SUCCESS -``` - -## fire_flicker.anim +## breathing_colors.anim **Status:** ✅ Success @@ -99,212 +12,17 @@ SUCCESS | Symbol | Type | Builtin | Dangerous | Takes Args | |---------------------|----------------------------|---------|-----------|------------| -| `LINEAR` | constant | ✓ | | | -| `fire_base_color` | color | | | | -| `fire_base` | animation | | | | -| `fire_colors` | palette | | | | -| `fire_flicker` | animation | | | | -| `flicker_pattern` | color | | | | +| `breathe_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `breathe_blue` | color | | | | +| `breathe_green` | color | | | | +| `breathe_orange` | color | | | | +| `breathe_palette` | palette | | | | +| `breathe_purple` | color | | | | +| `breathe_red` | color | | | | +| `breathing` | animation | | | | +| `palette_pattern` | color | | | | | `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | | `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## demo_shutter_rainbow_central.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|----------------------|----------|---------|-----------|------------| -| `blue` | color | ✓ | | | -| `green` | color | ✓ | | | -| `indigo` | color | ✓ | | | -| `orange` | color | ✓ | | | -| `rainbow_with_white` | palette | | | | -| `red` | color | ✓ | | | -| `shutter_central` | template | | | | -| `white` | color | ✓ | | | -| `yellow` | color | ✓ | | | - -### Compilation Output - -``` -SUCCESS -``` - -## disco_strobe.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|----------------------------|---------|-----------|------------| -| `LINEAR` | constant | ✓ | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `disco_base` | animation | | | | -| `disco_colors` | palette | | | | -| `disco_pulse` | animation | | | | -| `disco_rich_color` | color | | | | -| `disco_sparkles` | animation | | | | -| `pulse_pattern` | color | | | | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `sparkle_pattern` | color | | | | -| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `white_flash` | animation | | | | - -### Compilation Output - -``` -SUCCESS -``` - -## test_simple_math.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|-----------------|----------------------------|---------|-----------|------------| -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `x` | variable | | | | -| `y` | variable | | | | - -### Compilation Output - -``` -SUCCESS -``` - -## matrix_rain.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|-----------------------|---------|-----------|------------| -| `LINEAR` | constant | ✓ | | | -| `background` | animation | | | | -| `code_flash` | animation | | | | -| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `matrix_bg` | color | | | | -| `matrix_greens` | palette | | | | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `stream1_pattern` | color | | | | -| `stream1` | animation | | | | -| `stream2_pattern` | color | | | | -| `stream2` | animation | | | | -| `stream3_pattern` | color | | | | -| `stream3` | animation | | | | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## demo_shutter_rainbow2.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|----------------------------|---------|-----------|------------| -| `PALETTE_RAINBOW` | palette_constant | ✓ | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `col1` | color | | | | -| `col2` | color | | | | -| `color_cycle` | color_constructor | ✓ | ⚠️ | ✓ | -| `duration` | variable | | | | -| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `shutter_animation` | animation | | | | -| `shutter_run` | sequence | | | | -| `shutter_size` | value_provider | | | | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## scanner_larson.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------|----------------------------|---------|-----------|------------| -| `background` | animation | | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `pos_test` | value_provider | | | | -| `scanner_bg` | color | | | | -| `scanner_trail` | animation | | | | -| `scanner` | animation | | | | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `triangle` | value_provider_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## test_complex_template.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|-----------------|----------|---------|-----------|------------| -| `fire_palette` | palette | | | | -| `ocean_palette` | palette | | | | -| `rainbow_pulse` | template | | | | - -### Compilation Output - -``` -SUCCESS -``` - -## demo_shutter_rainbow_leftright.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|----------------------|----------|---------|-----------|------------| -| `blue` | color | ✓ | | | -| `green` | color | ✓ | | | -| `indigo` | color | ✓ | | | -| `orange` | color | ✓ | | | -| `rainbow_with_white` | palette | | | | -| `red` | color | ✓ | | | -| `shutter_lr` | template | | | | -| `white` | color | ✓ | | | -| `yellow` | color | ✓ | | | ### Compilation Output @@ -343,37 +61,30 @@ SUCCESS SUCCESS ``` -## fail_color_predefined.anim - -**Status:** ❌ Failed - -### Compilation Output - -``` -dsl_compilation_error: Line 4: Transpilation failed: Line 4: Cannot redefine predefined color 'red'. Use a different name like 'red_custom' or 'my_red' -stack traceback: - : in function `error` - : in function `transpile` - : in function `main` -``` - -## test_shutter_rainbow_bidir.anim +## christmas_tree.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|----------------------|----------|---------|-----------|------------| -| `blue` | color | ✓ | | | -| `green` | color | ✓ | | | -| `indigo` | color | ✓ | | | -| `orange` | color | ✓ | | | -| `rainbow_with_white` | palette | | | | -| `red` | color | ✓ | | | -| `shutter_bidir` | template | | | | -| `white` | color | ✓ | | | -| `yellow` | color | ✓ | | | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|----------------------------|---------|-----------|------------| +| `LINEAR` | constant | ✓ | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `garland_pattern` | color | | | | +| `garland` | animation | | | | +| `ornament_colors` | palette | | | | +| `ornament_pattern` | color | | | | +| `ornaments` | animation | | | | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `snow_sparkles` | animation | | | | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `tree_base` | animation | | | | +| `tree_green` | color | | | | +| `tree_star` | animation | | | | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -381,22 +92,47 @@ stack traceback: SUCCESS ``` -## property_assignment_demo.anim +## comet_chase.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------|-----------------------|---------|-----------|------------| -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `blue_custom` | color | | | | -| `center_pulse` | animation | | | | -| `demo` | sequence | | | | -| `green_custom` | color | | | | -| `left_pulse` | animation | | | | -| `red_custom` | color | | | | -| `right_pulse` | animation | | | | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|-----------------------|---------|-----------|------------| +| `background` | animation | | | | +| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `comet_main` | animation | | | | +| `comet_secondary` | animation | | | | +| `comet_sparkles` | animation | | | | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `space_blue` | color | | | | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## computed_values_demo.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|-------------------|----------------------------|---------|-----------|------------| +| `abs` | math_function | ✓ | | ✓ | +| `base_speed` | variable | | | | +| `blue` | color | ✓ | | | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `red` | color | ✓ | | | +| `stream1` | animation | | | | +| `stream2` | animation | | | | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -455,284 +191,21 @@ SUCCESS SUCCESS ``` -## demo_shutter_rainbow_bidir.anim +## cylon_red_eye.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|----------------------|----------|---------|-----------|------------| -| `blue` | color | ✓ | | | -| `green` | color | ✓ | | | -| `indigo` | color | ✓ | | | -| `orange` | color | ✓ | | | -| `rainbow_with_white` | palette | | | | -| `red` | color | ✓ | | | -| `shutter_bidir` | template | | | | -| `white` | color | ✓ | | | -| `yellow` | color | ✓ | | | - -### Compilation Output - -``` -SUCCESS -``` - -## christmas_tree.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|----------------------------|---------|-----------|------------| -| `LINEAR` | constant | ✓ | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `garland_pattern` | color | | | | -| `garland` | animation | | | | -| `ornament_colors` | palette | | | | -| `ornament_pattern` | color | | | | -| `ornaments` | animation | | | | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `snow_sparkles` | animation | | | | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `tree_base` | animation | | | | -| `tree_green` | color | | | | -| `tree_star` | animation | | | | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## plasma_wave.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------------|----------------------------|---------|-----------|------------| -| `SINE` | constant | ✓ | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `plasma_base` | animation | | | | -| `plasma_colors` | palette | | | | -| `plasma_wave1` | animation | | | | -| `plasma_wave2` | animation | | | | -| `plasma_wave3` | animation | | | | -| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `wave1_pattern` | color | | | | -| `wave2_pattern` | color | | | | -| `wave3_pattern` | color | | | | - -### Compilation Output - -``` -SUCCESS -``` - -## ocean_waves.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------------|----------------------------|---------|-----------|------------| -| `SINE` | constant | ✓ | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `foam` | animation | | | | -| `ocean_base` | animation | | | | -| `ocean_colors` | palette | | | | -| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `wave1_pattern` | color | | | | -| `wave1` | animation | | | | -| `wave2_pattern` | color | | | | -| `wave2` | animation | | | | - -### Compilation Output - -``` -SUCCESS -``` - -## swipe_rainbow.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|-------------------|----------------------------|---------|-----------|------------| -| `blue` | color | ✓ | | | -| `color_cycle` | color_constructor | ✓ | ⚠️ | ✓ | -| `green` | color | ✓ | | | -| `indigo` | color | ✓ | | | -| `olivary` | color | | | | -| `orange` | color | ✓ | | | -| `palette_olivary` | palette | | | | -| `red` | color | ✓ | | | -| `slide_colors` | sequence | | | | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `swipe_animation` | animation | | | | -| `violet` | color | ✓ | | | -| `white` | color | ✓ | | | -| `yellow` | color | ✓ | | | - -### Compilation Output - -``` -SUCCESS -``` - -## meteor_shower.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|-----------------------|---------|-----------|------------| -| `background` | animation | | | | -| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `meteor1` | animation | | | | -| `meteor2` | animation | | | | -| `meteor3` | animation | | | | -| `meteor4` | animation | | | | -| `meteor_flash` | animation | | | | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `space_bg` | color | | | | -| `stars` | animation | | | | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## palette_demo.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------------|-----------------------|---------|-----------|------------| -| `PALETTE_FOREST` | palette_constant | ✓ | | | -| `fire_anim` | animation | | | | -| `fire_colors` | palette | | | | -| `forest_anim` | animation | | | | -| `ocean_anim` | animation | | | | -| `ocean_colors` | palette | | | | -| `palette_demo` | sequence | | | | -| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## fail_value_provider_add.anim - -**Status:** ❌ Failed - -### Compilation Output - -``` -dsl_compilation_error: Line 4: Transpilation failed: Line 4: Expression 'animation.linear(engine)' cannot be used in computed expressions. This creates a new instance at each evaluation. Use either: - set var_name = animation.linear(engine)() # Single function call - set computed = (existing_var + 1) / 2 # Computation with existing values -stack traceback: - : in function `error` - : in function `transpile` - : in function `main` -``` - -## fail_name_predefined.anim - -**Status:** ❌ Failed - -### Compilation Output - -``` -dsl_compilation_error: Line 4: Transpilation failed: Line 4: Cannot redefine built-in symbol 'abs' (type: 4). Use a different name like 'abs_custom' or 'my_abs' -stack traceback: - : in function `error` - : in function `transpile` - : in function `main` -``` - -## test_shutter_rainbow_central.anim - -**Status:** ❌ Failed - -### Compilation Output - -``` -dsl_compilation_error: Line 12: Transpilation failed: Line 12: Template body transpilation failed: Line 12: Expression 'animation.strip_length(engine)' cannot be used in computed expressions. This creates a new instance at each evaluation. Use either: - set var_name = animation.strip_length(engine)() # Single function call - set computed = (existing_var + 1) / 2 # Computation with existing values -stack traceback: - : in function `error` - : in function `transpile` - : in function `main` -``` - -## sunrise_sunset.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------------|----------------------------|---------|-----------|------------| -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `daylight_colors` | palette | | | | -| `daylight_cycle` | animation | | | | -| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `stars` | animation | | | | -| `sun_glow` | animation | | | | -| `sun_position` | animation | | | | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - -## simple_palette.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------------|-----------------------|---------|-----------|------------| -| `blue` | color | ✓ | | | -| `demo` | sequence | | | | -| `green` | color | ✓ | | | -| `orange` | color | ✓ | | | -| `rainbow_cycle` | animation | | | | -| `rainbow` | palette | | | | -| `red` | color | ✓ | | | -| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `yellow` | color | ✓ | | | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------|----------------------------|---------|-----------|------------| +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `cosine_osc` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `red_eye` | animation | | | | +| `red` | color | ✓ | | | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -771,30 +244,23 @@ SUCCESS SUCCESS ``` -## neon_glow.anim +## demo_shutter_rainbow_bidir.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------------|----------------------------|---------|-----------|------------| -| `LINEAR` | constant | ✓ | | | -| `arc_sparkles` | animation | | | | -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `neon_colors` | palette | | | | -| `neon_main` | animation | | | | -| `neon_surge` | animation | | | | -| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `segment1` | animation | | | | -| `segment2` | animation | | | | -| `segment3` | animation | | | | -| `segment_pattern` | color | | | | -| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------------|----------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `green` | color | ✓ | | | +| `indigo` | color | ✓ | | | +| `orange` | color | ✓ | | | +| `rainbow_with_white` | palette | | | | +| `red` | color | ✓ | | | +| `shutter_bidir` | template | | | | +| `white` | color | ✓ | | | +| `yellow` | color | ✓ | | | ### Compilation Output @@ -802,7 +268,182 @@ SUCCESS SUCCESS ``` -## cylon_red_eye.anim +## demo_shutter_rainbow_central.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------------|----------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `green` | color | ✓ | | | +| `indigo` | color | ✓ | | | +| `orange` | color | ✓ | | | +| `rainbow_with_white` | palette | | | | +| `red` | color | ✓ | | | +| `shutter_central` | template | | | | +| `white` | color | ✓ | | | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## demo_shutter_rainbow_leftright.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------------|----------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `green` | color | ✓ | | | +| `indigo` | color | ✓ | | | +| `orange` | color | ✓ | | | +| `rainbow_with_white` | palette | | | | +| `red` | color | ✓ | | | +| `shutter_lr` | template | | | | +| `white` | color | ✓ | | | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## demo_shutter_rainbow2.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|----------------------------|---------|-----------|------------| +| `PALETTE_RAINBOW` | palette_constant | ✓ | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `col1` | color | | | | +| `col2` | color | | | | +| `color_cycle` | color_constructor | ✓ | ⚠️ | ✓ | +| `duration` | variable | | | | +| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `shutter_animation` | animation | | | | +| `shutter_run` | sequence | | | | +| `shutter_size` | value_provider | | | | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## disco_strobe.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|----------------------------|---------|-----------|------------| +| `LINEAR` | constant | ✓ | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `disco_base` | animation | | | | +| `disco_colors` | palette | | | | +| `disco_pulse` | animation | | | | +| `disco_rich_color` | color | | | | +| `disco_sparkles` | animation | | | | +| `pulse_pattern` | color | | | | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `sparkle_pattern` | color | | | | +| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `white_flash` | animation | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## fail_color_predefined.anim + +**Status:** ❌ Failed + +### Compilation Output + +``` +dsl_compilation_error: Line 4: Transpilation failed: Line 4: Cannot redefine predefined color 'red'. Use a different name like 'red_custom' or 'my_red' +stack traceback: + : in function `error` + : in function `transpile` + : in function `main` +``` + +## fail_name_predefined.anim + +**Status:** ❌ Failed + +### Compilation Output + +``` +dsl_compilation_error: Line 4: Transpilation failed: Line 4: Cannot redefine built-in symbol 'abs' (type: 4). Use a different name like 'abs_custom' or 'my_abs' +stack traceback: + : in function `error` + : in function `transpile` + : in function `main` +``` + +## fail_value_provider_add.anim + +**Status:** ❌ Failed + +### Compilation Output + +``` +dsl_compilation_error: Line 4: Transpilation failed: Line 4: Expression 'animation.linear(engine)' cannot be used in computed expressions. This creates a new instance at each evaluation. Use either: + set var_name = animation.linear(engine)() # Single function call + set computed = (existing_var + 1) / 2 # Computation with existing values +stack traceback: + : in function `error` + : in function `transpile` + : in function `main` +``` + +## fire_flicker.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|----------------------------|---------|-----------|------------| +| `LINEAR` | constant | ✓ | | | +| `fire_base_color` | color | | | | +| `fire_base` | animation | | | | +| `fire_colors` | palette | | | | +| `fire_flicker` | animation | | | | +| `flicker_pattern` | color | | | | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## heartbeat_pulse.anim **Status:** ✅ Success @@ -810,13 +451,16 @@ SUCCESS | Symbol | Type | Builtin | Dangerous | Takes Args | |--------------------|----------------------------|---------|-----------|------------| +| `background` | animation | | | | | `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `cosine_osc` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `red_eye` | animation | | | | -| `red` | color | ✓ | | | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `center_pulse` | animation | | | | +| `heart_bg` | color | | | | +| `heart_glow` | animation | | | | +| `heartbeat1` | animation | | | | +| `heartbeat2` | animation | | | | +| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -883,100 +527,6 @@ SUCCESS SUCCESS ``` -## police_lights.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------|----------------------------|---------|-----------|------------| -| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `half_length` | variable | | | | -| `left_red` | animation | | | | -| `right_blue` | animation | | | | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `white_strobe` | animation | | | | - -### Compilation Output - -``` -SUCCESS -``` - -## user_functions_demo.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|--------------------|----------------------------|---------|-----------|------------| -| `abs` | math_function | ✓ | | ✓ | -| `blue` | color | ✓ | | | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `cyan` | color | ✓ | | | -| `max` | math_function | ✓ | | ✓ | -| `min` | math_function | ✓ | | ✓ | -| `orange` | color | ✓ | | | -| `purple` | color | ✓ | | | -| `rand_demo` | user_function | ✓ | | ✓ | -| `random_base` | animation | | | | -| `random_bounded` | animation | | | | -| `random_complex` | animation | | | | -| `random_multi` | animation | | | | -| `random_variation` | animation | | | | -| `round` | math_function | ✓ | | ✓ | -| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `white` | color | ✓ | | | - -### Compilation Output - -``` -SUCCESS -``` - -## test_template_simple.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|----------------|----------|---------|-----------|------------| -| `pulse_effect` | template | | | | -| `red` | color | ✓ | | | - -### Compilation Output - -``` -SUCCESS -``` - -## test_compute_multiple.anim - -**Status:** ✅ Success - -## Symbol Table - -| Symbol | Type | Builtin | Dangerous | Takes Args | -|-----------------|----------------------------|---------|-----------|------------| -| `a` | variable | | | | -| `abs` | math_function | ✓ | | ✓ | -| `b` | variable | | | | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | - -### Compilation Output - -``` -SUCCESS -``` - ## lightning_storm.anim **Status:** ✅ Success @@ -1004,38 +554,29 @@ SUCCESS SUCCESS ``` -## test_cylon_generic.anim - -**Status:** ❌ Failed - -### Compilation Output - -``` -dsl_compilation_error: Line 9: Transpilation failed: Line 9: Template body transpilation failed: Line 9: Unknown function or identifier 'abs2'. Make sure it's defined before use. -stack traceback: - : in function `error` - : in function `transpile` - : in function `main` -``` - -## computed_values_demo.anim +## matrix_rain.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|-------------------|----------------------------|---------|-----------|------------| -| `abs` | math_function | ✓ | | ✓ | -| `base_speed` | variable | | | | -| `blue` | color | ✓ | | | -| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | -| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `red` | color | ✓ | | | -| `stream1` | animation | | | | -| `stream2` | animation | | | | -| `strip_len` | value_provider | | | | -| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|-----------------------|---------|-----------|------------| +| `LINEAR` | constant | ✓ | | | +| `background` | animation | | | | +| `code_flash` | animation | | | | +| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `matrix_bg` | color | | | | +| `matrix_greens` | palette | | | | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `stream1_pattern` | color | | | | +| `stream1` | animation | | | | +| `stream2_pattern` | color | | | | +| `stream2` | animation | | | | +| `stream3_pattern` | color | | | | +| `stream3` | animation | | | | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -1043,25 +584,25 @@ stack traceback: SUCCESS ``` -## breathing_colors.anim +## meteor_shower.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|---------------------|----------------------------|---------|-----------|------------| -| `breathe_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `breathe_blue` | color | | | | -| `breathe_green` | color | | | | -| `breathe_orange` | color | | | | -| `breathe_palette` | palette | | | | -| `breathe_purple` | color | | | | -| `breathe_red` | color | | | | -| `breathing` | animation | | | | -| `palette_pattern` | color | | | | -| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | -| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|---------------------|-----------------------|---------|-----------|------------| +| `background` | animation | | | | +| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `meteor1` | animation | | | | +| `meteor2` | animation | | | | +| `meteor3` | animation | | | | +| `meteor4` | animation | | | | +| `meteor_flash` | animation | | | | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `space_bg` | color | | | | +| `stars` | animation | | | | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -1069,16 +610,109 @@ SUCCESS SUCCESS ``` -## test_template_simple_reusable.anim +## neon_glow.anim **Status:** ✅ Success ## Symbol Table -| Symbol | Type | Builtin | Dangerous | Takes Args | -|----------------|----------|---------|-----------|------------| -| `pulse_effect` | template | | | | -| `red` | color | ✓ | | | +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------------|----------------------------|---------|-----------|------------| +| `LINEAR` | constant | ✓ | | | +| `arc_sparkles` | animation | | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `neon_colors` | palette | | | | +| `neon_main` | animation | | | | +| `neon_surge` | animation | | | | +| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `segment1` | animation | | | | +| `segment2` | animation | | | | +| `segment3` | animation | | | | +| `segment_pattern` | color | | | | +| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## ocean_waves.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------------|----------------------------|---------|-----------|------------| +| `SINE` | constant | ✓ | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `foam` | animation | | | | +| `ocean_base` | animation | | | | +| `ocean_colors` | palette | | | | +| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `sawtooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `wave1_pattern` | color | | | | +| `wave1` | animation | | | | +| `wave2_pattern` | color | | | | +| `wave2` | animation | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## plasma_wave.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------------|----------------------------|---------|-----------|------------| +| `SINE` | constant | ✓ | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `plasma_base` | animation | | | | +| `plasma_colors` | palette | | | | +| `plasma_wave1` | animation | | | | +| `plasma_wave2` | animation | | | | +| `plasma_wave3` | animation | | | | +| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `rich_palette` | color_constructor | ✓ | ⚠️ | ✓ | +| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `wave1_pattern` | color | | | | +| `wave2_pattern` | color | | | | +| `wave3_pattern` | color | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## palette_demo.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------------|-----------------------|---------|-----------|------------| +| `PALETTE_FOREST` | palette_constant | ✓ | | | +| `fire_anim` | animation | | | | +| `fire_colors` | palette | | | | +| `forest_anim` | animation | | | | +| `ocean_anim` | animation | | | | +| `ocean_colors` | palette | | | | +| `palette_demo` | sequence | | | | +| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -1122,6 +756,51 @@ SUCCESS SUCCESS ``` +## police_lights.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------|----------------------------|---------|-----------|------------| +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `half_length` | variable | | | | +| `left_red` | animation | | | | +| `right_blue` | animation | | | | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `square` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `white_strobe` | animation | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## property_assignment_demo.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------|-----------------------|---------|-----------|------------| +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `blue_custom` | color | | | | +| `center_pulse` | animation | | | | +| `demo` | sequence | | | | +| `green_custom` | color | | | | +| `left_pulse` | animation | | | | +| `red_custom` | color | | | | +| `right_pulse` | animation | | | | + +### Compilation Output + +``` +SUCCESS +``` + ## rainbow_cycle.anim **Status:** ✅ Success @@ -1142,7 +821,306 @@ SUCCESS SUCCESS ``` -## comet_chase.anim +## scanner_larson.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------|----------------------------|---------|-----------|------------| +| `background` | animation | | | | +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `pos_test` | value_provider | | | | +| `scanner_bg` | color | | | | +| `scanner_trail` | animation | | | | +| `scanner` | animation | | | | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `triangle` | value_provider_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## sequence_assignments_demo.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|-----------------------|----------------------------|---------|-----------|------------| +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `blue` | color | ✓ | | | +| `brightness_demo` | sequence | | | | +| `brightness_high` | variable | | | | +| `brightness_low` | variable | | | | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `color_cycle` | color_constructor | ✓ | ⚠️ | ✓ | +| `cosine_osc` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `cosine_val` | value_provider | | | | +| `cylon_eye` | sequence | | | | +| `eye_color` | color | | | | +| `eye_palette` | palette | | | | +| `green` | color | ✓ | | | +| `main_demo` | sequence | | | | +| `multi_change` | sequence | | | | +| `pulsating_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `pulse_demo` | animation | | | | +| `red_eye` | animation | | | | +| `red` | color | ✓ | | | +| `repeat_demo` | sequence | | | | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `triangle_val` | value_provider | | | | +| `triangle` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `violet` | color | ✓ | | | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## simple_palette.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------------|-----------------------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `demo` | sequence | | | | +| `green` | color | ✓ | | | +| `orange` | color | ✓ | | | +| `rainbow_cycle` | animation | | | | +| `rainbow` | palette | | | | +| `red` | color | ✓ | | | +| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## sunrise_sunset.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------------|----------------------------|---------|-----------|------------| +| `beacon_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `daylight_colors` | palette | | | | +| `daylight_cycle` | animation | | | | +| `rich_palette_animation` | animation_constructor | ✓ | ⚠️ | ✓ | +| `smooth` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `stars` | animation | | | | +| `sun_glow` | animation | | | | +| `sun_position` | animation | | | | +| `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## swipe_rainbow.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|-------------------|----------------------------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `color_cycle` | color_constructor | ✓ | ⚠️ | ✓ | +| `green` | color | ✓ | | | +| `indigo` | color | ✓ | | | +| `olivary` | color | | | | +| `orange` | color | ✓ | | | +| `palette_olivary` | palette | | | | +| `red` | color | ✓ | | | +| `slide_colors` | sequence | | | | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `swipe_animation` | animation | | | | +| `violet` | color | ✓ | | | +| `white` | color | ✓ | | | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## template_cylon_generic.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------|----------|---------|-----------|------------| +| `cylon_effect` | template | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## test_complex_template.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|-----------------|----------|---------|-----------|------------| +| `fire_palette` | palette | | | | +| `ocean_palette` | palette | | | | +| `rainbow_pulse` | template | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## test_compute_multiple.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|-----------------|----------------------------|---------|-----------|------------| +| `a` | variable | | | | +| `abs` | math_function | ✓ | | ✓ | +| `b` | variable | | | | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | + +### Compilation Output + +``` +SUCCESS +``` + +## test_shutter_rainbow_bidir.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------------|----------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `green` | color | ✓ | | | +| `indigo` | color | ✓ | | | +| `orange` | color | ✓ | | | +| `rainbow_with_white` | palette | | | | +| `red` | color | ✓ | | | +| `shutter_bidir` | template | | | | +| `white` | color | ✓ | | | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## test_shutter_rainbow_central.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------------|----------|---------|-----------|------------| +| `blue` | color | ✓ | | | +| `green` | color | ✓ | | | +| `indigo` | color | ✓ | | | +| `orange` | color | ✓ | | | +| `rainbow_with_white` | palette | | | | +| `red` | color | ✓ | | | +| `shutter_central` | template | | | | +| `white` | color | ✓ | | | +| `yellow` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## test_simple_math.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|-----------------|----------------------------|---------|-----------|------------| +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `x` | variable | | | | +| `y` | variable | | | | + +### Compilation Output + +``` +SUCCESS +``` + +## test_template_simple_reusable.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------|----------|---------|-----------|------------| +| `pulse_effect` | template | | | | +| `red` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## test_template_simple.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|----------------|----------|---------|-----------|------------| +| `pulse_effect` | template | | | | +| `red` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + +## twinkle_stars.anim **Status:** ✅ Success @@ -1151,12 +1129,10 @@ SUCCESS | Symbol | Type | Builtin | Dangerous | Takes Args | |---------------------|-----------------------|---------|-----------|------------| | `background` | animation | | | | -| `comet_animation` | animation_constructor | ✓ | ⚠️ | ✓ | -| `comet_main` | animation | | | | -| `comet_secondary` | animation | | | | -| `comet_sparkles` | animation | | | | +| `bright_flash` | animation | | | | +| `night_sky` | color | | | | | `solid` | animation_constructor | ✓ | ⚠️ | ✓ | -| `space_blue` | color | | | | +| `stars` | animation | | | | | `twinkle_animation` | animation_constructor | ✓ | ⚠️ | ✓ | ### Compilation Output @@ -1165,64 +1141,98 @@ SUCCESS SUCCESS ``` +## user_functions_demo.anim + +**Status:** ✅ Success + +## Symbol Table + +| Symbol | Type | Builtin | Dangerous | Takes Args | +|--------------------|----------------------------|---------|-----------|------------| +| `abs` | math_function | ✓ | | ✓ | +| `blue` | color | ✓ | | | +| `closure_value` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `cyan` | color | ✓ | | | +| `max` | math_function | ✓ | | ✓ | +| `min` | math_function | ✓ | | ✓ | +| `orange` | color | ✓ | | | +| `purple` | color | ✓ | | | +| `rand_demo` | user_function | ✓ | | ✓ | +| `random_base` | animation | | | | +| `random_bounded` | animation | | | | +| `random_complex` | animation | | | | +| `random_multi` | animation | | | | +| `random_variation` | animation | | | | +| `round` | math_function | ✓ | | ✓ | +| `solid` | animation_constructor | ✓ | ⚠️ | ✓ | +| `strip_len` | value_provider | | | | +| `strip_length` | value_provider_constructor | ✓ | ⚠️ | ✓ | +| `white` | color | ✓ | | | + +### Compilation Output + +``` +SUCCESS +``` + ## Summary - **Total files processed:** 47 -- **Successfully compiled:** 42 -- **Failed to compile:** 5 +- **Successfully compiled:** 44 +- **Failed to compile:** 3 ### Successful Files -- ✅ heartbeat_pulse.anim -- ✅ twinkle_stars.anim -- ✅ sequence_assignments_demo.anim -- ✅ fire_flicker.anim -- ✅ demo_shutter_rainbow_central.anim -- ✅ disco_strobe.anim -- ✅ test_simple_math.anim -- ✅ matrix_rain.anim -- ✅ demo_shutter_rainbow2.anim -- ✅ scanner_larson.anim -- ✅ test_complex_template.anim -- ✅ demo_shutter_rainbow_leftright.anim +- ✅ breathing_colors.anim - ✅ candy_cane.anim -- ✅ test_shutter_rainbow_bidir.anim -- ✅ property_assignment_demo.anim +- ✅ christmas_tree.anim +- ✅ comet_chase.anim +- ✅ computed_values_demo.anim - ✅ cylon_generic.anim - ✅ cylon_rainbow.anim -- ✅ demo_shutter_rainbow_bidir.anim -- ✅ christmas_tree.anim -- ✅ plasma_wave.anim -- ✅ ocean_waves.anim -- ✅ swipe_rainbow.anim -- ✅ meteor_shower.anim -- ✅ palette_demo.anim -- ✅ sunrise_sunset.anim -- ✅ simple_palette.anim -- ✅ demo_pattern_fire_opacity.anim -- ✅ neon_glow.anim - ✅ cylon_red_eye.anim +- ✅ demo_pattern_fire_opacity.anim +- ✅ demo_shutter_rainbow_bidir.anim +- ✅ demo_shutter_rainbow_central.anim +- ✅ demo_shutter_rainbow_leftright.anim +- ✅ demo_shutter_rainbow2.anim +- ✅ disco_strobe.anim +- ✅ fire_flicker.anim +- ✅ heartbeat_pulse.anim - ✅ import_demo.anim - ✅ lava_lamp.anim -- ✅ police_lights.anim -- ✅ user_functions_demo.anim -- ✅ test_template_simple.anim -- ✅ test_compute_multiple.anim - ✅ lightning_storm.anim -- ✅ computed_values_demo.anim -- ✅ breathing_colors.anim -- ✅ test_template_simple_reusable.anim +- ✅ matrix_rain.anim +- ✅ meteor_shower.anim +- ✅ neon_glow.anim +- ✅ ocean_waves.anim +- ✅ plasma_wave.anim +- ✅ palette_demo.anim - ✅ palette_showcase.anim +- ✅ police_lights.anim +- ✅ property_assignment_demo.anim - ✅ rainbow_cycle.anim -- ✅ comet_chase.anim +- ✅ scanner_larson.anim +- ✅ sequence_assignments_demo.anim +- ✅ simple_palette.anim +- ✅ sunrise_sunset.anim +- ✅ swipe_rainbow.anim +- ✅ template_cylon_generic.anim +- ✅ test_complex_template.anim +- ✅ test_compute_multiple.anim +- ✅ test_shutter_rainbow_bidir.anim +- ✅ test_shutter_rainbow_central.anim +- ✅ test_simple_math.anim +- ✅ test_template_simple_reusable.anim +- ✅ test_template_simple.anim +- ✅ twinkle_stars.anim +- ✅ user_functions_demo.anim ### Failed Files - ❌ fail_color_predefined.anim -- ❌ fail_value_provider_add.anim - ❌ fail_name_predefined.anim -- ❌ test_shutter_rainbow_central.anim -- ❌ test_cylon_generic.anim +- ❌ fail_value_provider_add.anim --- diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/template_cylon_generic.be b/lib/libesp32/berry_animation/anim_examples/compiled/template_cylon_generic.be new file mode 100644 index 000000000..1d7564e84 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_examples/compiled/template_cylon_generic.be @@ -0,0 +1,57 @@ +# Generated Berry code from Animation DSL +# Source: template_cylon_generic.anim +# +# This file was automatically generated by compile_all_examples.sh +# Do not edit manually - changes will be overwritten + +import animation + +# Cylon Red Eye +# Automatically adapts to the length of the strip +# Template function: cylon_effect +def cylon_effect_template(engine, eye_color_, duration_, back_color_) + var strip_len_ = animation.strip_length(engine) + var eye_animation_ = animation.beacon_animation(engine) + eye_animation_.color = eye_color_ + eye_animation_.back_color = back_color_ + eye_animation_.pos = (def (engine) + var provider = animation.cosine_osc(engine) + provider.min_value = (-1) + provider.max_value = animation.create_closure_value(engine, def (engine) return animation.resolve(strip_len_) - 2 end) + provider.duration = duration_ + return provider + end)(engine) + eye_animation_.beacon_size = 3 # small 3 pixels eye + eye_animation_.slew_size = 2 # with 2 pixel shading around + eye_animation_.priority = 5 + engine.add(eye_animation_) +end + +animation.register_user_function('cylon_effect', cylon_effect_template) + + + +#- Original DSL source: +# Cylon Red Eye +# Automatically adapts to the length of the strip + +template cylon_effect { + param eye_color type color + param duration type time + param back_color type color + + set strip_len = strip_length() + + animation eye_animation = beacon_animation( + color = eye_color + back_color = back_color + pos = cosine_osc(min_value = -1, max_value = strip_len - 2, duration = duration) + beacon_size = 3 # small 3 pixels eye + slew_size = 2 # with 2 pixel shading around + priority = 5 + ) + + run eye_animation +} + +-# diff --git a/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be b/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be new file mode 100644 index 000000000..e44fb0ac2 --- /dev/null +++ b/lib/libesp32/berry_animation/anim_examples/compiled/test_shutter_rainbow_central.be @@ -0,0 +1,110 @@ +# Generated Berry code from Animation DSL +# Source: test_shutter_rainbow_central.anim +# +# This file was automatically generated by compile_all_examples.sh +# Do not edit manually - changes will be overwritten + +import animation + +# Demo Shutter Rainbow +# +# Shutter from center to both left and right +# Template function: shutter_central +def shutter_central_template(engine, colors_, duration_) + var strip_len_ = animation.strip_length(engine) + var shutter_size_ = (def (engine) + var provider = animation.sawtooth(engine) + provider.min_value = 0 + provider.max_value = strip_len_ + provider.duration = duration_ + return provider + end)(engine) + var col1_ = animation.color_cycle(engine) + col1_.palette = colors_ + col1_.cycle_period = 0 + var col2_ = animation.color_cycle(engine) + col2_.palette = colors_ + col2_.cycle_period = 0 + col2_.next = 1 + # shutter moving from left to right + var shutter_central_animation_ = animation.beacon_animation(engine) + shutter_central_animation_.color = col2_ + shutter_central_animation_.back_color = col1_ + shutter_central_animation_.pos = animation.create_closure_value(engine, def (engine) return animation.resolve(strip_len_) - animation.resolve(shutter_size_) / 2 end) + shutter_central_animation_.beacon_size = shutter_size_ + shutter_central_animation_.slew_size = 0 + shutter_central_animation_.priority = 5 + var shutter_seq_ = animation.SequenceManager(engine, -1) + .push_closure_step(def (engine) shutter_size_.start(engine.time_ms) end) + .push_play_step(shutter_central_animation_, animation.resolve(duration_)) + .push_closure_step(def (engine) col1_.next = 1 end) + .push_closure_step(def (engine) col2_.next = 1 end) + engine.add(shutter_seq_) +end + +animation.register_user_function('shutter_central', shutter_central_template) + +# Auto-generated strip initialization (using Tasmota configuration) +var engine = animation.init_strip() + +var rainbow_with_white_ = bytes( + "FFFF0000" + "FFFFA500" + "FFFFFF00" + "FF008000" # comma left on-purpose to test transpiler + "FF0000FF" # need for a lighter blue + "FF4B0082" + "FFFFFFFF" +) +shutter_central_template(engine, rainbow_with_white_, 1500) +engine.run() + + +#- Original DSL source: +# Demo Shutter Rainbow +# +# Shutter from center to both left and right + +template shutter_central { + param colors type palette + param duration + + set strip_len = strip_length() + set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration) + + color col1 = color_cycle(palette=colors, cycle_period=0) + color col2 = color_cycle(palette=colors, cycle_period=0) + col2.next = 1 + + # shutter moving from left to right + animation shutter_central_animation = beacon_animation( + color = col2 + back_color = col1 + pos = strip_len - shutter_size / 2 + beacon_size = shutter_size + slew_size = 0 + priority = 5 + ) + + sequence shutter_seq repeat forever { + restart shutter_size + play shutter_central_animation for duration + col1.next = 1 + col2.next = 1 + } + + run shutter_seq +} + +palette rainbow_with_white = [ red + orange + yellow + green, # comma left on-purpose to test transpiler + blue # need for a lighter blue + indigo + white +] + +shutter_central(rainbow_with_white, 1.5s) + +-# diff --git a/lib/libesp32/berry_animation/anim_examples/test_cylon_generic.anim b/lib/libesp32/berry_animation/anim_examples/template_cylon_generic.anim similarity index 60% rename from lib/libesp32/berry_animation/anim_examples/test_cylon_generic.anim rename to lib/libesp32/berry_animation/anim_examples/template_cylon_generic.anim index 8ebc78389..f0e3407e7 100644 --- a/lib/libesp32/berry_animation/anim_examples/test_cylon_generic.anim +++ b/lib/libesp32/berry_animation/anim_examples/template_cylon_generic.anim @@ -3,18 +3,10 @@ template cylon_effect { param eye_color type color + param duration type time param back_color type color - param duration - set aaa = abs2(45) + 2 set strip_len = strip_length() - set strip_len_div_2 = abs(strip_len / 2) - set strip_len2 = strip_length(is_running=0) # artifically putting an argument to cause a closure - - set osc1 = sawtooth() - set osc2 = triangle() - set osc3 = scale(osc1 + osc2, 0, 200, 0, 255) - set osc9 = sawtooth() + triangle() # this should fail animation eye_animation = beacon_animation( color = eye_color diff --git a/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim b/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim index 961bc036d..8e041ff35 100644 --- a/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim +++ b/lib/libesp32/berry_animation/anim_examples/test_shutter_rainbow_central.anim @@ -3,48 +3,43 @@ # Shutter from center to both left and right template shutter_central { - param colors type palette - param duration - - set strip_len = strip_length() - set strip_len2 = (strip_len + 1) / 2 - # the following is highly discouraged because it creates a new value provider at each tick - set strip_len3 = 1 + strip_length() - set strip_len4 = (strip_length() + 1) / 2 - set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration) - - color col1 = color_cycle(palette=colors, cycle_period=0) - color col2 = color_cycle(palette=colors, cycle_period=0) + param colors type palette + param duration + + set strip_len = strip_length() + set shutter_size = sawtooth(min_value = 0, max_value = strip_len, duration = duration) + + color col1 = color_cycle(palette=colors, cycle_period=0) + color col2 = color_cycle(palette=colors, cycle_period=0) + col2.next = 1 + + # shutter moving from left to right + animation shutter_central_animation = beacon_animation( + color = col2 + back_color = col1 + pos = strip_len - shutter_size / 2 + beacon_size = shutter_size + slew_size = 0 + priority = 5 + ) + + sequence shutter_seq repeat forever { + restart shutter_size + play shutter_central_animation for duration + col1.next = 1 col2.next = 1 - - # shutter moving from left to right - animation shutter_central_animation = beacon_animation( - color = col2 - back_color = col1 - pos = strip_len3 - shutter_size / 2 - beacon_size = shutter_size - slew_size = 0 - priority = 5 - ) - - sequence shutter_seq repeat forever { - restart shutter_size - play shutter_central_animation for duration - col1.next = 1 - col2.next = 1 - } - - run shutter_seq } - palette rainbow_with_white = [ red - orange - yellow - green, # comma left on-purpose to test transpiler - blue # need for a lighter blue - indigo - white - ] - - shutter_central(rainbow_with_white, 1.5s) - \ No newline at end of file + run shutter_seq +} + +palette rainbow_with_white = [ red + orange + yellow + green, # comma left on-purpose to test transpiler + blue # need for a lighter blue + indigo + white +] + +shutter_central(rainbow_with_white, 1.5s) diff --git a/lib/libesp32/berry_animation/docs/ANIMATION_CLASS_HIERARCHY.md b/lib/libesp32/berry_animation/docs/ANIMATION_CLASS_HIERARCHY.md index 985653fdb..8906d171f 100644 --- a/lib/libesp32/berry_animation/docs/ANIMATION_CLASS_HIERARCHY.md +++ b/lib/libesp32/berry_animation/docs/ANIMATION_CLASS_HIERARCHY.md @@ -281,7 +281,7 @@ Generates colors from predefined palettes with smooth transitions and profession |-----------|------|---------|-------------|-------------| | `palette` | bytes | rainbow palette | - | Palette bytes or predefined palette constant | | `cycle_period` | int | 5000 | min: 0 | Cycle time in ms (0 = value-based only) | -| `transition_type` | int | 1 | enum: [0,1] | 0=linear, 1=sine/smooth | +| `transition_type` | int | animation.LINEAR | enum: [animation.LINEAR, animation.SINE] | LINEAR=constant speed, SINE=smooth ease-in/ease-out | | `brightness` | int | 255 | 0-255 | Overall brightness scaling | | `range_min` | int | 0 | - | Minimum value for value-based mapping | | `range_max` | int | 100 | - | Maximum value for value-based mapping | @@ -300,27 +300,26 @@ Generates colors from predefined palettes with smooth transitions and profession #### Usage Examples ```berry -# Rainbow palette with smooth transitions +# Rainbow palette with smooth ease-in/ease-out transitions color rainbow_colors = rich_palette( palette=PALETTE_RAINBOW, cycle_period=5s, - transition_type=1, + transition_type=SINE, brightness=255 ) -# Fire effect with linear transitions +# Fire effect with linear (constant speed) transitions color fire_colors = rich_palette( palette=PALETTE_FIRE, cycle_period=3s, - transition_type=0, + transition_type=LINEAR, brightness=200 ) -# Ocean waves with smooth, slow transitions +# Ocean waves with default linear transitions color ocean_colors = rich_palette( palette=PALETTE_OCEAN, cycle_period=8s, - transition_type=1, brightness=180 ) ``` @@ -789,7 +788,7 @@ Creates smooth color transitions using rich palette data with direct parameter a |-----------|------|---------|-------------|-------------| | `palette` | bytes | rainbow palette | - | Palette bytes or predefined palette | | `cycle_period` | int | 5000 | min: 0 | Cycle time in ms (0 = value-based only) | -| `transition_type` | int | 1 | enum: [0,1] | 0=linear, 1=sine | +| `transition_type` | int | animation.LINEAR | enum: [animation.LINEAR, animation.SINE] | LINEAR=constant speed, SINE=smooth ease-in/ease-out | | `brightness` | int | 255 | 0-255 | Overall brightness scaling | | `range_min` | int | 0 | - | Minimum value for value-based mapping | | `range_max` | int | 100 | - | Maximum value for value-based mapping | diff --git a/lib/libesp32/berry_animation/src/animation.be b/lib/libesp32/berry_animation/src/animation.be index 4be3a4722..d4b863cbe 100644 --- a/lib/libesp32/berry_animation/src/animation.be +++ b/lib/libesp32/berry_animation/src/animation.be @@ -165,8 +165,6 @@ register_to_animation(wave_animation) # Import palette examples import "animations/palettes" as palettes register_to_animation(palettes) -# import "animations/all_wled_palettes" as all_wled_palettes -# register_to_animation(all_wled_palettes) # Import specialized animation classes import "animations/rich_palette_animation" as rich_palette_animation diff --git a/lib/libesp32/berry_animation/src/animation_dsl.be b/lib/libesp32/berry_animation/src/animation_dsl.be index ef99703b9..de5621418 100644 --- a/lib/libesp32/berry_animation/src/animation_dsl.be +++ b/lib/libesp32/berry_animation/src/animation_dsl.be @@ -56,6 +56,9 @@ register_to_dsl(dsl_named_colors) import "webui/animation_web_ui.be" as animation_web_ui register_to_dsl(animation_web_ui) +import "dsl/all_wled_palettes" as all_wled_palettes +register_to_dsl(all_wled_palettes) + # Main DSL compilation function # Compiles DSL source code to Berry code # diff --git a/lib/libesp32/berry_animation/src/animations/all_wled_palettes.anim b/lib/libesp32/berry_animation/src/dsl/all_wled_palettes.anim similarity index 100% rename from lib/libesp32/berry_animation/src/animations/all_wled_palettes.anim rename to lib/libesp32/berry_animation/src/dsl/all_wled_palettes.anim diff --git a/lib/libesp32/berry_animation/src/animations/all_wled_palettes.be b/lib/libesp32/berry_animation/src/dsl/all_wled_palettes.be similarity index 100% rename from lib/libesp32/berry_animation/src/animations/all_wled_palettes.be rename to lib/libesp32/berry_animation/src/dsl/all_wled_palettes.be diff --git a/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be b/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be index 2cfa6b58d..5398b4d42 100644 --- a/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be +++ b/lib/libesp32/berry_animation/src/providers/rich_palette_color_provider.be @@ -22,7 +22,7 @@ class RichPaletteColorProvider : animation.color_provider static var PARAMS = encode_constraints({ "palette": {"type": "bytes", "default": nil}, # Palette bytes or predefined palette constant "cycle_period": {"min": 0, "default": 5000}, # 5 seconds default, 0 = value-based only - "transition_type": {"enum": [animation.LINEAR, animation.SINE], "default": animation.SINE}, + "transition_type": {"enum": [animation.LINEAR, animation.SINE], "default": animation.LINEAR}, "brightness": {"min": 0, "max": 255, "default": 255}, "range_min": {"default": 0}, "range_max": {"default": 255} @@ -173,6 +173,43 @@ class RichPaletteColorProvider : animation.color_provider return trgb end + # Interpolate a value between two points using the selected transition type + # + # @param value: int - Current value to interpolate + # @param from_min: int - Start of range + # @param from_max: int - End of range + # @param to_min: int - Start of output range + # @param to_max: int - End of output range + # @return int - Interpolated value + def _interpolate(value, from_min, from_max, to_min, to_max) + var transition_type = self.transition_type + + if transition_type == animation.SINE + # Cosine interpolation for smooth transitions + # Map value to 0..255 range first + var t = tasmota.scale_uint(value, from_min, from_max, 0, 255) + + # Map to angle range for cosine: 0 -> 16384 (180 degrees) + # We use cosine from 180° to 0° which gives us 0->1 smooth curve + var angle = tasmota.scale_uint(t, 0, 255, 16384, 0) + + # tasmota.sine_int returns -4096 to 4096 for angle 0-32767 + # At angle 16384 (180°): sine_int returns 0 (actually cosine = -1) + # At angle 0 (0°): sine_int returns 0 (cosine = 1) + # We need to shift by 8192 to get cosine behavior + var cos_val = tasmota.sine_int(angle + 8192) # -4096 to 4096 + + # Map cosine from -4096..4096 to 0..255 + var normalized = tasmota.scale_int(cos_val, -4096, 4096, 0, 255) + + # Finally map to output range + return tasmota.scale_int(normalized, 0, 255, to_min, to_max) + else + # Default to linear interpolation (for LINEAR mode or any unknown type) + return tasmota.scale_uint(value, from_min, from_max, to_min, to_max) + end + end + # Produce a color value for any parameter name (optimized version from Animate_palette) # # @param name: string - Parameter name being requested (ignored) @@ -231,10 +268,10 @@ class RichPaletteColorProvider : animation.color_provider var t0 = self.slots_arr[idx] var t1 = self.slots_arr[idx + 1] - # Use tasmota.scale_uint for efficiency (from Animate_palette) - var r = tasmota.scale_uint(past, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF) - var g = tasmota.scale_uint(past, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF) - var b = tasmota.scale_uint(past, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF) + # Use interpolation based on transition_type (LINEAR or SINE) + var r = self._interpolate(past, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF) + var g = self._interpolate(past, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF) + var b = self._interpolate(past, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF) # Use light_state for proper brightness calculation (from Animate_palette) var light_state = self.light_state @@ -242,7 +279,7 @@ class RichPaletteColorProvider : animation.color_provider var bri0 = light_state.bri light_state.set_rgb((bgrt1 >> 8) & 0xFF, (bgrt1 >> 16) & 0xFF, (bgrt1 >> 24) & 0xFF) var bri1 = light_state.bri - var bri2 = tasmota.scale_uint(past, t0, t1, bri0, bri1) + var bri2 = self._interpolate(past, t0, t1, bri0, bri1) light_state.set_rgb(r, g, b) light_state.set_bri(bri2) @@ -294,10 +331,10 @@ class RichPaletteColorProvider : animation.color_provider var t0 = self.value_arr[idx] var t1 = self.value_arr[idx + 1] - # Use tasmota.scale_uint for efficiency (from Animate_palette) - var r = tasmota.scale_uint(value, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF) - var g = tasmota.scale_uint(value, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF) - var b = tasmota.scale_uint(value, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF) + # Use interpolation based on transition_type (LINEAR or SINE) + var r = self._interpolate(value, t0, t1, (bgrt0 >> 8) & 0xFF, (bgrt1 >> 8) & 0xFF) + var g = self._interpolate(value, t0, t1, (bgrt0 >> 16) & 0xFF, (bgrt1 >> 16) & 0xFF) + var b = self._interpolate(value, t0, t1, (bgrt0 >> 24) & 0xFF, (bgrt1 >> 24) & 0xFF) # Apply brightness scaling (from Animate_palette) if brightness != 255 diff --git a/lib/libesp32/berry_animation/src/solidify/solidified_animation.h b/lib/libesp32/berry_animation/src/solidify/solidified_animation.h index 47250a7e5..ba14a197d 100644 --- a/lib/libesp32/berry_animation/src/solidify/solidified_animation.h +++ b/lib/libesp32/berry_animation/src/solidify/solidified_animation.h @@ -3291,66 +3291,71 @@ be_local_class(FireAnimation, })), be_str_weak(FireAnimation) ); -// compact class 'RichPaletteColorProvider' ktab size: 46, total: 99 (saved 424 bytes) -static const bvalue be_ktab_class_RichPaletteColorProvider[46] = { - /* K0 */ be_nested_str_weak(on_param_changed), - /* K1 */ be_nested_str_weak(range_min), - /* K2 */ be_nested_str_weak(range_max), - /* K3 */ be_nested_str_weak(cycle_period), - /* K4 */ be_nested_str_weak(palette), - /* K5 */ be_nested_str_weak(slots_arr), - /* K6 */ be_nested_str_weak(value_arr), - /* K7 */ be_nested_str_weak(_recompute_palette), - /* K8 */ be_nested_str_weak(_fix_time_ms), - /* K9 */ be_nested_str_weak(_get_palette_bytes), - /* K10 */ be_nested_str_weak(slots), - /* K11 */ be_const_int(2), - /* K12 */ be_nested_str_weak(brightness), - /* K13 */ be_const_int(0), +// compact class 'RichPaletteColorProvider' ktab size: 51, total: 109 (saved 464 bytes) +static const bvalue be_ktab_class_RichPaletteColorProvider[51] = { + /* K0 */ be_nested_str_weak(transition_type), + /* K1 */ be_nested_str_weak(animation), + /* K2 */ be_nested_str_weak(SINE), + /* K3 */ be_nested_str_weak(tasmota), + /* K4 */ be_nested_str_weak(scale_uint), + /* K5 */ be_const_int(0), + /* K6 */ be_nested_str_weak(sine_int), + /* K7 */ be_nested_str_weak(scale_int), + /* K8 */ be_nested_str_weak(RichPaletteColorProvider_X28slots_X3D_X25s_X2C_X20cycle_period_X3D_X25s_X29), + /* K9 */ be_nested_str_weak(slots), + /* K10 */ be_nested_str_weak(cycle_period), + /* K11 */ be_nested_str_weak(RichPaletteColorProvider_X28uninitialized_X29), + /* K12 */ be_nested_str_weak(_get_palette_bytes), + /* K13 */ be_nested_str_weak(resize), /* K14 */ be_nested_str_weak(get), - /* K15 */ be_nested_str_weak(tasmota), - /* K16 */ be_nested_str_weak(scale_uint), - /* K17 */ be_nested_str_weak(current_color), - /* K18 */ be_nested_str_weak(start_time), - /* K19 */ be_const_int(1), - /* K20 */ be_nested_str_weak(light_state), - /* K21 */ be_nested_str_weak(set_rgb), - /* K22 */ be_nested_str_weak(bri), - /* K23 */ be_nested_str_weak(set_bri), - /* K24 */ be_nested_str_weak(r), - /* K25 */ be_nested_str_weak(g), - /* K26 */ be_nested_str_weak(b), - /* K27 */ be_const_int(-16777216), - /* K28 */ be_nested_str_weak(resize), - /* K29 */ be_nested_str_weak(scale_int), - /* K30 */ be_nested_str_weak(RichPaletteColorProvider_X28slots_X3D_X25s_X2C_X20cycle_period_X3D_X25s_X29), - /* K31 */ be_nested_str_weak(RichPaletteColorProvider_X28uninitialized_X29), - /* K32 */ be_nested_str_weak(init), - /* K33 */ be_nested_str_weak(global), + /* K15 */ be_const_int(1), + /* K16 */ be_nested_str_weak(on_param_changed), + /* K17 */ be_nested_str_weak(range_min), + /* K18 */ be_nested_str_weak(range_max), + /* K19 */ be_nested_str_weak(palette), + /* K20 */ be_nested_str_weak(slots_arr), + /* K21 */ be_nested_str_weak(value_arr), + /* K22 */ be_nested_str_weak(_recompute_palette), + /* K23 */ be_nested_str_weak(brightness), + /* K24 */ be_const_int(2), + /* K25 */ be_nested_str_weak(_interpolate), + /* K26 */ be_nested_str_weak(_parse_palette), + /* K27 */ be_nested_str_weak(value_error), + /* K28 */ be_nested_str_weak(range_min_X20must_X20be_X20lower_X20than_X20range_max), + /* K29 */ be_nested_str_weak(current_color), + /* K30 */ be_nested_str_weak(_get_color_at_index), + /* K31 */ be_nested_str_weak(init), + /* K32 */ be_nested_str_weak(global), + /* K33 */ be_nested_str_weak(light_state), /* K34 */ be_nested_str_weak(RGB), - /* K35 */ be_nested_str_weak(start), - /* K36 */ be_nested_str_weak(_parse_palette), - /* K37 */ be_nested_str_weak(value_error), - /* K38 */ be_nested_str_weak(range_min_X20must_X20be_X20lower_X20than_X20range_max), - /* K39 */ be_nested_str_weak(_get_color_at_index), - /* K40 */ be_nested_str_weak(_DEFAULT_PALETTE), - /* K41 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right_X2C_X20_X23000000_X29_X3B), - /* K42 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right), - /* K43 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25), - /* K44 */ be_const_real_hex(0x41200000), - /* K45 */ be_nested_str_weak(_X29_X3B), + /* K35 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right_X2C_X20_X23000000_X29_X3B), + /* K36 */ be_nested_str_weak(background_X3Alinear_X2Dgradient_X28to_X20right), + /* K37 */ be_nested_str_weak(_X2C_X23_X2502X_X2502X_X2502X_X20_X25_X2E1f_X25_X25), + /* K38 */ be_const_real_hex(0x41200000), + /* K39 */ be_nested_str_weak(_X29_X3B), + /* K40 */ be_const_int(-16777216), + /* K41 */ be_nested_str_weak(start), + /* K42 */ be_nested_str_weak(_DEFAULT_PALETTE), + /* K43 */ be_nested_str_weak(_fix_time_ms), + /* K44 */ be_nested_str_weak(start_time), + /* K45 */ be_nested_str_weak(set_rgb), + /* K46 */ be_nested_str_weak(bri), + /* K47 */ be_nested_str_weak(set_bri), + /* K48 */ be_nested_str_weak(r), + /* K49 */ be_nested_str_weak(g), + /* K50 */ be_nested_str_weak(b), }; extern const bclass be_class_RichPaletteColorProvider; /******************************************************************** -** Solidified function: on_param_changed +** Solidified function: _interpolate ********************************************************************/ -be_local_closure(class_RichPaletteColorProvider_on_param_changed, /* name */ +be_local_closure(class_RichPaletteColorProvider__interpolate, /* name */ be_nested_proto( - 7, /* nstack */ - 3, /* argc */ + 18, /* nstack */ + 6, /* argc */ 10, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ @@ -3358,439 +3363,63 @@ be_local_closure(class_RichPaletteColorProvider_on_param_changed, /* name */ NULL, /* no sub protos */ 1, /* has constants */ &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(on_param_changed), + be_str_weak(_interpolate), &be_const_str_solidified, - ( &(const binstruction[26]) { /* code */ - 0x600C0003, // 0000 GETGBL R3 G3 - 0x5C100000, // 0001 MOVE R4 R0 - 0x7C0C0200, // 0002 CALL R3 1 - 0x8C0C0700, // 0003 GETMET R3 R3 K0 - 0x5C140200, // 0004 MOVE R5 R1 - 0x5C180400, // 0005 MOVE R6 R2 - 0x7C0C0600, // 0006 CALL R3 3 - 0x1C0C0301, // 0007 EQ R3 R1 K1 - 0x740E0005, // 0008 JMPT R3 #000F - 0x1C0C0302, // 0009 EQ R3 R1 K2 - 0x740E0003, // 000A JMPT R3 #000F - 0x1C0C0303, // 000B EQ R3 R1 K3 - 0x740E0001, // 000C JMPT R3 #000F - 0x1C0C0304, // 000D EQ R3 R1 K4 - 0x780E0009, // 000E JMPF R3 #0019 - 0x880C0105, // 000F GETMBR R3 R0 K5 - 0x4C100000, // 0010 LDNIL R4 - 0x200C0604, // 0011 NE R3 R3 R4 - 0x740E0003, // 0012 JMPT R3 #0017 - 0x880C0106, // 0013 GETMBR R3 R0 K6 - 0x4C100000, // 0014 LDNIL R4 - 0x200C0604, // 0015 NE R3 R3 R4 - 0x780E0001, // 0016 JMPF R3 #0019 - 0x8C0C0107, // 0017 GETMET R3 R0 K7 - 0x7C0C0200, // 0018 CALL R3 1 - 0x80000000, // 0019 RET 0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: produce_value -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider_produce_value, /* name */ - be_nested_proto( - 28, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(produce_value), - &be_const_str_solidified, - ( &(const binstruction[250]) { /* code */ - 0x8C0C0108, // 0000 GETMET R3 R0 K8 - 0x5C140400, // 0001 MOVE R5 R2 - 0x7C0C0400, // 0002 CALL R3 2 - 0x5C080600, // 0003 MOVE R2 R3 - 0x880C0105, // 0004 GETMBR R3 R0 K5 - 0x4C100000, // 0005 LDNIL R4 - 0x1C0C0604, // 0006 EQ R3 R3 R4 - 0x780E0005, // 0007 JMPF R3 #000E - 0x880C0106, // 0008 GETMBR R3 R0 K6 - 0x4C100000, // 0009 LDNIL R4 - 0x1C0C0604, // 000A EQ R3 R3 R4 - 0x780E0001, // 000B JMPF R3 #000E - 0x8C0C0107, // 000C GETMET R3 R0 K7 - 0x7C0C0200, // 000D CALL R3 1 - 0x8C0C0109, // 000E GETMET R3 R0 K9 - 0x7C0C0200, // 000F CALL R3 1 - 0x4C100000, // 0010 LDNIL R4 - 0x1C100604, // 0011 EQ R4 R3 R4 - 0x74120002, // 0012 JMPT R4 #0016 - 0x8810010A, // 0013 GETMBR R4 R0 K10 - 0x1410090B, // 0014 LT R4 R4 K11 - 0x78120001, // 0015 JMPF R4 #0018 - 0x5411FFFE, // 0016 LDINT R4 -1 - 0x80040800, // 0017 RET 1 R4 - 0x88100103, // 0018 GETMBR R4 R0 K3 - 0x8814010C, // 0019 GETMBR R5 R0 K12 - 0x1C18090D, // 001A EQ R6 R4 K13 - 0x781A0039, // 001B JMPF R6 #0056 - 0x8C18070E, // 001C GETMET R6 R3 K14 - 0x5820000D, // 001D LDCONST R8 K13 - 0x54260003, // 001E LDINT R9 4 - 0x7C180600, // 001F CALL R6 3 - 0x541E0007, // 0020 LDINT R7 8 - 0x3C1C0C07, // 0021 SHR R7 R6 R7 - 0x542200FE, // 0022 LDINT R8 255 - 0x2C1C0E08, // 0023 AND R7 R7 R8 - 0x5422000F, // 0024 LDINT R8 16 - 0x3C200C08, // 0025 SHR R8 R6 R8 - 0x542600FE, // 0026 LDINT R9 255 - 0x2C201009, // 0027 AND R8 R8 R9 - 0x54260017, // 0028 LDINT R9 24 - 0x3C240C09, // 0029 SHR R9 R6 R9 - 0x542A00FE, // 002A LDINT R10 255 - 0x2C24120A, // 002B AND R9 R9 R10 - 0x542A00FE, // 002C LDINT R10 255 - 0x20280A0A, // 002D NE R10 R5 R10 - 0x782A001A, // 002E JMPF R10 #004A - 0xB82A1E00, // 002F GETNGBL R10 K15 - 0x8C281510, // 0030 GETMET R10 R10 K16 - 0x5C300E00, // 0031 MOVE R12 R7 - 0x5834000D, // 0032 LDCONST R13 K13 - 0x543A00FE, // 0033 LDINT R14 255 - 0x583C000D, // 0034 LDCONST R15 K13 - 0x5C400A00, // 0035 MOVE R16 R5 - 0x7C280C00, // 0036 CALL R10 6 - 0x5C1C1400, // 0037 MOVE R7 R10 - 0xB82A1E00, // 0038 GETNGBL R10 K15 - 0x8C281510, // 0039 GETMET R10 R10 K16 - 0x5C301000, // 003A MOVE R12 R8 - 0x5834000D, // 003B LDCONST R13 K13 - 0x543A00FE, // 003C LDINT R14 255 - 0x583C000D, // 003D LDCONST R15 K13 - 0x5C400A00, // 003E MOVE R16 R5 - 0x7C280C00, // 003F CALL R10 6 - 0x5C201400, // 0040 MOVE R8 R10 - 0xB82A1E00, // 0041 GETNGBL R10 K15 - 0x8C281510, // 0042 GETMET R10 R10 K16 - 0x5C301200, // 0043 MOVE R12 R9 - 0x5834000D, // 0044 LDCONST R13 K13 - 0x543A00FE, // 0045 LDINT R14 255 - 0x583C000D, // 0046 LDCONST R15 K13 - 0x5C400A00, // 0047 MOVE R16 R5 - 0x7C280C00, // 0048 CALL R10 6 - 0x5C241400, // 0049 MOVE R9 R10 - 0x542A00FE, // 004A LDINT R10 255 - 0x542E0017, // 004B LDINT R11 24 - 0x3828140B, // 004C SHL R10 R10 R11 - 0x542E000F, // 004D LDINT R11 16 - 0x382C0E0B, // 004E SHL R11 R7 R11 - 0x3028140B, // 004F OR R10 R10 R11 - 0x542E0007, // 0050 LDINT R11 8 - 0x382C100B, // 0051 SHL R11 R8 R11 - 0x3028140B, // 0052 OR R10 R10 R11 - 0x30281409, // 0053 OR R10 R10 R9 - 0x9002220A, // 0054 SETMBR R0 K17 R10 - 0x80041400, // 0055 RET 1 R10 - 0x88180112, // 0056 GETMBR R6 R0 K18 - 0x04180406, // 0057 SUB R6 R2 R6 - 0x101C0C04, // 0058 MOD R7 R6 R4 - 0x8820010A, // 0059 GETMBR R8 R0 K10 - 0x0424110B, // 005A SUB R9 R8 K11 - 0x2428130D, // 005B GT R10 R9 K13 - 0x782A0006, // 005C JMPF R10 #0064 - 0x88280105, // 005D GETMBR R10 R0 K5 - 0x94281409, // 005E GETIDX R10 R10 R9 - 0x28280E0A, // 005F GE R10 R7 R10 - 0x782A0000, // 0060 JMPF R10 #0062 - 0x70020001, // 0061 JMP #0064 - 0x04241313, // 0062 SUB R9 R9 K19 - 0x7001FFF6, // 0063 JMP #005B - 0x8C28070E, // 0064 GETMET R10 R3 K14 - 0x54320003, // 0065 LDINT R12 4 - 0x0830120C, // 0066 MUL R12 R9 R12 - 0x54360003, // 0067 LDINT R13 4 - 0x7C280600, // 0068 CALL R10 3 - 0x8C2C070E, // 0069 GETMET R11 R3 K14 - 0x00341313, // 006A ADD R13 R9 K19 - 0x543A0003, // 006B LDINT R14 4 - 0x08341A0E, // 006C MUL R13 R13 R14 - 0x543A0003, // 006D LDINT R14 4 - 0x7C2C0600, // 006E CALL R11 3 - 0x88300105, // 006F GETMBR R12 R0 K5 - 0x94301809, // 0070 GETIDX R12 R12 R9 - 0x00341313, // 0071 ADD R13 R9 K19 - 0x88380105, // 0072 GETMBR R14 R0 K5 - 0x94341C0D, // 0073 GETIDX R13 R14 R13 - 0xB83A1E00, // 0074 GETNGBL R14 K15 - 0x8C381D10, // 0075 GETMET R14 R14 K16 - 0x5C400E00, // 0076 MOVE R16 R7 - 0x5C441800, // 0077 MOVE R17 R12 - 0x5C481A00, // 0078 MOVE R18 R13 - 0x544E0007, // 0079 LDINT R19 8 - 0x3C4C1413, // 007A SHR R19 R10 R19 - 0x545200FE, // 007B LDINT R20 255 - 0x2C4C2614, // 007C AND R19 R19 R20 - 0x54520007, // 007D LDINT R20 8 - 0x3C501614, // 007E SHR R20 R11 R20 - 0x545600FE, // 007F LDINT R21 255 - 0x2C502815, // 0080 AND R20 R20 R21 - 0x7C380C00, // 0081 CALL R14 6 - 0xB83E1E00, // 0082 GETNGBL R15 K15 - 0x8C3C1F10, // 0083 GETMET R15 R15 K16 - 0x5C440E00, // 0084 MOVE R17 R7 - 0x5C481800, // 0085 MOVE R18 R12 - 0x5C4C1A00, // 0086 MOVE R19 R13 - 0x5452000F, // 0087 LDINT R20 16 - 0x3C501414, // 0088 SHR R20 R10 R20 - 0x545600FE, // 0089 LDINT R21 255 - 0x2C502815, // 008A AND R20 R20 R21 - 0x5456000F, // 008B LDINT R21 16 - 0x3C541615, // 008C SHR R21 R11 R21 - 0x545A00FE, // 008D LDINT R22 255 - 0x2C542A16, // 008E AND R21 R21 R22 - 0x7C3C0C00, // 008F CALL R15 6 - 0xB8421E00, // 0090 GETNGBL R16 K15 - 0x8C402110, // 0091 GETMET R16 R16 K16 - 0x5C480E00, // 0092 MOVE R18 R7 - 0x5C4C1800, // 0093 MOVE R19 R12 - 0x5C501A00, // 0094 MOVE R20 R13 - 0x54560017, // 0095 LDINT R21 24 - 0x3C541415, // 0096 SHR R21 R10 R21 - 0x545A00FE, // 0097 LDINT R22 255 - 0x2C542A16, // 0098 AND R21 R21 R22 - 0x545A0017, // 0099 LDINT R22 24 - 0x3C581616, // 009A SHR R22 R11 R22 - 0x545E00FE, // 009B LDINT R23 255 - 0x2C582C17, // 009C AND R22 R22 R23 - 0x7C400C00, // 009D CALL R16 6 - 0x88440114, // 009E GETMBR R17 R0 K20 - 0x8C482315, // 009F GETMET R18 R17 K21 - 0x54520007, // 00A0 LDINT R20 8 - 0x3C501414, // 00A1 SHR R20 R10 R20 - 0x545600FE, // 00A2 LDINT R21 255 - 0x2C502815, // 00A3 AND R20 R20 R21 - 0x5456000F, // 00A4 LDINT R21 16 - 0x3C541415, // 00A5 SHR R21 R10 R21 - 0x545A00FE, // 00A6 LDINT R22 255 - 0x2C542A16, // 00A7 AND R21 R21 R22 - 0x545A0017, // 00A8 LDINT R22 24 - 0x3C581416, // 00A9 SHR R22 R10 R22 - 0x545E00FE, // 00AA LDINT R23 255 - 0x2C582C17, // 00AB AND R22 R22 R23 - 0x7C480800, // 00AC CALL R18 4 - 0x88482316, // 00AD GETMBR R18 R17 K22 - 0x8C4C2315, // 00AE GETMET R19 R17 K21 - 0x54560007, // 00AF LDINT R21 8 - 0x3C541615, // 00B0 SHR R21 R11 R21 - 0x545A00FE, // 00B1 LDINT R22 255 - 0x2C542A16, // 00B2 AND R21 R21 R22 - 0x545A000F, // 00B3 LDINT R22 16 - 0x3C581616, // 00B4 SHR R22 R11 R22 - 0x545E00FE, // 00B5 LDINT R23 255 - 0x2C582C17, // 00B6 AND R22 R22 R23 - 0x545E0017, // 00B7 LDINT R23 24 - 0x3C5C1617, // 00B8 SHR R23 R11 R23 - 0x546200FE, // 00B9 LDINT R24 255 - 0x2C5C2E18, // 00BA AND R23 R23 R24 - 0x7C4C0800, // 00BB CALL R19 4 - 0x884C2316, // 00BC GETMBR R19 R17 K22 - 0xB8521E00, // 00BD GETNGBL R20 K15 - 0x8C502910, // 00BE GETMET R20 R20 K16 - 0x5C580E00, // 00BF MOVE R22 R7 - 0x5C5C1800, // 00C0 MOVE R23 R12 - 0x5C601A00, // 00C1 MOVE R24 R13 - 0x5C642400, // 00C2 MOVE R25 R18 - 0x5C682600, // 00C3 MOVE R26 R19 - 0x7C500C00, // 00C4 CALL R20 6 - 0x8C542315, // 00C5 GETMET R21 R17 K21 - 0x5C5C1C00, // 00C6 MOVE R23 R14 - 0x5C601E00, // 00C7 MOVE R24 R15 - 0x5C642000, // 00C8 MOVE R25 R16 - 0x7C540800, // 00C9 CALL R21 4 - 0x8C542317, // 00CA GETMET R21 R17 K23 - 0x5C5C2800, // 00CB MOVE R23 R20 - 0x7C540400, // 00CC CALL R21 2 - 0x88382318, // 00CD GETMBR R14 R17 K24 - 0x883C2319, // 00CE GETMBR R15 R17 K25 - 0x8840231A, // 00CF GETMBR R16 R17 K26 - 0x545600FE, // 00D0 LDINT R21 255 - 0x20540A15, // 00D1 NE R21 R5 R21 - 0x7856001A, // 00D2 JMPF R21 #00EE - 0xB8561E00, // 00D3 GETNGBL R21 K15 - 0x8C542B10, // 00D4 GETMET R21 R21 K16 - 0x5C5C1C00, // 00D5 MOVE R23 R14 - 0x5860000D, // 00D6 LDCONST R24 K13 - 0x546600FE, // 00D7 LDINT R25 255 - 0x5868000D, // 00D8 LDCONST R26 K13 - 0x5C6C0A00, // 00D9 MOVE R27 R5 - 0x7C540C00, // 00DA CALL R21 6 - 0x5C382A00, // 00DB MOVE R14 R21 - 0xB8561E00, // 00DC GETNGBL R21 K15 - 0x8C542B10, // 00DD GETMET R21 R21 K16 - 0x5C5C1E00, // 00DE MOVE R23 R15 - 0x5860000D, // 00DF LDCONST R24 K13 - 0x546600FE, // 00E0 LDINT R25 255 - 0x5868000D, // 00E1 LDCONST R26 K13 - 0x5C6C0A00, // 00E2 MOVE R27 R5 - 0x7C540C00, // 00E3 CALL R21 6 - 0x5C3C2A00, // 00E4 MOVE R15 R21 - 0xB8561E00, // 00E5 GETNGBL R21 K15 - 0x8C542B10, // 00E6 GETMET R21 R21 K16 - 0x5C5C2000, // 00E7 MOVE R23 R16 - 0x5860000D, // 00E8 LDCONST R24 K13 - 0x546600FE, // 00E9 LDINT R25 255 - 0x5868000D, // 00EA LDCONST R26 K13 - 0x5C6C0A00, // 00EB MOVE R27 R5 - 0x7C540C00, // 00EC CALL R21 6 - 0x5C402A00, // 00ED MOVE R16 R21 - 0x545600FE, // 00EE LDINT R21 255 - 0x545A0017, // 00EF LDINT R22 24 - 0x38542A16, // 00F0 SHL R21 R21 R22 - 0x545A000F, // 00F1 LDINT R22 16 - 0x38581C16, // 00F2 SHL R22 R14 R22 - 0x30542A16, // 00F3 OR R21 R21 R22 - 0x545A0007, // 00F4 LDINT R22 8 - 0x38581E16, // 00F5 SHL R22 R15 R22 - 0x30542A16, // 00F6 OR R21 R21 R22 - 0x30542A10, // 00F7 OR R21 R21 R16 - 0x90022215, // 00F8 SETMBR R0 K17 R21 - 0x80042A00, // 00F9 RET 1 R21 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _get_color_at_index -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider__get_color_at_index, /* name */ - be_nested_proto( - 7, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(_get_color_at_index), - &be_const_str_solidified, - ( &(const binstruction[16]) { /* code */ - 0x1408030D, // 0000 LT R2 R1 K13 - 0x740A0002, // 0001 JMPT R2 #0005 - 0x8808010A, // 0002 GETMBR R2 R0 K10 - 0x28080202, // 0003 GE R2 R1 R2 - 0x780A0001, // 0004 JMPF R2 #0007 - 0x5409FFFE, // 0005 LDINT R2 -1 - 0x80040400, // 0006 RET 1 R2 - 0x8C080109, // 0007 GETMET R2 R0 K9 - 0x7C080200, // 0008 CALL R2 1 - 0x8C0C050E, // 0009 GETMET R3 R2 K14 - 0x54160003, // 000A LDINT R5 4 - 0x08140205, // 000B MUL R5 R1 R5 - 0x5419FFFB, // 000C LDINT R6 -4 - 0x7C0C0600, // 000D CALL R3 3 - 0x300C071B, // 000E OR R3 R3 K27 - 0x80040600, // 000F RET 1 R3 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _parse_palette -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider__parse_palette, /* name */ - be_nested_proto( - 16, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(_parse_palette), - &be_const_str_solidified, - ( &(const binstruction[69]) { /* code */ - 0x8C0C0109, // 0000 GETMET R3 R0 K9 - 0x7C0C0200, // 0001 CALL R3 1 - 0x60100012, // 0002 GETGBL R4 G18 - 0x7C100000, // 0003 CALL R4 0 - 0x8814010A, // 0004 GETMBR R5 R0 K10 - 0x8C18091C, // 0005 GETMET R6 R4 K28 - 0x5C200A00, // 0006 MOVE R8 R5 - 0x7C180400, // 0007 CALL R6 2 - 0x8C18070E, // 0008 GETMET R6 R3 K14 - 0x5820000D, // 0009 LDCONST R8 K13 - 0x58240013, // 000A LDCONST R9 K19 - 0x7C180600, // 000B CALL R6 3 - 0x20180D0D, // 000C NE R6 R6 K13 - 0x781A0022, // 000D JMPF R6 #0031 - 0x5818000D, // 000E LDCONST R6 K13 - 0x581C000D, // 000F LDCONST R7 K13 - 0x04200B13, // 0010 SUB R8 R5 K19 - 0x14200E08, // 0011 LT R8 R7 R8 - 0x78220007, // 0012 JMPF R8 #001B - 0x8C20070E, // 0013 GETMET R8 R3 K14 - 0x542A0003, // 0014 LDINT R10 4 - 0x08280E0A, // 0015 MUL R10 R7 R10 - 0x582C0013, // 0016 LDCONST R11 K19 - 0x7C200600, // 0017 CALL R8 3 - 0x00180C08, // 0018 ADD R6 R6 R8 - 0x001C0F13, // 0019 ADD R7 R7 K19 - 0x7001FFF4, // 001A JMP #0010 - 0x5820000D, // 001B LDCONST R8 K13 - 0x581C000D, // 001C LDCONST R7 K13 - 0x14240E05, // 001D LT R9 R7 R5 - 0x78260010, // 001E JMPF R9 #0030 - 0xB8261E00, // 001F GETNGBL R9 K15 - 0x8C24131D, // 0020 GETMET R9 R9 K29 - 0x5C2C1000, // 0021 MOVE R11 R8 - 0x5830000D, // 0022 LDCONST R12 K13 - 0x5C340C00, // 0023 MOVE R13 R6 - 0x5C380200, // 0024 MOVE R14 R1 - 0x5C3C0400, // 0025 MOVE R15 R2 - 0x7C240C00, // 0026 CALL R9 6 - 0x98100E09, // 0027 SETIDX R4 R7 R9 - 0x8C24070E, // 0028 GETMET R9 R3 K14 - 0x542E0003, // 0029 LDINT R11 4 - 0x082C0E0B, // 002A MUL R11 R7 R11 - 0x58300013, // 002B LDCONST R12 K19 - 0x7C240600, // 002C CALL R9 3 - 0x00201009, // 002D ADD R8 R8 R9 - 0x001C0F13, // 002E ADD R7 R7 K19 - 0x7001FFEC, // 002F JMP #001D - 0x70020012, // 0030 JMP #0044 - 0x5818000D, // 0031 LDCONST R6 K13 - 0x141C0C05, // 0032 LT R7 R6 R5 - 0x781E000F, // 0033 JMPF R7 #0044 - 0x8C1C070E, // 0034 GETMET R7 R3 K14 - 0x54260003, // 0035 LDINT R9 4 - 0x08240C09, // 0036 MUL R9 R6 R9 - 0x58280013, // 0037 LDCONST R10 K19 - 0x7C1C0600, // 0038 CALL R7 3 - 0xB8221E00, // 0039 GETNGBL R8 K15 - 0x8C20111D, // 003A GETMET R8 R8 K29 - 0x5C280E00, // 003B MOVE R10 R7 - 0x582C000D, // 003C LDCONST R11 K13 - 0x543200FE, // 003D LDINT R12 255 - 0x5C340200, // 003E MOVE R13 R1 - 0x5C380400, // 003F MOVE R14 R2 - 0x7C200C00, // 0040 CALL R8 6 - 0x98100C08, // 0041 SETIDX R4 R6 R8 - 0x00180D13, // 0042 ADD R6 R6 K19 - 0x7001FFED, // 0043 JMP #0032 - 0x80040800, // 0044 RET 1 R4 + ( &(const binstruction[54]) { /* code */ + 0x88180100, // 0000 GETMBR R6 R0 K0 + 0xB81E0200, // 0001 GETNGBL R7 K1 + 0x881C0F02, // 0002 GETMBR R7 R7 K2 + 0x1C1C0C07, // 0003 EQ R7 R6 R7 + 0x781E0026, // 0004 JMPF R7 #002C + 0xB81E0600, // 0005 GETNGBL R7 K3 + 0x8C1C0F04, // 0006 GETMET R7 R7 K4 + 0x5C240200, // 0007 MOVE R9 R1 + 0x5C280400, // 0008 MOVE R10 R2 + 0x5C2C0600, // 0009 MOVE R11 R3 + 0x58300005, // 000A LDCONST R12 K5 + 0x543600FE, // 000B LDINT R13 255 + 0x7C1C0C00, // 000C CALL R7 6 + 0xB8220600, // 000D GETNGBL R8 K3 + 0x8C201104, // 000E GETMET R8 R8 K4 + 0x5C280E00, // 000F MOVE R10 R7 + 0x582C0005, // 0010 LDCONST R11 K5 + 0x543200FE, // 0011 LDINT R12 255 + 0x54363FFF, // 0012 LDINT R13 16384 + 0x58380005, // 0013 LDCONST R14 K5 + 0x7C200C00, // 0014 CALL R8 6 + 0xB8260600, // 0015 GETNGBL R9 K3 + 0x8C241306, // 0016 GETMET R9 R9 K6 + 0x542E1FFF, // 0017 LDINT R11 8192 + 0x002C100B, // 0018 ADD R11 R8 R11 + 0x7C240400, // 0019 CALL R9 2 + 0xB82A0600, // 001A GETNGBL R10 K3 + 0x8C281507, // 001B GETMET R10 R10 K7 + 0x5C301200, // 001C MOVE R12 R9 + 0x5435EFFF, // 001D LDINT R13 -4096 + 0x543A0FFF, // 001E LDINT R14 4096 + 0x583C0005, // 001F LDCONST R15 K5 + 0x544200FE, // 0020 LDINT R16 255 + 0x7C280C00, // 0021 CALL R10 6 + 0xB82E0600, // 0022 GETNGBL R11 K3 + 0x8C2C1707, // 0023 GETMET R11 R11 K7 + 0x5C341400, // 0024 MOVE R13 R10 + 0x58380005, // 0025 LDCONST R14 K5 + 0x543E00FE, // 0026 LDINT R15 255 + 0x5C400800, // 0027 MOVE R16 R4 + 0x5C440A00, // 0028 MOVE R17 R5 + 0x7C2C0C00, // 0029 CALL R11 6 + 0x80041600, // 002A RET 1 R11 + 0x70020008, // 002B JMP #0035 + 0xB81E0600, // 002C GETNGBL R7 K3 + 0x8C1C0F04, // 002D GETMET R7 R7 K4 + 0x5C240200, // 002E MOVE R9 R1 + 0x5C280400, // 002F MOVE R10 R2 + 0x5C2C0600, // 0030 MOVE R11 R3 + 0x5C300800, // 0031 MOVE R12 R4 + 0x5C340A00, // 0032 MOVE R13 R5 + 0x7C1C0C00, // 0033 CALL R7 6 + 0x80040E00, // 0034 RET 1 R7 + 0x80000000, // 0035 RET 0 }) ) ); @@ -3816,9 +3445,9 @@ be_local_closure(class_RichPaletteColorProvider_tostring, /* name */ ( &(const binstruction[16]) { /* code */ 0xA8020008, // 0000 EXBLK 0 #000A 0x60040018, // 0001 GETGBL R1 G24 - 0x5808001E, // 0002 LDCONST R2 K30 - 0x880C010A, // 0003 GETMBR R3 R0 K10 - 0x88100103, // 0004 GETMBR R4 R0 K3 + 0x58080008, // 0002 LDCONST R2 K8 + 0x880C0109, // 0003 GETMBR R3 R0 K9 + 0x8810010A, // 0004 GETMBR R4 R0 K10 0x7C040600, // 0005 CALL R1 3 0xA8040001, // 0006 EXBLK 1 1 0x80040200, // 0007 RET 1 R1 @@ -3826,7 +3455,7 @@ be_local_closure(class_RichPaletteColorProvider_tostring, /* name */ 0x70020004, // 0009 JMP #000F 0xAC040000, // 000A CATCH R1 0 0 0x70020001, // 000B JMP #000E - 0x80063E00, // 000C RET 1 K31 + 0x80061600, // 000C RET 1 K11 0x70020000, // 000D JMP #000F 0xB0080000, // 000E RAISE 2 R0 R0 0x80000000, // 000F RET 0 @@ -3836,6 +3465,371 @@ be_local_closure(class_RichPaletteColorProvider_tostring, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: _parse_palette +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider__parse_palette, /* name */ + be_nested_proto( + 16, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(_parse_palette), + &be_const_str_solidified, + ( &(const binstruction[69]) { /* code */ + 0x8C0C010C, // 0000 GETMET R3 R0 K12 + 0x7C0C0200, // 0001 CALL R3 1 + 0x60100012, // 0002 GETGBL R4 G18 + 0x7C100000, // 0003 CALL R4 0 + 0x88140109, // 0004 GETMBR R5 R0 K9 + 0x8C18090D, // 0005 GETMET R6 R4 K13 + 0x5C200A00, // 0006 MOVE R8 R5 + 0x7C180400, // 0007 CALL R6 2 + 0x8C18070E, // 0008 GETMET R6 R3 K14 + 0x58200005, // 0009 LDCONST R8 K5 + 0x5824000F, // 000A LDCONST R9 K15 + 0x7C180600, // 000B CALL R6 3 + 0x20180D05, // 000C NE R6 R6 K5 + 0x781A0022, // 000D JMPF R6 #0031 + 0x58180005, // 000E LDCONST R6 K5 + 0x581C0005, // 000F LDCONST R7 K5 + 0x04200B0F, // 0010 SUB R8 R5 K15 + 0x14200E08, // 0011 LT R8 R7 R8 + 0x78220007, // 0012 JMPF R8 #001B + 0x8C20070E, // 0013 GETMET R8 R3 K14 + 0x542A0003, // 0014 LDINT R10 4 + 0x08280E0A, // 0015 MUL R10 R7 R10 + 0x582C000F, // 0016 LDCONST R11 K15 + 0x7C200600, // 0017 CALL R8 3 + 0x00180C08, // 0018 ADD R6 R6 R8 + 0x001C0F0F, // 0019 ADD R7 R7 K15 + 0x7001FFF4, // 001A JMP #0010 + 0x58200005, // 001B LDCONST R8 K5 + 0x581C0005, // 001C LDCONST R7 K5 + 0x14240E05, // 001D LT R9 R7 R5 + 0x78260010, // 001E JMPF R9 #0030 + 0xB8260600, // 001F GETNGBL R9 K3 + 0x8C241307, // 0020 GETMET R9 R9 K7 + 0x5C2C1000, // 0021 MOVE R11 R8 + 0x58300005, // 0022 LDCONST R12 K5 + 0x5C340C00, // 0023 MOVE R13 R6 + 0x5C380200, // 0024 MOVE R14 R1 + 0x5C3C0400, // 0025 MOVE R15 R2 + 0x7C240C00, // 0026 CALL R9 6 + 0x98100E09, // 0027 SETIDX R4 R7 R9 + 0x8C24070E, // 0028 GETMET R9 R3 K14 + 0x542E0003, // 0029 LDINT R11 4 + 0x082C0E0B, // 002A MUL R11 R7 R11 + 0x5830000F, // 002B LDCONST R12 K15 + 0x7C240600, // 002C CALL R9 3 + 0x00201009, // 002D ADD R8 R8 R9 + 0x001C0F0F, // 002E ADD R7 R7 K15 + 0x7001FFEC, // 002F JMP #001D + 0x70020012, // 0030 JMP #0044 + 0x58180005, // 0031 LDCONST R6 K5 + 0x141C0C05, // 0032 LT R7 R6 R5 + 0x781E000F, // 0033 JMPF R7 #0044 + 0x8C1C070E, // 0034 GETMET R7 R3 K14 + 0x54260003, // 0035 LDINT R9 4 + 0x08240C09, // 0036 MUL R9 R6 R9 + 0x5828000F, // 0037 LDCONST R10 K15 + 0x7C1C0600, // 0038 CALL R7 3 + 0xB8220600, // 0039 GETNGBL R8 K3 + 0x8C201107, // 003A GETMET R8 R8 K7 + 0x5C280E00, // 003B MOVE R10 R7 + 0x582C0005, // 003C LDCONST R11 K5 + 0x543200FE, // 003D LDINT R12 255 + 0x5C340200, // 003E MOVE R13 R1 + 0x5C380400, // 003F MOVE R14 R2 + 0x7C200C00, // 0040 CALL R8 6 + 0x98100C08, // 0041 SETIDX R4 R6 R8 + 0x00180D0F, // 0042 ADD R6 R6 K15 + 0x7001FFED, // 0043 JMP #0032 + 0x80040800, // 0044 RET 1 R4 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: on_param_changed +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider_on_param_changed, /* name */ + be_nested_proto( + 7, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(on_param_changed), + &be_const_str_solidified, + ( &(const binstruction[26]) { /* code */ + 0x600C0003, // 0000 GETGBL R3 G3 + 0x5C100000, // 0001 MOVE R4 R0 + 0x7C0C0200, // 0002 CALL R3 1 + 0x8C0C0710, // 0003 GETMET R3 R3 K16 + 0x5C140200, // 0004 MOVE R5 R1 + 0x5C180400, // 0005 MOVE R6 R2 + 0x7C0C0600, // 0006 CALL R3 3 + 0x1C0C0311, // 0007 EQ R3 R1 K17 + 0x740E0005, // 0008 JMPT R3 #000F + 0x1C0C0312, // 0009 EQ R3 R1 K18 + 0x740E0003, // 000A JMPT R3 #000F + 0x1C0C030A, // 000B EQ R3 R1 K10 + 0x740E0001, // 000C JMPT R3 #000F + 0x1C0C0313, // 000D EQ R3 R1 K19 + 0x780E0009, // 000E JMPF R3 #0019 + 0x880C0114, // 000F GETMBR R3 R0 K20 + 0x4C100000, // 0010 LDNIL R4 + 0x200C0604, // 0011 NE R3 R3 R4 + 0x740E0003, // 0012 JMPT R3 #0017 + 0x880C0115, // 0013 GETMBR R3 R0 K21 + 0x4C100000, // 0014 LDNIL R4 + 0x200C0604, // 0015 NE R3 R3 R4 + 0x780E0001, // 0016 JMPF R3 #0019 + 0x8C0C0116, // 0017 GETMET R3 R0 K22 + 0x7C0C0200, // 0018 CALL R3 1 + 0x80000000, // 0019 RET 0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: get_color_for_value +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider_get_color_for_value, /* name */ + be_nested_proto( + 23, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(get_color_for_value), + &be_const_str_solidified, + ( &(const binstruction[130]) { /* code */ + 0x880C0114, // 0000 GETMBR R3 R0 K20 + 0x4C100000, // 0001 LDNIL R4 + 0x1C0C0604, // 0002 EQ R3 R3 R4 + 0x780E0005, // 0003 JMPF R3 #000A + 0x880C0115, // 0004 GETMBR R3 R0 K21 + 0x4C100000, // 0005 LDNIL R4 + 0x1C0C0604, // 0006 EQ R3 R3 R4 + 0x780E0001, // 0007 JMPF R3 #000A + 0x8C0C0116, // 0008 GETMET R3 R0 K22 + 0x7C0C0200, // 0009 CALL R3 1 + 0x8C0C010C, // 000A GETMET R3 R0 K12 + 0x7C0C0200, // 000B CALL R3 1 + 0x88100111, // 000C GETMBR R4 R0 K17 + 0x88140112, // 000D GETMBR R5 R0 K18 + 0x88180117, // 000E GETMBR R6 R0 K23 + 0x4C1C0000, // 000F LDNIL R7 + 0x1C1C0807, // 0010 EQ R7 R4 R7 + 0x741E0002, // 0011 JMPT R7 #0015 + 0x4C1C0000, // 0012 LDNIL R7 + 0x1C1C0A07, // 0013 EQ R7 R5 R7 + 0x781E0001, // 0014 JMPF R7 #0017 + 0x4C1C0000, // 0015 LDNIL R7 + 0x80040E00, // 0016 RET 1 R7 + 0x881C0109, // 0017 GETMBR R7 R0 K9 + 0x04200F18, // 0018 SUB R8 R7 K24 + 0x24241105, // 0019 GT R9 R8 K5 + 0x78260006, // 001A JMPF R9 #0022 + 0x88240115, // 001B GETMBR R9 R0 K21 + 0x94241208, // 001C GETIDX R9 R9 R8 + 0x28240209, // 001D GE R9 R1 R9 + 0x78260000, // 001E JMPF R9 #0020 + 0x70020001, // 001F JMP #0022 + 0x0420110F, // 0020 SUB R8 R8 K15 + 0x7001FFF6, // 0021 JMP #0019 + 0x8C24070E, // 0022 GETMET R9 R3 K14 + 0x542E0003, // 0023 LDINT R11 4 + 0x082C100B, // 0024 MUL R11 R8 R11 + 0x54320003, // 0025 LDINT R12 4 + 0x7C240600, // 0026 CALL R9 3 + 0x8C28070E, // 0027 GETMET R10 R3 K14 + 0x0030110F, // 0028 ADD R12 R8 K15 + 0x54360003, // 0029 LDINT R13 4 + 0x0830180D, // 002A MUL R12 R12 R13 + 0x54360003, // 002B LDINT R13 4 + 0x7C280600, // 002C CALL R10 3 + 0x882C0115, // 002D GETMBR R11 R0 K21 + 0x942C1608, // 002E GETIDX R11 R11 R8 + 0x0030110F, // 002F ADD R12 R8 K15 + 0x88340115, // 0030 GETMBR R13 R0 K21 + 0x94301A0C, // 0031 GETIDX R12 R13 R12 + 0x8C340119, // 0032 GETMET R13 R0 K25 + 0x5C3C0200, // 0033 MOVE R15 R1 + 0x5C401600, // 0034 MOVE R16 R11 + 0x5C441800, // 0035 MOVE R17 R12 + 0x544A0007, // 0036 LDINT R18 8 + 0x3C481212, // 0037 SHR R18 R9 R18 + 0x544E00FE, // 0038 LDINT R19 255 + 0x2C482413, // 0039 AND R18 R18 R19 + 0x544E0007, // 003A LDINT R19 8 + 0x3C4C1413, // 003B SHR R19 R10 R19 + 0x545200FE, // 003C LDINT R20 255 + 0x2C4C2614, // 003D AND R19 R19 R20 + 0x7C340C00, // 003E CALL R13 6 + 0x8C380119, // 003F GETMET R14 R0 K25 + 0x5C400200, // 0040 MOVE R16 R1 + 0x5C441600, // 0041 MOVE R17 R11 + 0x5C481800, // 0042 MOVE R18 R12 + 0x544E000F, // 0043 LDINT R19 16 + 0x3C4C1213, // 0044 SHR R19 R9 R19 + 0x545200FE, // 0045 LDINT R20 255 + 0x2C4C2614, // 0046 AND R19 R19 R20 + 0x5452000F, // 0047 LDINT R20 16 + 0x3C501414, // 0048 SHR R20 R10 R20 + 0x545600FE, // 0049 LDINT R21 255 + 0x2C502815, // 004A AND R20 R20 R21 + 0x7C380C00, // 004B CALL R14 6 + 0x8C3C0119, // 004C GETMET R15 R0 K25 + 0x5C440200, // 004D MOVE R17 R1 + 0x5C481600, // 004E MOVE R18 R11 + 0x5C4C1800, // 004F MOVE R19 R12 + 0x54520017, // 0050 LDINT R20 24 + 0x3C501214, // 0051 SHR R20 R9 R20 + 0x545600FE, // 0052 LDINT R21 255 + 0x2C502815, // 0053 AND R20 R20 R21 + 0x54560017, // 0054 LDINT R21 24 + 0x3C541415, // 0055 SHR R21 R10 R21 + 0x545A00FE, // 0056 LDINT R22 255 + 0x2C542A16, // 0057 AND R21 R21 R22 + 0x7C3C0C00, // 0058 CALL R15 6 + 0x544200FE, // 0059 LDINT R16 255 + 0x20400C10, // 005A NE R16 R6 R16 + 0x7842001A, // 005B JMPF R16 #0077 + 0xB8420600, // 005C GETNGBL R16 K3 + 0x8C402104, // 005D GETMET R16 R16 K4 + 0x5C481A00, // 005E MOVE R18 R13 + 0x584C0005, // 005F LDCONST R19 K5 + 0x545200FE, // 0060 LDINT R20 255 + 0x58540005, // 0061 LDCONST R21 K5 + 0x5C580C00, // 0062 MOVE R22 R6 + 0x7C400C00, // 0063 CALL R16 6 + 0x5C342000, // 0064 MOVE R13 R16 + 0xB8420600, // 0065 GETNGBL R16 K3 + 0x8C402104, // 0066 GETMET R16 R16 K4 + 0x5C481C00, // 0067 MOVE R18 R14 + 0x584C0005, // 0068 LDCONST R19 K5 + 0x545200FE, // 0069 LDINT R20 255 + 0x58540005, // 006A LDCONST R21 K5 + 0x5C580C00, // 006B MOVE R22 R6 + 0x7C400C00, // 006C CALL R16 6 + 0x5C382000, // 006D MOVE R14 R16 + 0xB8420600, // 006E GETNGBL R16 K3 + 0x8C402104, // 006F GETMET R16 R16 K4 + 0x5C481E00, // 0070 MOVE R18 R15 + 0x584C0005, // 0071 LDCONST R19 K5 + 0x545200FE, // 0072 LDINT R20 255 + 0x58540005, // 0073 LDCONST R21 K5 + 0x5C580C00, // 0074 MOVE R22 R6 + 0x7C400C00, // 0075 CALL R16 6 + 0x5C3C2000, // 0076 MOVE R15 R16 + 0x544200FE, // 0077 LDINT R16 255 + 0x54460017, // 0078 LDINT R17 24 + 0x38402011, // 0079 SHL R16 R16 R17 + 0x5446000F, // 007A LDINT R17 16 + 0x38441A11, // 007B SHL R17 R13 R17 + 0x30402011, // 007C OR R16 R16 R17 + 0x54460007, // 007D LDINT R17 8 + 0x38441C11, // 007E SHL R17 R14 R17 + 0x30402011, // 007F OR R16 R16 R17 + 0x3040200F, // 0080 OR R16 R16 R15 + 0x80042000, // 0081 RET 1 R16 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _recompute_palette +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider__recompute_palette, /* name */ + be_nested_proto( + 9, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(_recompute_palette), + &be_const_str_solidified, + ( &(const binstruction[48]) { /* code */ + 0x8804010A, // 0000 GETMBR R1 R0 K10 + 0x8C08010C, // 0001 GETMET R2 R0 K12 + 0x7C080200, // 0002 CALL R2 1 + 0x600C000C, // 0003 GETGBL R3 G12 + 0x5C100400, // 0004 MOVE R4 R2 + 0x7C0C0200, // 0005 CALL R3 1 + 0x54120003, // 0006 LDINT R4 4 + 0x0C0C0604, // 0007 DIV R3 R3 R4 + 0x90021203, // 0008 SETMBR R0 K9 R3 + 0x240C0305, // 0009 GT R3 R1 K5 + 0x780E0008, // 000A JMPF R3 #0014 + 0x4C0C0000, // 000B LDNIL R3 + 0x200C0403, // 000C NE R3 R2 R3 + 0x780E0005, // 000D JMPF R3 #0014 + 0x8C0C011A, // 000E GETMET R3 R0 K26 + 0x58140005, // 000F LDCONST R5 K5 + 0x0418030F, // 0010 SUB R6 R1 K15 + 0x7C0C0600, // 0011 CALL R3 3 + 0x90022803, // 0012 SETMBR R0 K20 R3 + 0x70020001, // 0013 JMP #0016 + 0x4C0C0000, // 0014 LDNIL R3 + 0x90022803, // 0015 SETMBR R0 K20 R3 + 0x880C0111, // 0016 GETMBR R3 R0 K17 + 0x88100112, // 0017 GETMBR R4 R0 K18 + 0x28140604, // 0018 GE R5 R3 R4 + 0x78160000, // 0019 JMPF R5 #001B + 0xB006371C, // 001A RAISE 1 K27 K28 + 0x8C14010C, // 001B GETMET R5 R0 K12 + 0x7C140200, // 001C CALL R5 1 + 0x4C180000, // 001D LDNIL R6 + 0x20140A06, // 001E NE R5 R5 R6 + 0x78160005, // 001F JMPF R5 #0026 + 0x8C14011A, // 0020 GETMET R5 R0 K26 + 0x5C1C0600, // 0021 MOVE R7 R3 + 0x5C200800, // 0022 MOVE R8 R4 + 0x7C140600, // 0023 CALL R5 3 + 0x90022A05, // 0024 SETMBR R0 K21 R5 + 0x70020001, // 0025 JMP #0028 + 0x4C140000, // 0026 LDNIL R5 + 0x90022A05, // 0027 SETMBR R0 K21 R5 + 0x88140109, // 0028 GETMBR R5 R0 K9 + 0x24140B05, // 0029 GT R5 R5 K5 + 0x78160003, // 002A JMPF R5 #002F + 0x8C14011E, // 002B GETMET R5 R0 K30 + 0x581C0005, // 002C LDCONST R7 K5 + 0x7C140400, // 002D CALL R5 2 + 0x90023A05, // 002E SETMBR R0 K29 R5 + 0x80040000, // 002F RET 1 R0 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified function: init ********************************************************************/ @@ -3856,18 +3850,18 @@ be_local_closure(class_RichPaletteColorProvider_init, /* name */ 0x60080003, // 0000 GETGBL R2 G3 0x5C0C0000, // 0001 MOVE R3 R0 0x7C080200, // 0002 CALL R2 1 - 0x8C080520, // 0003 GETMET R2 R2 K32 + 0x8C08051F, // 0003 GETMET R2 R2 K31 0x5C100200, // 0004 MOVE R4 R1 0x7C080400, // 0005 CALL R2 2 0x5409FFFE, // 0006 LDINT R2 -1 - 0x90022202, // 0007 SETMBR R0 K17 R2 - 0x9002150D, // 0008 SETMBR R0 K10 K13 - 0xA40A4200, // 0009 IMPORT R2 K33 - 0x8C0C0514, // 000A GETMET R3 R2 K20 - 0x88140514, // 000B GETMBR R5 R2 K20 + 0x90023A02, // 0007 SETMBR R0 K29 R2 + 0x90021305, // 0008 SETMBR R0 K9 K5 + 0xA40A4000, // 0009 IMPORT R2 K32 + 0x8C0C0521, // 000A GETMET R3 R2 K33 + 0x88140521, // 000B GETMBR R5 R2 K33 0x88140B22, // 000C GETMBR R5 R5 K34 0x7C0C0400, // 000D CALL R3 2 - 0x90022803, // 000E SETMBR R0 K20 R3 + 0x90024203, // 000E SETMBR R0 K33 R3 0x80000000, // 000F RET 0 }) ) @@ -3875,304 +3869,6 @@ be_local_closure(class_RichPaletteColorProvider_init, /* name */ /*******************************************************************/ -/******************************************************************** -** Solidified function: start -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider_start, /* name */ - be_nested_proto( - 5, /* nstack */ - 2, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(start), - &be_const_str_solidified, - ( &(const binstruction[17]) { /* code */ - 0x88080105, // 0000 GETMBR R2 R0 K5 - 0x4C0C0000, // 0001 LDNIL R3 - 0x1C080403, // 0002 EQ R2 R2 R3 - 0x780A0005, // 0003 JMPF R2 #000A - 0x88080106, // 0004 GETMBR R2 R0 K6 - 0x4C0C0000, // 0005 LDNIL R3 - 0x1C080403, // 0006 EQ R2 R2 R3 - 0x780A0001, // 0007 JMPF R2 #000A - 0x8C080107, // 0008 GETMET R2 R0 K7 - 0x7C080200, // 0009 CALL R2 1 - 0x60080003, // 000A GETGBL R2 G3 - 0x5C0C0000, // 000B MOVE R3 R0 - 0x7C080200, // 000C CALL R2 1 - 0x8C080523, // 000D GETMET R2 R2 K35 - 0x5C100200, // 000E MOVE R4 R1 - 0x7C080400, // 000F CALL R2 2 - 0x80040000, // 0010 RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: get_color_for_value -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider_get_color_for_value, /* name */ - be_nested_proto( - 23, /* nstack */ - 3, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(get_color_for_value), - &be_const_str_solidified, - ( &(const binstruction[133]) { /* code */ - 0x880C0105, // 0000 GETMBR R3 R0 K5 - 0x4C100000, // 0001 LDNIL R4 - 0x1C0C0604, // 0002 EQ R3 R3 R4 - 0x780E0005, // 0003 JMPF R3 #000A - 0x880C0106, // 0004 GETMBR R3 R0 K6 - 0x4C100000, // 0005 LDNIL R4 - 0x1C0C0604, // 0006 EQ R3 R3 R4 - 0x780E0001, // 0007 JMPF R3 #000A - 0x8C0C0107, // 0008 GETMET R3 R0 K7 - 0x7C0C0200, // 0009 CALL R3 1 - 0x8C0C0109, // 000A GETMET R3 R0 K9 - 0x7C0C0200, // 000B CALL R3 1 - 0x88100101, // 000C GETMBR R4 R0 K1 - 0x88140102, // 000D GETMBR R5 R0 K2 - 0x8818010C, // 000E GETMBR R6 R0 K12 - 0x4C1C0000, // 000F LDNIL R7 - 0x1C1C0807, // 0010 EQ R7 R4 R7 - 0x741E0002, // 0011 JMPT R7 #0015 - 0x4C1C0000, // 0012 LDNIL R7 - 0x1C1C0A07, // 0013 EQ R7 R5 R7 - 0x781E0001, // 0014 JMPF R7 #0017 - 0x4C1C0000, // 0015 LDNIL R7 - 0x80040E00, // 0016 RET 1 R7 - 0x881C010A, // 0017 GETMBR R7 R0 K10 - 0x04200F0B, // 0018 SUB R8 R7 K11 - 0x2424110D, // 0019 GT R9 R8 K13 - 0x78260006, // 001A JMPF R9 #0022 - 0x88240106, // 001B GETMBR R9 R0 K6 - 0x94241208, // 001C GETIDX R9 R9 R8 - 0x28240209, // 001D GE R9 R1 R9 - 0x78260000, // 001E JMPF R9 #0020 - 0x70020001, // 001F JMP #0022 - 0x04201113, // 0020 SUB R8 R8 K19 - 0x7001FFF6, // 0021 JMP #0019 - 0x8C24070E, // 0022 GETMET R9 R3 K14 - 0x542E0003, // 0023 LDINT R11 4 - 0x082C100B, // 0024 MUL R11 R8 R11 - 0x54320003, // 0025 LDINT R12 4 - 0x7C240600, // 0026 CALL R9 3 - 0x8C28070E, // 0027 GETMET R10 R3 K14 - 0x00301113, // 0028 ADD R12 R8 K19 - 0x54360003, // 0029 LDINT R13 4 - 0x0830180D, // 002A MUL R12 R12 R13 - 0x54360003, // 002B LDINT R13 4 - 0x7C280600, // 002C CALL R10 3 - 0x882C0106, // 002D GETMBR R11 R0 K6 - 0x942C1608, // 002E GETIDX R11 R11 R8 - 0x00301113, // 002F ADD R12 R8 K19 - 0x88340106, // 0030 GETMBR R13 R0 K6 - 0x94301A0C, // 0031 GETIDX R12 R13 R12 - 0xB8361E00, // 0032 GETNGBL R13 K15 - 0x8C341B10, // 0033 GETMET R13 R13 K16 - 0x5C3C0200, // 0034 MOVE R15 R1 - 0x5C401600, // 0035 MOVE R16 R11 - 0x5C441800, // 0036 MOVE R17 R12 - 0x544A0007, // 0037 LDINT R18 8 - 0x3C481212, // 0038 SHR R18 R9 R18 - 0x544E00FE, // 0039 LDINT R19 255 - 0x2C482413, // 003A AND R18 R18 R19 - 0x544E0007, // 003B LDINT R19 8 - 0x3C4C1413, // 003C SHR R19 R10 R19 - 0x545200FE, // 003D LDINT R20 255 - 0x2C4C2614, // 003E AND R19 R19 R20 - 0x7C340C00, // 003F CALL R13 6 - 0xB83A1E00, // 0040 GETNGBL R14 K15 - 0x8C381D10, // 0041 GETMET R14 R14 K16 - 0x5C400200, // 0042 MOVE R16 R1 - 0x5C441600, // 0043 MOVE R17 R11 - 0x5C481800, // 0044 MOVE R18 R12 - 0x544E000F, // 0045 LDINT R19 16 - 0x3C4C1213, // 0046 SHR R19 R9 R19 - 0x545200FE, // 0047 LDINT R20 255 - 0x2C4C2614, // 0048 AND R19 R19 R20 - 0x5452000F, // 0049 LDINT R20 16 - 0x3C501414, // 004A SHR R20 R10 R20 - 0x545600FE, // 004B LDINT R21 255 - 0x2C502815, // 004C AND R20 R20 R21 - 0x7C380C00, // 004D CALL R14 6 - 0xB83E1E00, // 004E GETNGBL R15 K15 - 0x8C3C1F10, // 004F GETMET R15 R15 K16 - 0x5C440200, // 0050 MOVE R17 R1 - 0x5C481600, // 0051 MOVE R18 R11 - 0x5C4C1800, // 0052 MOVE R19 R12 - 0x54520017, // 0053 LDINT R20 24 - 0x3C501214, // 0054 SHR R20 R9 R20 - 0x545600FE, // 0055 LDINT R21 255 - 0x2C502815, // 0056 AND R20 R20 R21 - 0x54560017, // 0057 LDINT R21 24 - 0x3C541415, // 0058 SHR R21 R10 R21 - 0x545A00FE, // 0059 LDINT R22 255 - 0x2C542A16, // 005A AND R21 R21 R22 - 0x7C3C0C00, // 005B CALL R15 6 - 0x544200FE, // 005C LDINT R16 255 - 0x20400C10, // 005D NE R16 R6 R16 - 0x7842001A, // 005E JMPF R16 #007A - 0xB8421E00, // 005F GETNGBL R16 K15 - 0x8C402110, // 0060 GETMET R16 R16 K16 - 0x5C481A00, // 0061 MOVE R18 R13 - 0x584C000D, // 0062 LDCONST R19 K13 - 0x545200FE, // 0063 LDINT R20 255 - 0x5854000D, // 0064 LDCONST R21 K13 - 0x5C580C00, // 0065 MOVE R22 R6 - 0x7C400C00, // 0066 CALL R16 6 - 0x5C342000, // 0067 MOVE R13 R16 - 0xB8421E00, // 0068 GETNGBL R16 K15 - 0x8C402110, // 0069 GETMET R16 R16 K16 - 0x5C481C00, // 006A MOVE R18 R14 - 0x584C000D, // 006B LDCONST R19 K13 - 0x545200FE, // 006C LDINT R20 255 - 0x5854000D, // 006D LDCONST R21 K13 - 0x5C580C00, // 006E MOVE R22 R6 - 0x7C400C00, // 006F CALL R16 6 - 0x5C382000, // 0070 MOVE R14 R16 - 0xB8421E00, // 0071 GETNGBL R16 K15 - 0x8C402110, // 0072 GETMET R16 R16 K16 - 0x5C481E00, // 0073 MOVE R18 R15 - 0x584C000D, // 0074 LDCONST R19 K13 - 0x545200FE, // 0075 LDINT R20 255 - 0x5854000D, // 0076 LDCONST R21 K13 - 0x5C580C00, // 0077 MOVE R22 R6 - 0x7C400C00, // 0078 CALL R16 6 - 0x5C3C2000, // 0079 MOVE R15 R16 - 0x544200FE, // 007A LDINT R16 255 - 0x54460017, // 007B LDINT R17 24 - 0x38402011, // 007C SHL R16 R16 R17 - 0x5446000F, // 007D LDINT R17 16 - 0x38441A11, // 007E SHL R17 R13 R17 - 0x30402011, // 007F OR R16 R16 R17 - 0x54460007, // 0080 LDINT R17 8 - 0x38441C11, // 0081 SHL R17 R14 R17 - 0x30402011, // 0082 OR R16 R16 R17 - 0x3040200F, // 0083 OR R16 R16 R15 - 0x80042000, // 0084 RET 1 R16 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _recompute_palette -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider__recompute_palette, /* name */ - be_nested_proto( - 9, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(_recompute_palette), - &be_const_str_solidified, - ( &(const binstruction[48]) { /* code */ - 0x88040103, // 0000 GETMBR R1 R0 K3 - 0x8C080109, // 0001 GETMET R2 R0 K9 - 0x7C080200, // 0002 CALL R2 1 - 0x600C000C, // 0003 GETGBL R3 G12 - 0x5C100400, // 0004 MOVE R4 R2 - 0x7C0C0200, // 0005 CALL R3 1 - 0x54120003, // 0006 LDINT R4 4 - 0x0C0C0604, // 0007 DIV R3 R3 R4 - 0x90021403, // 0008 SETMBR R0 K10 R3 - 0x240C030D, // 0009 GT R3 R1 K13 - 0x780E0008, // 000A JMPF R3 #0014 - 0x4C0C0000, // 000B LDNIL R3 - 0x200C0403, // 000C NE R3 R2 R3 - 0x780E0005, // 000D JMPF R3 #0014 - 0x8C0C0124, // 000E GETMET R3 R0 K36 - 0x5814000D, // 000F LDCONST R5 K13 - 0x04180313, // 0010 SUB R6 R1 K19 - 0x7C0C0600, // 0011 CALL R3 3 - 0x90020A03, // 0012 SETMBR R0 K5 R3 - 0x70020001, // 0013 JMP #0016 - 0x4C0C0000, // 0014 LDNIL R3 - 0x90020A03, // 0015 SETMBR R0 K5 R3 - 0x880C0101, // 0016 GETMBR R3 R0 K1 - 0x88100102, // 0017 GETMBR R4 R0 K2 - 0x28140604, // 0018 GE R5 R3 R4 - 0x78160000, // 0019 JMPF R5 #001B - 0xB0064B26, // 001A RAISE 1 K37 K38 - 0x8C140109, // 001B GETMET R5 R0 K9 - 0x7C140200, // 001C CALL R5 1 - 0x4C180000, // 001D LDNIL R6 - 0x20140A06, // 001E NE R5 R5 R6 - 0x78160005, // 001F JMPF R5 #0026 - 0x8C140124, // 0020 GETMET R5 R0 K36 - 0x5C1C0600, // 0021 MOVE R7 R3 - 0x5C200800, // 0022 MOVE R8 R4 - 0x7C140600, // 0023 CALL R5 3 - 0x90020C05, // 0024 SETMBR R0 K6 R5 - 0x70020001, // 0025 JMP #0028 - 0x4C140000, // 0026 LDNIL R5 - 0x90020C05, // 0027 SETMBR R0 K6 R5 - 0x8814010A, // 0028 GETMBR R5 R0 K10 - 0x24140B0D, // 0029 GT R5 R5 K13 - 0x78160003, // 002A JMPF R5 #002F - 0x8C140127, // 002B GETMET R5 R0 K39 - 0x581C000D, // 002C LDCONST R7 K13 - 0x7C140400, // 002D CALL R5 2 - 0x90022205, // 002E SETMBR R0 K17 R5 - 0x80040000, // 002F RET 1 R0 - }) - ) -); -/*******************************************************************/ - - -/******************************************************************** -** Solidified function: _get_palette_bytes -********************************************************************/ -be_local_closure(class_RichPaletteColorProvider__get_palette_bytes, /* name */ - be_nested_proto( - 3, /* nstack */ - 1, /* argc */ - 10, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - &be_ktab_class_RichPaletteColorProvider, /* shared constants */ - be_str_weak(_get_palette_bytes), - &be_const_str_solidified, - ( &(const binstruction[ 8]) { /* code */ - 0x88040104, // 0000 GETMBR R1 R0 K4 - 0x4C080000, // 0001 LDNIL R2 - 0x20080202, // 0002 NE R2 R1 R2 - 0x780A0001, // 0003 JMPF R2 #0006 - 0x5C080200, // 0004 MOVE R2 R1 - 0x70020000, // 0005 JMP #0007 - 0x88080128, // 0006 GETMBR R2 R0 K40 - 0x80040400, // 0007 RET 1 R2 - }) - ) -); -/*******************************************************************/ - - /******************************************************************** ** Solidified function: to_css_gradient ********************************************************************/ @@ -4190,18 +3886,18 @@ be_local_closure(class_RichPaletteColorProvider_to_css_gradient, /* name */ be_str_weak(to_css_gradient), &be_const_str_solidified, ( &(const binstruction[47]) { /* code */ - 0x8C040109, // 0000 GETMET R1 R0 K9 + 0x8C04010C, // 0000 GETMET R1 R0 K12 0x7C040200, // 0001 CALL R1 1 0x4C080000, // 0002 LDNIL R2 0x1C080202, // 0003 EQ R2 R1 R2 0x780A0000, // 0004 JMPF R2 #0006 - 0x80065200, // 0005 RET 1 K41 - 0x8C080124, // 0006 GETMET R2 R0 K36 - 0x5810000D, // 0007 LDCONST R4 K13 + 0x80064600, // 0005 RET 1 K35 + 0x8C08011A, // 0006 GETMET R2 R0 K26 + 0x58100005, // 0007 LDCONST R4 K5 0x541603E7, // 0008 LDINT R5 1000 0x7C080600, // 0009 CALL R2 3 - 0x580C002A, // 000A LDCONST R3 K42 - 0x5810000D, // 000B LDCONST R4 K13 + 0x580C0024, // 000A LDCONST R3 K36 + 0x58100005, // 000B LDCONST R4 K5 0x6014000C, // 000C GETGBL R5 G12 0x5C180400, // 000D MOVE R6 R2 0x7C140200, // 000E CALL R5 1 @@ -4226,16 +3922,16 @@ be_local_closure(class_RichPaletteColorProvider_to_css_gradient, /* name */ 0x542A00FE, // 0021 LDINT R10 255 0x2C24120A, // 0022 AND R9 R9 R10 0x60280018, // 0023 GETGBL R10 G24 - 0x582C002B, // 0024 LDCONST R11 K43 + 0x582C0025, // 0024 LDCONST R11 K37 0x5C300E00, // 0025 MOVE R12 R7 0x5C341000, // 0026 MOVE R13 R8 0x5C381200, // 0027 MOVE R14 R9 - 0x0C3C0B2C, // 0028 DIV R15 R5 K44 + 0x0C3C0B26, // 0028 DIV R15 R5 K38 0x7C280A00, // 0029 CALL R10 5 0x000C060A, // 002A ADD R3 R3 R10 - 0x00100913, // 002B ADD R4 R4 K19 + 0x0010090F, // 002B ADD R4 R4 K15 0x7001FFDE, // 002C JMP #000C - 0x000C072D, // 002D ADD R3 R3 K45 + 0x000C0727, // 002D ADD R3 R3 K39 0x80040600, // 002E RET 1 R3 }) ) @@ -4243,6 +3939,385 @@ be_local_closure(class_RichPaletteColorProvider_to_css_gradient, /* name */ /*******************************************************************/ +/******************************************************************** +** Solidified function: _get_color_at_index +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider__get_color_at_index, /* name */ + be_nested_proto( + 7, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(_get_color_at_index), + &be_const_str_solidified, + ( &(const binstruction[16]) { /* code */ + 0x14080305, // 0000 LT R2 R1 K5 + 0x740A0002, // 0001 JMPT R2 #0005 + 0x88080109, // 0002 GETMBR R2 R0 K9 + 0x28080202, // 0003 GE R2 R1 R2 + 0x780A0001, // 0004 JMPF R2 #0007 + 0x5409FFFE, // 0005 LDINT R2 -1 + 0x80040400, // 0006 RET 1 R2 + 0x8C08010C, // 0007 GETMET R2 R0 K12 + 0x7C080200, // 0008 CALL R2 1 + 0x8C0C050E, // 0009 GETMET R3 R2 K14 + 0x54160003, // 000A LDINT R5 4 + 0x08140205, // 000B MUL R5 R1 R5 + 0x5419FFFB, // 000C LDINT R6 -4 + 0x7C0C0600, // 000D CALL R3 3 + 0x300C0728, // 000E OR R3 R3 K40 + 0x80040600, // 000F RET 1 R3 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: start +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider_start, /* name */ + be_nested_proto( + 5, /* nstack */ + 2, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(start), + &be_const_str_solidified, + ( &(const binstruction[17]) { /* code */ + 0x88080114, // 0000 GETMBR R2 R0 K20 + 0x4C0C0000, // 0001 LDNIL R3 + 0x1C080403, // 0002 EQ R2 R2 R3 + 0x780A0005, // 0003 JMPF R2 #000A + 0x88080115, // 0004 GETMBR R2 R0 K21 + 0x4C0C0000, // 0005 LDNIL R3 + 0x1C080403, // 0006 EQ R2 R2 R3 + 0x780A0001, // 0007 JMPF R2 #000A + 0x8C080116, // 0008 GETMET R2 R0 K22 + 0x7C080200, // 0009 CALL R2 1 + 0x60080003, // 000A GETGBL R2 G3 + 0x5C0C0000, // 000B MOVE R3 R0 + 0x7C080200, // 000C CALL R2 1 + 0x8C080529, // 000D GETMET R2 R2 K41 + 0x5C100200, // 000E MOVE R4 R1 + 0x7C080400, // 000F CALL R2 2 + 0x80040000, // 0010 RET 1 R0 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: _get_palette_bytes +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider__get_palette_bytes, /* name */ + be_nested_proto( + 3, /* nstack */ + 1, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(_get_palette_bytes), + &be_const_str_solidified, + ( &(const binstruction[ 8]) { /* code */ + 0x88040113, // 0000 GETMBR R1 R0 K19 + 0x4C080000, // 0001 LDNIL R2 + 0x20080202, // 0002 NE R2 R1 R2 + 0x780A0001, // 0003 JMPF R2 #0006 + 0x5C080200, // 0004 MOVE R2 R1 + 0x70020000, // 0005 JMP #0007 + 0x8808012A, // 0006 GETMBR R2 R0 K42 + 0x80040400, // 0007 RET 1 R2 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified function: produce_value +********************************************************************/ +be_local_closure(class_RichPaletteColorProvider_produce_value, /* name */ + be_nested_proto( + 28, /* nstack */ + 3, /* argc */ + 10, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 1, /* has constants */ + &be_ktab_class_RichPaletteColorProvider, /* shared constants */ + be_str_weak(produce_value), + &be_const_str_solidified, + ( &(const binstruction[246]) { /* code */ + 0x8C0C012B, // 0000 GETMET R3 R0 K43 + 0x5C140400, // 0001 MOVE R5 R2 + 0x7C0C0400, // 0002 CALL R3 2 + 0x5C080600, // 0003 MOVE R2 R3 + 0x880C0114, // 0004 GETMBR R3 R0 K20 + 0x4C100000, // 0005 LDNIL R4 + 0x1C0C0604, // 0006 EQ R3 R3 R4 + 0x780E0005, // 0007 JMPF R3 #000E + 0x880C0115, // 0008 GETMBR R3 R0 K21 + 0x4C100000, // 0009 LDNIL R4 + 0x1C0C0604, // 000A EQ R3 R3 R4 + 0x780E0001, // 000B JMPF R3 #000E + 0x8C0C0116, // 000C GETMET R3 R0 K22 + 0x7C0C0200, // 000D CALL R3 1 + 0x8C0C010C, // 000E GETMET R3 R0 K12 + 0x7C0C0200, // 000F CALL R3 1 + 0x4C100000, // 0010 LDNIL R4 + 0x1C100604, // 0011 EQ R4 R3 R4 + 0x74120002, // 0012 JMPT R4 #0016 + 0x88100109, // 0013 GETMBR R4 R0 K9 + 0x14100918, // 0014 LT R4 R4 K24 + 0x78120001, // 0015 JMPF R4 #0018 + 0x5411FFFE, // 0016 LDINT R4 -1 + 0x80040800, // 0017 RET 1 R4 + 0x8810010A, // 0018 GETMBR R4 R0 K10 + 0x88140117, // 0019 GETMBR R5 R0 K23 + 0x1C180905, // 001A EQ R6 R4 K5 + 0x781A0039, // 001B JMPF R6 #0056 + 0x8C18070E, // 001C GETMET R6 R3 K14 + 0x58200005, // 001D LDCONST R8 K5 + 0x54260003, // 001E LDINT R9 4 + 0x7C180600, // 001F CALL R6 3 + 0x541E0007, // 0020 LDINT R7 8 + 0x3C1C0C07, // 0021 SHR R7 R6 R7 + 0x542200FE, // 0022 LDINT R8 255 + 0x2C1C0E08, // 0023 AND R7 R7 R8 + 0x5422000F, // 0024 LDINT R8 16 + 0x3C200C08, // 0025 SHR R8 R6 R8 + 0x542600FE, // 0026 LDINT R9 255 + 0x2C201009, // 0027 AND R8 R8 R9 + 0x54260017, // 0028 LDINT R9 24 + 0x3C240C09, // 0029 SHR R9 R6 R9 + 0x542A00FE, // 002A LDINT R10 255 + 0x2C24120A, // 002B AND R9 R9 R10 + 0x542A00FE, // 002C LDINT R10 255 + 0x20280A0A, // 002D NE R10 R5 R10 + 0x782A001A, // 002E JMPF R10 #004A + 0xB82A0600, // 002F GETNGBL R10 K3 + 0x8C281504, // 0030 GETMET R10 R10 K4 + 0x5C300E00, // 0031 MOVE R12 R7 + 0x58340005, // 0032 LDCONST R13 K5 + 0x543A00FE, // 0033 LDINT R14 255 + 0x583C0005, // 0034 LDCONST R15 K5 + 0x5C400A00, // 0035 MOVE R16 R5 + 0x7C280C00, // 0036 CALL R10 6 + 0x5C1C1400, // 0037 MOVE R7 R10 + 0xB82A0600, // 0038 GETNGBL R10 K3 + 0x8C281504, // 0039 GETMET R10 R10 K4 + 0x5C301000, // 003A MOVE R12 R8 + 0x58340005, // 003B LDCONST R13 K5 + 0x543A00FE, // 003C LDINT R14 255 + 0x583C0005, // 003D LDCONST R15 K5 + 0x5C400A00, // 003E MOVE R16 R5 + 0x7C280C00, // 003F CALL R10 6 + 0x5C201400, // 0040 MOVE R8 R10 + 0xB82A0600, // 0041 GETNGBL R10 K3 + 0x8C281504, // 0042 GETMET R10 R10 K4 + 0x5C301200, // 0043 MOVE R12 R9 + 0x58340005, // 0044 LDCONST R13 K5 + 0x543A00FE, // 0045 LDINT R14 255 + 0x583C0005, // 0046 LDCONST R15 K5 + 0x5C400A00, // 0047 MOVE R16 R5 + 0x7C280C00, // 0048 CALL R10 6 + 0x5C241400, // 0049 MOVE R9 R10 + 0x542A00FE, // 004A LDINT R10 255 + 0x542E0017, // 004B LDINT R11 24 + 0x3828140B, // 004C SHL R10 R10 R11 + 0x542E000F, // 004D LDINT R11 16 + 0x382C0E0B, // 004E SHL R11 R7 R11 + 0x3028140B, // 004F OR R10 R10 R11 + 0x542E0007, // 0050 LDINT R11 8 + 0x382C100B, // 0051 SHL R11 R8 R11 + 0x3028140B, // 0052 OR R10 R10 R11 + 0x30281409, // 0053 OR R10 R10 R9 + 0x90023A0A, // 0054 SETMBR R0 K29 R10 + 0x80041400, // 0055 RET 1 R10 + 0x8818012C, // 0056 GETMBR R6 R0 K44 + 0x04180406, // 0057 SUB R6 R2 R6 + 0x101C0C04, // 0058 MOD R7 R6 R4 + 0x88200109, // 0059 GETMBR R8 R0 K9 + 0x04241118, // 005A SUB R9 R8 K24 + 0x24281305, // 005B GT R10 R9 K5 + 0x782A0006, // 005C JMPF R10 #0064 + 0x88280114, // 005D GETMBR R10 R0 K20 + 0x94281409, // 005E GETIDX R10 R10 R9 + 0x28280E0A, // 005F GE R10 R7 R10 + 0x782A0000, // 0060 JMPF R10 #0062 + 0x70020001, // 0061 JMP #0064 + 0x0424130F, // 0062 SUB R9 R9 K15 + 0x7001FFF6, // 0063 JMP #005B + 0x8C28070E, // 0064 GETMET R10 R3 K14 + 0x54320003, // 0065 LDINT R12 4 + 0x0830120C, // 0066 MUL R12 R9 R12 + 0x54360003, // 0067 LDINT R13 4 + 0x7C280600, // 0068 CALL R10 3 + 0x8C2C070E, // 0069 GETMET R11 R3 K14 + 0x0034130F, // 006A ADD R13 R9 K15 + 0x543A0003, // 006B LDINT R14 4 + 0x08341A0E, // 006C MUL R13 R13 R14 + 0x543A0003, // 006D LDINT R14 4 + 0x7C2C0600, // 006E CALL R11 3 + 0x88300114, // 006F GETMBR R12 R0 K20 + 0x94301809, // 0070 GETIDX R12 R12 R9 + 0x0034130F, // 0071 ADD R13 R9 K15 + 0x88380114, // 0072 GETMBR R14 R0 K20 + 0x94341C0D, // 0073 GETIDX R13 R14 R13 + 0x8C380119, // 0074 GETMET R14 R0 K25 + 0x5C400E00, // 0075 MOVE R16 R7 + 0x5C441800, // 0076 MOVE R17 R12 + 0x5C481A00, // 0077 MOVE R18 R13 + 0x544E0007, // 0078 LDINT R19 8 + 0x3C4C1413, // 0079 SHR R19 R10 R19 + 0x545200FE, // 007A LDINT R20 255 + 0x2C4C2614, // 007B AND R19 R19 R20 + 0x54520007, // 007C LDINT R20 8 + 0x3C501614, // 007D SHR R20 R11 R20 + 0x545600FE, // 007E LDINT R21 255 + 0x2C502815, // 007F AND R20 R20 R21 + 0x7C380C00, // 0080 CALL R14 6 + 0x8C3C0119, // 0081 GETMET R15 R0 K25 + 0x5C440E00, // 0082 MOVE R17 R7 + 0x5C481800, // 0083 MOVE R18 R12 + 0x5C4C1A00, // 0084 MOVE R19 R13 + 0x5452000F, // 0085 LDINT R20 16 + 0x3C501414, // 0086 SHR R20 R10 R20 + 0x545600FE, // 0087 LDINT R21 255 + 0x2C502815, // 0088 AND R20 R20 R21 + 0x5456000F, // 0089 LDINT R21 16 + 0x3C541615, // 008A SHR R21 R11 R21 + 0x545A00FE, // 008B LDINT R22 255 + 0x2C542A16, // 008C AND R21 R21 R22 + 0x7C3C0C00, // 008D CALL R15 6 + 0x8C400119, // 008E GETMET R16 R0 K25 + 0x5C480E00, // 008F MOVE R18 R7 + 0x5C4C1800, // 0090 MOVE R19 R12 + 0x5C501A00, // 0091 MOVE R20 R13 + 0x54560017, // 0092 LDINT R21 24 + 0x3C541415, // 0093 SHR R21 R10 R21 + 0x545A00FE, // 0094 LDINT R22 255 + 0x2C542A16, // 0095 AND R21 R21 R22 + 0x545A0017, // 0096 LDINT R22 24 + 0x3C581616, // 0097 SHR R22 R11 R22 + 0x545E00FE, // 0098 LDINT R23 255 + 0x2C582C17, // 0099 AND R22 R22 R23 + 0x7C400C00, // 009A CALL R16 6 + 0x88440121, // 009B GETMBR R17 R0 K33 + 0x8C48232D, // 009C GETMET R18 R17 K45 + 0x54520007, // 009D LDINT R20 8 + 0x3C501414, // 009E SHR R20 R10 R20 + 0x545600FE, // 009F LDINT R21 255 + 0x2C502815, // 00A0 AND R20 R20 R21 + 0x5456000F, // 00A1 LDINT R21 16 + 0x3C541415, // 00A2 SHR R21 R10 R21 + 0x545A00FE, // 00A3 LDINT R22 255 + 0x2C542A16, // 00A4 AND R21 R21 R22 + 0x545A0017, // 00A5 LDINT R22 24 + 0x3C581416, // 00A6 SHR R22 R10 R22 + 0x545E00FE, // 00A7 LDINT R23 255 + 0x2C582C17, // 00A8 AND R22 R22 R23 + 0x7C480800, // 00A9 CALL R18 4 + 0x8848232E, // 00AA GETMBR R18 R17 K46 + 0x8C4C232D, // 00AB GETMET R19 R17 K45 + 0x54560007, // 00AC LDINT R21 8 + 0x3C541615, // 00AD SHR R21 R11 R21 + 0x545A00FE, // 00AE LDINT R22 255 + 0x2C542A16, // 00AF AND R21 R21 R22 + 0x545A000F, // 00B0 LDINT R22 16 + 0x3C581616, // 00B1 SHR R22 R11 R22 + 0x545E00FE, // 00B2 LDINT R23 255 + 0x2C582C17, // 00B3 AND R22 R22 R23 + 0x545E0017, // 00B4 LDINT R23 24 + 0x3C5C1617, // 00B5 SHR R23 R11 R23 + 0x546200FE, // 00B6 LDINT R24 255 + 0x2C5C2E18, // 00B7 AND R23 R23 R24 + 0x7C4C0800, // 00B8 CALL R19 4 + 0x884C232E, // 00B9 GETMBR R19 R17 K46 + 0x8C500119, // 00BA GETMET R20 R0 K25 + 0x5C580E00, // 00BB MOVE R22 R7 + 0x5C5C1800, // 00BC MOVE R23 R12 + 0x5C601A00, // 00BD MOVE R24 R13 + 0x5C642400, // 00BE MOVE R25 R18 + 0x5C682600, // 00BF MOVE R26 R19 + 0x7C500C00, // 00C0 CALL R20 6 + 0x8C54232D, // 00C1 GETMET R21 R17 K45 + 0x5C5C1C00, // 00C2 MOVE R23 R14 + 0x5C601E00, // 00C3 MOVE R24 R15 + 0x5C642000, // 00C4 MOVE R25 R16 + 0x7C540800, // 00C5 CALL R21 4 + 0x8C54232F, // 00C6 GETMET R21 R17 K47 + 0x5C5C2800, // 00C7 MOVE R23 R20 + 0x7C540400, // 00C8 CALL R21 2 + 0x88382330, // 00C9 GETMBR R14 R17 K48 + 0x883C2331, // 00CA GETMBR R15 R17 K49 + 0x88402332, // 00CB GETMBR R16 R17 K50 + 0x545600FE, // 00CC LDINT R21 255 + 0x20540A15, // 00CD NE R21 R5 R21 + 0x7856001A, // 00CE JMPF R21 #00EA + 0xB8560600, // 00CF GETNGBL R21 K3 + 0x8C542B04, // 00D0 GETMET R21 R21 K4 + 0x5C5C1C00, // 00D1 MOVE R23 R14 + 0x58600005, // 00D2 LDCONST R24 K5 + 0x546600FE, // 00D3 LDINT R25 255 + 0x58680005, // 00D4 LDCONST R26 K5 + 0x5C6C0A00, // 00D5 MOVE R27 R5 + 0x7C540C00, // 00D6 CALL R21 6 + 0x5C382A00, // 00D7 MOVE R14 R21 + 0xB8560600, // 00D8 GETNGBL R21 K3 + 0x8C542B04, // 00D9 GETMET R21 R21 K4 + 0x5C5C1E00, // 00DA MOVE R23 R15 + 0x58600005, // 00DB LDCONST R24 K5 + 0x546600FE, // 00DC LDINT R25 255 + 0x58680005, // 00DD LDCONST R26 K5 + 0x5C6C0A00, // 00DE MOVE R27 R5 + 0x7C540C00, // 00DF CALL R21 6 + 0x5C3C2A00, // 00E0 MOVE R15 R21 + 0xB8560600, // 00E1 GETNGBL R21 K3 + 0x8C542B04, // 00E2 GETMET R21 R21 K4 + 0x5C5C2000, // 00E3 MOVE R23 R16 + 0x58600005, // 00E4 LDCONST R24 K5 + 0x546600FE, // 00E5 LDINT R25 255 + 0x58680005, // 00E6 LDCONST R26 K5 + 0x5C6C0A00, // 00E7 MOVE R27 R5 + 0x7C540C00, // 00E8 CALL R21 6 + 0x5C402A00, // 00E9 MOVE R16 R21 + 0x545600FE, // 00EA LDINT R21 255 + 0x545A0017, // 00EB LDINT R22 24 + 0x38542A16, // 00EC SHL R21 R21 R22 + 0x545A000F, // 00ED LDINT R22 16 + 0x38581C16, // 00EE SHL R22 R14 R22 + 0x30542A16, // 00EF OR R21 R21 R22 + 0x545A0007, // 00F0 LDINT R22 8 + 0x38581E16, // 00F1 SHL R22 R15 R22 + 0x30542A16, // 00F2 OR R21 R21 R22 + 0x30542A10, // 00F3 OR R21 R21 R16 + 0x90023A15, // 00F4 SETMBR R0 K29 R21 + 0x80042A00, // 00F5 RET 1 R21 + }) + ) +); +/*******************************************************************/ + + /******************************************************************** ** Solidified class: RichPaletteColorProvider ********************************************************************/ @@ -4250,35 +4325,36 @@ extern const bclass be_class_ColorProvider; be_local_class(RichPaletteColorProvider, 5, &be_class_ColorProvider, - be_nested_map(18, + be_nested_map(19, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(value_arr, -1), be_const_var(1) }, - { be_const_key_weak(to_css_gradient, -1), be_const_closure(class_RichPaletteColorProvider_to_css_gradient_closure) }, - { be_const_key_weak(_parse_palette, -1), be_const_closure(class_RichPaletteColorProvider__parse_palette_closure) }, - { be_const_key_weak(_DEFAULT_PALETTE, 17), be_const_bytes_instance(00FF000024FFA50049FFFF006E00FF00920000FFB74B0082DBEE82EEFFFF0000) }, - { be_const_key_weak(slots_arr, -1), be_const_var(0) }, - { be_const_key_weak(_get_color_at_index, 2), be_const_closure(class_RichPaletteColorProvider__get_color_at_index_closure) }, - { be_const_key_weak(PARAMS, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(light_state, -1), be_const_var(4) }, + { be_const_key_weak(produce_value, -1), be_const_closure(class_RichPaletteColorProvider_produce_value_closure) }, + { be_const_key_weak(tostring, -1), be_const_closure(class_RichPaletteColorProvider_tostring_closure) }, + { be_const_key_weak(PARAMS, 9), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(6, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_weak(cycle_period, -1), be_const_bytes_instance(050000018813) }, { be_const_key_weak(range_min, 0), be_const_bytes_instance(040000) }, { be_const_key_weak(palette, -1), be_const_bytes_instance(0C0602) }, - { be_const_key_weak(transition_type, 1), be_const_bytes_instance(1400050200010005) }, + { be_const_key_weak(transition_type, 1), be_const_bytes_instance(1400010200010005) }, { be_const_key_weak(brightness, -1), be_const_bytes_instance(07000001FF0001FF00) }, { be_const_key_weak(range_max, -1), be_const_bytes_instance(0401FF00) }, })) ) } )) }, - { be_const_key_weak(tostring, 1), be_const_closure(class_RichPaletteColorProvider_tostring_closure) }, - { be_const_key_weak(get_color_for_value, -1), be_const_closure(class_RichPaletteColorProvider_get_color_for_value_closure) }, - { be_const_key_weak(light_state, -1), be_const_var(4) }, - { be_const_key_weak(current_color, -1), be_const_var(3) }, - { be_const_key_weak(start, 8), be_const_closure(class_RichPaletteColorProvider_start_closure) }, - { be_const_key_weak(slots, -1), be_const_var(2) }, - { be_const_key_weak(on_param_changed, 9), be_const_closure(class_RichPaletteColorProvider_on_param_changed_closure) }, + { be_const_key_weak(slots_arr, 15), be_const_var(0) }, + { be_const_key_weak(_parse_palette, -1), be_const_closure(class_RichPaletteColorProvider__parse_palette_closure) }, + { be_const_key_weak(get_color_for_value, 10), be_const_closure(class_RichPaletteColorProvider_get_color_for_value_closure) }, + { be_const_key_weak(_DEFAULT_PALETTE, -1), be_const_bytes_instance(00FF000024FFA50049FFFF006E00FF00920000FFB74B0082DBEE82EEFFFF0000) }, { be_const_key_weak(_recompute_palette, -1), be_const_closure(class_RichPaletteColorProvider__recompute_palette_closure) }, - { be_const_key_weak(init, 6), be_const_closure(class_RichPaletteColorProvider_init_closure) }, + { be_const_key_weak(start, -1), be_const_closure(class_RichPaletteColorProvider_start_closure) }, + { be_const_key_weak(current_color, -1), be_const_var(3) }, + { be_const_key_weak(to_css_gradient, -1), be_const_closure(class_RichPaletteColorProvider_to_css_gradient_closure) }, + { be_const_key_weak(slots, -1), be_const_var(2) }, + { be_const_key_weak(init, 12), be_const_closure(class_RichPaletteColorProvider_init_closure) }, + { be_const_key_weak(_get_color_at_index, -1), be_const_closure(class_RichPaletteColorProvider__get_color_at_index_closure) }, + { be_const_key_weak(value_arr, 5), be_const_var(1) }, { be_const_key_weak(_get_palette_bytes, -1), be_const_closure(class_RichPaletteColorProvider__get_palette_bytes_closure) }, - { be_const_key_weak(produce_value, -1), be_const_closure(class_RichPaletteColorProvider_produce_value_closure) }, + { be_const_key_weak(_interpolate, 1), be_const_closure(class_RichPaletteColorProvider__interpolate_closure) }, + { be_const_key_weak(on_param_changed, 0), be_const_closure(class_RichPaletteColorProvider_on_param_changed_closure) }, })), be_str_weak(RichPaletteColorProvider) ); diff --git a/lib/libesp32/berry_animation/src/solidify/solidified_animation_dsl.h b/lib/libesp32/berry_animation/src/solidify/solidified_animation_dsl.h index 40e6a0ce7..dc0b190a5 100644 --- a/lib/libesp32/berry_animation/src/solidify/solidified_animation_dsl.h +++ b/lib/libesp32/berry_animation/src/solidify/solidified_animation_dsl.h @@ -2237,30 +2237,197 @@ be_local_class(Token, be_str_weak(Token) ); -extern const bclass be_class_MockEngine; +extern const bclass be_class_WLED_Palettes; /******************************************************************** -** Solidified function: init +** Solidified class: WLED_Palettes ********************************************************************/ -be_local_closure(class_MockEngine_init, /* name */ +be_local_class(WLED_Palettes, + 0, + NULL, + be_nested_map(1, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(map, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + be_const_map( * be_nested_map(59, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(Red_X20_X26_X20Blue, 38), be_const_bytes_instance(00290E631F80184A3FE322325F841F4C7F2F1D669F6D2F65BFB04264DF813968FF54306C) }, + { be_const_key_weak(Red_X20Tide, -1), be_const_bytes_instance(00FB2E001CFF8B192BF69E3F3AF6D87B54F35E0A72B1410B8CFFF173A8B1410BC4FAE99ED8FF5E06FF7E0804) }, + { be_const_key_weak(C9_X202, 5), be_const_bytes_instance(00067E022D067E022E041E725A041E725BFF050087FF050088C43902B4C43902B5895502FF895502) }, + { be_const_key_weak(Aqua_X20Flash, -1), be_const_bytes_instance(000000004282F2F560FFFF357CFFFFFF99FFFF35BC82F2F5FF000000) }, + { be_const_key_weak(Icefire, -1), be_const_bytes_instance(000000003B003375770066FF952699FFB456CCFFD9A7E6FFFFFFFFFF) }, + { be_const_key_weak(Hult, 15), be_const_bytes_instance(00FBD8FC30FFC0FF59EF5FF1A03399D9D818B8AEFF18B8AE) }, + { be_const_key_weak(Yelmag, 47), be_const_bytes_instance(000000002A71000054FF00007FFF0075AAFF00FFD4FF8075FFFFFF00) }, + { be_const_key_weak(Red_X20Flash, -1), be_const_bytes_instance(0000000063F20C0882FDE4A39BF20C08FF000000) }, + { be_const_key_weak(Beech, -1), be_const_bytes_instance(00FFFEEC0CFFFEEC16FFFEEC1ADFE0B21CC0C37C1CB0FFE7327BFBEC474AF6F15D21E1E47800CCD78504A8B2880A848F8833BDD4D0179FC9FF0081BE) }, + { be_const_key_weak(Landscape, -1), be_const_bytes_instance(00000000251F59134C48B22B7F96EB0580BAEA7782DEE9FC99C5DBE7CC84B3FDFF1C6BE1) }, + { be_const_key_weak(Rewhi, -1), be_const_bytes_instance(00B1A0C748CD9E9559E99B656BFF5F3F8DC0626DFF84659F) }, + { be_const_key_weak(C9_X20New, -1), be_const_bytes_instance(00FF05003CFF05003DC4390278C4390279067E02B4067E02B5041E72FF041E72) }, + { be_const_key_weak(Jul, 37), be_const_bytes_instance(00E2060C5E1A604E8482BD5EFFB10309) }, + { be_const_key_weak(Cyane, -1), be_const_bytes_instance(003D9B2C195FAE4D3C84C1715D9AA67D6AAF8A886DB7798971C2688A74E1B3A57CFFFFC0A8A7DACBFF54B6D7) }, + { be_const_key_weak(C9, -1), be_const_bytes_instance(00B804003CB8040041902C027D902C0282046002BE046002C3070758FF070758) }, + { be_const_key_weak(Light_X20Pink, -1), be_const_bytes_instance(004F206D195A28753366307C4C8D87B966B4DEF86DD0ECFC72EDFAFF7ACEC8EF95B195DEB7BB82CBFFC66FB8) }, + { be_const_key_weak(Lite_X20Light, -1), be_const_bytes_instance(0000000009141516282E2B31422E2B31653D1041FF000000) }, + { be_const_key_weak(Orange_X20_X26_X20Teal, 50), be_const_bytes_instance(0000965C3700965CC8FF4800FFFF4800) }, + { be_const_key_weak(Sunset2, -1), be_const_bytes_instance(00AF793E1D80673C4454543A44F8B83761EFCC5D7CE6E185B2667D81FF001A7D) }, + { be_const_key_weak(Toxy_X20Reaf, 9), be_const_bytes_instance(0002EF7EFF9123D9) }, + { be_const_key_weak(Aurora_X202, -1), be_const_bytes_instance(0011B10D4079F2058019AD79C0FA4D7FFFAB65DD) }, + { be_const_key_weak(Vintage, 44), be_const_bytes_instance(00291218334900164CA5AA2665FFBD507F8B382899490016E5291218FF291218) }, + { be_const_key_weak(Fire, 3), be_const_bytes_instance(000000002E4D000060B100006CC4260977D74C1392EB731DAEFF9929BCFFB229CAFFCC29DAFFE629EAFFFF29F4FFFF8FFFFFFFFF) }, + { be_const_key_weak(Rivendell, 29), be_const_bytes_instance(0018452C65496946A5818C61F2C8CCA6FFC8CCA6) }, + { be_const_key_weak(Blink_X20Red, -1), be_const_bytes_instance(000407042B28193E4C3D0F246DCF27607FFF9CB8A5B949CFCC6942F0FF4D1D4E) }, + { be_const_key_weak(Magred, -1), be_const_bytes_instance(000000003F7100757FFF00FFBFFF0075FFFF0000) }, + { be_const_key_weak(Semi_X20Blue, -1), be_const_bytes_instance(000000000C18042635370854502B309F771F59ED91323BA6BA471E62E91F0F2DFF000000) }, + { be_const_key_weak(Analogous, 39), be_const_bytes_instance(002600FF3F5600FF7F8B00FFBFC40075FFFF0000) }, + { be_const_key_weak(Sakura, 20), be_const_bytes_instance(00C4130A41FF452D82DF2D48C3FF5267FFDF0D11) }, + { be_const_key_weak(Pastel, -1), be_const_bytes_instance(003D87B82481BCA957CBF19B64E4ED8D6BFFE87F73FBCA8278F8AC8580FBCA82B4FFE87FDFFFF278FFFFFC71) }, + { be_const_key_weak(Candy2, -1), be_const_bytes_instance(006D6666192A31473079605449F1D61A59D8682C822A3147A3FFB12FBAF1D61AD36D6666FF14130D) }, + { be_const_key_weak(Red_X20Reaf, -1), be_const_bytes_instance(002444726895C3F8BCFF0000FF5E0E09) }, + { be_const_key_weak(Red_X20Shift, 40), be_const_bytes_instance(0062165D2D67164963C02D3884EBBB3BAFE4551AC9E43830FF020002) }, + { be_const_key_weak(Grintage, -1), be_const_bytes_instance(001D0803354C0100688E601C99D3BF3DFF75812A) }, + { be_const_key_weak(Pink_X20Candy, 14), be_const_bytes_instance(00FFFFFF2D3240FF70F210BA8CFFFFFF9BF210BAC4740DA6FFFFFFFF) }, + { be_const_key_weak(Temperature, 12), be_const_bytes_instance(00145CAB0E0F6FBA1C068ED32A02A1E33810B5EF4626BCC95456CCC8638BDBB071B6E57D7FC4E63F8DF1F0169BFEDE1EAAFBC704B8F79D09C6F3720FE2D51E1DF0972623FF972623) }, + { be_const_key_weak(Departure, -1), be_const_bytes_instance(003522002A5633003F936C3154D4A66C6AEBD4B474FFFFFF8ABFFFC19454FF58AA00FF00BF00C000D4008000FF008000) }, + { be_const_key_weak(Candy, -1), be_const_bytes_instance(00F3F2170FF2A8268E6F1597C64A1696FF000075) }, + { be_const_key_weak(Retro_X20Clown, 46), be_const_bytes_instance(00F2A82675E24E50FFA136E1) }, + { be_const_key_weak(Beach, 26), be_const_bytes_instance(000C2D001365560226CF80043FF3C512426DC492FF052707) }, + { be_const_key_weak(Sunset, -1), be_const_bytes_instance(00B5000016DA550033FFAA0055D3554D87A700A9C64900BCFF0000CF) }, + { be_const_key_weak(Yelblu, -1), be_const_bytes_instance(000000FF3F0080FF7F00FFFFBF71FF75FFFFFF00) }, + { be_const_key_weak(Atlantica, -1), be_const_bytes_instance(00001C70322060FF6400F32D960C5F52C819BE5FFF28AA50) }, + { be_const_key_weak(Sherbet, -1), be_const_bytes_instance(00FF66292BFF8C5A56FF335A7FFF99A9AAFFFFF9D171FF55FF9DFF89) }, + { be_const_key_weak(Orangery, -1), be_const_bytes_instance(00FF5F171EFF52003CDF0D085A902C0278FF6E1196FF4500B49E0D0BD2F15211FFD52504) }, + { be_const_key_weak(Yellowout, -1), be_const_bytes_instance(00DEBF08FF753401) }, + { be_const_key_weak(April_X20Night, -1), be_const_bytes_instance(0001052D0A01052D1905A9AF2801052D3D01052D4C2DAF1F5B01052D7001052D7FF996058F01052DA201052DB2FF5C00C101052DD601052DE5DF2D48F401052DFF01052D) }, + { be_const_key_weak(Aurora, -1), be_const_bytes_instance(0001052D4000C8178000FF00AA00F32DC8008707FF01052D) }, + { be_const_key_weak(Magenta, 28), be_const_bytes_instance(000000002A000075540000FF7F7100FFAAFF00FFD4FF80FFFFFFFFFF) }, + { be_const_key_weak(Autumn, 18), be_const_bytes_instance(005A0E05338B290D54B4461168C0CA7D70B189037ABEC8837CC0CA7C87B189038EC2CB76A3B14411CC80230CF94A0502FF4A0502) }, + { be_const_key_weak(Drywet, -1), be_const_bytes_instance(007761212AEBC75854A9EE7C7F25EEE8AA0778ECD41B01AFFF043365) }, + { be_const_key_weak(Hult64, -1), be_const_bytes_instance(0018B8AE4208A296687C890782B2BA16967C8907C9069C90EF008075FF008075) }, + { be_const_key_weak(Yelblu_X20Hot, -1), be_const_bytes_instance(002B1E393A4900777A57004A9EC53916B7DA751BDBEFB120FFF6F71B) }, + { be_const_key_weak(Traffic_X20Light, 13), be_const_bytes_instance(000000005500FF00AAFFFF00FFFF0000) }, + { be_const_key_weak(Splash, 34), be_const_bytes_instance(00BA3FFF7FE30955AFEACDD5DDCD26B0FFCD26B0) }, + { be_const_key_weak(Breeze, -1), be_const_bytes_instance(00103033591BA6AF99C5E9FFFF009198) }, + { be_const_key_weak(Tertiary, -1), be_const_bytes_instance(000019FF3F268C757F56FF00BFA78C13FFFF1929) }, + { be_const_key_weak(Tiamat, 27), be_const_bytes_instance(0001020E21020523640D875C782BFFC18CF707F9A0C111D0B427FF9AC804D5ECDC27FC87F0C1D5FDFFFFF9FF) }, + { be_const_key_weak(Fairy_X20Reaf, 31), be_const_bytes_instance(00DC13BBA00CE1DBDBCBF2DFFFFFFFFF) }, + })) ) } )) }, + })), + be_str_weak(WLED_Palettes) +); + +/******************************************************************** +** Solidified function: compile_file +********************************************************************/ +be_local_closure(compile_file, /* name */ be_nested_proto( - 1, /* nstack */ + 13, /* nstack */ 1, /* argc */ - 2, /* varg */ + 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[ 2]) { /* constants */ - /* K0 */ be_nested_str_weak(time_ms), - /* K1 */ be_const_int(0), + ( &(const bvalue[25]) { /* constants */ + /* K0 */ be_nested_str_weak(string), + /* K1 */ be_nested_str_weak(animation_dsl), + /* K2 */ be_nested_str_weak(endswith), + /* K3 */ be_nested_str_weak(_X2Eanim), + /* K4 */ be_nested_str_weak(Input_X20file_X20must_X20have_X20_X2Eanim_X20extension_X3A_X20_X25s), + /* K5 */ be_nested_str_weak(invalid_filename), + /* K6 */ be_const_int(0), + /* K7 */ be_nested_str_weak(_X2Ebe), + /* K8 */ be_nested_str_weak(r), + /* K9 */ be_nested_str_weak(Cannot_X20open_X20input_X20file_X3A_X20_X25s), + /* K10 */ be_nested_str_weak(io_error), + /* K11 */ be_nested_str_weak(read), + /* K12 */ be_nested_str_weak(close), + /* K13 */ be_nested_str_weak(compile), + /* K14 */ be_nested_str_weak(DSL_X20compilation_X20failed_X20for_X3A_X20_X25s), + /* K15 */ be_nested_str_weak(dsl_compilation_error), + /* K16 */ be_nested_str_weak(_X23_X20Generated_X20Berry_X20code_X20from_X20Animation_X20DSL_X0A), + /* K17 */ be_nested_str_weak(_X23_X20Source_X3A_X20_X25s_X0A), + /* K18 */ be_nested_str_weak(_X23_X20Generated_X20automatically_X20by_X20animation_dsl_X2Ecompile_file_X28_X29_X0A), + /* K19 */ be_nested_str_weak(_X23_X20_X0A), + /* K20 */ be_nested_str_weak(_X23_X20Do_X20not_X20edit_X20manually_X20_X2D_X20changes_X20will_X20be_X20overwritten_X0A), + /* K21 */ be_nested_str_weak(_X0A), + /* K22 */ be_nested_str_weak(w), + /* K23 */ be_nested_str_weak(Cannot_X20create_X20output_X20file_X3A_X20_X25s), + /* K24 */ be_nested_str_weak(write), }), - be_str_weak(init), + be_str_weak(compile_file), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x90020101, // 0000 SETMBR R0 K0 K1 - 0x80000000, // 0001 RET 0 + ( &(const binstruction[71]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0xA40A0200, // 0001 IMPORT R2 K1 + 0x8C0C0302, // 0002 GETMET R3 R1 K2 + 0x5C140000, // 0003 MOVE R5 R0 + 0x58180003, // 0004 LDCONST R6 K3 + 0x7C0C0600, // 0005 CALL R3 3 + 0x740E0004, // 0006 JMPT R3 #000C + 0x600C0018, // 0007 GETGBL R3 G24 + 0x58100004, // 0008 LDCONST R4 K4 + 0x5C140000, // 0009 MOVE R5 R0 + 0x7C0C0400, // 000A CALL R3 2 + 0xB0060A03, // 000B RAISE 1 K5 R3 + 0x540DFFF9, // 000C LDINT R3 -6 + 0x400E0C03, // 000D CONNECT R3 K6 R3 + 0x940C0003, // 000E GETIDX R3 R0 R3 + 0x00100707, // 000F ADD R4 R3 K7 + 0x60140011, // 0010 GETGBL R5 G17 + 0x5C180000, // 0011 MOVE R6 R0 + 0x581C0008, // 0012 LDCONST R7 K8 + 0x7C140400, // 0013 CALL R5 2 + 0x4C180000, // 0014 LDNIL R6 + 0x1C180A06, // 0015 EQ R6 R5 R6 + 0x781A0004, // 0016 JMPF R6 #001C + 0x60180018, // 0017 GETGBL R6 G24 + 0x581C0009, // 0018 LDCONST R7 K9 + 0x5C200000, // 0019 MOVE R8 R0 + 0x7C180400, // 001A CALL R6 2 + 0xB0061406, // 001B RAISE 1 K10 R6 + 0x8C180B0B, // 001C GETMET R6 R5 K11 + 0x7C180200, // 001D CALL R6 1 + 0x8C1C0B0C, // 001E GETMET R7 R5 K12 + 0x7C1C0200, // 001F CALL R7 1 + 0x8C1C050D, // 0020 GETMET R7 R2 K13 + 0x5C240C00, // 0021 MOVE R9 R6 + 0x7C1C0400, // 0022 CALL R7 2 + 0x4C200000, // 0023 LDNIL R8 + 0x1C200E08, // 0024 EQ R8 R7 R8 + 0x78220004, // 0025 JMPF R8 #002B + 0x60200018, // 0026 GETGBL R8 G24 + 0x5824000E, // 0027 LDCONST R9 K14 + 0x5C280000, // 0028 MOVE R10 R0 + 0x7C200400, // 0029 CALL R8 2 + 0xB0061E08, // 002A RAISE 1 K15 R8 + 0x60200018, // 002B GETGBL R8 G24 + 0x58240011, // 002C LDCONST R9 K17 + 0x5C280000, // 002D MOVE R10 R0 + 0x7C200400, // 002E CALL R8 2 + 0x00222008, // 002F ADD R8 K16 R8 + 0x00201112, // 0030 ADD R8 R8 K18 + 0x00201113, // 0031 ADD R8 R8 K19 + 0x00201114, // 0032 ADD R8 R8 K20 + 0x00201115, // 0033 ADD R8 R8 K21 + 0x60240011, // 0034 GETGBL R9 G17 + 0x5C280800, // 0035 MOVE R10 R4 + 0x582C0016, // 0036 LDCONST R11 K22 + 0x7C240400, // 0037 CALL R9 2 + 0x4C280000, // 0038 LDNIL R10 + 0x1C28120A, // 0039 EQ R10 R9 R10 + 0x782A0004, // 003A JMPF R10 #0040 + 0x60280018, // 003B GETGBL R10 G24 + 0x582C0017, // 003C LDCONST R11 K23 + 0x5C300800, // 003D MOVE R12 R4 + 0x7C280400, // 003E CALL R10 2 + 0xB006140A, // 003F RAISE 1 K10 R10 + 0x8C281318, // 0040 GETMET R10 R9 K24 + 0x00301007, // 0041 ADD R12 R8 R7 + 0x7C280400, // 0042 CALL R10 2 + 0x8C28130C, // 0043 GETMET R10 R9 K12 + 0x7C280200, // 0044 CALL R10 1 + 0x50280200, // 0045 LDBOOL R10 1 0 + 0x80041400, // 0046 RET 1 R10 }) ) ); @@ -2268,45 +2435,52 @@ be_local_closure(class_MockEngine_init, /* name */ /******************************************************************** -** Solidified function: get_strip_length +** Solidified function: is_keyword ********************************************************************/ -be_local_closure(class_MockEngine_get_strip_length, /* name */ +be_local_closure(is_keyword, /* name */ be_nested_proto( - 2, /* nstack */ + 5, /* nstack */ 1, /* argc */ - 2, /* varg */ + 0, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ - 0, /* has constants */ - NULL, /* no const */ - be_str_weak(get_strip_length), + 1, /* has constants */ + ( &(const bvalue[ 4]) { /* constants */ + /* K0 */ be_nested_str_weak(animation_dsl), + /* K1 */ be_nested_str_weak(Token), + /* K2 */ be_nested_str_weak(keywords), + /* K3 */ be_nested_str_weak(stop_iteration), + }), + be_str_weak(is_keyword), &be_const_str_solidified, - ( &(const binstruction[ 2]) { /* code */ - 0x5406001D, // 0000 LDINT R1 30 - 0x80040200, // 0001 RET 1 R1 + ( &(const binstruction[19]) { /* code */ + 0xA4060000, // 0000 IMPORT R1 K0 + 0x60080010, // 0001 GETGBL R2 G16 + 0x880C0301, // 0002 GETMBR R3 R1 K1 + 0x880C0702, // 0003 GETMBR R3 R3 K2 + 0x7C080200, // 0004 CALL R2 1 + 0xA8020007, // 0005 EXBLK 0 #000E + 0x5C0C0400, // 0006 MOVE R3 R2 + 0x7C0C0000, // 0007 CALL R3 0 + 0x1C100003, // 0008 EQ R4 R0 R3 + 0x78120002, // 0009 JMPF R4 #000D + 0x50100200, // 000A LDBOOL R4 1 0 + 0xA8040001, // 000B EXBLK 1 1 + 0x80040800, // 000C RET 1 R4 + 0x7001FFF7, // 000D JMP #0006 + 0x58080003, // 000E LDCONST R2 K3 + 0xAC080200, // 000F CATCH R2 1 0 + 0xB0080000, // 0010 RAISE 2 R0 R0 + 0x50080000, // 0011 LDBOOL R2 0 0 + 0x80040400, // 0012 RET 1 R2 }) ) ); /*******************************************************************/ -/******************************************************************** -** Solidified class: MockEngine -********************************************************************/ -be_local_class(MockEngine, - 1, - NULL, - be_nested_map(3, - ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(time_ms, 1), be_const_var(0) }, - { be_const_key_weak(init, -1), be_const_closure(class_MockEngine_init_closure) }, - { be_const_key_weak(get_strip_length, -1), be_const_closure(class_MockEngine_get_strip_length_closure) }, - })), - be_str_weak(MockEngine) -); - /******************************************************************** ** Solidified function: compile_dsl_source ********************************************************************/ @@ -3542,53 +3716,6 @@ be_local_class(SymbolTable, })), be_str_weak(SymbolTable) ); - -/******************************************************************** -** Solidified function: is_keyword -********************************************************************/ -be_local_closure(is_keyword, /* name */ - be_nested_proto( - 5, /* nstack */ - 1, /* argc */ - 0, /* varg */ - 0, /* has upvals */ - NULL, /* no upvals */ - 0, /* has sup protos */ - NULL, /* no sub protos */ - 1, /* has constants */ - ( &(const bvalue[ 4]) { /* constants */ - /* K0 */ be_nested_str_weak(animation_dsl), - /* K1 */ be_nested_str_weak(Token), - /* K2 */ be_nested_str_weak(keywords), - /* K3 */ be_nested_str_weak(stop_iteration), - }), - be_str_weak(is_keyword), - &be_const_str_solidified, - ( &(const binstruction[19]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0x60080010, // 0001 GETGBL R2 G16 - 0x880C0301, // 0002 GETMBR R3 R1 K1 - 0x880C0702, // 0003 GETMBR R3 R3 K2 - 0x7C080200, // 0004 CALL R2 1 - 0xA8020007, // 0005 EXBLK 0 #000E - 0x5C0C0400, // 0006 MOVE R3 R2 - 0x7C0C0000, // 0007 CALL R3 0 - 0x1C100003, // 0008 EQ R4 R0 R3 - 0x78120002, // 0009 JMPF R4 #000D - 0x50100200, // 000A LDBOOL R4 1 0 - 0xA8040001, // 000B EXBLK 1 1 - 0x80040800, // 000C RET 1 R4 - 0x7001FFF7, // 000D JMP #0006 - 0x58080003, // 000E LDCONST R2 K3 - 0xAC080200, // 000F CATCH R2 1 0 - 0xB0080000, // 0010 RAISE 2 R0 R0 - 0x50080000, // 0011 LDBOOL R2 0 0 - 0x80040400, // 0012 RET 1 R2 - }) - ) -); -/*******************************************************************/ - // compact class 'Lexer' ktab size: 109, total: 288 (saved 1432 bytes) static const bvalue be_ktab_class_Lexer[109] = { /* K0 */ be_nested_str_weak(position), @@ -5849,125 +5976,75 @@ be_local_closure(load_file, /* name */ /*******************************************************************/ +extern const bclass be_class_MockEngine; + /******************************************************************** -** Solidified function: compile_file +** Solidified function: init ********************************************************************/ -be_local_closure(compile_file, /* name */ +be_local_closure(class_MockEngine_init, /* name */ be_nested_proto( - 13, /* nstack */ + 1, /* nstack */ 1, /* argc */ - 0, /* varg */ + 2, /* varg */ 0, /* has upvals */ NULL, /* no upvals */ 0, /* has sup protos */ NULL, /* no sub protos */ 1, /* has constants */ - ( &(const bvalue[25]) { /* constants */ - /* K0 */ be_nested_str_weak(string), - /* K1 */ be_nested_str_weak(animation_dsl), - /* K2 */ be_nested_str_weak(endswith), - /* K3 */ be_nested_str_weak(_X2Eanim), - /* K4 */ be_nested_str_weak(Input_X20file_X20must_X20have_X20_X2Eanim_X20extension_X3A_X20_X25s), - /* K5 */ be_nested_str_weak(invalid_filename), - /* K6 */ be_const_int(0), - /* K7 */ be_nested_str_weak(_X2Ebe), - /* K8 */ be_nested_str_weak(r), - /* K9 */ be_nested_str_weak(Cannot_X20open_X20input_X20file_X3A_X20_X25s), - /* K10 */ be_nested_str_weak(io_error), - /* K11 */ be_nested_str_weak(read), - /* K12 */ be_nested_str_weak(close), - /* K13 */ be_nested_str_weak(compile), - /* K14 */ be_nested_str_weak(DSL_X20compilation_X20failed_X20for_X3A_X20_X25s), - /* K15 */ be_nested_str_weak(dsl_compilation_error), - /* K16 */ be_nested_str_weak(_X23_X20Generated_X20Berry_X20code_X20from_X20Animation_X20DSL_X0A), - /* K17 */ be_nested_str_weak(_X23_X20Source_X3A_X20_X25s_X0A), - /* K18 */ be_nested_str_weak(_X23_X20Generated_X20automatically_X20by_X20animation_dsl_X2Ecompile_file_X28_X29_X0A), - /* K19 */ be_nested_str_weak(_X23_X20_X0A), - /* K20 */ be_nested_str_weak(_X23_X20Do_X20not_X20edit_X20manually_X20_X2D_X20changes_X20will_X20be_X20overwritten_X0A), - /* K21 */ be_nested_str_weak(_X0A), - /* K22 */ be_nested_str_weak(w), - /* K23 */ be_nested_str_weak(Cannot_X20create_X20output_X20file_X3A_X20_X25s), - /* K24 */ be_nested_str_weak(write), + ( &(const bvalue[ 2]) { /* constants */ + /* K0 */ be_nested_str_weak(time_ms), + /* K1 */ be_const_int(0), }), - be_str_weak(compile_file), + be_str_weak(init), &be_const_str_solidified, - ( &(const binstruction[71]) { /* code */ - 0xA4060000, // 0000 IMPORT R1 K0 - 0xA40A0200, // 0001 IMPORT R2 K1 - 0x8C0C0302, // 0002 GETMET R3 R1 K2 - 0x5C140000, // 0003 MOVE R5 R0 - 0x58180003, // 0004 LDCONST R6 K3 - 0x7C0C0600, // 0005 CALL R3 3 - 0x740E0004, // 0006 JMPT R3 #000C - 0x600C0018, // 0007 GETGBL R3 G24 - 0x58100004, // 0008 LDCONST R4 K4 - 0x5C140000, // 0009 MOVE R5 R0 - 0x7C0C0400, // 000A CALL R3 2 - 0xB0060A03, // 000B RAISE 1 K5 R3 - 0x540DFFF9, // 000C LDINT R3 -6 - 0x400E0C03, // 000D CONNECT R3 K6 R3 - 0x940C0003, // 000E GETIDX R3 R0 R3 - 0x00100707, // 000F ADD R4 R3 K7 - 0x60140011, // 0010 GETGBL R5 G17 - 0x5C180000, // 0011 MOVE R6 R0 - 0x581C0008, // 0012 LDCONST R7 K8 - 0x7C140400, // 0013 CALL R5 2 - 0x4C180000, // 0014 LDNIL R6 - 0x1C180A06, // 0015 EQ R6 R5 R6 - 0x781A0004, // 0016 JMPF R6 #001C - 0x60180018, // 0017 GETGBL R6 G24 - 0x581C0009, // 0018 LDCONST R7 K9 - 0x5C200000, // 0019 MOVE R8 R0 - 0x7C180400, // 001A CALL R6 2 - 0xB0061406, // 001B RAISE 1 K10 R6 - 0x8C180B0B, // 001C GETMET R6 R5 K11 - 0x7C180200, // 001D CALL R6 1 - 0x8C1C0B0C, // 001E GETMET R7 R5 K12 - 0x7C1C0200, // 001F CALL R7 1 - 0x8C1C050D, // 0020 GETMET R7 R2 K13 - 0x5C240C00, // 0021 MOVE R9 R6 - 0x7C1C0400, // 0022 CALL R7 2 - 0x4C200000, // 0023 LDNIL R8 - 0x1C200E08, // 0024 EQ R8 R7 R8 - 0x78220004, // 0025 JMPF R8 #002B - 0x60200018, // 0026 GETGBL R8 G24 - 0x5824000E, // 0027 LDCONST R9 K14 - 0x5C280000, // 0028 MOVE R10 R0 - 0x7C200400, // 0029 CALL R8 2 - 0xB0061E08, // 002A RAISE 1 K15 R8 - 0x60200018, // 002B GETGBL R8 G24 - 0x58240011, // 002C LDCONST R9 K17 - 0x5C280000, // 002D MOVE R10 R0 - 0x7C200400, // 002E CALL R8 2 - 0x00222008, // 002F ADD R8 K16 R8 - 0x00201112, // 0030 ADD R8 R8 K18 - 0x00201113, // 0031 ADD R8 R8 K19 - 0x00201114, // 0032 ADD R8 R8 K20 - 0x00201115, // 0033 ADD R8 R8 K21 - 0x60240011, // 0034 GETGBL R9 G17 - 0x5C280800, // 0035 MOVE R10 R4 - 0x582C0016, // 0036 LDCONST R11 K22 - 0x7C240400, // 0037 CALL R9 2 - 0x4C280000, // 0038 LDNIL R10 - 0x1C28120A, // 0039 EQ R10 R9 R10 - 0x782A0004, // 003A JMPF R10 #0040 - 0x60280018, // 003B GETGBL R10 G24 - 0x582C0017, // 003C LDCONST R11 K23 - 0x5C300800, // 003D MOVE R12 R4 - 0x7C280400, // 003E CALL R10 2 - 0xB006140A, // 003F RAISE 1 K10 R10 - 0x8C281318, // 0040 GETMET R10 R9 K24 - 0x00301007, // 0041 ADD R12 R8 R7 - 0x7C280400, // 0042 CALL R10 2 - 0x8C28130C, // 0043 GETMET R10 R9 K12 - 0x7C280200, // 0044 CALL R10 1 - 0x50280200, // 0045 LDBOOL R10 1 0 - 0x80041400, // 0046 RET 1 R10 + ( &(const binstruction[ 2]) { /* code */ + 0x90020101, // 0000 SETMBR R0 K0 K1 + 0x80000000, // 0001 RET 0 }) ) ); /*******************************************************************/ + +/******************************************************************** +** Solidified function: get_strip_length +********************************************************************/ +be_local_closure(class_MockEngine_get_strip_length, /* name */ + be_nested_proto( + 2, /* nstack */ + 1, /* argc */ + 2, /* varg */ + 0, /* has upvals */ + NULL, /* no upvals */ + 0, /* has sup protos */ + NULL, /* no sub protos */ + 0, /* has constants */ + NULL, /* no const */ + be_str_weak(get_strip_length), + &be_const_str_solidified, + ( &(const binstruction[ 2]) { /* code */ + 0x5406001D, // 0000 LDINT R1 30 + 0x80040200, // 0001 RET 1 R1 + }) + ) +); +/*******************************************************************/ + + +/******************************************************************** +** Solidified class: MockEngine +********************************************************************/ +be_local_class(MockEngine, + 1, + NULL, + be_nested_map(3, + ( (struct bmapnode*) &(const bmapnode[]) { + { be_const_key_weak(time_ms, 1), be_const_var(0) }, + { be_const_key_weak(init, -1), be_const_closure(class_MockEngine_init_closure) }, + { be_const_key_weak(get_strip_length, -1), be_const_closure(class_MockEngine_get_strip_length_closure) }, + })), + be_str_weak(MockEngine) +); // ktab too big for class 'SimpleDSLTranspiler' - skipping extern const bclass be_class_SimpleDSLTranspiler; @@ -16076,17 +16153,22 @@ be_local_class(AnimationWebUI, ********************************************************************/ be_local_module(animation_dsl, "animation_dsl", - be_nested_map(17, + be_nested_map(18, ( (struct bmapnode*) &(const bmapnode[]) { - { be_const_key_weak(animation_web_ui, -1), be_const_class(be_class_AnimationWebUI) }, - { be_const_key_weak(MockEngine, 14), be_const_class(be_class_MockEngine) }, - { be_const_key_weak(compile_dsl, -1), be_const_closure(compile_dsl_closure) }, - { be_const_key_weak(is_keyword, -1), be_const_closure(is_keyword_closure) }, - { be_const_key_weak(Token, -1), be_const_class(be_class_Token) }, { be_const_key_weak(create_lexer, -1), be_const_class(be_class_Lexer) }, + { be_const_key_weak(animation_web_ui, -1), be_const_class(be_class_AnimationWebUI) }, + { be_const_key_weak(SimpleDSLTranspiler, -1), be_const_class(be_class_SimpleDSLTranspiler) }, + { be_const_key_weak(compile_dsl, 8), be_const_closure(compile_dsl_closure) }, + { be_const_key_weak(Token, -1), be_const_class(be_class_Token) }, + { be_const_key_weak(VERSION, -1), be_const_int(65536) }, { be_const_key_weak(compile, -1), be_const_closure(compile_dsl_source_closure) }, - { be_const_key_weak(compile_file, 9), be_const_closure(compile_file_closure) }, - { be_const_key_weak(named_colors, -1), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { + { be_const_key_weak(_symbol_table, 1), be_const_class(be_class_SymbolTable) }, + { be_const_key_weak(execute, -1), be_const_closure(execute_closure) }, + { be_const_key_weak(MockEngine, -1), be_const_class(be_class_MockEngine) }, + { be_const_key_weak(wled_palettes, 3), be_const_class(be_class_WLED_Palettes) }, + { be_const_key_weak(compile_file, 16), be_const_closure(compile_file_closure) }, + { be_const_key_weak(is_color_name, -1), be_const_closure(is_color_name_closure) }, + { be_const_key_weak(named_colors, 5), be_const_simple_instance(be_nested_simple_instance(&be_class_map, { be_const_map( * be_nested_map(37, ( (struct bmapnode*) &(const bmapnode[]) { { be_const_key_weak(brown, -1), be_const_int(-5952982) }, @@ -16128,13 +16210,9 @@ be_local_module(animation_dsl, { be_const_key_weak(maroon, -1), be_const_int(-8388608) }, })) ) } )) }, { be_const_key_weak(load_file, -1), be_const_closure(load_file_closure) }, - { be_const_key_weak(_symbol_entry, 6), be_const_class(be_class_SymbolEntry) }, - { be_const_key_weak(is_color_name, 7), be_const_closure(is_color_name_closure) }, - { be_const_key_weak(execute, 0), be_const_closure(execute_closure) }, { be_const_key_weak(init, -1), be_const_closure(animation_dsl_init_closure) }, - { be_const_key_weak(VERSION, -1), be_const_int(65536) }, - { be_const_key_weak(_symbol_table, 13), be_const_class(be_class_SymbolTable) }, - { be_const_key_weak(SimpleDSLTranspiler, -1), be_const_class(be_class_SimpleDSLTranspiler) }, + { be_const_key_weak(is_keyword, -1), be_const_closure(is_keyword_closure) }, + { be_const_key_weak(_symbol_entry, 12), be_const_class(be_class_SymbolEntry) }, })) ); BE_EXPORT_VARIABLE be_define_const_native_module(animation_dsl); diff --git a/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be b/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be index 6880d604f..09921ec99 100644 --- a/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be +++ b/lib/libesp32/berry_animation/src/tests/rich_palette_animation_test.be @@ -44,8 +44,13 @@ class RichPaletteAnimationTest self.test_palette_properties() self.test_css_gradient() self.test_cycle_period_zero() + self.test_sine_mode() + self.test_sine_mode_value_based() print(f"animation.solid with RichPaletteColorProvider Tests: {self.passed} passed, {self.failed} failed") + if self.failed > 0 + raise "test_failed" + end end def assert_equal(actual, expected, test_name) @@ -85,7 +90,7 @@ class RichPaletteAnimationTest var custom_provider = animation.rich_palette(mock_engine) custom_provider.palette = custom_palette custom_provider.cycle_period = 2000 - custom_provider.transition_type = animation.LINEAR + custom_provider.transition_type = animation.SINE custom_provider.brightness = 128 var anim2 = animation.solid(mock_engine) @@ -97,7 +102,7 @@ class RichPaletteAnimationTest # Check provider properties directly on the provider object self.assert_equal(custom_provider.cycle_period, 2000, "Custom cycle period is 2000ms") - self.assert_equal(custom_provider.transition_type, animation.LINEAR, "Custom transition type is linear") + self.assert_equal(custom_provider.transition_type, animation.SINE, "Custom transition type is sine") self.assert_equal(custom_provider.brightness, 128, "Custom brightness is 128") end @@ -157,7 +162,6 @@ class RichPaletteAnimationTest # Test the rainbow factory method var provider = animation.rich_palette_rainbow(mock_engine) provider.cycle_period = 5000 - provider.transition_type = animation.SINE # sine provider.brightness = 255 var anim = animation.solid(mock_engine) @@ -171,7 +175,7 @@ class RichPaletteAnimationTest # Check provider properties directly on the provider object self.assert_equal(provider.cycle_period, 5000, "Cycle period is 5000ms") - self.assert_equal(provider.transition_type, animation.SINE, "Transition type is sine") + self.assert_equal(provider.transition_type, animation.LINEAR, "Default transition type is linear") self.assert_equal(provider.brightness, 255, "Brightness is 255") # Check animation properties @@ -278,6 +282,107 @@ class RichPaletteAnimationTest # Note: Colors may be the same depending on palette resolution, so just check they're valid self.assert_equal(time_color_0 != 0, true, "Time-based color at 0 is valid") end + + def test_sine_mode() + # Test SINE mode for smooth ease-in/ease-out transitions + var palette = bytes("00FF0000" "FF0000FF") # Red at 0, Blue at 255 + + # Create LINEAR provider + var provider_linear = animation.rich_palette(mock_engine) + provider_linear.palette = palette + provider_linear.cycle_period = 1000 + provider_linear.transition_type = animation.LINEAR + provider_linear.brightness = 255 + provider_linear.start(0) + + # Create SINE provider + var provider_sine = animation.rich_palette(mock_engine) + provider_sine.palette = palette + provider_sine.cycle_period = 1000 + provider_sine.transition_type = animation.SINE + provider_sine.brightness = 255 + provider_sine.start(0) + + # Test that transition_type is set correctly + self.assert_equal(provider_linear.transition_type, animation.LINEAR, "LINEAR mode is set") + self.assert_equal(provider_sine.transition_type, animation.SINE, "SINE mode is set") + + # Test at 0% - should be identical (Red) + var linear_0 = provider_linear.produce_value("color", 0) + var sine_0 = provider_sine.produce_value("color", 0) + self.assert_equal(linear_0, sine_0, "LINEAR and SINE identical at 0%") + + # Test at 10% - SINE should have less blue (slower start) + var linear_100 = provider_linear.produce_value("color", 100) + var sine_100 = provider_sine.produce_value("color", 100) + var linear_blue_100 = linear_100 & 0xFF + var sine_blue_100 = sine_100 & 0xFF + + self.assert_equal(linear_blue_100 > sine_blue_100, true, "SINE slower than LINEAR at 10%") + + # Test at 25% - SINE should still be slower + var linear_250 = provider_linear.produce_value("color", 250) + var sine_250 = provider_sine.produce_value("color", 250) + var linear_blue_250 = linear_250 & 0xFF + var sine_blue_250 = sine_250 & 0xFF + + self.assert_equal(linear_blue_250 > sine_blue_250, true, "SINE slower than LINEAR at 25%") + + # Test at 50% - both should be at midpoint (approximately) + var linear_500 = provider_linear.produce_value("color", 500) + var sine_500 = provider_sine.produce_value("color", 500) + + # Colors should be very close at midpoint + self.assert_approx_equal(linear_500, sine_500, "LINEAR and SINE similar at 50%") + + # Test ease-in behavior: change from 0-100ms should be smaller than 100-250ms for SINE + var sine_blue_0 = sine_0 & 0xFF + + var change_0_100 = sine_blue_100 - sine_blue_0 + var change_100_250 = sine_blue_250 - sine_blue_100 + + self.assert_equal(change_0_100 < change_100_250, true, "SINE has ease-in (slow start)") + end + + def test_sine_mode_value_based() + # Test SINE mode with value-based interpolation + var palette = bytes("00FF0000" "FF0000FF") # Red to Blue + var provider = animation.rich_palette(mock_engine) + provider.palette = palette + provider.cycle_period = 0 # Value-based mode + provider.transition_type = animation.SINE + provider.range_min = 0 + provider.range_max = 100 + provider.start() + + # Get colors at different values + var color_0 = provider.get_color_for_value(0, 0) + var color_25 = provider.get_color_for_value(25, 0) + var color_50 = provider.get_color_for_value(50, 0) + var color_75 = provider.get_color_for_value(75, 0) + var color_100 = provider.get_color_for_value(100, 0) + + # Extract blue channel + var blue_0 = color_0 & 0xFF + var blue_25 = color_25 & 0xFF + var blue_50 = color_50 & 0xFF + var blue_75 = color_75 & 0xFF + var blue_100 = color_100 & 0xFF + + # Test that we have a smooth S-curve + # Change from 0-25 should be smaller than 25-50 (ease-in) + var change_0_25 = blue_25 - blue_0 + var change_25_50 = blue_50 - blue_25 + self.assert_equal(change_0_25 < change_25_50, true, "Value-based SINE has ease-in") + + # Change from 50-75 should be larger than 75-100 (ease-out) + var change_50_75 = blue_75 - blue_50 + var change_75_100 = blue_100 - blue_75 + self.assert_equal(change_50_75 > change_75_100, true, "Value-based SINE has ease-out") + + # Midpoint should be approximately 128 + self.assert_approx_equal(blue_50, 128, "Value-based SINE midpoint is ~128") + end end # Run the tests