VOGONS

Common searches


New util for DosBox users.

Topic actions

First post, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

Being the holidays and all, I found some of my old DOS CD games and decided to rip them for use with DosBox, obviously, those with CDA tracks ended taking up quite a bit of hard drive space, so I decided to rip the audio tracks to Ogg Vorbis and create their respective .cue sheets, creating them by hand is rather impractical and tedious, so I wrote a small utility to automatically generate them.
It goes by the inspired name of "Compressed Cue Sheet Generator", it is licensed under the GPLv3, it is multiplatform (should compile readily under Linux and OS X provided a working Lazarus install is present) and should be, if anyone desires to do so, easily integrated to D-Fend Reloaded as it's written using Lazarus/Free Pascal and the cue generator is a class in itself (hell, you can write a command line frontend for it if you wish) that should be Delphi compatible out of the box or with minimal code changes.
It is flexible as to what extension (file format, in the end) you want to use for your audio files, as well as being able to accept any number of tracks (1 to 99, per the CD spec [they should be sequential if you want the program to work its magic though]).
The program won't rip your CD, won't compress the audio tracks or anything of the sort, all it does is generate .cue sheets for said files and, at your option, include the data track as well (filename is flexible, too).
The program (only Windows binary ATM) and code can be found here
http://sourceforge.net/projects/cuegen
I *think* it's rather easy to use.
At the moment it's missing binaries for Linux, OS X and documentation, if anyone wants to contribute any of those, you're more than welcome and I'd be grateful, specially for a proper manual 😜.

Reply 4 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

When the baby is asleep and the family gone, I might be able to try my hands tonight (GMT)

Edit: uhm, no, never experienced lazarus/free pascal before...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 5 of 36, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

You just need XCode (I believe you already have it) and the Lazarus .dmgs for Lazarus, FPC and Sources, the tools include install scripts, so it should be pretty easy to setup; the cuegen project itself includes several pre-defined build modes, you probably want "Release", just go to the Lazarus "Run" menu, click "Build" and you will get a nice binary (should be wherever you placed the source under the bin/release folder), if you want an application bundle go to the "Project" menu, "Project Options", under "Application", click on "Create Application Bundle", it should mostly work, I might do a build script for the different platforms when I have some time.
The only real problem I've had when compiling under OS X is that Lazarus (for whatever perverse reason) DOESN'T strip the generated binary, so it comes out rather large and you have to run the strip command by hand, again, if I get around to doing a command line script for building the project, that should be taken care of automatically.
It's also missing an icon in icns format, but that should be easily generated from the .png included in the source.

Reply 6 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Thanks for the writeup. Sounds like a bigger project but I'll give it a try just will need more time 😉
If someone else wants to do it for OS X, I won't be sad 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 7 of 36, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

The platform building scripts have been done, along with an OS X icon, you can build an Intel or Power PC binary and it will create an application bundle all by itself, if you build both, it will create a universal ("fat") binary. Just install Lazarus and its requirements, get the SVN code and run

buildosx.sh

. Lazarus sometimes behaves oddly and if it doesn't build on the first run, execute the script again, if it still refuses, please DO tell me 😜

Reply 8 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Downloaded lazarus and the needed packages and will give it a try soon 😉

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 9 of 36, by Mau1wurf1977

User metadata
Rank l33t++
Rank
l33t++

I'm more interested in the reverse!

Have a game with bin/cue and compressed audio tracks and convert it back to a bin/cue which you can burn onto a disc.

Using compressed audio is blessing, but a curse because now all the GOG.com games come with compressed tracks.

The steps I do to get a working disc for my DOS machine is:

- Convert tracks to WAV
- Remove references to compressed tracks from CUE file
- Change the reference to the bin file so it refers to the renamed one
- Rename the GOG and INST files to bin and cue
- Create a mixed mode project with infrarecorder
- Burn the disc

My website with reviews, demos, drivers, tutorials and more...
My YouTube channel

Reply 10 of 36, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

If your cue files work with

Index 01 00:00:00

it should be an easy addition to the program (write AUDIO instead of MP3 in the Track portion) and add .wav to the extension list (that functionality is already present and can be controlled by the user). You probably don't need to rename anything, in the end, it doesn't have to be a .bin file to be recognized using a .cue.
Example:

FILE "somefile.ext" BINARY

And...you get a .cue sheet generated by the program.
So, really, the only change would be to allow the user to select whether they want the audio tracks to be listed as AUDIO or MP3.
I'll add that option if you're willing to test it and see if the CD works.
Of course the end user would be responsible for making the audio tracks correct for CD standard (44100 KHz sample rate, signed 16 bit)

Reply 11 of 36, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

