SpriteLayer::SetOpacity(1.0) writes ratio -1
@seven-shades is already working on this.
Since Nov 17, 2026.
Assessment
- Difficulty
- 1/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 82/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- cpp
- Domain
- computer-graphics
Research direction
Start at srl_vdp2.hpp lines 1854-1860, the SetOpacity conversion of 0.0-1.0 into hardware blend ratios; trace how the shift result is computed and why 1.0 yields 32 before the subtraction. Read SGL's definition of VDP2_CCRSA to confirm the register allows 0-31. Clamp the ratio to 31, then add a test calling SetOpacity(1.0), (0.5) and (0.0) and reading back VDP2_CCRSA; done when the values stay in range and the suite passes.
Written by the indexing model from the issue text.
Description
(saturnringlib/srl_vdp2.hpp:1854-1860)
- What this is: It turns an opacity from 0.0 to 1.0 into one of the 32 hardware blend ratios (0 to 31).
- Problem: 1.0 is accepted, and 31 - (0x10000 >> 11) is 31 - 32 = -1, which becomes 0xFFFF as a 16-bit value. The largest opacity gives a value outside the register's range.
- Fix: Clamp the shift result to 31 before subtracting. Add a test that reads SGL's copy VDP2_CCRSA after SetOpacity(1.0), SetOpacity(0.5) and SetOpacity(0.0).
- Dominant language
- C++
- Stars
- 90
- Forks
- 5
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ReyeMe/SaturnRingLib
-
bug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ReyeMe/SaturnRingLib#155 ·
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ReyeMe/SaturnRingLib#152 ·
-
Sprite priority bank 0 is set twice at startupPossibly taken @seven-shades claimed this today. Openbug required hardware test
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ReyeMe/SaturnRingLib#150 · 1 assignee ·
-
VDP2::ClearVRAM never frees background-layer palettes (saturnringlib/srl_vdp2.hpp:1912,1924,1935,1946)Possibly taken @seven-shades claimed this today. Openbug required hardware test
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
ReyeMe/SaturnRingLib#148 · 1 assignee ·
-
128- and 64-color palettes can share color memory with other palettes (saturnringlib/srl_cram.hpp:173-264)Possibly taken @ReyeMe claimed this today. Openbug required hardware test
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
ReyeMe/SaturnRingLib#147 · 1 assignee ·
All issues in ReyeMe/SaturnRingLib
Similar issues
-
ai_p2
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
ClickHouse/ClickHouse#132519 ·
Maintainers usually reply within 1 day
-
[Bug]: VST3 getMidiControllerAssignment reads past midiControllerToParameter for program changeOpen
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
juce-framework/JUCE#1810 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100
petercorke/robotics-toolbox-python#952 ·
Maintainers usually reply within 1 day
-
NatronRenderer: a Python error in the script (-t / project script) doesn't change the exit statusOpenfunc:engine type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
NatronGitHub/Natron#1276 ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 1-3 hours Newbie friendliness 77/100
Maintainers usually reply within 1 day