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

[Libretro] Change VMUs scaling for GL/D3D11 #1300

Merged
merged 1 commit into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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