Page 2 of 3

Re: Is CD+G possible?

Posted: Wed Jul 07, 2021 4:36 am
by dshadoff
zakk4223 wrote: ↑Sat Jul 03, 2021 7:41 pm Interesting. With my mister modification it doesn't do anything, but I'm only trying with Information Society and Rock Paintings. Maybe they only have one channel anyways.
I finally got a chance to apply the patch to Main_MiSTer and try this out... looks pretty good ! (for cdrdao -> CHD rips)

However, I was wondering whether you were expecting it to work with CloneCD-type rips... it doesn't. Or rather, it plays them as audio CDs only.
The changes to Main_MiSTer would seem to imply that it should be opening the *.sub file, and reading from it though...

Re: Is CD+G possible?

Posted: Wed Jul 07, 2021 5:26 am
by dshadoff
Oh, my mistake - I applied the patch from a couple of days ago, and just now noticed that you had updated it.
The new one appears to work.

Thanks !

Re: Is CD+G possible?

Posted: Wed Jul 07, 2021 6:04 am
by zakk4223
I can also confirm the 'cd+g channel' is a pure 'software' feature. It works with no changes to the core or main (other than all the changes to support CD+G).

I'll assemble the required PRs in a day or two; soon everyone will be able to enjoy facts about Minnesota while listening to Information Society

Re: Is CD+G possible?

Posted: Thu Jul 08, 2021 3:19 pm
by rhester72
@zakk4223 Do you want more test rips? I had another disc show up yesterday.

Re: Is CD+G possible?

Posted: Fri Jul 09, 2021 5:50 pm
by dshadoff
I found some technical information about how the graphic data is encoded into bytes (in addition to how the subcode is encoded on the disc).

This won't be necessary for playback, as the software players already implement the playback protocol - but since the list of CD+G discs that exist is pretty short, if somebody wants to see what the technical capabilities are, and encode a disc, some technical information is here
https://web.ncf.ca/aa571/cdgfaq.htm (Note: lots of broken links)

Re: Is CD+G possible?

Posted: Fri Jul 09, 2021 6:56 pm
by rhester72
This might be the longest disc I've ever ripped - 19 tracks, 69:46:15.

https://www.rendezvo.us/cdg_try2/Little ... Hoy%21.chd

Re: Is CD+G possible?

Posted: Sat Jul 10, 2021 1:24 am
by rhester72
OK, finally got it working after doing my own Quartus build - I think I picked up an earlier prebuild before things were ironed out.

Is what appears to be random decoding and/or paint errors a known issue? No matter what disc I choose (or how many times I cold restart), a minimum of one (but often 2-4) vertical 'strips' anywhere from 2 to 8 'blocks' high on various parts of each screen are either flat-out corrupt or "leftovers" from a prior screen (but in the wrong place!). Not quite sure how to explain it, I can make a video if it'll help.

Re: Is CD+G possible?

Posted: Sat Jul 10, 2021 4:27 pm
by Moondandy
I didn't know CD+G was a thing until I read this thread, have ordered a copy of this Jimmi Hendrix one:
https://www.discogs.com/Jimi-Hendrix-Ex ... ase/589570

I was planning on doing some testing on various CD based consoles so when I am doing it will try this on the ones I have and document which can actually play these things.

Re: Is CD+G possible?

Posted: Sat Jul 10, 2021 4:51 pm
by dshadoff
Just be careful when ordering; many of the circa-1990 discs have both CD+G version and non-CD+G versions (and the CD+G versions are getting harder to find as time goes on).

Of course, there are also apparently karaoke CD+G discs...

Re: Is CD+G possible?

Posted: Sun Jul 11, 2021 4:19 pm
by Mellified
Moondandy wrote: ↑Sat Jul 10, 2021 4:27 pm I didn't know CD+G was a thing until I read this thread, have ordered a copy of this Jimmi Hendrix one:
https://www.discogs.com/Jimi-Hendrix-Ex ... ase/589570

I was planning on doing some testing on various CD based consoles so when I am doing it will try this on the ones I have and document which can actually play these things.
I played that disc on my Sega CD back in the day. It added some interesting visuals to the music. Would be nice to see it working again!

Re: Is CD+G possible?

