From db1c37c799c63e5ee8123831120e5a23746f1c9f Mon Sep 17 00:00:00 2001 From: byuu <2107894+byuu@users.noreply.github.com> Date: Sat, 24 Aug 2019 08:34:17 +0900 Subject: [PATCH] v108.12 * fix sprite index mask (Addams Family bugfix) * fix exclusive mode in Direct3D driver --- bsnes/emulator/emulator.hpp | 2 +- bsnes/sfc/ppu-fast/object.cpp | 2 +- ruby/video/direct3d.cpp | 13 ++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/bsnes/emulator/emulator.hpp b/bsnes/emulator/emulator.hpp index da49f0e7..650ab3eb 100644 --- a/bsnes/emulator/emulator.hpp +++ b/bsnes/emulator/emulator.hpp @@ -29,7 +29,7 @@ using namespace nall; namespace Emulator { static const string Name = "bsnes"; - static const string Version = "108.11"; + static const string Version = "108.12"; static const string Author = "byuu"; static const string License = "GPLv3"; static const string Website = "https://byuu.org"; diff --git a/bsnes/sfc/ppu-fast/object.cpp b/bsnes/sfc/ppu-fast/object.cpp index 85224f11..f03b6ebe 100644 --- a/bsnes/sfc/ppu-fast/object.cpp +++ b/bsnes/sfc/ppu-fast/object.cpp @@ -12,7 +12,7 @@ auto PPU::Line::renderObject(PPU::IO::Object& self) -> void { for(uint n : range(ppu.TileLimit)) tiles[n].valid = false; for(uint n : range(128)) { - ObjectItem item{true, uint8_t(self.first + n)}; + ObjectItem item{true, uint8_t(self.first + n & 127)}; const auto& object = ppu.objects[item.index]; if(object.size == 0) { diff --git a/ruby/video/direct3d.cpp b/ruby/video/direct3d.cpp index 7e929d65..52836583 100755 --- a/ruby/video/direct3d.cpp +++ b/ruby/video/direct3d.cpp @@ -253,8 +253,10 @@ private: _monitorWidth = monitor.width; _monitorHeight = monitor.height; + _exclusive = self.exclusive && self.fullScreen; + //Direct3D exclusive mode targets the primary monitor only - if(self.exclusive) { + if(_exclusive) { POINT point{0, 0}; //the primary monitor always starts at (0,0) HMONITOR monitor = MonitorFromPoint(point, MONITOR_DEFAULTTOPRIMARY); MONITORINFOEX info{}; @@ -292,10 +294,10 @@ private: _presentation.AutoDepthStencilFormat = D3DFMT_UNKNOWN; _presentation.PresentationInterval = D3DPRESENT_INTERVAL_IMMEDIATE; _presentation.hDeviceWindow = _context; - _presentation.Windowed = !self.exclusive; - _presentation.BackBufferFormat = self.exclusive ? D3DFMT_X8R8G8B8 : D3DFMT_UNKNOWN; - _presentation.BackBufferWidth = self.exclusive ? _monitorWidth : 0; - _presentation.BackBufferHeight = self.exclusive ? _monitorHeight : 0; + _presentation.Windowed = !_exclusive; + _presentation.BackBufferFormat = _exclusive ? D3DFMT_X8R8G8B8 : D3DFMT_UNKNOWN; + _presentation.BackBufferWidth = _exclusive ? _monitorWidth : 0; + _presentation.BackBufferHeight = _exclusive ? _monitorHeight : 0; _presentation.FullScreen_RefreshRateInHz = D3DPRESENT_RATE_DEFAULT; if(_instance->CreateDevice(D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, _context, @@ -348,6 +350,7 @@ private: LPDIRECT3DTEXTURE9 _texture = nullptr; LPDIRECT3DSURFACE9 _surface = nullptr; + bool _exclusive = false; bool _lost = true; uint _windowWidth; uint _windowHeight;