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

CHD support for PCE Fast #62

Closed
ajshell1 opened this issue Aug 3, 2017 · 24 comments
Closed

CHD support for PCE Fast #62

ajshell1 opened this issue Aug 3, 2017 · 24 comments

Comments

@ajshell1
Copy link

ajshell1 commented Aug 3, 2017

This is a follow-up to a previous bounty.

All I ask is that someone adds CHD support to the Mednafen PCE Fast.

I won't be posting a bounty to add CHD support to the Mednafen SGX core. There weren't any Supergrafx CD games, so there isn't any point. I imagine that the cores are similar enough in their handling of the CD that it wouldn't be very difficult to add it to the SGX core anyway.

This will have a bounty of $15.

EDIT: I seem to have problems creating a bounty for this one. Hang in there while I sort this out.
EDIT2: Nevermind. I created the bounty.

@rtissera
Copy link
Contributor

rtissera commented Aug 8, 2017

This has been merged, can anyone testing and provide feedback ?

@ajshell1
Copy link
Author

ajshell1 commented Aug 8, 2017

Luckily, I already have all my PCE-CD games already in the CHD format. I'll start testing.

EDIT: I'm having trouble compiling cores right now. I'm going to try re-installing MSYS2.

@ajshell1
Copy link
Author

ajshell1 commented Aug 8, 2017

Brief testing with Castlevania Rondo of Blood shows that the redbook audio tracks play correctly. More investigation will be done soon.

@Awakened0
Copy link
Contributor

I hope the SuperGrafx core isn't left behind getting this feature. I stopped using this core since the SuperGrafx one is just this core with, well, SuperGrafx support. Though I suppose it should be fully tested over here before being brought over.

@ajshell1
Copy link
Author

ajshell1 commented Aug 8, 2017

Hopefully it shouldn't be too hard to port it over.

If you want to make a bounty for it, be my guest.

@rtissera
Copy link
Contributor

rtissera commented Aug 8, 2017

No I can add it for free, it's copying / pasting PCE FAST changes.
Just create an issue and I will push the corresponding pull request with code changes.

@ajshell1
Copy link
Author

ajshell1 commented Aug 8, 2017

Do you think you could also port over Tatsuya79's commit that added a bios selector?. I get the feeling that this would also be a fairly easy change.

@Awakened0
Copy link
Contributor

Thanks @rtissera! I created the issue here: libretro/beetle-supergrafx-libretro#22

Since I have that core already setup, it will be easier for me to test CHD support there too.

@ghost
Copy link

ghost commented Aug 8, 2017

im not sure is there is a proper way to use the chdman for this, but converting a verified redump version of Akumajou Dracula -Chi No Rondo renders a bit of an offset for the music tracks. using the command to convert "chdman createcd --input <filename.cue> --output <filename.chd>" the music starts way in and cuts the starting portions of the audio. there should be a Music test on the menu befor starting a stage and it should a quick way for test.

not sure if this is reliable but here is the track comparision between using the cue vs converted chd based on pce lba log:

cue - https://hastebin.com/eviwowuwep.css
chd - https://hastebin.com/kibidonane.css

NOTE: directly using the orig multiple-bin tracks format from the redump image does not work after converting to chd and stucks at bios screen after pressing start, the image has to be re-imaged into single bin/cue format before the converted chd can load into pce_fast. this new cue sheet has been tested and starts-ends of music as expected, but portions of the starting and ending parts of are cut off when using the chd.

@rtissera
Copy link
Contributor

rtissera commented Aug 8, 2017

@retro-wertz Thanks for the detailed feedback and data I will have a look when at home.
The offset looks like some pregap and TOC issues.

@anothername99
Copy link

@rtissera Will you consider writing a CHD conversion utility? I need something that is easy to use, can process Redump images correctly, and is cross-platform. I can open a bounty if you would be interested in working on this. It's sorely needed.

@rtissera
Copy link
Contributor

rtissera commented Aug 8, 2017 via email

@anothername99
Copy link

I know nothing about making scripts. Ah well, thanks anyway.

@rtissera
Copy link
Contributor

rtissera commented Aug 9, 2017

I have seen some batch files floating around. There is also some GUI tools search for QMC2 / QCHDMAN

@rtissera
Copy link
Contributor

rtissera commented Aug 9, 2017

