XboxDev / extract-xiso

Xbox ISO Creation/Extraction utility. Imported from SourceForge.
http://sourceforge.net/projects/extract-xiso/
Other
690 stars 87 forks source link

Black screen after repacking Marvel vs Capcom 2; empty directories are incorrectly rewritten as files. #92

Open Sypwn opened 1 month ago

Sypwn commented 1 month ago

The Marvel vs Capcom 2 ISO contains an empty directory located at \media\sounds. If this directory is not present, the game will hang at a black screen during startup. When rewriting the Marvel vs Capcom 2 ISO using extract-xiso -r, the sounds folder is rewritten with attribute 0x20 (archive) instead of attribute 0x10 (directory), thus preventing the rewritten ISO from starting.

The EMPTY_SUBDIRECTORY value seems to be the intended solution here, but it never gets assigned in this situation. Expanding line 1324 to assign subdirectory = EMPTY_SUBDIRECTORY to zero-size directories appears to resolve the issue:

                if (!err)
                {
                    if (dir->file_size > 0)
                        err = traverse_xiso(in_xiso, &subdir, (xoff_t)dir->start_sector * XISO_SECTOR_SIZE + s_xbox_disc_lseek, path, in_mode, in_mode == k_generate_avl ? &dir->avl_node->subdirectory : nil, in_ll_compat);
                    else
                        dir->avl_node->subdirectory = EMPTY_SUBDIRECTORY;
                }
rapperskull commented 1 month ago

The issue is not present in my branch (see #80).