Skip to content

Add fade_in / fade_out helpers for palette brightness transitions #424

@jonathanpeppers

Description

@jonathanpeppers

Multiple samples manually loop over pal_bright() with delay() to create fade effects:

// rletitle, fade samples — fade in:
for (byte i = 0; i < 4; i++) { pal_bright(i); delay(4); }

// fade out:
for (byte i = 4; i > 0; i--) { pal_bright(i); delay(4); }

Proposed API:

// Fade from black to normal brightness over N frames per step
fade_in(4);

// Fade from normal brightness to black over N frames per step
fade_out(4);

These are simple 6502 subroutines that loop over pal_bright levels 0-4 (or 4-0) with the given delay between steps. Pure neslib addition, no transpiler changes.

Once implemented, the rletitle, fade, and climber samples should be updated to use the helpers.

Related to #30

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions