diff --git a/saturnin/src/video/opengl/opengl.cpp b/saturnin/src/video/opengl/opengl.cpp index 2b858ae..b18d0f1 100644 --- a/saturnin/src/video/opengl/opengl.cpp +++ b/saturnin/src/video/opengl/opengl.cpp @@ -243,22 +243,22 @@ void Opengl::displayFramebuffer(core::EmulatorContext& state) { } void Opengl::clearFboTextures() { - // Log::debug(Logger::opengl, "clearFboTextures() call"); - // for (u8 index = 0; auto& status : fbo_texture_pool_status_) { - // if (status == FboTextureStatus::to_clear) { - // :WIP: - // Log::debug(Logger::opengl, "- Clearing texture at index {}", index); - // attachTextureLayerToFbo(fbo_texture_array_id_, index); - // attachTextureToFbo(getFboTextureId(FboTextureType::vdp2_debug_layer)); - - // gl::glClearColor(0.0f, 0.0f, 0.0f, 1.0f); - // glClear(GL_COLOR_BUFFER_BIT); - - // Log::debug(Logger::opengl, "- Changing FBO texture status at index {} to 'unused'", index); - // status = FboTextureStatus::unused; - // } - //} - // Log::debug(Logger::opengl, "clearFbos() return"); + Log::debug(Logger::opengl, "clearFboTextures() call"); + for (u8 index = 0; auto& status : fbo_texture_pool_status_) { + if (status == FboTextureStatus::to_clear) { + // :WIP: + Log::debug(Logger::opengl, "- Clearing texture at index {}", index); + // attachTextureLayerToFbo(fbo_texture_array_id_, index); + // attachTextureToFbo(getFboTextureId(FboTextureType::vdp2_debug_layer)); + + gl::glClearColor(0.0f, 0.0f, 0.0f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + + Log::debug(Logger::opengl, "- Changing FBO texture status at index {} to 'unused'", index); + status = FboTextureStatus::unused; + } + } + Log::debug(Logger::opengl, "clearFbos() return"); } void Opengl::clearFboKeys() { diff --git a/saturnin/src/video/vdp2/vdp2.h b/saturnin/src/video/vdp2/vdp2.h index 3b4b402..2576e8a 100644 --- a/saturnin/src/video/vdp2/vdp2.h +++ b/saturnin/src/video/vdp2/vdp2.h @@ -1582,7 +1582,6 @@ class Vdp2 { constexpr auto row_offset = u8{4}; auto current_address = vram_start_address + cell_address; auto row = DataExtraction{}; - // const auto data = modules_.memory()->read(core::MemoryMapArea::vdp2_video_ram, current_address, 0x40); for (u32 i = 0; i < 8; ++i) { row.as_8bits = modules_.memory()->read(current_address); readPalette256Dot(texture_data, screen, palette_number, row.as_8bits >> DataExtraction::As8Bits::dot0_shift); @@ -1610,7 +1609,6 @@ class Vdp2 { auto current_address = vram_start_address + cell_address; auto row = DataExtraction{}; for (u32 i = 0; i < 8; ++i) { - // auto addr = current_address & core::vdp2_vram_memory_mask; row.as_8bits = utilities::readAs32(vram.subspan(current_address & core::vdp2_vram_memory_mask, 4)); readPalette256Dot(texture_data, screen, palette_number, row.as_8bits >> DataExtraction::As8Bits::dot0_shift, cram); readPalette256Dot(texture_data, screen, palette_number, row.as_8bits >> DataExtraction::As8Bits::dot1_shift, cram); diff --git a/saturnin/src/video/vdp_common.h b/saturnin/src/video/vdp_common.h index e422992..0083444 100644 --- a/saturnin/src/video/vdp_common.h +++ b/saturnin/src/video/vdp_common.h @@ -33,7 +33,7 @@ namespace saturnin::video { constexpr auto vram_start_address = u32{0x25e00000}; constexpr auto cram_start_address = u32{0x25f00000}; constexpr auto vdp1_address_multiplier = u8{8}; -constexpr auto uses_fbo = false; +constexpr auto uses_fbo = true; constexpr auto gouraud_offset = s8{0x10};