Compare commits
No commits in common. "d2d8d4da118d7f0f231985f159cb23c8641c6ccf" and "33c4b9a7c0db933fc33aa877a59991390051b57e" have entirely different histories.
d2d8d4da11
...
33c4b9a7c0
145
ReadMe.txt
145
ReadMe.txt
@ -1,7 +1,7 @@
|
||||
# $RCSfile: ReadMe.txt,v $
|
||||
# $Revision: 1.5 $
|
||||
# $Revision: 1.1 $
|
||||
# $Name: $
|
||||
# $Date: 2009/12/07 11:32:06 $
|
||||
# $Date: 2009/03/21 18:55:50 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
@ -10,149 +10,10 @@
|
||||
|
||||
Welcome to NDS2RM:Nintendo DS Simple ROM Manger !
|
||||
|
||||
This little shell script (BASH) is designed for automatize simple Nintendo DS ROM Management.
|
||||
This little shell script (BASH) is designed for automatise simple Nintendo DS ROM Management.
|
||||
|
||||
|
||||
|
||||
There is three modes available
|
||||
------------------------------
|
||||
- Test Mode (-T | --test):
|
||||
In this mode, nds2rm will load rom data from dsrom.xml, scan the roms repository and finally report info and statistics about what would be done in correct mode. No file are modified.
|
||||
- Correct Mode (-C | --correct):
|
||||
In this mode, nds2rm will load rom data from dsrom.xml, scan the roms repository, perform action on rom files (extract / rename / compress) and finally report info and statistics about what have been done.
|
||||
- dsrom.lst dump Mode (-D | --dsrom):
|
||||
In this mode, nds2rm will load rom data from dsrom.xml, scan the roms repository and finally dump on stdout the dsrom.lst file.
|
||||
This file is used by NinjaPass cards (http://www.ninjapass.com).
|
||||
|
||||
|
||||
|
||||
Repository structure
|
||||
--------------------
|
||||
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 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
|
||||
|
||||
|
||||
|
||||
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:
|
||||
XXXX - NNNNNNNNNN (R=L1-...-Ln) [SS].nds
|
||||
with
|
||||
XXXX: id
|
||||
NNNNNNNNN: name
|
||||
R: region
|
||||
L1-...-Ln: language list
|
||||
SS: status (OK,KO)
|
||||
|
||||
nds2rm compresses each ROM file in an archive file with a standardized file name format:
|
||||
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:
|
||||
XXXX: id
|
||||
NNNNNNNNN: name
|
||||
R: region
|
||||
L1-...-Ln: language list
|
||||
SS: status (OK,KO)
|
||||
CCCCCCCC: checksum
|
||||
FFFF: fingerprint
|
||||
Y: dup id
|
||||
ccc: archive suffix (zip, rar, 7z)
|
||||
|
||||
|
||||
|
||||
Statistics explanations
|
||||
-----------------------
|
||||
Example:
|
||||
|
||||
run statistics:
|
||||
1 roms set to OK
|
||||
0 roms changed to OK
|
||||
3560 roms kept to OK
|
||||
|
||||
0 roms set to KO
|
||||
0 roms changed to KO
|
||||
61 roms kept to KO
|
||||
|
||||
0 roms are renumbered
|
||||
|
||||
This details in term of status and renumbering what has been (or would be) done.
|
||||
|
||||
|
||||
global statistics:
|
||||
3600 roms are in dsrom.dat Number of entry in the XML dat file
|
||||
3622 roms are found Number of ROMs found in the input repository
|
||||
0 roms are ignored Number of ROMs ignored by the "max idx" option
|
||||
3622 roms are proceeded Number of ROMs proceed (found - ignored)
|
||||
22 roms are duplicated Number of ROMs with the same id and the same status
|
||||
|
||||
3561 total roms are OK Total number of ROMs which have the OK status
|
||||
6 roms are dup OK Number of duplacted OK ROMs
|
||||
3555 roms are OK Number of unique ROMs which have the OK status (total - duplicated)
|
||||
|
||||
61 total roms are KO Total number of ROMs which have the KO status
|
||||
16 roms are dup KO Number of duplacted KO ROMs
|
||||
45 roms are KO Number of unique ROMs which have the OK status (total - duplicated)
|
||||
39 roms are KO not OK Number of unique ROMs which have the OK and not the OK status
|
||||
|
||||
6 roms are missing Number of missing ROMs (ROMs found in the dat file and not found in the repository)
|
||||
|
||||
The four more important numbers are:
|
||||
3600 roms are in dsrom.dat
|
||||
3555 roms are OK
|
||||
39 roms are KO not OK
|
||||
6 roms are missing
|
||||
|
||||
This means that on 3600 ROMs found in the dat file, 6 are missing in the repository, 3555 are found OK and 39 are found KO.
|
||||
|
||||
|
||||
|
||||
Command line help
|
||||
-----------------
|
||||
Path options:
|
||||
-i | --repo_in <path>: input repository path (default: /opt/public/nds)
|
||||
-o | --repo_out <path>: output repository path (default: /opt/public/nds)
|
||||
|
||||
Mode selection
|
||||
-C | --correct: corect output repository
|
||||
-T | --test: test input repository (default mode)
|
||||
-D | --dsrom: dsrom.lst will be dumped
|
||||
-h | --help: print this help and exit
|
||||
-V | --version: print the version and exit
|
||||
|
||||
Global options
|
||||
-m | --max <id>: maximum rom id to load from dat file (default: 9999)
|
||||
-v | --verbose: switch on verbosity
|
||||
-c | --compressor <c>: set archive compressor (zip, rar or 7z) (default: 7z)
|
||||
|
||||
Test and Correct Mode options:
|
||||
-j | --jobs <jobs>: nuber of parallel jobs to run (default: 1)
|
||||
-r | --rebuild: don't trust archive file name (test & correct mode)
|
||||
rebuild archives (correct mode)
|
||||
-n | --renum: try to renumber archives
|
||||
--list_ok: list roms with ok status
|
||||
--list_ko: list roms with ko status
|
||||
--list_miss: list missing roms
|
||||
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
- nds2rm -T -i /opt/public/nds.new -o /opt/public/nds.new -m 3600 -n
|
||||
it will ask nds2rm to tests the repository (/opt/public/nds.new) with renum option. Only the 3600 first roms will be used.
|
||||
|
||||
- nds2rm -C -i /opt/public/nds.old -o /opt/public/nds.new -m 3600 -n
|
||||
it will ask nds2rm to create a new repository in /opt/public/nds.new by reading an existing one from /opt/public/nds.old. Only the 3600 first roms will be processed. The roms archive with the right name format (RRNF) will not be extracted / recompressed. If needed roms will be renumbered.
|
||||
|
||||
- nds2rm -C -i /opt/public/nds.old -o /opt/public/nds.new -m 3600 -r -n
|
||||
it will ask nds2rm to create a new repository in /opt/public/nds.new by reading an existing one from /opt/public/nds.old. Only the 3600 first roms will be processed. The roms archive name format (RRNF) will not be trusted and systematically extracted / recompressed. If needed roms will be renumbered.
|
||||
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
NDS2RM is licensed under the GPL GNU Licenses.
|
||||
For more information, please read the corresponding source file headers.
|
||||
The license details can be found in the GNU-GPL.txt and GNU-FDL.txt files.
|
||||
|
@ -1,7 +1,7 @@
|
||||
# $RCSfile: ReleaseNotes.txt,v $
|
||||
# $Revision: 1.7 $
|
||||
# $Revision: 1.1 $
|
||||
# $Name: $
|
||||
# $Date: 2009/12/07 11:32:07 $
|
||||
# $Date: 2009/03/21 18:55:50 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
@ -9,38 +9,7 @@
|
||||
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
nds2rm V 1.2.0-1 - A. Gibert - 2009/11/23
|
||||
nds2rm V 1.0.0-1 - A. Gibert - 2009/??/??
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
- 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
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
- Initial public release,
|
||||
- Zip, Rar and 7zip support,
|
||||
- Rx3 ROM Name Format Standard Support (RRFNFS)
|
||||
- NDS XML dat file support: ADVANsCEne (http://www.advanscene.com/offline/datas/ADVANsCEne_NDS.zip)
|
||||
- NinjaPass dsrom.lst generator.
|
||||
Initial public release.
|
||||
|
7
ToDo.txt
7
ToDo.txt
@ -1,7 +1,7 @@
|
||||
# $RCSfile: ToDo.txt,v $
|
||||
# $Revision: 1.2 $
|
||||
# $Revision: 1.1 $
|
||||
# $Name: $
|
||||
# $Date: 2009/04/12 01:20:14 $
|
||||
# $Date: 2009/03/21 18:55:50 $
|
||||
# $Author: agibert $
|
||||
|
||||
|
||||
@ -9,7 +9,4 @@
|
||||
|
||||
|
||||
- Write a better documentation !
|
||||
- Add Patched ROM support (PT Status) ?
|
||||
- Add multi input repository,
|
||||
- Add status mode (stats only),
|
||||
- ...
|
||||
|
91
nds2rm
91
nds2rm
@ -5,9 +5,9 @@
|
||||
# (C) 2009 Arnaud G. Gibert
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
# $RCSfile: nds2rm,v $
|
||||
# $Revision: 1.21 $
|
||||
# $Revision: 1.14 $
|
||||
# $Name: $
|
||||
# $Date: 2009/12/07 11:32:07 $
|
||||
# $Date: 2009/04/11 22:57:02 $
|
||||
# $Author: agibert $
|
||||
#-----------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
@ -251,7 +251,7 @@ function env_setup()
|
||||
;;
|
||||
esac
|
||||
|
||||
rrfnfs_regex=".... - .* \(.*=.*\) \[..\] \{........} _...._[-]*[0-9]*\.${csfx}$"
|
||||
rnfh_regex=".... - .* \(.*:.*\) \[..\] \{........} <....>[-]*[0-9]*\.${csfx}$"
|
||||
}
|
||||
|
||||
|
||||
@ -373,23 +373,27 @@ function xml_load()
|
||||
|
||||
if [[ "${idx}" != "xxxx" ]]
|
||||
then
|
||||
if [[ ${idx} -le ${max_idx} ]]
|
||||
|
||||
count_print ${idx}
|
||||
|
||||
dat_rn[${idx}]="${rn}"
|
||||
dat_id[${idx}]="${id}"
|
||||
dat_title[${idx}]="${title}"
|
||||
dat_region[${idx}]="${reg_tab[${location}]}"
|
||||
dat_lang[${idx}]="${lang}"
|
||||
dat_save_type[${idx}]="${save_type}"
|
||||
dat_crc[${idx}]="${crc}"
|
||||
|
||||
dat_fp[${idx}]="????"
|
||||
dat_status[${idx}]="?"
|
||||
dat_dup[${idx}]="0"
|
||||
|
||||
loaded_cnt=$((${loaded_cnt} + 1))
|
||||
|
||||
if [[ ${loaded_cnt} -ge ${max_idx} ]]
|
||||
then
|
||||
count_print ${idx}
|
||||
|
||||
dat_rn[${idx}]="${rn}"
|
||||
dat_id[${idx}]="${id}"
|
||||
dat_title[${idx}]="${title}"
|
||||
dat_region[${idx}]="${reg_tab[${location}]}"
|
||||
dat_lang[${idx}]="${lang}"
|
||||
dat_save_type[${idx}]="${save_type}"
|
||||
dat_crc[${idx}]="${crc}"
|
||||
|
||||
dat_fp[${idx}]="????"
|
||||
dat_status[${idx}]="?"
|
||||
dat_dup[${idx}]="0"
|
||||
|
||||
loaded_cnt=$((${loaded_cnt} + 1))
|
||||
echo "max rom id reached: skipping loading !" 1>&2
|
||||
break;
|
||||
fi
|
||||
fi
|
||||
;;
|
||||
@ -527,7 +531,7 @@ function rom_list_dump()
|
||||
do
|
||||
if [[ ${dat_status[${i}]} == "${status}" ]]
|
||||
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
|
||||
|
||||
i=$(( ${i} + 1 ))
|
||||
@ -570,8 +574,6 @@ function dsrom_dump()
|
||||
{
|
||||
echo "dumping ds rom list..." 1>&2
|
||||
|
||||
echo "${dat_id[${loaded_cnt}]}"
|
||||
|
||||
i=1
|
||||
|
||||
while [[ ${i} -le ${loaded_cnt} ]]
|
||||
@ -580,10 +582,7 @@ function dsrom_dump()
|
||||
then
|
||||
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}]}}"
|
||||
|
||||
# Try to fix non working dsrom.lst by removing rom name... :^(
|
||||
echo "${dat_id[${i}]} ${dat_fp[${i}]}-0 $mask"
|
||||
echo "${dat_id[${i}]} ${dat_fp[${i}]}-0 $mask ${dat_title[${i}]} (${dat_region[${i}]}:${dat_lang[${i}]}) [${dat_status[${i}]}] {${dat_crc[${i}]}}"
|
||||
fi
|
||||
|
||||
i=$(( ${i} + 1 ))
|
||||
@ -658,7 +657,7 @@ function arc_mkfn()
|
||||
dup_id=${9}
|
||||
|
||||
|
||||
file_prefix="${id} - ${title} (${reg}=${lang}) [${status}] {${crc}} _${fp}_"
|
||||
file_prefix="${id} - ${title} (${reg}:${lang}) [${status}] {${crc}} <${fp}>"
|
||||
|
||||
if [[ ${dup_id} == "" ]]
|
||||
then
|
||||
@ -878,7 +877,7 @@ function arc_ident()
|
||||
|
||||
# Type of archive ?
|
||||
|
||||
if [[ ${file} =~ ${rrfnfs_regex} ]]
|
||||
if [[ ${file} =~ ${rnfh_regex} ]]
|
||||
then
|
||||
eval ${arc_type_ptr}="rx3"
|
||||
else
|
||||
@ -934,15 +933,15 @@ function arc_proceed()
|
||||
|
||||
if [[ "${extract}" == "yes" ]]
|
||||
then
|
||||
rom="${id} - ${title} (${reg}=${lang}).nds"
|
||||
rom="${id} - ${title} (${reg}:${lang}).nds"
|
||||
|
||||
rom_extract "${rom}" "${file}"
|
||||
|
||||
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)
|
||||
else
|
||||
crc2=${file/*\{/}; crc2=${crc2/\} _*/}
|
||||
fp=${file/*\} _/}; fp=${fp/_*/}
|
||||
crc2=${file/*\{/}; crc2=${crc2/\}*/}
|
||||
fp=${file/*\} \</}; fp=${fp/\>*/}
|
||||
fi
|
||||
|
||||
|
||||
@ -1000,13 +999,13 @@ function arc_proceed()
|
||||
crc=${dat_crc[${idx}]}
|
||||
status2="OK"
|
||||
|
||||
# Extract ROM file if not yet done
|
||||
if [[ "${rom}" == "" ]]
|
||||
then
|
||||
rom="${id} - ${title} (${reg}=${lang}).nds"
|
||||
# Rename the ROM file
|
||||
rom2="${id} - ${title} (${reg}:${lang}) [${status2}].nds"
|
||||
|
||||
rom_extract "${rom}" "${file}"
|
||||
fi
|
||||
print_verbose "moving ${rom} to ${rom2}"
|
||||
|
||||
mv "${rom}" "${rom2}"
|
||||
rom=${rom2}
|
||||
|
||||
if [[ "${arc_type}" == "rx3" ]]
|
||||
then
|
||||
@ -1030,9 +1029,9 @@ function arc_proceed()
|
||||
|
||||
# Rename ROM if needed
|
||||
|
||||
if [[ ( "${renumed}" == "yes") || ( "${arc_type}" != "rx3" ) || ( "${rebuild}" == "yes" ) ]]
|
||||
if [[ ( "${renumed}" != "yes") && ( ( "${arc_type}" != "rx3" ) || ( "${rebuild}" == "yes" ) ) ]]
|
||||
then
|
||||
rom2="${id} - ${title} (${reg}=${lang}) [${status}].nds"
|
||||
rom2="${id} - ${title} (${reg}:${lang}) [${status}].nds"
|
||||
|
||||
print_verbose "moving ${rom} to ${rom2}"
|
||||
|
||||
@ -1050,7 +1049,7 @@ function arc_proceed()
|
||||
|
||||
# Make / Rename Archive
|
||||
|
||||
if [[ ( "${renumed}" == "yes") || ( "${arc_type}" != "rx3" ) || ( ${rebuild} == "yes" ) ]]
|
||||
if [[ ( "${arc_type}" != "rx3" ) || ( ${rebuild} == "yes" ) ]]
|
||||
then
|
||||
arc_build "${file_name}" "${rom}" "${file}" "${mode}" "${idx}"
|
||||
else
|
||||
@ -1162,8 +1161,8 @@ function suffix_mng()
|
||||
ignored_cnt=$((${ignored_cnt} + 1))
|
||||
else
|
||||
status=${file/* \[/}; status=${status/\] \{*/}
|
||||
crc=${file/*\] \{/}; crc=${crc/\} _*/}
|
||||
fp=${file/*\} _/}; fp=${fp/_*/}
|
||||
crc=${file/*\] \{/}; crc=${crc/\} \<*/}
|
||||
fp=${file/*\} \</}; fp=${fp/\>-*/}
|
||||
|
||||
dat_dup[${idx}]="${dup_id}"
|
||||
|
||||
@ -1176,7 +1175,7 @@ function suffix_mng()
|
||||
idx_old=${idx}
|
||||
status_old=${status}
|
||||
dup_id=0
|
||||
file_name="${file/) \[*/}) [${status}] {${crc}} _${fp}_.${csfx}"
|
||||
file_name="${file/) \[*/}) [${status}] {${crc}} <${fp}>.${csfx}"
|
||||
|
||||
dat_fp[${idx}]="${fp}"
|
||||
dat_status[${idx}]="${status}"
|
||||
@ -1189,7 +1188,7 @@ function suffix_mng()
|
||||
# Duplicate rom
|
||||
|
||||
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))
|
||||
|
||||
@ -1420,9 +1419,9 @@ function fp_scan()
|
||||
|
||||
# Type of archive ?
|
||||
|
||||
if [[ ${file} =~ ${rrfnfs_regex} ]]
|
||||
if [[ ${file} =~ ${rnfh_regex} ]]
|
||||
then
|
||||
fp=${file/*\} _/}; fp=${fp/_*/}
|
||||
fp=${file/*\} \</}; fp=${fp/\>*/}
|
||||
status=${file/* \[/}; status=${status/\] \{*/}
|
||||
|
||||
if [[ ( "${dat_fp[${idx}]}" == "????" ) || ( ( "${dat_status[${idx}]}" == "KO" ) && ( "${status}" == "OK" ) ) ]]
|
||||
|
Loading…
Reference in New Issue
Block a user