-
Notifications
You must be signed in to change notification settings - Fork 6
/
diff_settings.py
51 lines (41 loc) · 1.62 KB
/
diff_settings.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python3
def add_custom_arguments(parser):
parser.add_argument(
'--overlay',
default='game',
dest='overlay',
help='Defines which overlay to use for the diff (game, ovlcr, etc.)',
)
def apply_base(config, name):
config['baseimg'] = 'iso/' + (f'{name}.bin').upper()
config['myimg'] = 'build/' + (f'{name}.bin').upper()
config['mapfile'] = f'build/{name}.map'
config['source_directories'] = [
f'src/{name}', 'include', f'asm/{name}']
config['objdump_executable'] = 'mipsel-linux-gnu-objdump'
def apply_bin(config, name):
config['arch'] = 'mipsel'
config['baseimg'] = 'iso/' + (f'BIN/{name}.BIN').upper()
config['myimg'] = 'build/' + (f'{name}.bin').upper()
config['mapfile'] = f'build/{name}.map'
config['source_directories'] = [
f'src/{name}', 'include', f'asm/{name}']
config['objdump_executable'] = 'mipsel-linux-gnu-objdump'
def apply_overlay(config, name):
config['arch'] = 'mipsel'
config['baseimg'] = 'iso/' + (f'OVERLAYS/{name}.BIN').upper()
config['myimg'] = 'build/' + (f'{name}.bin').upper()
config['mapfile'] = f'build/ovl{name}.map'
config['source_directories'] = [
f'src/ovl/{name}', 'include', f'asm/ovl/{name}']
config['objdump_executable'] = 'mipsel-linux-gnu-objdump'
def apply(config, args):
name = args.overlay or 'game'
if name.startswith('ovl'):
apply_overlay(config, name[3:])
elif name == 'game':
apply_base(config, name)
else:
apply_bin(config, name)
config['arch'] = 'mipsel'
config['objdump_executable'] = 'mipsel-linux-gnu-objdump'