Skip to content

Conversation

@nchapman
Copy link
Collaborator

Took a look at MyMinUI to learn from the work they've been doing. Main thing that stood out was that we don't support 0RGB1555. We haven't hit specific issues from this yet although we haven't tested all of our new cores thoroughly yet so it'll be nice to already have this in place.

  Replace the boolean `downsample` flag with a proper `pixel_format`
  enum that tracks all three libretro pixel formats. This fixes
  compatibility with cores that use the legacy 0RGB1555 default format
  (like mame2003+).

  Changes: - Add RETRO_PIXEL_FORMAT_0RGB1555 support (was previously
  rejected) - Rename downsample/buffer to pixel_format/convert_buffer
  for clarity - Add convert_0rgb1555_neon() processing 8 pixels per
  iteration - Add convert_0rgb1555_scalar() fallback for non-NEON
  platforms - Unify conversion dispatch through pixel_convert() function
  - Reset pixel_format to default when closing cores

  The 0RGB1555→RGB565 conversion expands green from 5 to 6 bits using g6
  = (g << 1) | (g >> 4) for better color accuracy.
Copilot AI review requested due to automatic review settings November 28, 2025 19:43
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the 0RGB1555 pixel format (15-bit color with 1 unused bit) to complement the existing XRGB8888 and RGB565 format support. This change aligns with the libretro specification where 0RGB1555 is the default format if cores don't explicitly set a pixel format, and is used by older arcade cores like mame2003+.

Key changes:

  • Refactored pixel format handling from a boolean flag (downsample) to an enum-based system (pixel_format) supporting three formats
  • Implemented 0RGB1555 to RGB565 conversion with both NEON-optimized (8 pixels per iteration) and scalar fallback versions
  • Improved documentation with detailed explanations of each pixel format, conversion algorithms, and performance characteristics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nchapman nchapman merged commit badfc29 into develop Nov 28, 2025
4 checks passed
@nchapman nchapman deleted the feature/myminui-lessons branch November 28, 2025 19:57
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

Successfully merging this pull request may close these issues.

2 participants