Compare commits

..

8 Commits

Author SHA1 Message Date
agibert
d2d8d4da11 - Add RRFNFS V 1.2 support. 2009-12-07 11:32:06 +00:00
agibert
c3a454144f - Add Release 1.1.1-1:
- Fix Rx3 archive renaming bug...
2009-10-27 18:28:44 +00:00
agibert
4799b1602c - Fix Rx3 archive renaming bug... 2009-10-26 01:35:08 +00:00
agibert
0445022bd8 - Add support for non sorted dsrom.xml file.. 2009-05-09 21:30:53 +00:00
agibert
c1fb24662c - Add fp bug correction. 2009-04-26 00:14:53 +00:00
agibert
ca4259ed43 - Update RRFNFS to 1.1 version. 2009-04-26 00:14:32 +00:00
agibert
dbd9496c4a - Fix a bug in fp reading from file name. 2009-04-26 00:08:50 +00:00
agibert
9553e74e55 - Change the RRFNFS: Region and Language list are separated by an '=' and not a ':' in order to be FAT friendly !
- Add a work around in dsrom.lsg generator: remove the rom name... NinjaPass bug ?!
2009-04-24 22:42:03 +00:00
3 changed files with 100 additions and 69 deletions

View File

@ -1,7 +1,7 @@
# $RCSfile: ReadMe.txt,v $ # $RCSfile: ReadMe.txt,v $
# $Revision: 1.2 $ # $Revision: 1.5 $
# $Name: $ # $Name: $
# $Date: 2009/04/12 01:20:14 $ # $Date: 2009/12/07 11:32:06 $
# $Author: agibert $ # $Author: agibert $
@ -29,34 +29,37 @@ There is three modes available
Repository structure Repository structure
-------------------- --------------------
The repository is minimally composed by two directory: roms and misc. The repository is minimally composed by two directory: roms and misc.
The rom directory is full of rom files. These file can be uncompressed (.nds) or compressed. Three compressors are supported: zip, rar and 7zip. Next to a nds2rm run, the rom file names and rom archive file names follow the RRNF format. Before a nds2rn run, the rom file names must start with a number followed by a space. The rom directory is full of rom files. These file can be uncompressed (.nds) or compressed. Three compressors are supported: zip, rar and 7zip. Next to a nds2rm run, the rom file names and rom archive file names follow the RRFNFS 1.2 format. Before a nds2rn run, the rom file names must start with a number followed by a space.
In the misc directory, nds2rm is looking for the dat file: dsrom.xml. This file is comming from http://www.advanscene.com/offline/datas/ADVANsCEne_NDS.zip In the misc directory, nds2rm is looking for the dat file: dsrom.xml. This file is comming from http://www.advanscene.com/offline/datas/ADVANsCEne_NDS.zip
RRFNFS: Rx3 Rom File Name Format Standard RRFNFS 1.2: Rx3 Rom File Name Format Standard version 1.2
----------------------------------------- ---------------------------------------------------------
nds2rm stores ROMs in a .nds file with a standardized file name format: nds2rm stores ROMs in a .nds file with a standardized file name format:
XXXX - NNNNNNNNNN (R:L1-...-Ln) [SS].nds XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS].nds
with with
XXXX: id XXXX: id
NNNNNNNNN: name NNNNNNNNN: name
R: Region R: region
L1-...-Ln: Language list L1-...-Ln: language list
SS: Status (OK,KO) SS: status (OK,KO)
nds2rm compresses each ROM file in an archive file with a standardized file name format: nds2rm compresses each ROM file in an archive file with a standardized file name format:
XXXX - NNNNNNNNNN (R:L1-...-Ln) [SS] {CCCCCCCC} <FFFF>.ccc XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS] {CCCCCCCC} _FFFF_.ccc
or this form for a duplicate archive:
XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS] {CCCCCCCC} _FFFF_-Y.ccc
with: with:
XXXX: id XXXX: id
NNNNNNNNN: name NNNNNNNNN: name
R: Region R: region
L1-...-Ln: Language list L1-...-Ln: language list
SS: Status (OK,KO) SS: status (OK,KO)
CCCCCCCC: CheckSum CCCCCCCC: checksum
FFFF: FingerPrint FFFF: fingerprint
ccc: Archive suffix (zip, rar, 7z) Y: dup id
ccc: archive suffix (zip, rar, 7z)

