1
0
mirror of https://github.com/blawar/GLideN64.git synced 2024-07-04 10:03:36 +00:00

Hardcode blend mode, which is impossible to emulate with shaders.

Fixed Tony Hawk's Pro Skater 2 Shadow Glitch #1337
This commit is contained in:
Sergey Lipskiy 2017-11-10 23:53:27 +07:00
parent 732c27a07d
commit 3c61198043
2 changed files with 17 additions and 0 deletions

View File

@ -306,6 +306,12 @@ public:
void update(bool _force) override
{
if ((gDP.otherMode.l & 0xFFFF0000) == 0x01500000) {
uForceBlendCycle1.set(0, _force);
uForceBlendCycle2.set(0, _force);
return;
}
uBlendMux1.set(gDP.otherMode.c1_m1a,
gDP.otherMode.c1_m1b,
gDP.otherMode.c1_m2a,

View File

@ -441,6 +441,17 @@ void GraphicsDrawer::_setBlendMode() const
return;
}
if ((gDP.otherMode.l & 0xFFFF0000) == 0x01500000) {
// clr_in * a_in + clr_mem * (1-a)
// clr_in * a_fog + clr_mem * (1-a)
// impossible to emulate
if (gDP.otherMode.forceBlender != 0 && gDP.otherMode.cycleType < G_CYC_COPY) {
gfxContext.enable(enable::BLEND, true);
gfxContext.setBlending(blend::SRC_ALPHA, blend::ONE_MINUS_SRC_ALPHA);
return;
}
}
if (gDP.otherMode.forceBlender != 0 && gDP.otherMode.cycleType < G_CYC_COPY) {
BlendParam srcFactor = blend::ONE;
BlendParam dstFactor = blend::ZERO;