Skip to content

Commit

Permalink
FF8: Preliminary support for true widescreen
Browse files Browse the repository at this point in the history
  • Loading branch information
CosmosXIII committed Dec 1, 2024
1 parent 9203488 commit 5571fbe
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/cfg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -502,9 +502,6 @@ void read_cfg()
else
external_vibrate_path += "/ff7";

// WIDESCREEN
if (ff8 && aspect_ratio > AR_STRETCH) aspect_ratio = AR_ORIGINAL;

// VOLUME
if (external_music_volume > 100) external_music_volume = 100;
if (external_sfx_volume > 100) external_sfx_volume = 100;
Expand Down
21 changes: 18 additions & 3 deletions src/renderer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1736,10 +1736,15 @@ void Renderer::setScissor(uint16_t x, uint16_t y, uint16_t width, uint16_t heigh
case MODE_FIELD:
{
// Keep the default scissor for widescreen disabled movies and fields
bool is_movie_playing = *ff7_externals.word_CC1638 && !ff7_externals.modules_global_object->BGMOVIE_flag;
if((is_movie_playing && widescreen.getMovieMode() == WM_DISABLED) || widescreen.getMode() == WM_DISABLED)
bool isKeepDefaultScissor = false;
if (!ff8)
{
bool is_movie_playing = *ff7_externals.word_CC1638 && !ff7_externals.modules_global_object->BGMOVIE_flag;
isKeepDefaultScissor = (is_movie_playing && widescreen.getMovieMode() == WM_DISABLED) || widescreen.getMode() == WM_DISABLED;
}

if (isKeepDefaultScissor)
{
scissorOffsetX = getInternalCoordX(x + abs(wide_viewport_x));
return;
}

Expand Down Expand Up @@ -1779,6 +1784,16 @@ void Renderer::setScissor(uint16_t x, uint16_t y, uint16_t width, uint16_t heigh
scissorWidth = getInternalCoordX(wide_viewport_width);
else if(internalState.bIsTLVertex)
scissorOffsetX = getInternalCoordX(x + abs(wide_viewport_x));

if (ff8)
{
// This removes the black bars on the top and bottom of the screen
if(y == 24 && height == 432)
{
scissorOffsetY = getInternalCoordY(0.0);
scissorHeight = getInternalCoordY(480);
}
}
}
break;
default:
Expand Down

0 comments on commit 5571fbe

Please sign in to comment.