Project

General

Profile

Emulator Issues #12797

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

Added by leodexe 9 months ago. Updated 8 months 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.

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
8857
8858
8859
8860
8861
8862
8863
8864
8865

History

#1 Updated by JMC4789 9 months ago

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

#2 Updated by leodexe 9 months ago

8860
8861

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.

#4 Updated by JMC4789 9 months ago

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

#5 Updated by leodexe 9 months ago

8862
8863

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)

#6 Updated by JMC4789 9 months 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.

#7 Updated by JosJuice 9 months ago

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

#8 Updated by AdmiralCurtiss 8 months ago

8864

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.

#9 Updated by leodexe 8 months 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.

#10 Updated by leodexe 8 months 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...

#11 Updated by leodexe 8 months ago

8865

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.

Also available in: Atom PDF