Help turning my game into cue/bin files?

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
Post Reply
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
Joined: Sat Dec 30, 2017 4:03 pm
Has thanked: 0
Been thanked: 0

Help turning my game into cue/bin files?

Post by Rizzoislandgame »

Hopefully this goes here!

I basically need to turn a multi-track disc image into a cue/bin file since I don’t want people to install the crapware/adware that is Alcohol 120%. However, if I burn the game using bootdreams or Alcohol 120% and try to rip it via imgburn or any other program, it doesn’t boot on the Dreamcast! Is there any way to make the file from the ISO and wav files to cue/bin without having to rip it? Would Dreamshell disc ripper work (I need a Dreamcast SD reader)? Does anyone have any personal programs they could give me to help do this? I need it kinda soon since I’m releasing it on March 23rd. Also, could it be I’m using bad cdtools fte settings to rip it? If so, what would be the proper settings from a bootdreams burn?
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
User avatar
snickerbockers
DCEmu Cool Newbie
DCEmu Cool Newbie
Posts: 10
Joined: Tue Mar 06, 2018 8:11 pm
Has thanked: 0
Been thanked: 0
Contact:

Re: Help turning my game into cue/bin files?

Post by snickerbockers »

Ripping the game through your PC's CD-ROM drive won't work because it won't pick up the second session, which is where the filesystem resides.

There's a page on comstedt's site which describes how a CD-R disc needs to be laid out to boot on Dreamcast. I don't know how to use that to generate a cue/bin or a cdi (which is probably going to be an easier format for your users, IMO), but as long as you maintain that disc structure then it should work with any image format.

Wikipedia's cuesheet page makes it seem like all you need to do to generate a cue/bin is to have a text file which tells the computer where the audio and data tracks go on the disc and where it can find them (the audio and data tracks are the audio.raw and data.raw files described on comstedt's site) in which case you don't need to use any special software to create the cue/bin (just write the cuesheet yourself with a normal text editor). I've never tried this before so it's possible that I'm incorrect, but that's how it seems to work.
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
Joined: Sat Dec 30, 2017 4:03 pm
Has thanked: 0
Been thanked: 0

Re: Help turning my game into cue/bin files?

Post by Rizzoislandgame »

snickerbockers wrote:Ripping the game through your PC's CD-ROM drive won't work because it won't pick up the second session, which is where the filesystem resides.

There's a page on comstedt's site which describes how a CD-R disc needs to be laid out to boot on Dreamcast. I don't know how to use that to generate a cue/bin or a cdi (which is probably going to be an easier format for your users, IMO), but as long as you maintain that disc structure then it should work with any image format.

Wikipedia's cuesheet page makes it seem like all you need to do to generate a cue/bin is to have a text file which tells the computer where the audio and data tracks go on the disc and where it can find them (the audio and data tracks are the audio.raw and data.raw files described on comstedt's site) in which case you don't need to use any special software to create the cue/bin (just write the cuesheet yourself with a normal text editor). I've never tried this before so it's possible that I'm incorrect, but that's how it seems to work.
Is it possible to get multi-track CDDA audio on a cdi image? If so, how would I do it?
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Help turning my game into cue/bin files?

Post by nymus »

Hi. If I understand you correctly, you have successfully burned a bootable multisession dreamcast disc of your game and want to distribute a BIN+CUE so that generic writing software can burn it?

imgburn just worked for me as you described so you could just be missing a step somewhere. I burned a disc with bootdreams, ripped it into a BIN with imgburn which produced a BIN+CUE pair that booted properly when I rewrote the CUE (using imgburn).
behold the mind
inspired by Dreamcast
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
Joined: Sat Dec 30, 2017 4:03 pm
Has thanked: 0
Been thanked: 0

Re: Help turning my game into cue/bin files?

Post by Rizzoislandgame »

nymus wrote:imgburn just worked for me as you described so you could just be missing a step somewhere. I burned a disc with bootdreams, ripped it into a BIN with imgburn which produced a BIN+CUE pair that booted properly when I rewrote the CUE (using imgburn).
How would I rewrite it using imgburn?

I have 9 CD tracks and 1 Data track
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Help turning my game into cue/bin files?

Post by nymus »

Following are the instructions for creating the master, just in case you are having trouble with this step. I'll leave finding out the details to your demonstrated development skills ;)

- ensure you have cdrtools (or wodim in Linux) on your (KOS-based) development system.
- note that the loader tools (dcload, dreamshell) provide the convenience of directly loading compiled elf binaries and ISO disc images that do not meet the Dreamcast boot criteria.
- create your game directory, but use sh-elf-objcopy to convert your stripped elf to binary format.
- obtain Marcus' scramble and makeip and compile them.
- scramble and rename the converted binary to 1ST_READ.BIN and copy it to the root of your games directory.
- create IP.BIN using makeip. The IP.BIN will direct the Dreamcast loader to the 1ST_READ.BIN. Copy it to the root as well.
- next, we need to burn the audio session (See below for some discussion on this) and then import its session info to create the ISO image of the game directory. Please correct any errors in my command line quotation.

