Post by dfreer on Jul 22, 2008 11:03:43 GMT -5
Just found this on another site, have yet to try it out myself but I thought I'd post it here anyways.
BTW, I assume that the rar and ECM steps are for compression purposes only, and are not needed. Any thoughts?
BACKUP PSX GAMES UNDER LINUX
We need:
# cdrdao (install using the package manager of your distro)
# PowerISO
# dbase.PS1
# ECM
# rar (install using the package manager of your distro)
# ps1renamer (bash script created by me)
Steps (by order):
# Make the .bin/.cue with cdrdao
# Rename using ps1renamer script
# Compress with ECM
# Delete the .bin file
# Compress .ecm and .cue files with rar
THE BEST WAY TO LEARN: SEEING AN EXAMPLE
The backup of Kula World
IMPORTANT NOTES
# My ps1renamer ONLY works if you are it into the .bin/.cue directory
# My ps1renamer ONLY works if you type the parameters in the correct order.
First: .bin file
Second: .cue file
Third: dbase.PS1 file
This is correct: ps1renamer image.bin image.cue dbase.PS1
This is NOT correct: ps1renamer image.cue image.bin dbase.PS1
And other combinations are incorrect too.
# First, use simple names for the folder, bin and cue file. ps1renamer could fail if you use a complicated name. If you don't want have problems, use only letters and "_" for your folder, bin and cue names. Then, ps1renamer do the rest :-)
BTW, I assume that the rar and ECM steps are for compression purposes only, and are not needed. Any thoughts?
BACKUP PSX GAMES UNDER LINUX
We need:
# cdrdao (install using the package manager of your distro)
# PowerISO
# dbase.PS1
# ECM
# rar (install using the package manager of your distro)
# ps1renamer (bash script created by me)
#!/bin/bash
BINFILE=$1
CUEFILE=$2
DBASEFILE=$3
if [ -f $BINFILE ]; then
rm -f /tmp/SYSTEM.CNF
poweriso extract $BINFILE /SYSTEM.CNF -od /tmp > /dev/null
CODE=`grep BOOT /tmp/SYSTEM.CNF`
DESP=$((${#CODE}-13))
CODE=${CODE:$DESP:11}
rm -f /tmp/SYSTEM.CNF
echo $CODE | sed 's/_//' | sed 's/\.//' > /tmp/miniout
CODE=`cat /tmp/miniout`
grep -i $CODE $DBASEFILE > /tmp/gamedata
cat /tmp/gamedata | cut -d\; -f4 > /tmp/miniout
SERIAL=`cat /tmp/miniout`
cat /tmp/gamedata | cut -d\; -f6 /tmp/miniout
LANGUAGE=`cat /tmp/miniout`
cat /tmp/gamedata | cut -d\; -f9 > /tmp/miniout
NAME=`cat /tmp/miniout`
FINALNAME="${NAME} [${LANGUAGE}] [${SERIAL}]"
sed -i s/"$BINFILE"/"$FINALNAME".bin/g $CUEFILE
mv $BINFILE "${FINALNAME}.bin"
mv $CUEFILE "${FINALNAME}.cue"
rm /tmp/miniout
rm /tmp/gamedata
CURRENTDIR=`pwd`
CURRENTDIR=`basename $CURRENTDIR`
mv "../$CURRENTDIR" "../$FINALNAME"
else
echo Error
fi
Steps (by order):
# Make the .bin/.cue with cdrdao
cdrdao read-cd --read-raw --datafile image.bin --device /dev/scd1 --driver generic-mmc-raw image.cue
# Rename using ps1renamer script
ps1renamer <file.bin> <file.cue> <path_to_dbase.PS1>
# Compress with ECM
ecm <file.bin> new_file.ecm
# Delete the .bin file
# Compress .ecm and .cue files with rar
rar a -v50000000b -m5 file_name <file.ecm> <file.cue>
THE BEST WAY TO LEARN: SEEING AN EXAMPLE
The backup of Kula World
wiked@hostname:~/PSX$ mkdir kula_world
wiked@hostname:~/PSX$ cd kula_world/
wiked@hostname:~/PSX/kula_world$ cdrdao read-cd --read-raw --datafile kula_world.bin --device /dev/scd1 --driver generic-mmc-raw kula_world.cue
Cdrdao version 1.2.2 - (C) Andreas Mueller <andreas@daneb.de>
SCSI interface library - (C) Joerg Schilling
Paranoia DAE library - (C) Monty
Check http://cdrdao.sourceforge.net/drives.html#dt for current driver tables.
Using libscg version 'ubuntu-0.8ubuntu1'
/dev/scd1: HL-DT-ST RW/DVD GCC-H30N Rev: 1.01
Using driver: Generic SCSI-3/MMC (raw writing) - Version 2.0 (options 0x0000)
Reading toc and track data...
Track Mode Flags Start Length
------------------------------------------------------------
1 DATA 4 00:00:00( 0) 24:06:21(108471)
Leadout DATA 4 24:06:21(108471)
PQ sub-channel reading (data track) is supported, data format is BCD.
Raw P-W sub-channel reading (data track) is supported.
Copying data track 1 (MODE2_RAW): start 00:00:00, length 24:06:21 to "kula_world.bin"...
Reading of toc and track data finished successfully.
wiked@hostname:~/PSX/kula_world$ ps1renamer kula_world.bin kula_world.cue ../../dbase.PS1
wiked@hostname:~/PSX/kula_world$ cd ..
wiked@hostname:~/PSX$ ls
Kula World [E] [SCES-01000]
wiked@hostname:~/PSX$ cd "Kula World [E] [SCES-01000]"
wiked@hostname:~/PSX/Kula World [E] [SCES-01000]$ ecm "Kula World [E] [SCES-01000].bin" "Kula World [E] [SCES-01000].ecm"
ECM - Encoder for Error Code Modeler format v1.0
Copyright (C) 2002 Neill Corlett
Encoding Kula World [E] [SCES-01000].bin to Kula World [E] [SCES-01000].ecm.
Literal bytes........... 1735536
Mode 1 sectors.......... 0
Mode 2 form 1 sectors... 29444
Mode 2 form 2 sectors... 79027
Encoded 255123792 bytes -> 246346435 bytes
Done.
wiked@hostname:~/PSX/Kula World [E] [SCES-01000]$ rm "Kula World [E] [SCES-01000].bin"
wiked@hostname:~/PSX/Kula World [E] [SCES-01000]$ rar a -v50000000b -m5 "Kula World [E] [SCES-01000]" *
RAR 3.71 Copyright (c) 1993-2007 Alexander Roshal 20 Sep 2007
Shareware version Type RAR -? for help
Evaluation copy. Please register.
Creating archive Kula World [E] [SCES-01000].rar
Adding Kula World [E] [SCES-01000].ecm
Calculating the control sum
Creating archive Kula World [E] [SCES-01000].part2.rar
... Kula World [E] [SCES-01000].ecm
Calculating the control sum
Creating archive Kula World [E] [SCES-01000].part3.rar
... Kula World [E] [SCES-01000].ecm OK
Adding Kula World [E] [SCES-01000].cue OK
Calculating the control sum
Done
IMPORTANT NOTES
# My ps1renamer ONLY works if you are it into the .bin/.cue directory
# My ps1renamer ONLY works if you type the parameters in the correct order.
First: .bin file
Second: .cue file
Third: dbase.PS1 file
This is correct: ps1renamer image.bin image.cue dbase.PS1
This is NOT correct: ps1renamer image.cue image.bin dbase.PS1
And other combinations are incorrect too.
# First, use simple names for the folder, bin and cue file. ps1renamer could fail if you use a complicated name. If you don't want have problems, use only letters and "_" for your folder, bin and cue names. Then, ps1renamer do the rest :-)