Compare commits

..

2 Commits

Author SHA1 Message Date
lizzie 5dda5a6581 unused var 2026-07-21 11:21:53 +02:00
lizzie 75d033b88c [nce] invalidate split pages
Signed-off-by: lizzie <lizzie@eden-emu.dev>
2026-07-21 11:21:53 +02:00
6 changed files with 56 additions and 23 deletions
@@ -3,7 +3,7 @@
<!-- General application strings -->
<string name="app_name" translatable="false">Eden</string>
<string name="app_disclaimer">This software will run games for the Nintendo Switch game console. No game titles or keys are included.&lt;br /&gt;&lt;br /&gt;Before you begin, please locate your <![CDATA[<b> prod.keys </b>]]> file on your device storage.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/QuickStart.md\">Learn more</a>]]></string>
<string name="app_disclaimer">This software will run games for the Nintendo Switch game console. No game titles or keys are included.&lt;br /&gt;&lt;br /&gt;Before you begin, please locate your <![CDATA[<b> prod.keys </b>]]> file on your device storage.&lt;br /&gt;&lt;br /&gt;<![CDATA[<a href=\"https://yuzu-mirror.github.io/help/quickstart\">Learn more</a>]]></string>
<string name="notice_notification_channel_name">Notices and errors</string>
<string name="notice_notification_channel_id" translatable="false">noticesAndErrors</string>
<string name="notice_notification_channel_description">Shows notifications when something goes wrong.</string>
@@ -867,7 +867,7 @@
<string name="loader_error_file_not_found">ROM file does not exist</string>
<string name="loader_requires_firmware">Game Requires Firmware</string>
<string name="loader_requires_firmware_description"><![CDATA[This game may require firmware to function properly, and you don\'t have any installed. Please install firmware before launching, or press \"OK\" to launch anyways.]]></string>
<string name="loader_requires_firmware_description"><![CDATA[The game you are trying to launch requires firmware to boot or to get past the opening menu. Please <a href=\"https://yuzu-mirror.github.io/help/quickstart\"> dump and install firmware</a>, or press \"OK\" to launch anyways.]]></string>
<!-- Intent Launch strings -->
<string name="searching_for_game">Searching for game...</string>
+26 -8
View File
@@ -160,16 +160,34 @@ bool ArmNce::HandleGuestAlignmentFault(GuestContext* guest_ctx, void* raw_info,
bool ArmNce::HandleGuestAccessFault(GuestContext* guest_ctx, void* raw_info, void* raw_context) {
auto* info = static_cast<siginfo_t*>(raw_info);
// Try to handle an invalid access.
// TODO: handle accesses which split a page?
const Common::ProcessAddress addr =
(reinterpret_cast<u64>(info->si_addr) & ~Memory::YUZU_PAGEMASK);
auto& memory = guest_ctx->parent->m_running_thread->GetOwnerProcess()->GetMemory();
if (memory.InvalidateNCE(addr, Memory::YUZU_PAGESIZE)) {
// We handled the access successfully and are returning to guest code.
return true;
}
// Try to handle an invalid access.
// This computes the addr for the (first) page corresponding to the access
auto const acc_size = 16; // Max architectural access size
// Please note accesses can be wider than 16-bytes on some(which?) cases
// but this should handle **most** of the fragant issues with cases like 128-bit vector
// load/stores or GPU writes.
auto const addr_c1 = Common::ProcessAddress(u64(info->si_addr) & ~Memory::YUZU_PAGEMASK);
if (!(acc_size > 1 && (addr_c1 & Memory::YUZU_PAGEMASK) + acc_size > Memory::YUZU_PAGESIZE)) {
if (memory.InvalidateNCE(addr_c1, Memory::YUZU_PAGESIZE))
return true;
} else {
// Corresponds to the 2nd page, this means the access is split between two pages
auto const addr_c2 = (addr_c1 & ~Memory::YUZU_PAGEMASK) + Memory::YUZU_PAGESIZE;
// Heres the stupid part, how the fuck do we decide if either the first
// or second pages should be the ones to propagate the fault?
if (memory.InvalidateNCE(addr_c1, Memory::YUZU_PAGESIZE))
return true;
// ... well my solution is stupid, but basically we just ignore the second page
// IS THIS A REASONABLE SOLUTION? Absolutely. If we were to cross page boundaries
// we would need to fetch our stuff from **somewhere**, by then it would
// likely be too late to handle the "invalidate case".
//
// Or simply put, the architecture might expect us to invalidate the unaligned access
// this should especially reflect on any game that had unaligned issues with JIT before.
memory.InvalidateNCE(addr_c2, Memory::YUZU_PAGESIZE);
}
// We couldn't handle the access.
return HandleFailedGuestFault(guest_ctx, raw_info, raw_context);
}
+3 -2
View File
@@ -28,8 +28,9 @@ bool CheckGameFirmware(u64 program_id) {
!FirmwareManager::CheckFirmwarePresence(*system)) {
auto result = QtCommon::Frontend::Warning(
tr("Game Requires Firmware"),
tr("This game may require firmware to function properly, and you don't have any installed. "
"Please install firmware before launching, or press \"OK\" to launch anyways."),
tr("The game you are trying to launch requires firmware to boot or to get past the "
"opening menu. Please <a href='https://yuzu-mirror.github.io/help/quickstart'>"
"dump and install firmware</a>, or press \"OK\" to launch anyways."),
QtCommon::Frontend::Ok | QtCommon::Frontend::Cancel);
return result == QtCommon::Frontend::Ok;
+9 -3
View File
@@ -233,7 +233,8 @@
</property>
<addaction name="action_Report_Compatibility"/>
<addaction name="action_Open_Mods_Page"/>
<addaction name="action_Open_UserHandbook"/>
<addaction name="action_Open_Quickstart_Guide"/>
<addaction name="action_Open_FAQ"/>
<addaction name="separator"/>
<addaction name="action_About"/>
<addaction name="action_Eden_Dependencies"/>
@@ -406,9 +407,14 @@
<string>Open &amp;Mods Page</string>
</property>
</action>
<action name="action_Open_UserHandbook">
<action name="action_Open_Quickstart_Guide">
<property name="text">
<string>&amp;User Handbook</string>
<string>Open &amp;Quickstart Guide</string>
</property>
</action>
<action name="action_Open_FAQ">
<property name="text">
<string>&amp;FAQ</string>
</property>
</action>
<action name="action_Capture_Screenshot">
+14 -7
View File
@@ -1500,7 +1500,8 @@ void MainWindow::ConnectMenuEvents() {
connect_menu(ui->action_Pause, &MainWindow::OnPauseContinueGame);
connect_menu(ui->action_Stop, &MainWindow::OnStopGame);
connect_menu(ui->action_Open_Mods_Page, &MainWindow::OnOpenModsPage);
connect_menu(ui->action_Open_UserHandbook, &MainWindow::OnOpenUserHandbook);
connect_menu(ui->action_Open_Quickstart_Guide, &MainWindow::OnOpenQuickstartGuide);
connect_menu(ui->action_Open_FAQ, &MainWindow::OnOpenFAQ);
connect_menu(ui->action_Restart, &MainWindow::OnRestartGame);
connect_menu(ui->action_Configure, &MainWindow::OnConfigure);
connect_menu(ui->action_Configure_Current_Game, &MainWindow::OnConfigurePerGame);
@@ -1836,10 +1837,12 @@ bool MainWindow::LoadROM(const QString& filename, Service::AM::FrontendAppletPar
case Core::SystemResultStatus::ErrorVideoCore:
QMessageBox::critical(
this, tr("An error occurred initializing the video core."),
tr("This is usually caused by outdated GPU drivers. "
"Please see the log for more details. See: "
"<a href='https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/HowToAccessLogs.md'>"
"How to access log files</a>."));
tr("Eden has encountered an error while running the video core. "
"This is usually caused by outdated GPU drivers, including integrated ones. "
"Please see the log for more details. "
"For more information on accessing the log, please see the following page: "
"<a href='https://yuzu-mirror.github.io/help/reference/log-files/'>"
"How to Upload the Log File</a>. "));
break;
default:
if (result > Core::SystemResultStatus::ErrorLoader) {
@@ -3146,8 +3149,12 @@ void MainWindow::OnOpenModsPage() {
OpenURL(QUrl(QStringLiteral("https://github.com/eden-emulator/yuzu-mod-archive")));
}
void MainWindow::OnOpenUserHandbook() {
OpenURL(QUrl(QStringLiteral("https://git.eden-emu.dev/eden-emu/eden/src/branch/master/docs/user/README.md")));
void MainWindow::OnOpenQuickstartGuide() {
OpenURL(QUrl(QStringLiteral("https://yuzu-mirror.github.io/help/quickstart/")));
}
void MainWindow::OnOpenFAQ() {
OpenURL(QUrl(QStringLiteral("https://yuzu-mirror.github.io/help")));
}
void MainWindow::ToggleFullscreen() {
+2 -1
View File
@@ -336,7 +336,8 @@ private slots:
void OnPrepareForSleep(bool prepare_sleep);
void OnMenuReportCompatibility();
void OnOpenModsPage();
void OnOpenUserHandbook();
void OnOpenQuickstartGuide();
void OnOpenFAQ();
/// Called whenever a user selects a game in the game list widget.
void OnGameListLoadFile(QString game_path, u64 program_id);