Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FF8: Preliminary support for true widescreen #756

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
31 changes: 28 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 All @@ -1788,6 +1803,16 @@ void Renderer::setScissor(uint16_t x, uint16_t y, uint16_t width, uint16_t heigh
scissorWidth = getInternalCoordX(wide_viewport_width);
else
scissorOffsetX = getInternalCoordX(x + abs(wide_viewport_x));

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