Project

General

Profile

Actions

Emulator Issues #12797

open

NAND Pagefile is broken/unsupported on Wii64/Not64 (Invalid Write, Invalid Read)

Added by leodexe over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
% Done:

0%

Operating system:
N/A
Issue type:
Bug
Milestone:
Regression:
No
Relates to usability:
No
Relates to performance:
No
Easy:
No
Relates to maintainability:
No
Regression start:
Fixed in:

Description

Game Name? Nintendo 64 Emulator for Wii (Wii64/Not64)

To name a few: Smash Remix, Goldeneye X, Perfect Dark, Mario Party 1, 2 & 3, Pokémon Stadium 1 & 2

What's the problem?

Any game that exceeds 16MB in ROM size will require Wii64/Not64 to use the nand pagefile to partially load the ROM into MEM2, this is because MEM2 can only handle ROM sizes that are equal or less than 16MB. On console, the nand pagefile works as expected, but unfortunately it seems that Dolphin does not support nand paging or it's broken for some reason. As a result, trying to load any game higher than 16MB will simply trigger invalid writes and reads into MEM2, thus crashing the emulator with a silent black screen.

Steps to reproduce the problem:

On Dolphin 5.x (latest), run either Wii64 1.3 2021-12-22 or Not64 2013-02-02 or any other newer version, assuming you already have setup and configured a virtual SD Card in order to store the ROMs (any size should work but 2GB is recommended for most homebrew apps), load ANY game higher than 16MB in ROM size, this will trigger the NAND page growth, then the game is partially loaded into MEM2, after the load is finished, select "Play Game".

Is the issue present in the latest development version? Yes. Versions tested:

[Dolphin 5.0.15445 (Arch Linux), dolphin-master-5.0-15377-x64 (Windows 10)]

Is the issue present in the latest stable version? [Yes]

What are your PC specifications? (CPU, GPU, Operating System, more)

[PC specs here]

CPU: Intel Core i5-4590
GPU: Intel HD Graphics 4600
RAM: 12GB DDR3 @ 1600Mhz
OS: Windows 10 / Arch Linux both x64

configuration files, savefiles, savestates)
I don't think I can upload my 2GB Virtual SD card but if you need it I could try uploading to let others test with it.

Once it starts partially loading ROM into MEM2 a lot of these warnings will pop up on the log:
Common/MsgHandler.cpp:112 E[MASTER]: Warning: Invalid write to 0x7fffb2b4, PC = 0x800ea860

Then after "Play Game" is selected, it start showing up invalid reads:
Common/MsgHandler.cpp:112 E[MASTER]: Warning: Invalid read from 0x00000258, PC = 0x800833d4

[Anything else here]
On real hardware this isn't an issue.


Files

warninginvalidwrite.png (17.8 KB) warninginvalidwrite.png When partially loading ROM into MEM2, these messages pop up leodexe, 01/12/2022 12:47 AM
warninginvalidwrite2.png (1.82 MB) warninginvalidwrite2.png A more detailed log of the invalid writes on MEM2 leodexe, 01/12/2022 12:48 AM
warninginvalidread3.png (1.38 MB) warninginvalidread3.png A more detailed log of the invalid reads on MEM2 leodexe, 01/12/2022 12:48 AM
invalidread-15874.png (240 KB) invalidread-15874.png Unresolved as of 5.0-15874 leodexe, 01/12/2022 02:27 AM
invalidwrite-15874.png (539 KB) invalidwrite-15874.png Unresolved as of 5.0-15874 leodexe, 01/12/2022 02:27 AM
interpreter-15874.png (1.18 MB) interpreter-15874.png Not64 2021-11-16 set to interpreter+mmu enabled - works leodexe, 01/12/2022 03:18 AM
wii64-15874-interpreter.png (213 KB) wii64-15874-interpreter.png Wii64 1.3 set to interpreter+mmu enabled - doesn't even boot leodexe, 01/12/2022 03:21 AM
mp1.png (779 KB) mp1.png AdmiralCurtiss, 01/14/2022 08:52 PM
mk64-auv2.1-crashed.png (603 KB) mk64-auv2.1-crashed.png leodexe, 01/15/2022 05:18 PM
Actions #1

