mameau%CWD%:> █
OFFLINE
$ cat readme.txt
SHA1Merger

not an overly well known tool so some history

history
- was hosted on www.mame.net for a period of time in 2003
- mentioned in the whatsnew_069.txt

original written in '2003 by FarFetch'd for python2
- original version had functionality to convert source files from CRC only to
  CRC+SHA1 hashes.

ported to python3 by sairuk in 2024, with some minor changes:
- the conversion functionality has been removed as it is no longer applicable 
  to the current MAME code base, this includes all source files
- getopts replaced with argparse, 
- removed usage.py
- c/d options are now -c/-d or --checksums/--definitions respectively
- sha1 lib replaced with hashlib
- all stray semi colons removed, not required in python
- -x flag added to report sha256/sha512 for potential future use


example
$ python3 SHA1Merger.py -d apple2p.zip apple2.zip

SHA1Merger.py - by Farfetch'd, (py3 sairuk)
-----------------------------
ROM_START( apple2p )
	ROM_LOAD( "341-0011.d0",  0x000000, 0x000800, CRC(6f05f949) SHA1(0287ebcef2c1ce11dc71be15a99d2d7e0e128b1e) ) 
	ROM_LOAD( "341-0012.d8",  0x000000, 0x000800, CRC(1f08087c) SHA1(a75ce5aab6401355bf1ab01b04e4946a424879b5) ) 
	ROM_LOAD( "341-0013.e0",  0x000000, 0x000800, CRC(2b8d9a89) SHA1(8d82a1da63224859bd619005fab62c4714b25dd7) ) 
	ROM_LOAD( "341-0014.e8",  0x000000, 0x000800, CRC(5719871a) SHA1(37501be96d36d041667c15d63e0c1eff2f7dd4e9) ) 
	ROM_LOAD( "341-0015.f0",  0x000000, 0x000800, CRC(9a04eecf) SHA1(e6bf91ed28464f42b807f798fc6422e5948bf581) ) 
ROM_END

ROM_START( apple2 )
	ROM_LOAD( "a2.chr",       0x000000, 0x000800, CRC(64f415c6) SHA1(f9d312f128c9557d9d6ac03bfad6c3ddf83e5659) ) 
	ROM_LOAD( "341-0001-00.e0", 0x000000, 0x000800, CRC(c0a4ad3b) SHA1(bf32195efcb34b694c893c2d342321ec3a24b98f) ) 
	ROM_LOAD( "341-0002-00.e8", 0x000000, 0x000800, CRC(a99c2cf6) SHA1(9767d92d04fc65c626223f25564cca31f5248980) ) 
	ROM_LOAD( "341-0003-00.f0", 0x000000, 0x000800, CRC(62230d38) SHA1(f268022da555e4c809ca1ae9e5d2f00b388ff61c) ) 
	ROM_LOAD( "341-0004-00.f8", 0x000000, 0x000800, CRC(020a86d0) SHA1(52a18bd578a4694420009cad7a7a5779a8c00226) ) 
	ROM_LOAD( "341-0016-00.d0", 0x000000, 0x000800, CRC(4234e88a) SHA1(c9a81d704dc2f0c3416c20f9c4ab71fedda937ed) ) 
	ROM_LOAD( "341-0020-00.f8", 0x000000, 0x000800, CRC(079589c4) SHA1(a28852ff997b4790e53d8d0352112c4b1a395098) ) 
ROM_END