Skip to content

Fix color blending math in fast PPU #79

Open
@ghost

Description

Presuming #78 gets merged, there will be four hacks left that aren't directly related to intentional accuracy sacrifices for speed. Two in particular look like low hanging fruit:

https://github.com/bsnes-emu/bsnes/blob/master/bsnes/target-bsnes/program/hacks.cpp#L25

//the dialogue text is blurry due to an issue in the scanline-based renderer's color math support
if(title == "マーヴェラス") fastPPU = false;
//stage 2 uses pseudo-hires in a way that's not compatible with the scanline-based renderer
if(title == "SFC クレヨンシンチャン") fastPPU = false;

These work correctly with the pixel-based PPU. I can't make sense of how to port the fixes from it to the scanline-based PPU, but I'm making an issue report in the hopes someone else can.

The color blending code for the pixel-based PPU is here:
https://github.com/bsnes-emu/bsnes/blob/master/bsnes/sfc/ppu/screen.cpp#L32

The color blending code for the scanline-based PPU is here:
https://github.com/bsnes-emu/bsnes/blob/master/bsnes/sfc/ppu-fast/line.cpp#L106

Also worth noting is this issue affects higan-emu's ppu-performance, only there's no hacks in place with it:
https://github.com/higan-emu/higan/blob/master/higan/sfc/ppu-performance/dac.cpp#L33

A fix for this would improve both emulators.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requesthelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions