Project

General

Profile

Emulator Issues #11324

Advance Game Port (v2) Savestate Feature Does Not Work with GCI Folders

Added by JMC4789 over 1 year ago. Updated about 1 year ago.

Status:
Accepted
Priority:
Low
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?

Advance Game Port (2004 Datel) - GNHE5d
Mario Golf - Advance Tour - AGB-BMGE-USA

This feature it not present in the 2003 Advance Game Port

MD5 Hash? (right click the game in the game list, properties, info tab, MD5 Hash: Compute)

hahahahahahhahahahaha

What's the problem? Describe what went wrong. Also turn it into a sarcastic story.

Let's say you had a build of Dolphin that sorta-properly-but-maybe-not emulated GPU timings to the point where the Advance Game Port could run games again. Basically, imagine the Advance Game Port was functional and didn't randomly crash all the time. Okay, now that you did that, you need DSP-LLE and a GameCube BIOS of any region. Once you have that, load up the Advance Game Port, set the Advance Game Port to SlotB and make sure you dumped a GBA rom that works in the Advance Game Port. I used Mario Golf in my test but any game works.

Anyway, if you happen to be using GCI Folders in Slot A, things seem to be working fine. The game runs at a crisp 14 - 20 FPS on the Advance Game Port with the audio constantly stuttering. It's beautiful, really. Hell, the 2004 version of the Advance Game Port at least emulates the game's mirrored sprites correctly, unlike the 2003 version. So really you can't ask for a better way to play Mario Golf: Advance Tour on the big screen.

But in the 2004 version of the Advance Game Port is this fancy new "snapshot" feature which lets you save your progress even in games that don't have saves. Why you'd need to use this over Dolphin's savestates, I don't exactly know but for some reason I decided to try it out and BOOM. Dolphin crashed.

Using regular memory cards works fine, but that's no fun. Dolphin definitely shouldn't crash at the very least, even if this feature for some reason can't be supported with a fix.

Is the issue present in the latest development version? For future reference, please also write down the version number of the latest development version.

This issue isn't actually present in any version of Dolphin as they'll hang very early in the boot process. It only theoretically exists in the sense that if the AGP were to boot, it'd definitely happen.

Is the issue present in the latest stable version?

The above also applies to stable versions.

If the issue isn't present in the latest stable version, which is the first broken version? (You can find the first broken version by bisecting. Windows users can use the tool https://forums.dolphin-emu.org/Thread-green-notice-development-thread-unofficial-dolphin-bisection-tool-for-finding-broken-builds and anyone who is building Dolphin on their own can use git bisect.)

I guess the first broken revision would be the one that added GCI folders?

If your issue is a graphical issue, please attach screenshots and record a three frame fifolog of the issue if possible. Screenshots showing what it is supposed to look like from either console or older builds of Dolphin will help too. For more information on how to use the fifoplayer, please check here: https://wiki.dolphin-emu.org/index.php?title=FifoPlayer

If we had a fifolog for memory card writes I would oblige.

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

CPU ARM7TDMI @ 16.78 MHz, Zilog Z80 @ 8 or 4 MHz
Memory 32 KB internal, 256 KB external, 96 KB VRAM
Display TFT LCD, 240×160 pixels, 40.8×61.2 mm[5]

Is there anything else that can help developers narrow down the issue? (e.g. logs, screenshots,
configuration files, savefiles, savestates)

I spent way too long searching for GBA gameIDs...

GCIFolderAGP.jpg (36.5 KB) GCIFolderAGP.jpg JMC4789, 08/05/2018 06:56 AM
AGPTest.JAP.7z (36.5 KB) AGPTest.JAP.7z JMC4789, 08/14/2018 03:20 AM
6958

History

#1 Updated by Helios over 1 year ago

  • Priority changed from Normal to Low

JMC this was critical so I'm triaging as requested.

#2 Updated by lpfaint99 over 1 year ago

Fun times. I don't have this disc, but it makes sense that an unlicensed game wouldn't use the normal writes.

GCI Folders relies on the fact that the official games write the header and allocate blocks prior to writing to the block.
so only the first 5 blocks are automatically created (header, directory,directorybackup, bat, batbackup).
after that the only blocks are ones that have been allocated by a game,
directory listing points to first block in BAT, which points to the next block up until the end (-1).

#3 Updated by JMC4789 over 1 year ago

Is there any way to fix this or should the warning be changed or something?

#4 Updated by lpfaint99 over 1 year ago

The analytics weren't in place when I wrote the feature, so I figured dolphin closing would get it to actually be reported

https://github.com/dolphin-emu/dolphin/blob/master/Source/Core/Core/HW/GCMemcard/GCMemcardDirectory.cpp#L373

If you replace that exit(0) with
~~~ cpp
l.unlock();
return length + extra;
~~~

It should "skip" writing that block, but not crash (at least not deliberately)

Almost certainly fixable, but rather challenging without the disc. If you could provide raw memory card files I could potentially get some details worked out.
* Brand new memory card with exactly one snapshot
* Copy of that same card with an additional snapshot
* Copy of the original card with a snapshot from a different game.

If I were writing that feature today I'd have better logging in place so you could just provide me with a log, so maybe it'd be worthwhile for me to add some now :shrug:

#5 Updated by JMC4789 over 1 year ago

How the snapshots work are a bit a mystery. You definitely can't have two snapshots from the same game. I'm not sure if you can have snapshots from two different games even.

I'll get some memory cards though.

#6 Updated by JMC4789 over 1 year ago

It definitely seems to only let me keep one snapshot on a memory card. The game's region is apparently japanese (even on console, though it'll boot on any region.)

#7 Updated by lpfaint99 over 1 year ago

I was afraid that it would be one per memory card, which hits another case that isn't well defined, depending on exactly how it does the writes, only the first time might work

The good news is, it doesn't look like it is doing anything super crazy, I'll see if I can find some time this week to throw together a first pass at supporting it, with some logging that can help finalize the details

#8 Updated by JMC4789 about 1 year ago

  • Status changed from New to Accepted

Also available in: Atom PDF