Skip to content

Commit

Permalink
pico: calculate page size
Browse files Browse the repository at this point in the history
  • Loading branch information
Daft-Freak committed Aug 12, 2024
1 parent 85ac8af commit b4f4a78
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions 32blit-pico/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,7 @@ static const Size hires_screen_size(DISPLAY_WIDTH, DISPLAY_HEIGHT);
ScreenMode cur_screen_mode = ScreenMode::lores;

int get_display_page_size() {
if(cur_screen_mode == blit::ScreenMode::lores) // paletted is half the size
return blit::screen.format == blit::PixelFormat::P ? lores_page_size / 2 : lores_page_size;
else // paletted hires
return DISPLAY_WIDTH * DISPLAY_HEIGHT;
return cur_surf_info.bounds.area() * pixel_format_stride[int(cur_surf_info.format)];
}

// blit api
Expand Down

0 comments on commit b4f4a78

Please sign in to comment.