SabreTools / MPF

Redumper/Aaru/DiscImageCreator GUI in C#
GNU General Public License v3.0
427 stars 34 forks source link

[Request] Please add multisession information to comments, for MS discs. #370

Closed sadikyo closed 2 years ago

sadikyo commented 2 years ago

Is your feature request related to a problem? Please describe. When multisession discs are submitted, mods need to inspect the logs manually to determine and share the sessions for multisession in the comments.

Describe the solution you'd like If MPF could calculate and automatically store this information in the comments, this would be very helpful.

Describe alternatives you've considered Mods continuing to do this manually.

Additional context Here is an example: http://redump.org/disc/90453/ You can see the two sessions recorded in the comments under the Multisession heading.

Essentially, the two tracks are stored in the TOC info of _disc.txt, but a calculation has to be done. For the first session, 11400 is subtracted from the end of the first track, to determine the sectors for session one. In this example, it shows 13836 sectors, so by subtracting 11400, you get 2436. Therefore, Session 1: 0-2435 Session 2 should be as shown in the TOC in disc.txt. Session 2: 13836 - 15099.

In this example, you can confirm this by the number of sectors shown in each track on the redump page. Essentially, there is a 11,400 sector "gap" that DIC stores as part of the first track, that should be parsed out here.

If there is any way for this to be done at the MPF level automatically with dumps, this would save a lot of post-work for mods.

Please reach out with any questions!

mnadareski commented 2 years ago

As noted elsewhere, the work for this will be split into 2 parts:

  1. Add the multisession data as a new pseudo-tag so it can be represented internally and shown in the read-only data
  2. Add the parsing and population functionality from the DiscImageCreator outputs
sadikyo commented 2 years ago

Some additional info:

Planet DC Cheats Band 3_disc.txt

Here is an example of a _disc.txt file for a simple case with only one track in each session.

  1. You can see the "gap" toward the bottom, as follows; Set OpCode: 0xd8, SubCode: 8(Raw) Lead-out length of 1st session: 6750 Lead-in length of 2nd session: 4500 Pregap length of 1st track of 2nd session: 150

Total of above is the 11,400 gap.

If you look at the TOC toward the top: ========== TOC ========== Audio Track 1, LBA 0 - 13835, Length 13836 Data Track 2, LBA 13836 - 15099, Length 1264 Total 15100

It shows total sectors as 15100, but it stores the first track incorrectly (it adds the 11,400 gap to the first track)

First session is not 13836 sectors, but only 2436 sectors (13836 - 11400). Therefore, session one is 0 - 2435. Second session is 1264 sectors, and listed correctly above, as 13836 - 15099.

mnadareski commented 2 years ago

Pseudo-tag added in https://github.com/SabreTools/MPF/commit/e5154dad5b745ecdfcb97f2402b013ceb452f763

mnadareski commented 2 years ago

I've been looking this over and I don't fully understand how it's determined what tracks fall into what session based on the _disc.txt file. Can you possibly provide the outputs of a multisession disc with more than 2 tracks?

Feathered-Serpent commented 2 years ago

I'm not OP though I thought I can share examples. One from a PSX game, which has lots of audio tracks (though I think these are all within one session), one of a EnhancedCD (aka Audio CD with Data track) which are definitely two sessions. EnhancedCD.txt PSX.txt

Thought maybe they can help.

mnadareski commented 2 years ago

Implementation notes:

mnadareski commented 2 years ago

Another note: The Enhanced CD example above does not have the line that says "Lead-in length of 2nd session". So that part is variable.