Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MegaCD images not being released #16

Closed
rhester72 opened this issue Aug 30, 2021 · 9 comments
Closed

MegaCD images not being released #16

rhester72 opened this issue Aug 30, 2021 · 9 comments

Comments

@rhester72
Copy link

When MBC is used to copy/launch a MegaCD title (I'm using CHD, not sure if that matters), when the emulator is killed, the file lock on the CHD doesn't seem to be released, resulting in breakage on later runs (in conjunction with MiSTer_SAM). There have been a significant number of changes to Main MiSTer, Linux and the MegaCD core over the past few months and it's unclear which (if any) led to this breakage.

More interestingly, this problem does not appear to occur with TGFX-CD.

@pocomane
Copy link
Owner

pocomane commented Sep 1, 2021

It is very strange that the issue appears with the MegaCD but not the TFGX-CD. I can not see any difference between them. I will try to update all the MiSTer stack soon and to reproduce this issue. In the meanwhile:

  • When did you downloaded mbc? (There where some changes in its internal operation about one month ago)
  • Does this happen every time you launch any MegaCD game, or it is sporadic?
  • Does it correctly load the next game if you delete the !MBC folder manually?

@rhester72
Copy link
Author

  • I picked up MBC when I installed MiSTer_SAM, it was included
  • Yes, it happens every time
  • It works if I delete the folder manually for exactly one time :)

@rhester72
Copy link
Author

Another observation of the same issue:

https://misterfpga.org/viewtopic.php?p=32933#p32933

@mrchrisster
Copy link

Can you try out one of the older mbc releases (eg version 4) to see if that makes it work?
Download:
https://github.com/mrchrisster/MiSTer_Batch_Control/raw/master/mbc_v04
Rename to mbc and replace at /media/fat/Scripts/.MiSTer_SAM

@mrchrisster
Copy link

I did some testing and can confirm this error was introduced at
https://github.com/pocomane/MiSTer_Batch_Control/commit/dcf0eec8829c6d33bef2d9064803553a2de35599
The version before works correctly while the version after always loads the same rom

@pocomane
Copy link
Owner

Thanks for the the analysis. The reason for the break in that commit, is that it changes where the rom are mounted, so it makes clear an issue that is present also in the previous versions: with MegaCD CHD the "Normal" umount does not work.

I not really understand why, however I found a workaround: use the special unmounting option "DETACH" a.k.a. "lazy". This is tried only if the "Normal" unmounting fails 10 times in 5 seconds.

This seems to fix the issue on my MiSTer setup. Please check if it works for you too.

@mrchrisster
Copy link

Just tried working on a fix as well by defining the filename in MBC.c but it didn't work. I noticed megacd core now has an unmount option by pushing button a+b on the gamepad. Unfortunately this relaunches the core so i wasn't able to define a sequence through MBC. Anyways, great to hear you found a workaround!

@mrchrisster
Copy link

Can confirm this works, thanks for the fix!

@rhester72
Copy link
Author

Looks good here as well, closing - thanks, @pocomane !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants