diff --git a/src/include/constants.h b/src/include/constants.h index d4a102751..2ac586186 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -3625,6 +3625,8 @@ #define SCREEN_320 320 #define SCREEN_240 240 +#ifdef PLATFORM_N64 + // The framebuffer allocation sizes are mostly the same between versions. // Note that the height is the same regardless of lo/hi-res, but we use separate constants. // FBALLOC_HEIGHT (without the LO/HI suffix) is used when the game references this value @@ -3653,6 +3655,36 @@ #define SCREEN_HEIGHT_HI 220 #endif +#define FBALLOC_HEIGHT_PAL 252 + +#else + +// on PC we're using proper 320x240 as the base resolution to avoid aspect stretching +// or 320x290 on PAL + +#define FBALLOC_WIDTH_LO 320 +#define FBALLOC_HEIGHT_LO 240 +#define FBALLOC_WIDTH_HI 640 +#define FBALLOC_HEIGHT_HI 240 +#define FBALLOC_HEIGHT 240 + +#if VERSION == VERSION_PAL_FINAL +#define SCREEN_WIDTH_LO 320 +#define SCREEN_HEIGHT_LO 290 +#define SCREEN_WIDTH_HI 448 +#define SCREEN_HEIGHT_HI 290 +#else +#define SCREEN_WIDTH_LO 320 +#define SCREEN_HEIGHT_LO 240 +#define SCREEN_WIDTH_HI 640 +#define SCREEN_HEIGHT_HI 240 +#endif + +// 252 * ~1.09091 to match the 220 -> 240 transition +#define FBALLOC_HEIGHT_PAL 275 + +#endif + #define SCREENRATIO_NORMAL 0 #define SCREENRATIO_16_9 1 diff --git a/src/lib/vi.c b/src/lib/vi.c index f76788821..4219066c6 100644 --- a/src/lib/vi.c +++ b/src/lib/vi.c @@ -165,7 +165,7 @@ void viConfigureForLegal(void) } const s16 g_ViModeWidths[] = {FBALLOC_WIDTH_LO, FBALLOC_WIDTH_LO, SCREEN_320 * 2}; -const s16 g_ViModeHeights[] = {FBALLOC_HEIGHT_LO, FBALLOC_HEIGHT_LO, (PAL ? 252 : 220) * 2}; +const s16 g_ViModeHeights[] = {FBALLOC_HEIGHT_LO, FBALLOC_HEIGHT_LO, (PAL ? FBALLOC_HEIGHT_PAL : FBALLOC_HEIGHT_LO) * 2}; /** * Allocate the colour framebuffers for the given stage.