View File

@ -1,13 +1,40 @@
# $RCSfile: ReleaseNotes.txt,v $ # $RCSfile: ReleaseNotes.txt,v $
# $Revision: 1.2 $ # $Revision: 1.7 $
# $Name: $ # $Name: $
# $Date: 2009/04/12 01:20:14 $ # $Date: 2009/12/07 11:32:07 $
# $Author: agibert $ # $Author: agibert $
--------------------------------------------------------------------------------
nds2rm V 1.2.0-1 - A. Gibert - 2009/11/23
--------------------------------------------------------------------------------
- Update RRFNFS to 1.2: replace angle bracket by _ to enclose fingerprint, in order to be FAT/NTFS friendly !
--------------------------------------------------------------------------------
nds2rm V 1.1.1-1 - A. Gibert - 2009/10/27
--------------------------------------------------------------------------------
- Fix Rx3 archive renaming bug (during renumbering pass)...
--------------------------------------------------------------------------------
nds2rm V 1.1.0-1 - A. Gibert - 2009/05/09
--------------------------------------------------------------------------------
- Change the RRFNFS: Region and Language list are separated by an '=' and not a ':' in order to be FAT friendly !
- Add a work around in dsrom.lst generator: remove the rom name... NinjaPass bug ?! Help Me !
- Fix a bug in fp reading (visible in rom listing),
- Add support for non sorted dsrom.xml file...
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
nds2rm V 1.0.0-1 - A. Gibert - 2009/04/12 nds2rm V 1.0.0-1 - A. Gibert - 2009/04/12
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------

59
nds2rm
View File

