Fix blur emulation in the accurate PPU mode.

This commit is contained in:
byuu 2019-08-01 01:10:27 +09:00
parent 454b39cb78
commit a7b30b069c
5 changed files with 17 additions and 1 deletions

View File

@ -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);
}

View File

@ -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"; });

View File

@ -70,6 +70,7 @@ auto Program::load() -> void {
presentation.addRecentGame(games.trimRight("|", 1L));
updateVideoPalette();
updateVideoEffects();
updateAudioEffects();
updateAudioFrequency();
}

View File

@ -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;

View File

@ -110,3 +110,7 @@ auto Program::updateVideoPalette() -> void {
emulator->configure("Video/ColorEmulation", false);
}
auto Program::updateVideoEffects() -> void {
emulator->configure("Video/BlurEmulation", settings.video.blur);
}