Core: Begin on video scale hack
Vicki Pfau vi@endrift.com
Fri, 10 May 2019 15:04:14 -0700
3 files changed,
13 insertions(+),
5 deletions(-)
M
src/gba/core.c
→
src/gba/core.c
@@ -255,12 +255,19 @@ #ifndef DISABLE_THREADING
mCoreConfigCopyValue(&core->config, config, "threadedVideo"); #endif mCoreConfigCopyValue(&core->config, config, "hwaccelVideo"); + mCoreConfigCopyValue(&core->config, config, "videoScale"); } static void _GBACoreDesiredVideoDimensions(struct mCore* core, unsigned* width, unsigned* height) { - UNUSED(core); - *width = GBA_VIDEO_HORIZONTAL_PIXELS; - *height = GBA_VIDEO_VERTICAL_PIXELS; + struct GBACore* gbacore = (struct GBACore*) core; + int fakeBool; + int scale = 1; + if (mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) { + scale = gbacore->glRenderer.scale; + } + + *width = GBA_VIDEO_HORIZONTAL_PIXELS * scale; + *height = GBA_VIDEO_VERTICAL_PIXELS * scale; } static void _GBACoreSetVideoBuffer(struct mCore* core, color_t* buffer, size_t stride) {@@ -406,6 +413,7 @@ }
#endif if (mCoreConfigGetIntValue(&core->config, "hwaccelVideo", &fakeBool) && fakeBool) { renderer = &gbacore->glRenderer.d; + mCoreConfigGetIntValue(&core->config, "videoScale", &gbacore->glRenderer.scale); } if (core->videoLogger) { gbacore->proxyRenderer.logger = core->videoLogger;
M
src/platform/qt/CoreController.cpp
→
src/platform/qt/CoreController.cpp
@@ -40,7 +40,7 @@ {
m_threadContext.core = core; m_threadContext.userData = this; - QSize size(256, 512); + QSize size(1024, 2048); m_buffers[0].resize(size.width() * size.height() * sizeof(color_t)); m_buffers[1].resize(size.width() * size.height() * sizeof(color_t)); m_buffers[0].fill(0xFF);
M
src/platform/qt/DisplayGL.cpp
→
src/platform/qt/DisplayGL.cpp
@@ -251,7 +251,7 @@ m_backend->filter = false;
m_backend->lockAspectRatio = false; for (int i = 0; i < 2; ++i) { - m_free.append(new uint32_t[256 * 256]); + m_free.append(new uint32_t[1024 * 2048]); } }