mirror of
https://github.com/bsnes-emu/bsnes.git
synced 2025-08-13 21:14:25 +02:00
Fix blur emulation in the accurate PPU mode.
This commit is contained in:
@@ -250,6 +250,16 @@ auto PPU::refresh() -> void {
|
||||
auto pitch = 512;
|
||||
auto width = 512;
|
||||
auto height = 480;
|
||||
if(configuration.video.blurEmulation) {
|
||||
for(uint y : range(height)) {
|
||||
auto data = output + y * pitch;
|
||||
for(uint x : range(width - 1)) {
|
||||
auto a = data[x + 0];
|
||||
auto b = data[x + 1];
|
||||
data[x] = (a + b - ((a ^ b) & 0x0421)) >> 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
if(auto device = controllerPort2.device) device->draw(output, pitch * sizeof(uint16), width, height);
|
||||
platform->videoFrame(output, pitch * sizeof(uint16), width, height, /* scale = */ 1);
|
||||
}
|
||||
|
@@ -50,7 +50,7 @@ auto Presentation::create() -> void {
|
||||
});
|
||||
blurEmulation.setText("Blur Emulation").setChecked(settings.video.blur).onToggle([&] {
|
||||
settings.video.blur = blurEmulation.checked();
|
||||
emulator->configure("Video/BlurEmulation", blurEmulation.checked());
|
||||
emulator->configure("Video/BlurEmulation", settings.video.blur);
|
||||
}).doToggle();
|
||||
filterMenu.setIcon(Icon::Emblem::Image).setText("Filter");
|
||||
filterNone.setText("None").onActivate([&] { settings.video.filter = "None"; });
|
||||
|
@@ -70,6 +70,7 @@ auto Program::load() -> void {
|
||||
presentation.addRecentGame(games.trimRight("|", 1L));
|
||||
|
||||
updateVideoPalette();
|
||||
updateVideoEffects();
|
||||
updateAudioEffects();
|
||||
updateAudioFrequency();
|
||||
}
|
||||
|
@@ -95,6 +95,7 @@ struct Program : Lock, Emulator::Platform {
|
||||
auto updateVideoFormat() -> void;
|
||||
auto updateVideoShader() -> void;
|
||||
auto updateVideoPalette() -> void;
|
||||
auto updateVideoEffects() -> void;
|
||||
|
||||
//audio.cpp
|
||||
auto updateAudioDriver(Window parent) -> void;
|
||||
|
@@ -110,3 +110,7 @@ auto Program::updateVideoPalette() -> void {
|
||||
|
||||
emulator->configure("Video/ColorEmulation", false);
|
||||
}
|
||||
|
||||
auto Program::updateVideoEffects() -> void {
|
||||
emulator->configure("Video/BlurEmulation", settings.video.blur);
|
||||
}
|
||||
|
Reference in New Issue
Block a user