diff --git a/menu/main.cpp b/menu/main.cpp index 83f7542..522c7ab 100644 --- a/menu/main.cpp +++ b/menu/main.cpp @@ -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(); diff --git a/menu/menu.cpp b/menu/menu.cpp index 0259038..1f86b68 100644 --- a/menu/menu.cpp +++ b/menu/menu.cpp @@ -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; @@ -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--; } diff --git a/sal/linux/sal.c b/sal/linux/sal.c index 0041ec5..a49c97c 100644 --- a/sal/linux/sal.c +++ b/sal/linux/sal.c @@ -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; @@ -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); }