From 78de5724047f56bd3ecbfb9ab423bb6c943f6589 Mon Sep 17 00:00:00 2001 From: Michael Ball Date: Sun, 27 Oct 2019 11:59:25 -0700 Subject: 3DS: Implement magnify mode toggle on L and move keyboard to Y/DRIGHT --- backends/platform/3ds/osystem-graphics.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'backends/platform/3ds/osystem-graphics.cpp') diff --git a/backends/platform/3ds/osystem-graphics.cpp b/backends/platform/3ds/osystem-graphics.cpp index 1a86be4402..7204a9fb05 100644 --- a/backends/platform/3ds/osystem-graphics.cpp +++ b/backends/platform/3ds/osystem-graphics.cpp @@ -151,6 +151,8 @@ void OSystem_3DS::initSize(uint width, uint height, _gameHeight = height; _gameTopTexture.create(width, height, _pfGameTexture); _overlay.create(getOverlayWidth(), getOverlayHeight(), _pfGameTexture); + _topHalfWidth = _topWidth / 2; + _topHalfHeight = _topHeight / 2; if (format) { debug("pixelformat: %d %d %d %d %d", format->bytesPerPixel, format->rBits(), format->gBits(), format->bBits(), format->aBits()); @@ -198,6 +200,8 @@ void OSystem_3DS::updateSize() { } _gameTopTexture.setPosition(_gameTopX, _gameTopY); _gameBottomTexture.setPosition(_gameBottomX, _gameBottomY); + _gameTopTexture.setOffset(0, 0); + _gameBottomTexture.setOffset(0, 0); if (_overlayVisible) _cursorTexture.setScale(1.f, 1.f); else if (config.screen == kScreenTop) @@ -275,6 +279,17 @@ void OSystem_3DS::updateScreen() { C3D_FrameBegin(0); _gameTopTexture.transfer(); + if (_magnifyMode == MODE_MAGON) { + _topX = (_cursorX < _topHalfWidth) ? + 0 : ((_cursorX < (_gameWidth - _topHalfWidth)) ? + _cursorX - _topHalfWidth : _gameWidth - _topWidth); + _topY = (_cursorY < _topHalfHeight) ? + 0 : ((_cursorY < _gameHeight - _topHalfHeight) ? + _cursorY - _topHalfHeight : _gameHeight - _topHeight); + _gameTopTexture.setScale(1.f,1.f); + _gameTopTexture.setPosition(0,0); + _gameTopTexture.setOffset(_topX, _topY); + } if (_overlayVisible) { _overlay.transfer(); } -- cgit v1.2.3