forked from libretro/libretro-super
-
Notifications
You must be signed in to change notification settings - Fork 0
/
comptable.py
206 lines (180 loc) · 6.39 KB
/
comptable.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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
# License: MIT
# Copyright (C) Google
# Author: Vladimit 'phcoder' Serbinenko
import os
import csv
MISSING = 'missing'
OK = 'OK'
DISABLED = 'disabled'
ENABLED = 'enabled'
coremap = {}
allcores = set()
allplatformset = set()
corestatus = {}
corereason = {}
GFX_FEATS = ['gfxaccel', 'gl1', 'gl2', 'gl3', 'gles2', 'gles3']
CPU_FEATS = ['x86_any', 'libco', 'cpu64', 'threads', 'jit']
PERIPHERAL_FEATS = ['cdrom', 'usb']
ALL_FEATS = GFX_FEATS + CPU_FEATS + PERIPHERAL_FEATS
DESKTOP_ALL = list(set(ALL_FEATS) - set(['gles2', 'gles3', 'cpu64', 'x86_any']))
DESKTOP_X64 = DESKTOP_ALL + ['x86_any', 'cpu64']
DESKTOP_X86 = DESKTOP_ALL + ['x86_any']
DESKTOP_ARM32 = DESKTOP_ALL
UWP = ['gfxaccel', 'gles2', 'threads', 'libco'] + ['cdrom', 'usb'] # unsure about second part
MOBILE = ['gfxaccel', 'gles2', 'gles3', 'threads', 'libco']
features_platforms = {
# Misc
'emscripten': ['gfxaccel', 'gles2'],
# consoles
'3ds': ['threads', 'libco', 'jit'],
'psl1ght': ['cpu64'] + ['libco', 'cdrom', 'usb', 'jit'], # unsure about second part
'gamecube': ['threads', 'libco'] + ['cdrom', 'jit'], # unsure about second part
'wii': ['threads', 'libco'] + ['cdrom', 'usb', 'jit'], # unsure about second part
'ps2': [] + ['libco', 'cpu64', 'threads', 'cdrom', 'usb', 'jit'], # unsure about second part
'ps3': ['threads', 'cpu64'] + ['libco', 'cdrom', 'usb', 'jit'], # unsure about second part
'psp': ['libco', 'threads'] + ['jit'], # unsure about second part
'libnx': ['gfxaccel', 'gl1', 'gl2', 'gl3', 'libco', 'cpu64', 'threads', 'jit'] + ['usb'], # unsure about second part
'wiiu': ['libco'] + ['cdrom', 'usb', 'jit'], # unsure about second part
'vita': ['gfxaccel', 'gl1', 'gl2', 'threads', 'libco', 'jit'], # 'gl3', 'gles2', 'gles3'?
# UWP
'windows-uwp-arm': UWP,
'windows-uwp-x64': UWP + ['x86_any', 'cpu64'],
'windows-uwp-x86': UWP + ['x86_any'],
# Mobile
'android' : MOBILE + ['x86_any', 'cpu64', 'jit'],
'ios': MOBILE,
'ios9': MOBILE,
'ios-arm64': MOBILE + ['cpu64'],
'tvos-arm64': MOBILE + ['cpu64'],
'qnx': MOBILE, # Unsure about usb
# Desktop
'linux-x64': DESKTOP_X64,
'windows-x64': DESKTOP_X64,
'osx-x64': DESKTOP_X64,
'linux-x86': DESKTOP_X86,
'windows-x86': DESKTOP_X86,
'linux-arm7neonhf': DESKTOP_ARM32,
'linux-armhf': DESKTOP_ARM32,
'xbox-x86': DESKTOP_X86,
}
features_cores = {
'3dengine': ['gl2'], # Should be gl2 or gles2 but current bugs prevent operating with gles2
'atari800': ['libco'],
'blastem': ['x86_any'],
'boom3': ['gl1'],
'boom3_xp': ['gl1'],
'bsnes': ['libco'],
'bsnes2014': ['libco'],
'bsnes_cplusplus98': ['libco'],
'bsnes_hd_beta': ['libco'],
'bsnes_mercury': ['libco'],
'citra': ['gfxaccel'],
'citra_canary': ['gfxaccel'],
'craft': ['gfxaccel'],
'dolphin': ['cpu64', 'jit'],
'dosbox_svn': ['libco'],
'dosbox_svn_ce': ['libco'],
'dosbox_core': ['threads'],
'ffmpeg': ['threads'],
'flycast': ['gfxaccel'],
'frodo': ['libco'],
'hatari': ['libco'],
'gpsp': ['libco'],
'ishiiruka': ['cpu64'],
'kronos': ['gl3'],
'mednafen_psx_hw': ['gfxaccel'],
'mupen64plus_next': ['gfxaccel', 'libco'],
'mupen64plus_next_gles2': ['gles2', 'libco'],
'mupen64plus_next_gles3': ['gles3', 'libco'],
'openlara': ['gfxaccel'],
'parallel_n64': ['gfxaccel', 'libco'],
'play': ['gfxaccel'],
'redbook': ['cdrom'],
'remotejoy': ['usb'],
'reminiscence': ['libco'],
'scummvm': ['libco'],
'thepowdertoy': ['threads'],
'vitaquake3': ['gl1'],
'vitavoyager': ['gl1'],
'yabasanshiro': ['gfxaccel']
}
def strip_suffix(s, suffix):
if s.endswith(suffix):
return s[:-len(suffix)]
return s
def strip_suffixes(s, suffixes):
r = s
for suffix in suffixes:
r = strip_suffix(r, suffix)
return r
def strip_prefix(s, prefix):
if s.startswith(prefix):
return s[len(prefix):]
return s
def strip_prefixes(s, prefixes):
r = s
for prefix in prefixes:
r = strip_prefix(r, prefix)
return r
def file_to_platform(fname):
s = strip_suffixes(fname, ["-generic", "-noccache", "-r16b", "-cross", "_dw2", "_seh", "_sjlj", "_w32"])
s = strip_prefixes(s, ["cores-"])
for infix in ["msvc2003", "msvc2005", "msvc2010", "msvc2017", "desktop"]:
s = s.replace("-" + infix + "-", "-")
return s
for root, _, files in os.walk("recipes"):
for file in files:
if file.endswith(".conf") or file.endswith(".ra") or file.endswith(".yml") or file.endswith(".info") or file.endswith(".sh") or file.startswith("retroarch-"):
continue
if file in ["cores-android-aarch64", "cores-android-armv7-ndk-mame"]:
continue
platform = file_to_platform(file)
allplatformset.add(platform)
with open(os.path.join(root, file)) as fin:
for line in fin:
sp = line.split()
if len(sp) == 0:
continue
core = sp[0]
k = (platform, core)
if k not in coremap:
coremap[k] = []
coremap[k].append({'file': file, ENABLED: sp[4]})
allcores.add(core)
allplatforms = sorted(allplatformset)
cf = open ("comptable.csv", "w")
c = csv.writer(cf)
c.writerow([""] + allplatforms)
for core in allcores:
row = [core]
for platform in allplatforms:
k = (platform, core)
if k not in coremap:
status = MISSING
else:
enabled = False
for x in coremap[k]:
if x[ENABLED] == 'YES':
enabled = True
if enabled:
status = OK
else:
status = DISABLED
corestatus[k] = status
if core in features_cores and platform in features_platforms:
missing = set(features_cores[core]) - set(features_platforms[platform])
if missing:
corereason[k] = ','.join(missing)
for core in sorted (allcores):
row = [core]
for platform in allplatforms:
k = (platform, core)
st = corestatus[k]
s = st
if st != OK and k in corereason:
s += " (" + corereason[k] + ")"
if st == OK and k in corereason:
print("%s is enabled on %s despite %s" % (core, platform, corereason[k]))
row += [s]
c.writerow(row)
cf.close()