Posted: Sun Jul 11, 2021 7:12 pm
by zakk4223
rhester72 wrote: ↑Sat Jul 10, 2021 1:24 am OK, finally got it working after doing my own Quartus build - I think I picked up an earlier prebuild before things were ironed out.

Is what appears to be random decoding and/or paint errors a known issue? No matter what disc I choose (or how many times I cold restart), a minimum of one (but often 2-4) vertical 'strips' anywhere from 2 to 8 'blocks' high on various parts of each screen are either flat-out corrupt or "leftovers" from a prior screen (but in the wrong place!). Not quite sure how to explain it, I can make a video if it'll help.
I see it sometimes, and it isn't consistent at all for me. So it's likely not something simple. This is one of the disadvantages of not having a SegaCD myself to compare/test with. It's like it misses an update for a block randomly; kinda makes me suspect this could be some sort of subtle timing issue related to when the subcode data interrupt is generated.

Re: Is CD+G possible?

Posted: Sun Jul 11, 2021 7:34 pm
by dshadoff
I see what you mean; I saw this very often on the cdrdao->CHD rips, but not so much on the CloneCD ones.
Are you using a FIFO to stream the subcode data, or is it possibly being overwritten by the next sector ?

Since the CDDA seems to have a pretty big 8000-sample output FIFO (plus whatever SCSI FIFO exists), if the subcode doesn't have something similar, there could be data loss (but then there should also be a flush whenever there is a repositioning...).

Re: Is CD+G possible?

Posted: Sun Jul 11, 2021 10:50 pm
by zakk4223
The existing MegaCD subcode stuff I resurrected+fixed didn't have a FIFO. It just updates/simulates the ring buffer the raw subcodes are stored in and asserts the interrupt. That ring buffer is only 15 words bigger than a full subcode set, although the interrupt is supposed to only fire when a full subcode set is 'valid' in the buffer. I guess there could be some timing differences with how that buffer is filled and the overflow flag managed since we aren't reading from a cd directly.

I'm also not very (as in, at all...) experienced with FPGA programming so there may be something I'm doing wrong. Maybe I should be using a signal instead of a variable etc. I also need to dig a bit deeper into how ARM->Core data transfer works so I can understand that bit of code better.

Re: Is CD+G possible?

Posted: Mon Jul 12, 2021 1:02 am
by dshadoff
I think it's close enough for a pull request; if there is an improvement or bugfix needed, it can come afterward.

Re: Is CD+G possible?

Posted: Tue Jul 13, 2021 12:29 am
by rhester72
If you can make it there, you can make it anywhere...

https://www.rendezvo.us/cdg_try2/Lou%20 ... D+G%5D.chd

Re: Is CD+G possible?

Posted: Tue Jul 20, 2021 6:23 am
by zakk4223
This was in the latest update of Main+MegaCD core. One step closer to the ultimate FPGA Karaoke machine

Re: Is CD+G possible?

Posted: Tue Jul 20, 2021 8:18 am
by Stupid Dufus
Just wanted to say I tried it out with Information Society. Blast from the past. First CD I ever asked for as a kid. Thanks for adding this in.

Re: Is CD+G possible?

Posted: Wed Jul 21, 2021 7:09 pm
by WiteWulf
Hi folks, I'm curious to see these running. I've grabbed some CD+G CHD files (linked from this thread) and loaded them up in the MegaCD core in MiSTer. I get music but no graphics, even after selecting the CD+G option in the CD player app. Am I missing something?

The MegaCD BIOS version appears to default to is a Japanese v2.00, so I'm guessing "[BIOS] Mega-CD 2 (Japan) (v2.00C).md"

Re: Is CD+G possible?

Posted: Thu Jul 22, 2021 2:29 am
by rhester72
It should 'just work'. Are you sure your main and core are both up-to-date?

Re: Is CD+G possible?

Posted: Thu Jul 22, 2021 8:07 am
by WiteWulf
Yeah, did an update_all before I tried it. Weird, I’ll try again later.

*edit* Yeah, update_all.sh wasn't running properly. I usually start it off and go do something more interesting while it runs :) Turns out that update.sh was abending as some ssl certs were out of date, so I had to run security.sh to fix those. Now everything's up to date and I have the current versions of main and megacd I've got the CD+G working, thanks 8-)

FYI, regarding different data channels: the Lou Reed disk has lyrics in (I think) Spanish and French on channels 2 and 3.