Skip to content

Commit

Permalink
[Libretro] Change VMUs scaling for GL/D3D11
Browse files Browse the repository at this point in the history
  • Loading branch information
bslenul committed Nov 14, 2023
1 parent ab25cc7 commit e107d09
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
5 changes: 4 additions & 1 deletion core/rend/dx11/dx11_overlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,17 @@ void DX11Overlay::draw(u32 width, u32 height, bool vmu, bool crosshair)
deviceContext->RSSetScissorRects(1, &rect);
if (vmu)
{
#ifndef LIBRETRO
float vmu_padding = 8.f * settings.display.uiScale;
float vmu_height = 70.f * settings.display.uiScale;
float vmu_width = 48.f / 32.f * vmu_height;

#ifndef LIBRETRO
const float blend_factor[4] = { 0.75f, 0.75f, 0.75f, 0.75f };
deviceContext->OMSetBlendState(blendStates.getState(true, 8, 8), blend_factor, 0xffffffff);
#else
float vmu_padding = 8.f * config::RenderResolution / 480.f;
float vmu_height = 32.f * config::RenderResolution / 480.f;
float vmu_width = 48.f * config::RenderResolution / 480.f;
deviceContext->OMSetBlendState(blendStates.getState(true, 4, 5), nullptr, 0xffffffff);
#endif

Expand Down
6 changes: 3 additions & 3 deletions core/rend/gles/gldraw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -828,11 +828,11 @@ static void updateVmuTexture(int vmu_screen_number)

void DrawVmuTexture(u8 vmu_screen_number, int width, int height)
{
constexpr float vmu_padding = 8.f;
float vmu_padding = 8.f * config::RenderResolution / 480.f;
float x = vmu_padding;
float y = vmu_padding;
float w = (float)VMU_SCREEN_WIDTH * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult * 4.f / 3.f / gl.ofbo.aspectRatio;
float h = (float)VMU_SCREEN_HEIGHT * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult;
float w = (float)VMU_SCREEN_WIDTH * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult * 4.f / 3.f / gl.ofbo.aspectRatio * config::RenderResolution / 480.f;
float h = (float)VMU_SCREEN_HEIGHT * vmu_screen_params[vmu_screen_number].vmu_screen_size_mult * config::RenderResolution / 480.f;

if (vmu_lcd_changed[vmu_screen_number * 2] || vmuTextureId[vmu_screen_number] == 0)
updateVmuTexture(vmu_screen_number);
Expand Down

0 comments on commit e107d09

Please sign in to comment.