gbdev / gbdev/rgbds

Feature request: Support negative from-the-end indexes in `INCBIN`

Open
#1,998 0 comments 0 reactions 0 assignees View on GitHub
enhancement rgbasm
Dominant language
C++
Stars
1.6k
Forks
193
Avg merge
22h 17m
Merged PRs (30d)
26

Description

We currently support `INCBIN "path.bin"[, start[, len]]` to include *len* bytes (or "the rest" of the bytes if it's not specified) starting at index *start* (or the beginning of the file, index 0, if it's not specified). However, we do *not* support negative from-the-end indexes. This use case is rare but not unheard of, and we generally do support negative indexes in other features (string functions, angle-bracketed macro arguments, etc).

Contributor guide

Open the contributing guide

Research direction

Start by locating the INCBIN implementation and its existing tests, then read how start and len are parsed and applied. Check the handling of negative indexes in the other features mentioned by the issue. Done means INCBIN accepts negative from-the-end indexes while preserving current behavior for omitted and non-negative values, with coverage for the new cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
compilers, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.