Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SET_GEOMETRY Not Properly Reported #27

Closed
rtomasa opened this issue Oct 31, 2023 · 2 comments
Closed

SET_GEOMETRY Not Properly Reported #27

rtomasa opened this issue Oct 31, 2023 · 2 comments

Comments

@rtomasa
Copy link

rtomasa commented Oct 31, 2023

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;
}
@rtomasa rtomasa changed the title SET_GEOMETRY Not Reported Properly SET_GEOMETRY Not Properly Reported Dec 2, 2023
@sonninnos
Copy link

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?

@rtomasa
Copy link
Author

rtomasa commented Feb 23, 2024

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

@rtomasa rtomasa closed this as completed Apr 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants