Skip to content
This repository was archived by the owner on Jan 13, 2020. It is now read-only.
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: 2 additions & 1 deletion menu/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ bool8_32 S9xDeinitUpdate (int Width, int Height, bool8_32)
switch (mMenuOptions.fullScreen)
{
case 0: /* No scaling */
case 3: /* Hardware scaling */
case 3: /* Hardware scaling - Aspect */
case 4: /* Hardware scaling - Stretch */
{
u32 h = PAL ? SNES_HEIGHT_EXTENDED : SNES_HEIGHT;
u32 y, pitch = sal_VideoGetPitch();
Expand Down
9 changes: 6 additions & 3 deletions menu/menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,7 +1194,10 @@ void MainMenuUpdateText(s32 menu_index)
strcpy(mMenuText[MENU_FULLSCREEN],"Full screen: SMOOTH");
break;
case 3:
strcpy(mMenuText[MENU_FULLSCREEN],"Full screen: HARDWARE");
strcpy(mMenuText[MENU_FULLSCREEN],"Full screen: HARDWARE-ASPECT");
break;
case 4:
strcpy(mMenuText[MENU_FULLSCREEN],"Full screen: HARDWARE-STRETCH");
break;
}
break;
Expand Down Expand Up @@ -1590,12 +1593,12 @@ s32 MenuRun(s8 *romName)
case MENU_FULLSCREEN:
if (keys & SAL_INPUT_RIGHT)
{
mMenuOptions->fullScreen = (mMenuOptions->fullScreen + 1) % 4;
mMenuOptions->fullScreen = (mMenuOptions->fullScreen + 1) % 5;
}
else
{
if (mMenuOptions->fullScreen == 0)
mMenuOptions->fullScreen = 3;
mMenuOptions->fullScreen = 4;
else
mMenuOptions->fullScreen--;
}
Expand Down
19 changes: 17 additions & 2 deletions sal/linux/sal.c
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ void sal_VideoEnterGame(u32 fullscreenOption, u32 pal, u32 refreshRate)
/* Copied from C++ headers which we can't include in C */
unsigned int Width = 256 /* SNES_WIDTH */,
Height = pal ? 239 /* SNES_HEIGHT_EXTENDED */ : 224 /* SNES_HEIGHT */;
if (fullscreenOption != 3)
if (fullscreenOption < 3)
{
Width = SAL_SCREEN_WIDTH;
Height = SAL_SCREEN_HEIGHT;
Expand All @@ -282,12 +282,27 @@ void sal_VideoEnterGame(u32 fullscreenOption, u32 pal, u32 refreshRate)
mRefreshRate = refreshRate;
if (SDL_MUSTLOCK(mScreen))
SDL_LockSurface(mScreen);

if (fullscreenOption == 3 || fullscreenOption == 4)
{
FILE* aspect_ratio_file = fopen("/sys/devices/platform/jz-lcd.0/keep_aspect_ratio", "w");
if (aspect_ratio_file)
{
if (fullscreenOption == 3)
fwrite("1", 1, 1, aspect_ratio_file);

if (fullscreenOption == 4)
fwrite("0", 1, 1, aspect_ratio_file);

fclose(aspect_ratio_file);
}
}
#endif
}

void sal_VideoSetPAL(u32 fullscreenOption, u32 pal)
{
if (fullscreenOption == 3) /* hardware scaling */
if (fullscreenOption == 3 || fullscreenOption == 4) /* hardware scaling */
{
sal_VideoEnterGame(fullscreenOption, pal, mRefreshRate);
}
Expand Down