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

Disc-hashing of non-PSX discs #1075

Open
adelikat opened this issue Dec 9, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@adelikat
Copy link
Contributor

commented Dec 9, 2017

Open a saturn game and click the rom status icon in the staus bar, nothing happens.

This is also true of any core that takes a list of roms (for some there's both a single rom and multi-rom constructors and it only happens for multi-rom).

Either we need the client to take a stab at implementing RomAnnotationDetails for multi-roms or each core affected needs to implement that logic

@Asnivor

This comment has been minimized.

Copy link
Contributor

commented Mar 22, 2018

see #1152

adelikat added a commit that referenced this issue Jun 22, 2018

@Asnivor

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2018

This now works as of a few months ago.

The last thing is that disc-based 'ROMS' just show their hashes as 'N/A' (because thats what I did at the time).

Can we have a discussion on what we should be showing here in this instance?

  • cue hashes are pointless
  • bin/img/iso hashes can be expensive I would imagine
  • iirc PSX has some blackmagic internal hash thing that @zeromus mentioned to me a while back. Do we think about using this?
  • is there such a thing as a 'known good dump' when it comes to disc images?
  • do we just not bother....
@zeromus

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2018

cue is the same situation as bin/img/iso. It's the mounted disc which is hashed. All of the disc images have a black magic hashing method (although some like PSX are far blacker than others). I did generate a known good list of PSX roms by running my blacker magic hashing method on all of redump. It's in our gamedb.

We should be able to show a disc "hash" in the rom status. These are useful for identification purposes. Thats what the movie tools should be doing to confirm the "correct" game is probably being used. Of course, it can't be known for 100% sure unless the entire disc's contents are hashed. For now, a weaker identifying hash is all we can do.

For all discs we should (maybe we arent, I dont know) using a hash based on the TOC, plus the first several sectors. First several sectors was chosen by vecna originally. I determined how many sectors were required to uniquely identify all the PSX games (part of blacker magic) although it would be possible to trick it.

A more robust identification would involve parsing the filesystem, hashing that, AND identifying the executable, and hashing that. The goal is to hash as much as we can, except for the last bit of hashing everything. While keeping in mind romhacks are likely to only change the EXE, and bad rips are likely to have different TOCs before anything else is wrong.

However, we're probably not changing any hashing methods now. I'm just telling you what my grand plan was.

At any rate we DO have a disc identifying hash. We should display that. How we indicate that it's a disc identifying hash and not a complete verification hash, I don't know. I had thought we should offer to compute a complete verification hash, and people should be able to put that in movies--people that want to be sure can run the verification hash on their media to check. Without that, only the cursory identification hash would be used.

@Asnivor

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2018

@zeromus

So should we be using DiscHasher.Calculate_PSX_BizIDHash() for non-PSX discs as well?
Or DiscHasher.OldHash()?

@zeromus

This comment has been minimized.

Copy link
Contributor

commented Sep 11, 2018

The right way to do this is to do the same analysis I did for the PSX: use the PSX hash but adjust the 26 as needed while running it on the whole saturn corpus until an appropriate value is found (or just use 26 again if that works, so that we can use the same hash for both systems). At that time the gamedb also needs to be built. I already know how to do that, so you can either assign this to me in order to make me do it, or tackle it yourself.

note: DBMan's DiscHash.cs seems to be what I used to perform this analysis. I think it would be nice if we can improve that tool to formalize this process, so that the analysis can be performed again on an updated corpus. Although keep in mind that if the hashes ever change, people's movies would contain obsolete disc ID hashes. This isn't the end of the world, though.

Also, if we DO ever change the hashing approach, we should go ahead and try the filesystem and EXE thing. However, since I just thought of the 'obsoleting hashes in movies' argument, that may be justification for doing the work now, for saturn. I think this cdfs-and-exe thing may suit your interests well, but it's up to you.

@Asnivor Asnivor changed the title Rom status icon doesn't work on Saturn Disc-hashing of non-PSX discs Sep 13, 2018

@Asnivor

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2018

I think i'll have to push it to you for now. The 'whole ss corpus' thing is where I will struggle at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.