Code: Select all

cdrecord -multi -audio game_music/*.wav
mkisofs -l -J -R -C `cdrecord -msinfo` -o game.iso game_dir
#prepend the IP.BIN
(cat IP.BIN ; dd if=game.iso bs=2048 skip=16) > game-ip.iso
#use the correct option for mode2 form1 for your version of cdrtools. This is important. 
cdrecord -xa game.iso
You should now have a bootable Dreamcast disc. Open imgburn, select read mode and it will rip the disc into a single BIN+CUE pair regardless of how many audio tracks you have. The CUE file has the session and track info for the binary image as well as the correct writing modes for both sessions.

Set imgburn's mode to write and open the CUE file for burning.

Regarding audio:

In my case, I would just copy the European warning audio wav to the root as well, but since you want to have multiple audio tracks, you could leave them in the ISO filesystem e.g. in a "soundtrack" directory as mp3. I think mp3 playback was possible towards the end of the Walkman's life.
Last edited by nymus on Fri Mar 16, 2018 5:14 pm, edited 2 times in total.
behold the mind
inspired by Dreamcast
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
Joined: Sat Dec 30, 2017 4:03 pm
Has thanked: 0
Been thanked: 0

Re: Help turning my game into cue/bin files?

Post by Rizzoislandgame »

Thanks man! This will help out a lot when I get a new CD-r Pack tomorrow! Hopefully this works!
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Help turning my game into cue/bin files?

Post by nymus »

Oh! I forgot to mention that you need to scramble the 1ST_READ.BIN and prepend the IP.BIN to the ISO image. I've edited my previous post, but you can also use the dcload-ip sources as a reference. (make-cd/Makefile)

You might burn one coaster if you miss one of the technical details e.g. forgetting to scramble like I just did, but these are actually pretty easy to debug because you'll go through Marcus' instructions and realise what you missed.

The hardest and most confounding issues that will cost you more than two or three discs, even with a correct script are not-so-obvious things like the correct -xa option for your cdrtools, whether your burn media is easy to read or whether it needs 8x burn speed. I'll try and write a script that should take care of most of the technical details so you can eliminate them when troubleshooting non-bootable discs.
behold the mind
inspired by Dreamcast
User avatar
lerabot
Insane DCEmu
Insane DCEmu
Posts: 134
Joined: Sun Nov 01, 2015 8:25 pm
Has thanked: 2 times
Been thanked: 19 times

Re: Help turning my game into cue/bin files?

Post by lerabot »

why not do .CDI + imgBurns?
works 100% of the time for me.
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Help turning my game into cue/bin files?

Post by nymus »

I managed to successfully burn Dreamshell using its pre-compiled binaries and have attached the tools I used, copied from Marcus' site. It went pretty smoothly and burned at the max 24X of my drive, but I still made one toaster because the name of the Dreamshell executable has been modified in its IP.BIN. Therefore, I just used the makeip tool (which includes its own IP.BIN template) to create one set to 1ST_READ.BIN.

My version of cdrtools worked with -xa (manpage says mode 2 form 1 with 2048 sectors). I copied the Dreamshell/build directory into dciso, copied WARNING.WAV in there and it worked.

I tried to "fix" the bad disc by rewriting the data session with -multi but it didn't work, probably because the Dreamcast iso loader doesn't look beyond the first data session? It is possible to reuse discs by continuously overwriting the last session, so I might look at the Dreamshell IP.BIN to see if I can fix the bad disc.

Personally, I'm glad that you have chosen NOT to use the cdi format. Thanks for your work and good luck with the release.
Attachments
dccd.tar.gz
(13.94 KiB) Downloaded 93 times
behold the mind
inspired by Dreamcast
Rizzoislandgame
DCEmu Junior
DCEmu Junior
Posts: 44
Joined: Sat Dec 30, 2017 4:03 pm
Has thanked: 0
Been thanked: 0

Re: Help turning my game into cue/bin files?

Post by Rizzoislandgame »

I successfully made a disc image that can be burned with full audio! The version should be up in an hour or so!

Thx so very much man!
"Smile for me, You're in loving hands
Don't be sad today, You can make other plans"

-Smile, Tom Rizzo
nymus
DC Developer
DC Developer
Posts: 968
Joined: Tue Feb 11, 2003 4:12 pm
Location: In a Dream
Has thanked: 5 times
Been thanked: 6 times

Re: Help turning my game into cue/bin files?

Post by nymus »

You’re welcome. I'm glad it all worked out. For the next release, could you also release an ISO of the game session so that people with loaders set up can run it from files or over a network?

All the best.
behold the mind
inspired by Dreamcast
Post Reply