Skip to content

Commit

Permalink
framebuffer align
Browse files Browse the repository at this point in the history
  • Loading branch information
vailkyte authored Aug 20, 2023
1 parent d72be2c commit 6f17ebf
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions libretro.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@
#define MEDNAFEN_CORE_TIMING_FPS 7159090.90909090 / 455.0 / 263.0
#define MEDNAFEN_CORE_GEOMETRY_BASE_W 256
#define MEDNAFEN_CORE_GEOMETRY_BASE_H 224
#define MEDNAFEN_CORE_GEOMETRY_MAX_W 1365+3
#define MEDNAFEN_CORE_GEOMETRY_MAX_W 1365
#define MEDNAFEN_CORE_GEOMETRY_MAX_H 270
#define MEDNAFEN_CORE_GEOMETRY_ASPECT_RATIO 6.0 / 5.0
#define FB_WIDTH 1365
#define FB_HEIGHT 270
#define FB_WIDTH_ALIGN 1368

static bool cdimagecache = false;
static bool show_advanced_input_settings = true;
Expand Down Expand Up @@ -1457,8 +1458,8 @@ bool retro_load_game(const struct retro_game_info *info)

surf->width = FB_WIDTH;
surf->height = FB_HEIGHT;
surf->pitch = FB_WIDTH;
surf->pixels = (bpp_t*) calloc(sizeof(bpp_t), FB_WIDTH * FB_HEIGHT);
surf->pitch = FB_WIDTH_ALIGN;
surf->pixels = (bpp_t*) calloc(sizeof(bpp_t), FB_WIDTH_ALIGN * FB_HEIGHT);

if (!surf->pixels)
{
Expand Down Expand Up @@ -1802,9 +1803,9 @@ void retro_run(void)

bpp_t *fb = surf->pixels + spec.DisplayRect.x + surf->pitch * spec.DisplayRect.y;

hires_blending(fb, video_width, video_height, FB_WIDTH);
hires_blending(fb, video_width, video_height, FB_WIDTH_ALIGN);

video_cb(fb, video_width, video_height, FB_WIDTH * sizeof(bpp_t));
video_cb(fb, video_width, video_height, FB_WIDTH_ALIGN * sizeof(bpp_t));
audio_batch_cb(spec.SoundBuf, spec.SoundBufSize);

bool updated = false;
Expand Down

0 comments on commit 6f17ebf

Please sign in to comment.