
main.py - added `Game revision` (DSi only) and info pages. nintendo_ds.py - added `gamerevision` and `region`
28 lines
No EOL
1.4 KiB
Python
28 lines
No EOL
1.4 KiB
Python
import sys
|
|
|
|
from logger import Logger
|
|
from rominfo.nintendo_ds import *
|
|
|
|
logger = Logger('RomInfo')
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) == 2:
|
|
if sys.argv[1].endswith('.nds') or sys.argv[1].endswith('.ids'):
|
|
with open(sys.argv[1], mode='rb') as nds:
|
|
logger.info('Title : {}'.format(nds_get_info('title', nds)))
|
|
logger.info('Game code : {}'.format(nds_get_info('gamecode', nds)))
|
|
logger.info('Maker code : {}'.format(nds_get_info('makercode', nds)))
|
|
logger.info('Unit code : {}'.format(nds_get_info('unitcode', nds)))
|
|
logger.info('Encryption seed : {}'.format(nds_get_info('encryptionseed', nds)))
|
|
logger.info('Device capacity : {}'.format(nds_get_info('devicecapacity', nds)))
|
|
if 'DSi ' in nds_get_info('unitcode', nds):
|
|
logger.info('Game revision : {} (DSi only)'.format(nds_get_info('gamerevision', nds)))
|
|
logger.info('Game region : {}'.format(nds_get_info('region', nds)))
|
|
else:
|
|
logger.error('No ROM specified. App requires one argument.')
|
|
|
|
# Info taken from:
|
|
# https://dsibrew.org/wiki/DSi_cartridge_header
|
|
# https://scenegate.github.io/Ekona/specs/cartridge/header.html
|
|
# https://problemkaputt.de/gbatek-ds-cartridge-header.htm
|
|
# https://gist.github.com/pleonex/6265017 |