gbdev/rgbds

RGBLINT tool to optimize and improve code

Open

#1,807 opened on Aug 25, 2025

View on GitHub
 (6 comments) (3 reactions) (0 assignees)C++ (187 forks)auto 404
enhancementgood first issuenew tool

Repository metrics

Stars
 (1,623 stars)
PR merge metrics
 (PR metrics pending)

Description

There are many "peephole" optimizations that can be applied by searching for suboptimal patterns of assembly code. There may also be reasons to lint code besides optimization (and besides consistent formatting, which would be its own tool; see #1796).

This would be like optimize.py, but ideally running faster, and not tied to pret's preferred formatting and macros (generalizable to all of GB dev). On the other hand, it should have a way to easily define custom lint rules, so it can recognize project-specific macros and exceptions. (For instance, in pret jmp should be recognized by all relevant patterns as a jump instruction, and the Hungarian h/w/v/s RAM prefixes are relevant for some patterns.)

Contributor guide