Dreamcast
CDR Sizes
80min/700MB: 1st Session 674MB Maximum
90min/800MB: max 748MB when 45000 Sectors in 1st Session with dummy burn
90min/800MB: max ~735MB when 45000 Sectors in 1st Session
Access Files on CDI Images
- Extract the seperate Track first
cdirip <CDIFILE>.cdi
- In case of 2nd Data Track, fix the LBA first
isofix <TRACK02>.iso <LBA Value reported by cdirip>
What binhack does
Changes LBA Value at offset 1461904 ( 8 Bytes before CD001 string) from 6EB0 (45166) to LBA Value+166 specified during binhack.
Adds Region Codes for JAP,EUR and USA and strings for that. Adds some bootcode, probably SH4 ASM to make the GDROM accept CDRs.
What cdda does
Changes some bytes, probably SH4 ASM to enable playback of CDDA tracks.
What dahack does
Changes LBA Values at offsets 1301408,1302380 and 1461904. First 2 offsets get rewritten from 5EB0 (45150) to 9600 (150). Third offset gets rewritten from 6EB0 (45166) to LBA Value+166 specified during dahack. 3rd offset change is basically the same what binhack does.
What hack3 does
Changes LBA Values at offsets 1301408,1302380 and 1461904. First 2 offsets get rewritten from 5EB0 (45150) to LBA Value+150 specified during dahack. Third offset gets rewritten from 6EB0 (45166) to LBA Value+166 specified during dahack. 3rd offset change is basically the same what binhack does.
LBA 45000 Trick
69120000 bytes in first session will result in LBA 45000.
Fill 1st Session ISO File to 69120000 bytes with zeros
6912000 bytes = 33750 2048-byte-sectors
CORRECTION : Must be 33598 Sectors !!! = 68808703 bytes
1st Session Leadout = 11250 Sectors = 23040000 Bytes
2nd Session will start at Sector 45000
When using extract.exe, add 150 Sectors to LBA reported in gdinfo_FG.exe track05
dd if=/dev/zero of=<ISOFILE> bs=1 count=1 seek=69119999
Creating & Burning DATA/DATA ISOs
Merging track03 & track05 into one file
Create dummy file first Calculate 1185760800 - <SIZE OF track03.bin + SIZE OF track05.bin>
dd if=/dev/zero bs=1 count=0 seek=<RESULT> of=dummy.bin cat track03.bin dummy.bin track05.bin > combined.bin
This also helps when extract.exe only outputs garbage out of track03.iso along with track05.iso. This way only the combined.iso needs to be extracted.
Burning DATA/DATA CDIs
cdirip <CDIFile> <Destination Directory> cdrecord dev=/dev/sr0 -v -multi -tao -xa tdata01.iso cdrecord dev=/dev/sr0 -v -tao -xa tdata02.iso
Full rip process from GD-ROM to CD-ROM
Get GDROM Data from Dreamcast with http-ack
https://github.com/sega-dreamcast/httpd-ack
- Boot HTTP-ack from CD
- Swap HTTP-ack CD with Original GD-ROm
- Connect via Browser to http://192.168.1.30
- Download all files starting with track03.bin
- Download disc.gdi
Extract Data from Tracks
Use gditools
https://sourceforge.net/projects/dcisotools/
Either use GUI or gditools.py
python2.7 ./gditools.py Usage: ./gditools.py -i input_gdi [options] -h, --help Display this help -l, --list List all files in the filesystem and exit -o [outdir] Output directory. Default: gdi folder -s [filename] Create a sorttxt file with custom name (It uses *data-folder* as prefix) -b [ipname] Dump the ip.bin with custom name -e [filename] Dump a single file from the filesystem --extract-all Dump all the files in the *data-folder* --data-folder [name] *data-folder* subfolder. Default: data (__volume_label__ --> Use ISO9660 volume label) --sort-spacer [num] Sorttxt entries are sperated by num --silent Minimal verbosity mode [no option] Display gdi infos if not silent gditools.py by FamilyGuy, http://sourceforge.net/p/dcisotools/ Licensed under GPLv3, see licences folder. iso9660.py by Barney Gale, http://github.com/barneygale Licensed under a BSD-based license, see licences folder.
python2.7 ./gditools.py -i <disc.gdi> --extract-all -o /mnt/development/dreamcast/rips/orgs/<GAME_NAME>/<CD Number> --data-folder __volume_label__ -s sort.txt -b ip.bin
Old way
- If the game contains more than track03.bin, combine the 2 binfiles into 1:
cat track03.bin dummy.bin track05.bin > <BINFILE>
- Convert .BIN Files to .ISO Files first with bin2iso.exe
bin2iso.exe <BINFILE> <ISOFILE>
- Extract Data from .ISO files
extract.exe <ISOFILE>
If extracted 1ST_READ.BIN has filesize of 0, LBA of track05 is wrong.
Downsampling
AFS Files
https://sizious.com/download/dreamcast/
AFS files contain multiple ADX files combined into one AFS file.
compact AFS with:
AFSCompactor.exe
for Alone in the Dark - The New Nightmare .XA files are AFS files, rename first with:
rename .XA .afs *.XA
then compact and rename back to .XA:
rename .afs .XA *.afs
AFSCompactor.exe will rename files inside .afs to file0001 etc... AITD4 doesnt seem to care.
extract AFS with:
afs_extract.exe *.afs|*.XA
or
afsextract.exe -sc afsfile|XAfile
or
afsutils_v2.exe | rename .XA files to .afs beforehand.
SFD Movies
http://www.dc-swat.ru/page/download/
Demux video to .m1v and audio to .wav first
Example (play around with bitrates):
for f in <SFD Files>; do ffmpeg -i $f -vcodec mpeg1video -b:v 2600k -minrate 2600k -maxrate 3600k -y $f.m1v -acodec adpcm_ima_wav -y $f.wav ; done
Open all .wavs in single Audacity project and mass export again, 16bit and 44100 Hz.
Start Dreamcast Movie Converter and remux/reencode to .SFD. Dont use batch processing, videos get truncated!
4XM Movies
http://samples.mplayerhq.hu/game-formats/4xm/
Convert to AVI first with ffmpeg
for i in ../rips/unmodified/aitd4/cd2/AITD4_GD_2/MOVIES/*.4XM; do ffmpeg -i "$i" -vf scale=320x160 -y "${i%.*}.avi"; done
Downsample with 4xm_comp.exe
Speed : 30 fps Data Rate : 110000 Resize Width 320 Height 160
Create ISO Images
For the 1st Session, chosen files must not exceed total of 69120000 bytes!
1st Session
Create first ISOFile
mkisofs -l -duplicates-once -no-allow-lowercase -graft-points -V <DISCNAME> -o <OUTPUT1.ISO> <CHOSEN FILE> <CHOSEN FILE> <CHOSEN FILE>...
Fill first ISOFile with zeros so it takes up exactly 68808703 bytes = LBA 45000
dd if=/dev/zero of=<OUTPUT1.ISO> bs=1 count=1 seek=68808703
Burn 1st session
cdrecord -v -multi -tao -xa <OUTPUT1.ISO>
Check MSINFO value & TOC
cdrecord -msinfo 0,45000
cdrecord -toc first: 1 last 1 track: 1 lba: 0 ( 0) 00:02:00 adr: 1 control: 4 mode: -1 track:lout lba: 33600 ( 134400) 07:30:00 adr: 1 control: 4 mode: -1
To include subdirectories into the root directory of the CD, use
mkisofs -l -duplicates-once -no-allow-lowercase -graft-points -V <DISCNAME> -o <OUTPUT1.ISO> <SUBDIRECTORY>/=<PATH_OF_SUBDIRECTORY>
Example:
mkisofs -no-allow-lowercase -graft-points -l -duplicates-once -V AITD4_GD_2 -o aitd4_d2_1.iso MOVIES/=../rips/modified/aitd4/cd2/AITD4_GD_2/MOVIES/
2nd Session
Hack 1ST_READ.BIN & IP.BIN
Get MSINFO Value
cdrecord -msinfo
binhack Enter name of binary: 1ST_READ.BIN Enter name of bootsector: ip.bin Enter msinfo value: <MSINFO Value> File 1ST_READ.BIN successfully hacked. Bincon detected, OS flag set to 0. File ip.bin successfully created.
Insert custom Logo
logoinsert darkrealm.mr IP.BIN
Burn 2nd Session
mkisofs -no-allow-lowercase -l -duplicates-once -V <DISCNAME> -G <IP.BIN> -M <OUTPUT1.ISO> -C <MSINFO VALUE> -o <OUTPUT2.ISO> <GAME_DATA_DIRECTORY> cdrecord -v -tao -xa <OUTPUT2.ISO>