djhackersdev / bemanitools

Runs recent Konami arcade games and emulates various arcade hardware.
The Unlicense
85 stars 17 forks source link

IIDX Lincle - pre-Lincle songs do not load at all using bemanitools 5.44 #243

Open JeffPaine4890 opened 1 year ago

JeffPaine4890 commented 1 year ago

Summary Songs from previous styles do not load at all when launching the game using bemanitools 5.44. Version 5.43 works fine.

Expected behavior Old songs should be playable

Current behavior Old songs simply kick you right back to the song selection screen

Detailed Description On the songwheel, the old songs all show a BPM of 000 and have no preview. Selecting a broken song will show the transition screen, then go right back to the song selection screen without advancing to the next stage. Absolutely nothing has changed in this setup except for replacing bemanitools 5.43 with 5.44. I've also tried deleting all the backup data and making new backup data by launching with bemanitools 5.44, but that didn't help.

At a glance, this seems to affect all songs from Resort Anthem and earlier, but no songs from Lincle.

I tried on both CGDev and Arcana, as well as with no network, on the offchance it was a network issue.

Trying to play a dan course (just for fun) crashed the game.

Looking at the log showed me a bunch of stuff like this:

[2023/04/07 21:37:27] M:ifs-snd-redir: Sound data redirect: /sd00/0100/0100a.2dx -> /data/sound/0100/0100a.2dx
[2023/04/07 21:37:27] M:ifs-snd-redir: Success, use /data/sound/0100/0100a.2dx

(that example is when I picked a dan course and it immediately crashed, there's nothing in the log after that)

There is no /data/sound/0100 folder, nor a lot of other folders that one would expect to be there. It seems Lincle stores a bunch of its sound data packed into ifs files in the data/imagefs folder.

edit: oh, taking another look at the log, it looks like bemanitools is attempting to mount those IFS files into those nonexistent /data/sound/ folders, clearly something is going wrong though

edit2: It occurred to me that this might be caused by a readonly issue with the data folder, so I made sure the data folder and everything in it was not read-only, this issue is still occurring

Steps to reproduce

  1. Start the game
  2. Start a new credit
  3. Try to select a song from a style earlier than Lincle. Notice the lack of preview and the BPM listing of 000
  4. Select a broken song

Bemanitools version(s) affected 5.44 only

Game(s) and version(s) affected beatmania IIDX 19 Lincle

Command line arguments Nothing other than the defaults in gamestart.bat

APIs used None

OS version Windows 11 Pro Canary 25330

Hardware specs CPU: Intel Core i7-12700H, 2300 Mhz RAM: 16 GB GPU: NVIDIA GeForce RTX 3060 Laptop GPU, 6 GB Controllers/IO: Built-in laptop keyboard (10keyless)

JeffPaine4890 commented 1 year ago

So taking a cursory look at the code, when the my_avs_fs_open function is called in ifs-snd-redir.c, real_avs_fs_open seems to be returning a non-null handle even though the file doesn't exist. Commenting out the success case and falling back to using the imagefs files instead will fix this, as you'd imagine, but I don't know if removing this functionality will break the timebase thing you added in 5.44

This is all I did to change the code to get it to work, in case I worded it confusingly above:

        //if (handle != NULL) {
        //    log_misc("Success, use %s", redir_path);
        //    return handle;
        //} else {
            log_misc("Failure, use %s", path);
            return real_avs_fs_open(path, mode, flags);
        //}
icex2 commented 1 year ago

Thanks for triaging the problem. I have to take a look and test this again. I remember I ran into some confusing parts and also had songs not loading. This resolved after I cleaned up my code, I thought. I might have missed something and forgot to test it in the end.

BlueMoon1890 commented 1 year ago

bump. also having this issue with 5.44, using an older version works fine.