I just posted a beta version that can generate cue files with uncompressed audio (as per Mau1wurf1977's suggestion). Look under the options menu. You can probably skip the part about renaming the .bin file from .gog or .inst as long as you use the correct file name and place everything in the same folder. The audio decompression and burning you still have to do with other programs. The beta version also includes some improvements and slight bug fixes. It can be found under the "BETA" folder in the Sourceforge files repository.

Reply 14 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

bloodbat:
had a little time, some problems:
- in the buildosx.sh you call the wrong buildparameters.
lazbuild --bm="release os x ppc" cuegenerator.lpi
lazbuild --bm="release os x intel" cuegenerator.lpi
while in the cuegenerator.lpi you have "Release OS X PowerPC" and "Release OS X i386"

- building with lazbuild --bm="release os x i386" cuegenerator.lpi, I got the following output and error

lazbuild --bm="release os x i386" cuegenerator.lpi
primary config path: /Users/Dominus/.lazarus
TranslateResourceStrings A Lang=en FallbackLang=en
TCompiler.Compile WorkingDir="/Users/Dominus/Code/SVN/cuegen/" CompilerFilename="/usr/local/bin/ppc386" CompilerParams=" -MObjFPC -Scghim -CX -WR -O3 -Tdarwin -Pi386 -Xs -XX -k-framework -kCarbon -k-framework -kOpenGL -k-dylib_file -k/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -vewnhi -Filib/i386-darwin -Fu/Developer/lazarus/components/synedit/units/i386-darwin/carbon -Fu/Developer/lazarus/ideintf/units/i386-darwin/carbon -Fu/Developer/lazarus/lcl/units/i386-darwin/carbon -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/components/lazutils/lib/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu. -FUlib/i386-darwin/ -l -FEbin/release/i386/ -dLCL -dLCLcarbon -dCUEGEN cuegenerator.lpr"
[TCompiler.Compile] CmdLine="/usr/local/bin/ppc386 -MObjFPC -Scghim -CX -WR -O3 -Tdarwin -Pi386 -Xs -XX -k-framework -kCarbon -k-framework -kOpenGL -k-dylib_file -k/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib:/System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib -vewnhi -Filib/i386-darwin -Fu/Developer/lazarus/components/synedit/units/i386-darwin/carbon -Fu/Developer/lazarus/ideintf/units/i386-darwin/carbon -Fu/Developer/lazarus/lcl/units/i386-darwin/carbon -Fu/Developer/lazarus/lcl/units/i386-darwin -Fu/Developer/lazarus/components/lazutils/lib/i386-darwin -Fu/Developer/lazarus/packager/units/i386-darwin -Fu. -FUlib/i386-darwin/ -l -FEbin/release/i386/ -dLCL -dLCLcarbon -dCUEGEN cuegenerator.lpr"
Hint: Start of reading config file /etc/fpc.cfg
Hint: End of reading config file /etc/fpc.cfg
Error: Illegal parameter: -WR
ERROR: failed compiling of project /Users/Dominus/Code/SVN/cuegen/cuegenerator.lpi

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 15 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

ok, editing the cuegenerator.lpi and deleting <RelocatableUnit Value="True"/> from the i386 target helped building it.

running the create_osx_bundle.sh chocked on line 24 (create_osx_bundle.sh: line 24: createbundle.resp: No such file or directory), commenting line 24 and 25 made that run and produced a "working" bundle.

On starting it breaks with

error reading MemoCue.SelectedColor.StrikeOutPriority:
Unknown property: "StrikeOutProperty"

Press OK to ignore and risk data corruption.
Press Cancel to kill the program.

Either OK or Cancel kill the program.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 16 of 36, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

The scripts have been fixed.
The -WR parameter is unneeded for OS X and has been removed from those modes.
About the SynEdit error...I call no strikeout properties, get the latest SVN code of the generator, the Lazarus implementation of SynEdit is a bit...odd and barfs if I disable some properties I don't use (though it shouldn't).
Also, try using the latest Lazarus 1.2 Release Candidate, I'm using that (though it really shouldn't be a problem).
Edit: Indeed...the StrikeOut property isn't the latest Lazarus release version, use the RC2 for building the program 😉.

Reply 17 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Will download and try. Hopefully sooner than weeks 😉

Is optimization level 3 stable? At least with gcc I thought the general advice is, to stick to -O2.
OTOH, it's not something complicated as DOSBox, so -O3 probably doesn't hurt...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 18 of 36, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

compiled and runs.
BUT... how does it work? am I supposed to write down each file with path?
Drag'n'drop doesn't seem to work and I see no other way to put files there.

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 19 of 36, by bloodbat

User metadata
Rank Oldbie
Rank
Oldbie

I don't know what you'd want to drag and drop.
Anyway, set starting and ending tracks, a extension (should default to .ogg) and, optionally, a data track, and click generate...there you go, you have a cue sheet, it can be edited, copied, saved...
The data track can be chosen (in the SVN version) using the "open" icon next to the data track text box. That's all.
I don't know about GCC and its evils, but my build modes should default to -O3, Free Pascal doesn't go through GCC...ever.