@ -5,9 +5,9 @@
# (C) 2009 Arnaud G. Gibert # (C) 2009 Arnaud G. Gibert
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
# $RCSfile: nds2rm,v $ # $RCSfile: nds2rm,v $
# $Revision: 1.16 $ # $Revision: 1.21 $
# $Name: $ # $Name: $
# $Date: 2009/04/12 01:20:14 $ # $Date: 2009/12/07 11:32:07 $
# $Author: agibert $ # $Author: agibert $
#----------------------------------------------------------------------------------------------------------------------------------- #-----------------------------------------------------------------------------------------------------------------------------------
@ -251,7 +251,7 @@ function env_setup()
;; ;;
esac esac
rrfnfs_regex=".... - .* \(.*:.*\) \[..\] \{........} <....>[-]*[0-9]*\.${csfx}$" rrfnfs_regex=".... - .* \(.*=.*\) \[..\] \{........} _...._[-]*[0-9]*\.${csfx}$"
} }
@ -373,7 +373,8 @@ function xml_load()
if [[ "${idx}" != "xxxx" ]] if [[ "${idx}" != "xxxx" ]]
then then
if [[ ${idx} -le ${max_idx} ]]
then
count_print ${idx} count_print ${idx}
dat_rn[${idx}]="${rn}" dat_rn[${idx}]="${rn}"
@ -389,11 +390,6 @@ function xml_load()
dat_dup[${idx}]="0" dat_dup[${idx}]="0"
loaded_cnt=$((${loaded_cnt} + 1)) loaded_cnt=$((${loaded_cnt} + 1))
if [[ ${loaded_cnt} -ge ${max_idx} ]]
then
echo "max rom id reached: skipping loading !" 1>&2
break;
fi fi
fi fi
;; ;;
@ -531,7 +527,7 @@ function rom_list_dump()
do do
if [[ ${dat_status[${i}]} == "${status}" ]] if [[ ${dat_status[${i}]} == "${status}" ]]
then then
echo "${dat_id[${i}]} - ${dat_title[${i}]} (${dat_region[${i}]}:${dat_lang[${i}]}) {${dat_crc[${i}]}} <${dat_fp[${i}]}>" echo "${dat_id[${i}]} - ${dat_title[${i}]} (${dat_region[${i}]}=${dat_lang[${i}]}) {${dat_crc[${i}]}} _${dat_fp[${i}]}_"
fi fi
i=$(( ${i} + 1 )) i=$(( ${i} + 1 ))
@ -574,6 +570,8 @@ function dsrom_dump()
{ {
echo "dumping ds rom list..." 1>&2 echo "dumping ds rom list..." 1>&2
echo "${dat_id[${loaded_cnt}]}"
i=1 i=1
while [[ ${i} -le ${loaded_cnt} ]] while [[ ${i} -le ${loaded_cnt} ]]
@ -582,7 +580,10 @@ function dsrom_dump()
then then
mask=$(mask_get "${dat_save_type[${i}]}") mask=$(mask_get "${dat_save_type[${i}]}")
echo "${dat_id[${i}]} ${dat_fp[${i}]}-0 $mask ${dat_title[${i}]} (${dat_region[${i}]}:${dat_lang[${i}]}) [${dat_status[${i}]}] {${dat_crc[${i}]}}" # echo "${dat_id[${i}]} ${dat_fp[${i}]}-0 $mask ${dat_title[${i}]} (${dat_region[${i}]}:${dat_lang[${i}]}) [${dat_status[${i}]}] {${dat_crc[${i}]}}"
# Try to fix non working dsrom.lst by removing rom name... :^(
echo "${dat_id[${i}]} ${dat_fp[${i}]}-0 $mask"
fi fi
i=$(( ${i} + 1 )) i=$(( ${i} + 1 ))
@ -657,7 +658,7 @@ function arc_mkfn()
dup_id=${9} dup_id=${9}
file_prefix="${id} - ${title} (${reg}:${lang}) [${status}] {${crc}} <${fp}>" file_prefix="${id} - ${title} (${reg}=${lang}) [${status}] {${crc}} _${fp}_"
if [[ ${dup_id} == "" ]] if [[ ${dup_id} == "" ]]
then then
@ -933,15 +934,15 @@ function arc_proceed()
if [[ "${extract}" == "yes" ]] if [[ "${extract}" == "yes" ]]
then then
rom="${id} - ${title} (${reg}:${lang}).nds" rom="${id} - ${title} (${reg}=${lang}).nds"
rom_extract "${rom}" "${file}" rom_extract "${rom}" "${file}"
crc2=$(check -n <"${rom}" 2>&1 | sed -e 's/,.*//' -e 's/.*= //' | tr [:lower:] [:upper:]) crc2=$(check -n <"${rom}" 2>&1 | sed -e 's/,.*//' -e 's/.*= //' | tr [:lower:] [:upper:])
fp=$(dd skip=12 count=4 bs=1 <"${rom}" 2>/dev/null) fp=$(dd skip=12 count=4 bs=1 <"${rom}" 2>/dev/null)
else else
crc2=${file/*\{/}; crc2=${crc2/\}*/} crc2=${file/*\{/}; crc2=${crc2/\} _*/}
fp=${file/*\} \</}; fp=${fp/\>*/} fp=${file/*\} _/}; fp=${fp/_*/}
fi fi
@ -999,13 +1000,13 @@ function arc_proceed()
crc=${dat_crc[${idx}]} crc=${dat_crc[${idx}]}
status2="OK" status2="OK"
# Rename the ROM file # Extract ROM file if not yet done
rom2="${id} - ${title} (${reg}:${lang}) [${status2}].nds" if [[ "${rom}" == "" ]]
then
rom="${id} - ${title} (${reg}=${lang}).nds"
print_verbose "moving ${rom} to ${rom2}" rom_extract "${rom}" "${file}"
fi
mv "${rom}" "${rom2}"
rom=${rom2}
if [[ "${arc_type}" == "rx3" ]] if [[ "${arc_type}" == "rx3" ]]
then then
@ -1029,9 +1030,9 @@ function arc_proceed()
# Rename ROM if needed # Rename ROM if needed
if [[ ( "${renumed}" != "yes") && ( ( "${arc_type}" != "rx3" ) || ( "${rebuild}" == "yes" ) ) ]] if [[ ( "${renumed}" == "yes") || ( "${arc_type}" != "rx3" ) || ( "${rebuild}" == "yes" ) ]]
then then
rom2="${id} - ${title} (${reg}:${lang}) [${status}].nds" rom2="${id} - ${title} (${reg}=${lang}) [${status}].nds"
print_verbose "moving ${rom} to ${rom2}" print_verbose "moving ${rom} to ${rom2}"
@ -1049,7 +1050,7 @@ function arc_proceed()
# Make / Rename Archive # Make / Rename Archive
if [[ ( "${arc_type}" != "rx3" ) || ( ${rebuild} == "yes" ) ]] if [[ ( "${renumed}" == "yes") || ( "${arc_type}" != "rx3" ) || ( ${rebuild} == "yes" ) ]]
then then
arc_build "${file_name}" "${rom}" "${file}" "${mode}" "${idx}" arc_build "${file_name}" "${rom}" "${file}" "${mode}" "${idx}"
else else
@ -1161,8 +1162,8 @@ function suffix_mng()
ignored_cnt=$((${ignored_cnt} + 1)) ignored_cnt=$((${ignored_cnt} + 1))
else else
status=${file/* \[/}; status=${status/\] \{*/} status=${file/* \[/}; status=${status/\] \{*/}
crc=${file/*\] \{/}; crc=${crc/\} \<*/} crc=${file/*\] \{/}; crc=${crc/\} _*/}
fp=${file/*\} \</}; fp=${fp/\>-*/} fp=${file/*\} _/}; fp=${fp/_*/}
dat_dup[${idx}]="${dup_id}" dat_dup[${idx}]="${dup_id}"
@ -1175,7 +1176,7 @@ function suffix_mng()
idx_old=${idx} idx_old=${idx}
status_old=${status} status_old=${status}
dup_id=0 dup_id=0
file_name="${file/) \[*/}) [${status}] {${crc}} <${fp}>.${csfx}" file_name="${file/) \[*/}) [${status}] {${crc}} _${fp}_.${csfx}"
dat_fp[${idx}]="${fp}" dat_fp[${idx}]="${fp}"
dat_status[${idx}]="${status}" dat_status[${idx}]="${status}"
@ -1188,7 +1189,7 @@ function suffix_mng()
# Duplicate rom # Duplicate rom
dup_id=$((${dup_id} + 1)) dup_id=$((${dup_id} + 1))
file_name="${file/) \[*/}) [${status}] {${crc}} <${fp}>-${dup_id}.${csfx}" file_name="${file/) \[*/}) [${status}] {${crc}} _${fp}_-${dup_id}.${csfx}"
dup_cnt=$((${dup_cnt} + 1)) dup_cnt=$((${dup_cnt} + 1))
@ -1421,7 +1422,7 @@ function fp_scan()
if [[ ${file} =~ ${rrfnfs_regex} ]] if [[ ${file} =~ ${rrfnfs_regex} ]]
then then
fp=${file/*\} \</}; fp=${fp/\>*/} fp=${file/*\} _/}; fp=${fp/_*/}
status=${file/* \[/}; status=${status/\] \{*/} status=${file/* \[/}; status=${status/\] \{*/}
if [[ ( "${dat_fp[${idx}]}" == "????" ) || ( ( "${dat_status[${idx}]}" == "KO" ) && ( "${status}" == "OK" ) ) ]] if [[ ( "${dat_fp[${idx}]}" == "????" ) || ( ( "${dat_status[${idx}]}" == "KO" ) && ( "${status}" == "OK" ) ) ]]