2 # --- T2-COPYRIGHT-NOTE-BEGIN ---
3 # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
5 # T2 SDE: target/dreamcast/DreamBurn.sh
6 # Copyright (C) 2004 - 2005 The T2 SDE Project
8 # More information can be found in the files COPYING and README.
10 # This program is free software; you can redistribute it and/or modify
11 # it under the terms of the GNU General Public License as published by
12 # the Free Software Foundation; version 2 of the License. A copy of the
13 # GNU General Public License can be found in the file COPYING.
14 # --- T2-COPYRIGHT-NOTE-END ---
20 $0 <content> <IP.BIN> [ -cdrw ] [-dev <device>] [-genopt <string>] [-burnopt <string>] [-xa <string>]
22 Burn boot-able discs for the SEGA Dreamcast console using cdrecord.
25 <content> file or directory containing scrambled executable
27 <IP.BIN> valid IP header conforming to <content>
31 -cdrw burn CD-RW (blank PMA, TOC, Pregap first). Note that
32 the Dreamcast cannot read CD-RWs !
34 -dev cdrecord device string. Default is "0,0,0"
36 -genopt additional cdrecord options. Default is ""
38 -burnopt additional cdrecord options for burning (e.g. speed=8 ).
41 -xa cdrecord option for CD/XA with form 1 sectors with 2048
42 bytes per sector. Depending on cdrecord version this is
43 -xa or -xa1 (consult the manpage !). Default is "-xa"
66 -cdrw) cdrw
=" blank=minimal" ; shift ;;
67 -dev) dev
="$2" ; shift ; shift ;;
68 -genopt) genopt
=" $2" ; shift ; shift ;;
69 -burnopt) burnopt
=" $2" ; shift ; shift ;;
70 -xa) xa
="$2" ; shift ; shift ;;
72 *) echo "Unknown option: $1" ; show_usage
;;
76 [ -e "$content" -a -f "$ip" ] || show_usage
;
78 cdr
="cdrecord dev=$dev$genopt"
79 burnaudio
="$cdr$burnopt$cdrw -multi -audio"
81 burndata
="$cdr$burnopt -multi $xa"
85 cdrecord calls to be executed:
92 echo -n "Proceed ? [Y/n] "
95 [ -z "$confirm" -o "$confirm" == "y" -o "$confirm" == "Y" ] ||
exit 0;
97 audiofile
=`mktemp -t audio.raw.XXXXXX`
98 datafile
=`mktemp -t data.raw.XXXXXX`
99 isofile
=`mktemp -t data.iso.XXXXXX`
101 echo "Creating bogus audio track."
102 dd if=/dev
/zero bs
=2352 count
=300 of
=$audiofile 2>/dev
/null
107 cmd
="$burnaudio $audiofile"
113 echo "Geting multisession status:"
115 status
=`eval "$info"`
120 echo "Creating image."
121 mkisofs
-l -C $status -o $isofile $content
122 echo "Inserting $ip."
123 ( cat $ip ; dd if=$isofile bs
=2048 skip
=16 ) > $datafile
128 cmd
="$burndata $datafile"
135 rm -f $audiofile $isofile $datafile