6911042cf60827a31168618f1fc8a26bc1ce339d
The pair LUT introduced in a502cea was built at the top of
RefreshLine, before the
Pal[0] |= 64;
Pal[4] |= 64;
Pal[8] |= 64;
Pal[0xC] |= 64;
block that follows. That OR sets the 0x40 "background priority"
marker on the universal-background entries of PALRAM (Pal is
`#define Pal (PALRAM)`), so that the framebuffer downstream of the
pputile.h tile expansion can distinguish BG-colour pixels from
true zero-pen pixels for sprite priority / sprite-0-hit testing.
The matching `Pal[i] &= 63` at the bottom of the function strips
the bit again after rendering.
Building the LUT before the |= 64 meant entries 0/4/8/0xC carried
the PALRAM value WITHOUT the priority bit, so every tile pixel that
expanded to one of those four indices wrote a plain palette index
to the framebuffer instead of (palette | 0x40). Sprite compositing
then could not tell which BG pixels were the universal background,
and broke priority for games that exercise Pal[0x04/0x08/0x0C] --
Mega Man 3 sprites were reported.
Fix: move the FCEU_BuildBgPairLUT() call to just after the
`Pal[i] |= 64` block. The LUT is now built with the priority bit
present in entries 0/4/8/0xC and bit-exactly matches what the
original eight-load scalar code reads from PALRAM during the
pputile.h includes. No second rebuild is needed before the
`Pal[i] &= 63` cleanup because the LUT is only consumed inside
the includes, which sit between the OR and the AND.
Mid-scanline RefreshLine entries via FCEUPPU_LineUpdate continue
to work: each entry walks the same |= 64 -> BuildLUT -> includes
-> &= 63 sequence, so any $3F00..$3F0F write the CPU made since
the previous span is folded into the LUT before the resumed tile
span renders.
Codegen unchanged: still one leaq fceu_bg_pair_lut at function
entry, 48 indexed LUT loads across the 12 pputile.h expansion
sites, one movq per site to P.
FCE Ultra mappers modified
FCEU "mappers modified" is an unofficial build of FCEU Ultra by CaH4e3, which supports a lot of new mappers including some obscure mappers such as one for unlicensed NES ROM's.
Sequential targets Light Guns support added
Support for Sequential targets Light Guns has been added. "Gun Aux A" serves as light sensor logic input.
Description
Languages
C
97.7%
Python
2%
C++
0.2%