Skip to content

Commit

Permalink
port: unsquish the aspect ratio
Browse files Browse the repository at this point in the history
this might break something but I haven't noticed anything bad yet
  • Loading branch information
fgsfdsfgs committed Nov 30, 2023
1 parent 7cd3daf commit af34015
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
32 changes: 32 additions & 0 deletions src/include/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/lib/vi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit af34015

Please sign in to comment.