early-access version 2105

This commit is contained in:
pineappleEA 2021-10-04 07:04:26 +02:00
parent 4981320657
commit 6bca3a8c05
3 changed files with 6 additions and 41 deletions

View file

@ -1,7 +1,7 @@
yuzu emulator early access yuzu emulator early access
============= =============
This is the source code for early-access 2104. This is the source code for early-access 2105.
## Legal Notice ## Legal Notice

View file

@ -587,7 +587,11 @@ void Memory::UnmapRegion(Common::PageTable& page_table, VAddr base, u64 size) {
bool Memory::IsValidVirtualAddress(const VAddr vaddr) const { bool Memory::IsValidVirtualAddress(const VAddr vaddr) const {
const Kernel::KProcess& process = *system.CurrentProcess(); const Kernel::KProcess& process = *system.CurrentProcess();
const auto& page_table = process.PageTable().PageTableImpl(); const auto& page_table = process.PageTable().PageTableImpl();
const auto [pointer, type] = page_table.pointers[vaddr >> PAGE_BITS].PointerType(); const size_t page = vaddr >> PAGE_BITS;
if (page >= page_table.pointers.size()) {
return false;
}
const auto [pointer, type] = page_table.pointers[page].PointerType();
return pointer != nullptr || type == Common::PageType::RasterizerCachedMemory; return pointer != nullptr || type == Common::PageType::RasterizerCachedMemory;
} }

View file

@ -59,7 +59,6 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include <QProgressBar> #include <QProgressBar>
#include <QProgressDialog> #include <QProgressDialog>
#include <QPushButton> #include <QPushButton>
#include <QScreen>
#include <QShortcut> #include <QShortcut>
#include <QStatusBar> #include <QStatusBar>
#include <QString> #include <QString>
@ -3458,41 +3457,6 @@ void GMainWindow::SetDiscordEnabled([[maybe_unused]] bool state) {
#undef main #undef main
#endif #endif
static void SetHighDPIAttributes(int argc, char* argv[]) {
// Create a temporary QApplication as a workaround to get the current screen geometry.
QApplication* temp_app = new QApplication(argc, argv);
const QScreen* primary_screen = temp_app->primaryScreen();
const QRect screen_rect = primary_screen->geometry();
const int real_width = screen_rect.width();
const int real_height = screen_rect.height();
const float real_ratio = primary_screen->logicalDotsPerInch() / 96.0f;
delete temp_app;
// Recommended minimum width and height for proper window fit.
// Any screen with a lower resolution than this will still have a scale of 1.
constexpr float minimum_width = 1350.0f;
constexpr float minimum_height = 900.0f;
const float width_ratio = std::max(1.0f, real_width / minimum_width);
const float height_ratio = std::max(1.0f, real_height / minimum_height);
// Get the lower of the 2 ratios and truncate, this is the maximum integer scale.
const float max_ratio = std::trunc(std::min(width_ratio, height_ratio));
QApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication::setAttribute(Qt::AA_UseHighDpiPixmaps);
if (max_ratio > real_ratio) {
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Round);
} else {
QApplication::setHighDpiScaleFactorRoundingPolicy(
Qt::HighDpiScaleFactorRoundingPolicy::Floor);
}
}
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
Common::DetachedTasks detached_tasks; Common::DetachedTasks detached_tasks;
MicroProfileOnThreadCreate("Frontend"); MicroProfileOnThreadCreate("Frontend");
@ -3525,11 +3489,8 @@ int main(int argc, char* argv[]) {
} }
#endif #endif
SetHighDPIAttributes(argc, argv);
// Enables the core to make the qt created contexts current on std::threads // Enables the core to make the qt created contexts current on std::threads
QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity); QCoreApplication::setAttribute(Qt::AA_DontCheckOpenGLContextThreadAffinity);
QApplication app(argc, argv); QApplication app(argc, argv);
// Qt changes the locale and causes issues in float conversion using std::to_string() when // Qt changes the locale and causes issues in float conversion using std::to_string() when