Updated by JMC4789 over 2 years ago

This was working a while ago, please try the latest development build as I believe we addressed this once.

Updated by leodexe over 2 years ago

JMC4789 wrote:

This was working a while ago, please try the latest development build as I believe we addressed this once.

Tested latest development build #15874
Still having the same issue.

Actions #4

Updated by JMC4789 over 2 years ago

Can you make sure MMU is enabled in Options -> Configuration -> Advanced

Updated by leodexe over 2 years ago

JMC4789 wrote:

Can you try using interpreter? This seems similar to https://dolphin-emu.org/blog/2018/09/01/dolphin-progress-report-august-2018/#50-8576-jit64-fix-pc-location-on-fallback-to-interpreter-by-delroth

Yeah setting the core to interpreter seems to work out, at an unplayable framerate.

JMC4789 wrote:

Can you make sure MMU is enabled in Options -> Configuration -> Advanced

It wasn't. But with this config only Not64 (injected through a wad) seems to boots properly in the fist place.

Wii64 seems to get stuck with these two last messages in the log:
12:55:715 Core\HW\ProcessorInterface.cpp:114 W[PI]: Fifo reset (00000001)
12:55:715 Core\HW\ProcessorInterface.cpp:114 W[PI]: Fifo reset (00000000)

Actions #6

Updated by JMC4789 over 2 years ago

If interpreter works and the JIT doesn't, the build I linked should work for you. Then you just have to bisect to find out what build broke it, and we can fix it in the latest development builds.

Actions #7

Updated by JosJuice over 2 years ago

  • Tracker changed from Issue to Emulator Issues
  • Project changed from Infrastructure to Emulator
  • Issue type set to Bug
  • Regression set to No
  • Relates to usability set to No
  • Relates to performance set to No
  • Easy set to No
  • Relates to maintainability set to No
  • Operating system N/A added
Actions #8

Updated by AdmiralCurtiss over 2 years ago

I tried this just now and... as far as I can tell this works?

We need some more detailed instructions on what you're doing, I think.

Actions #9

Updated by leodexe over 2 years ago

Pikachu025 wrote:

I tried this just now and... as far as I can tell this works?

We need some more detailed instructions on what you're doing, I think.

I can tell you're using OHBC to run Not64, while I inject it to run into a wad so it doesn't crash. If this same bug happen with Wii64, that should explain why pagefile seems broken.
I'll run some tests later with OHBC > Wii64/Not64 and report back results later.

Actions #10

Updated by leodexe over 2 years ago

JMC4789 wrote:

If interpreter works and the JIT doesn't, the build I linked should work for you. Then you just have to bisect to find out what build broke it, and we can fix it in the latest development builds.

It does work, with the workaround you provided in the link. Not64 nand paging works properly. It must be noted that this specific setup (Load Not64 through OHBC and not other way around) is required so the emulator doesn't break when triggers r/w to sdcard with nand paging.

Wii64 (1.3) nand paging also works when loaded through OHBC, HOWEVER it also causes the menu to permanently appear after starting the game, thus rendering the game unplayable but the emulator itself does not crash, it's just that for some reason the button combo is always pressed so the menu is called in an infinite loop. Do you have any clue why this happens? And then again, when you load Wii64 directly from Dolphin, this does not happen but the nand paging will only work if loaded through OHBC.

Still, this technically resolves what I was looking for. So my original issue is pretty much solved at this point.
Now, if there were some way to play games with Wii64 Rice without slowing down to an unplayable pace of 1FPS...

Actions #11

Updated by leodexe over 2 years ago

Hey, it's me again. I was playing Mario Kart 64 Amped Up v2.1 on Not64 (latest) loaded through OHBC, after playing the first two cups, the game froze on Green Greens (1st track of 3rd cup)
This is not supposed to happen as I have played many times this mod on the actual Wii and never experienced a crash on console. Here is the log but idk if contains anything useful.
As this ROM is exactly 16MB and it's within the limits of MEM2 so it's actually fully loaded into it, this problem is unrelated to nand paging.

Actions

Also available in: Atom PDF