libretro / beetle-saturn-libretro

Standalone hard fork of Mednafen Saturn to the libretro API.
GNU General Public License v2.0
18 stars 7 forks source link

SET_GEOMETRY Not Properly Reported #27

Open rtomasa opened 8 months ago

rtomasa commented 8 months ago

The core is doing some weird logic when calling SET_GEOMETRY like subtracting 352px. The base_width and base_height are not the same as the width and height that are the correct ones. Actually it also calls input_set_geometry, which sets geometry_width and geometry_height with the proper values, but those variables are never used in the core.

Retroarch is able to properly display the game because it is setting geometry also based on the W and H coming from the video_refresh cb which reports the correct resolution, but these values mismatch with the SET_GEOMETRY ones.

if (width != game_width || height != game_height)
   {
      struct retro_system_av_info av_info;

      // Change frontend resolution using  base width/height (+ overscan adjustments).
      // This avoids inconsistent frame scales when game switches between interlaced and non-interlaced modes.
      av_info.geometry.base_width   = 352 - h_mask;
      av_info.geometry.base_height  = linevislast + 1 - linevisfirst;
      av_info.geometry.max_width    = MEDNAFEN_CORE_GEOMETRY_MAX_W;
      av_info.geometry.max_height   = MEDNAFEN_CORE_GEOMETRY_MAX_H;
      av_info.geometry.aspect_ratio = MEDNAFEN_CORE_GEOMETRY_ASPECT_RATIO;
      environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &av_info);

      log_cb(RETRO_LOG_INFO, "Target framebuffer size : %dx%d\n", width, height);

      game_width  = width;
      game_height = height;

      input_set_geometry( width, height );
   }

void input_set_geometry( unsigned width, unsigned height )
{
    log_cb( RETRO_LOG_INFO, "input_set_geometry: %dx%d\n", width, height );

    geometry_width = width;
    geometry_height = height;
}
sonninnos commented 4 months ago

I was about to fix this, but apparently it is done on purpose, meaning that perhaps something needs to be changed in the frontend too if this is changed.

https://github.com/libretro/beetle-saturn-libretro/commit/34602749d5808570897ce96e821bbed85eb64ac1

Any decent examples of interlace switching when the screen is not black?

rtomasa commented 4 months ago

I was about to fix this, but apparently it is done on purpose, meaning that perhaps something needs to be changed in the frontend too if this is changed.

3460274

Any decent examples of interlace switching when the screen is not black?

Ohh interesting Maybe Dead or Alive and/or Virtua Fighter 2