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

Example of how to write cdg files #1

Open
ionutcristea opened this issue Apr 4, 2017 · 2 comments
Open

Example of how to write cdg files #1

ionutcristea opened this issue Apr 4, 2017 · 2 comments

Comments

@ionutcristea
Copy link

Can you post a little example on how to write cdg files?

@tobsan
Copy link
Owner

tobsan commented Sep 23, 2017

Hey, sorry it took so long to reply. Basically, writing cdg files is the reverse of reading them, and the format is described in detail here: http://jbum.com/cdg_revealed.html

In short, the CDG format is tied to how the actual CD works, which means 4 packets per sector and 75 sectors per second. Each packet is 24 bytes. Then whatever one writes in the packets will control what happens when someone reads the file. Because the format is very low-bandwidth, the format uses instructions on what to change rather than embedding video.

Hope this helps. Whenever I get my act together, the code in this repository should be able to both read and write CDG files. Hopefully it can be extended with an example player of sorts just to see how it works. Writing an editor for cdg files is probably much harder, but creating new files shouldn't be too hard.

@tobsan
Copy link
Owner

tobsan commented Mar 24, 2018

@ionutcristea Turns out there is an open source CDG editor out there: http://cdgmagic.sourceforge.net/. It should be able to both read and write files. See CDG_Magic/Source/CDGMagic_GraphicsEncoder.{h,cpp}

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

2 participants