Show what a sprite's fetch slot read from the chip's bus, and a halted multicolour pair as the chip does - #339
Merged
highbyte merged 1 commit intoSep 17, 2026
Conversation
…d multicolour pair as the chip does A sprite 3-7 displayed on the line its DMA starts (X at or beyond $164) shows what its fetch slot at the line's start read while the DMA was off. In place of the $FF of the two accesses in the CPU's half of the cycle it now carries the byte of a VIC-II register access the CPU makes in that cycle, and the idle byte is the one of the line's start rather than the line's end. VICE's sbsprf24-164 test program places three bytes of its own that way. A multicolour sprite still shifting when its own fetch halts it repeats its last pixel; a pair taken in the last pixel before the halt shows only its high bit there, as a standard pixel would (VICE's spritefetchbug test program).
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



What
Two details of a sprite drawn on the line its own data fetch happens, each established by one of VICE's test programs.
The bytes a fetch slot reads with the DMA off. A sprite 3-7 with X at or beyond
$164is displayed on the line its compare starts the DMA, with what its fetch slot at the line's start read while the DMA was still off. That was$FF, the idle byte,$FF, with the idle byte read when the line ended. Now:$FFwhen it makes none;sb_sprite_fetch/sbsprf24-164places three bytes of its own this way (STA $D000,Ytimed so its dummy read and its write fall in sprite 6's slot, and an idle byte it restores a few cycles later).A multicolour pair caught by the halt. A sprite still shifting when its own fetch begins repeats its last pixel for seven pixels. When a multicolour pair is taken in the last pixel before the halt, that pixel and its repeats show only the pair's high bit, as a standard pixel would:
01shows nothing,11the sprite colour.spritefetchbug/test-136-2ashows it; the X positions its readme lists are exactly that alignment, so the rule is kept that narrow.How
Vic2: register accesses in a line's first ten cycles (the slots of sprites 3-7) record their byte by cycle, reset per line only when something was recorded; the idle byte is captured at the line's start when an enabled sprite 3-7 with its DMA off has its Y on the line. The run derivation builds the slot's row from those.Vic2SpriteManager.DecodeSpriteRun: a pair taken at the pixel before the halt keeps only its high bit from that pixel on. The run derivation sends such runs through the decoded path, so drawing and collisions both see it.Verification
sb_sprite_fetch/sbsprf24-164,spritefetchbug/test-136-2a. No other result changed.11→ sprite colour,01→ nothing, a pair taken a pixel earlier unchanged).