Viewing Issue Advanced Details
ID Category [?] Severity [?] Reproducibility Date Submitted Last Update
08320 Debugger Major Always May 21, 2022, 03:17 May 25, 2022, 17:25
Tester Foxhack View Status Public Platform MAME (Official Binary)
Assigned To Resolution Not fixable OS Windows 10/11 (64-bit)
Status [?] Closed Driver nes.cpp
Version 0.243 Fixed in Version Build 64-bit
Fixed in Git Commit Github Pull Request #
Summary 08320: Debugger cart loader causes empty software list to appear / video settings reset
Description Start MAME with -debug, select Nintendo Entertainment System. From here, you can either load any game you wish, or start empty. When the game loads, go to the debugger window and select Media - Cartridge. Try selecting a game file from the software list folder, and loading anything will fail with the error "Fatal error: Device NES Cartridge Slot load failed: File is neither iNES or UNIF format" - because none of the games in the software list are in either of those anymore. (Edit: Cuavas has confirmed this is normal and not a bug, I edited the bug title to reflect this.)

Selecting a file in .NES format from a folder in your computer will load the game seemingly without any problems. But, the game will not have any of your custom video settings applied. Now press Tab - File Manager, and try to select another game. Select the Cart option, and MAME will start in the folder you loaded the NES rom from. From there, select [software list]... and the list will be empty! (See attached image.)

I tried to reproduce this with the Genesis driver, and the same issues happened.
Steps To Reproduce Start NES in MAME with debugger, load a game from the software list or start empty, load a NES rom from the debugger window, try to load a game from the software list afterwards.
Additional Information I managed to find this bug while trying to verify that this bug report over at github did not happen in Windows: https://github.com/mamedev/mame/issues/9789
Github Commit
Flags
Regression Version
Affected Sets / Systems
Attached Files
jpg file icon mamedebugbug.jpg (32,996 bytes) May 21, 2022, 03:17 Uploaded by Foxhack
Empty software list display
Foxhack
Relationships
There are no relationship linked to this issue.
Notes
5
User avatar
No.20212
cuavas
Administrator
May 22, 2022, 19:30
I don’t think this is really a bug – the convenience menu in the debugger is just like mounting loose software from the file manager or by path on the command line. You can’t mount software list archives that way, either.
User avatar
No.20213
cuavas
Administrator
May 22, 2022, 19:36
The reason for the empty software list is that you have a relative path specified for you "hashpath" option and probably other options as well, and selecting a file using the Windows file open dialog changes the working directory. This is for backwards compatibility with 16-bit windows behaviour. Microsoft introduced new Common Dialog Box COM objects in Windows Vista that don’t suffer from this limitation, but we can’t easily switch to using them, because the MinGW SDK still doesn’t include the necessary type definitions.

You can work around it by specifying absolute paths for everything in your mame.ini and ui.ini, or you can just avoid using that debugger menu.
User avatar
No.20215
Foxhack
Tester
May 23, 2022, 01:20
My point was that I was surprised MAME still loaded games in NES / UNIF format since it was basically deprecated in favor of chip dumps and other cart configuration settings being defined in the software list XML; granted, I didn't realize that was still possible. I dug through the source and read nes_slot.cpp, so having looked that up and read your explanation, I understand that it isn't a bug. It's just seemed odd at first.

Since you said the software list issue was likely caused caused by a relative path, I edited the ini file, added the full path to the hashfiles, and got the same empty software list after doing the steps above. I then closed MAME, started it up, loaded a cart from the software list, that worked fine. Then I went to the debugger, loaded the .NES file, MAME hard reset the system (as it should), I hit F5 to start emulation, selected the game window, tried to change the game to something on the software list, empty again.

The video output not having any custom settings after doing the above seems super odd, though.

Since 0.234 is close to being released, I'm going to hold off until it's out to do a completely fresh install and try to reproduce this, if that's okay.
User avatar
No.20216
cuavas
Administrator
May 23, 2022, 01:32
Are you expecting it to load mame.ini from the working directory? If you are, it won't find mame.ini after a hard reset when the working directory has changed.
User avatar
No.20220
cuavas
Administrator
May 25, 2022, 17:25
Coincidentally, recent MinGW headers include COM interfaces for stuff up to Windows 7 at least. As of 9ce44fa048793de5e14d1e7af98e8b5ca148d0f3, this won’t happen (it also makes MAME more dependent on Windows Vista or later).

The bug description still shows a misunderstanding of what’s happening. It’s all a side effect of changing the working directory out from under yourself when you’re expecting MAME to use relative paths.