Skip to content

Commit

Permalink
Clear texture WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
rtoumazet committed Sep 26, 2024
1 parent 38d4492 commit e85c89d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 19 deletions.
32 changes: 16 additions & 16 deletions saturnin/src/video/opengl/opengl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
2 changes: 0 additions & 2 deletions saturnin/src/video/vdp2/vdp2.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<u32>(current_address);
readPalette256Dot<T>(texture_data, screen, palette_number, row.as_8bits >> DataExtraction::As8Bits::dot0_shift);
Expand Down Expand Up @@ -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<T>(texture_data, screen, palette_number, row.as_8bits >> DataExtraction::As8Bits::dot0_shift, cram);
readPalette256Dot<T>(texture_data, screen, palette_number, row.as_8bits >> DataExtraction::As8Bits::dot1_shift, cram);
Expand Down
2 changes: 1 addition & 1 deletion saturnin/src/video/vdp_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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};

Expand Down

0 comments on commit e85c89d

Please sign in to comment.