@retro-wertz I can't reproduce the same behaviour (wrong TOC calculated for CHD version).
Can you confirm your Dracula X CHD has this info ?

File Version: 5
Logical size: 541,742,400 bytes
Hunk Size: 19,584 bytes
Total Hunks: 27,663
Unit Size: 2,448 bytes
Total Units: 221,300
Compression: cdlz (CD LZMA), cdzl (CD Deflate), cdfl (CD FLAC)
CHD size: 283,421,488 bytes
Ratio: 52.3%
SHA1: 92cdfc558162e75781345808ebf8e6095a05eb18
Data SHA1: 006e82932a7b45adfec2f46eeb8ff8f83fc3d663

You can generate this by using chdman info -i <filename.chd>

I am using Redump "Akumajou Dracula X - Chi no Rondo (Japan) (FABT, FACT)" dump.

@ajshell1
Copy link
Author

ajshell1 commented Aug 9, 2017

Here is my script I use to make CHD files on windows.

for /r %%i in (*.cue) do chdman createcd -i "%%i" -o "%%~ni.chd"

This is the batch file format. If you want to type this in directly from the command line, replace all instances of "%%" with "%".

This converts all bin/cue files in the directory and subdirectories into CHD files

Then you can delete all the bin/cue files when it's done. You could put that in the batch file, but I have bad experiences with batch files that indiscriminately delete things, so I didn't.

@ghost
Copy link

ghost commented Aug 9, 2017

https://hastebin.com/qugacefebu.pas

@rtissera - how did you convert yours and play in pce? im sure converting directly the verified, multiple-bin format of redump does not work after pressing start..

anyways i think i found a remedy to my issue here. i had to safely convert the multi-bin format to wav/bin/cue using TurboRip, and then convert that new cue sheet instead to chd. audio seems to work fine now but like in pc-fx, its missing some leadout stuff. based on my image, here is what pce-log window shows:

...
[libretro INFO]   Track 21, LBA: 192012  AUDIO
[libretro INFO]   Track 22, LBA: 211262  DATA
[libretro INFO]   Leadout: 220662

compare this to source cue-sheet file, leadout should be 221262(based on my cd-image) this might cause some problems with "picky" games since last track is a data track (probably part of cd-check stuff?)

@rtissera
Copy link
Contributor

rtissera commented Aug 9, 2017

@retro-wertz I basically convert verified redump using chdman which is the right way to do it.

The leadout is indeed wrong, I can spot the bug easily, LBA calculation is not especially if we are not using the same test vectors.
You latest link seems to contain SHA1 for your re-ripped (through TurboRip) CHD, which is not the straight converted redump one. Re-ripping changes the way gaps are stored and this brings a different hash.

Can you run some chdman info on the straight converted chd from the redump multi-track bin to make sure I have the same dump ?

I am available on IRC if needed.

@rtissera
Copy link
Contributor

rtissera commented Aug 9, 2017

PR #65 fixes the wrong leadout value.
Regarding @retro-wertz issues we discussed it on IRC, CHDMAN 0.146 is buggy and should not be used, I have confirmed it does not handle pregap properly and therefore the generated CHD is bad.

Please refrain from using CHDMAN 0.146 (just use the one from latest MAME mainline) and make sure to make other users aware of the issue.

@Awakened0
Copy link
Contributor

I wonder if it will be possible to properly convert the english dub patched Rondo of Blood and Dawn of Ys to CHD. I don't think you can even apply those patches to Redump images. You need to use ISO/WAV or single BIN dumps.

https://burntprojects.wordpress.com/castlevania-rondo-of-blood/
https://burntprojects.wordpress.com/ys-iv-the-dawn-of-ys/

@rtissera
Copy link
Contributor

rtissera commented Aug 9, 2017 via email

@Awakened0
Copy link
Contributor

I tested out these games in CHD format with the latest build of this core:

Castlevania - Rondo of Blood (English Text and Dub Patched)
Dungeon Explorer II
Gate of Thunder
Lords of Thunder
Ys Book I & II
Ys III - Wanderers from Ys
Ys IV - The Dawn of Ys (English Text and Dub Patched)

They all played CD audio at the correct times and all cutscenes with voice were synced up as far as I could tell :)

@rtissera
Copy link
Contributor

rtissera commented Aug 11, 2017 via email

@ghost
Copy link

ghost commented Aug 11, 2017 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants