mirror of
https://github.com/libretro/RetroArch
synced 2025-03-29 22:20:21 +00:00
DOS: fix image scaling and colors for 16-bit core video
This commit is contained in:
parent
22dfa1ca7c
commit
2661d5556b
@ -222,11 +222,11 @@ static bool vga_gfx_frame(void *data, const void *frame,
|
||||
for (x = 0; x < VGA_WIDTH; x++)
|
||||
{
|
||||
/* scale incoming frame to fit the screen */
|
||||
unsigned scaled_x = (width / VGA_WIDTH) * x;
|
||||
unsigned scaled_y = (height / VGA_HEIGHT) * y;
|
||||
unsigned scaled_x = (width / (float)VGA_WIDTH) * x;
|
||||
unsigned scaled_y = (height / (float)VGA_HEIGHT) * y;
|
||||
unsigned short pixel = ((unsigned short*)frame_to_copy)[width * scaled_y + scaled_x];
|
||||
|
||||
/* convert RGB565 to RGB332 */
|
||||
/* convert RGB565 to BGR332 */
|
||||
unsigned r = (7.0f / 31.0f) * ((pixel & 0xF800) >> 11);
|
||||
unsigned g = (7.0f / 63.0f) * ((pixel & 0x07E0) >> 5);
|
||||
unsigned b = (3.0f / 31.0f) * ((pixel & 0x001F) >> 0);
|
||||
|
Loading…
x
Reference in New Issue
Block a user