all repos — mgba @ 2a6d106ebde9d8c84053ba7dc01e95781c21d4ec

mGBA Game Boy Advance Emulator

Use command line options for renderer, too
Jeffrey Pfau jeffrey@endrift.com
Fri, 10 Oct 2014 22:52:49 -0700
commit

2a6d106ebde9d8c84053ba7dc01e95781c21d4ec

parent

435edc801789fc454c2ad005fe63f875cc3dc5e9

1 files changed, 8 insertions(+), 6 deletions(-)

jump to
M tools/perf.pytools/perf.py

@@ -65,11 +65,12 @@ def get_args(self):

return ['-F', str(self.frames)] class Suite(object): - def __init__(self, cwd, wall=None, game=None): + def __init__(self, cwd, wall=None, game=None, renderer='software'): self.cwd = cwd self.tests = [] self.wall = wall self.game = game + self.renderer = renderer def collect_tests(self): roms = []

@@ -82,9 +83,9 @@ self.add_tests(rom)

def add_tests(self, rom): if self.wall: - self.tests.append(WallClockTest(rom, self.wall)) + self.tests.append(WallClockTest(rom, self.wall, renderer=self.renderer)) if self.game: - self.tests.append(GameClockTest(rom, self.game, renderer=None)) + self.tests.append(GameClockTest(rom, self.game, renderer=self.renderer)) def run(self): results = []

@@ -101,13 +102,14 @@ return results

if __name__ == '__main__': parser = argparse.ArgumentParser() - parser.add_argument('-w', '--wall-time', type=float, default=60, metavar='TIME', help='wall-clock time') - parser.add_argument('-g', '--game-frames', type=int, default=120*60, metavar='FRAMES', help='game-clock frames') + parser.add_argument('-w', '--wall-time', type=float, default=0, metavar='TIME', help='wall-clock time') + parser.add_argument('-g', '--game-frames', type=int, default=0, metavar='FRAMES', help='game-clock frames') + parser.add_argument('-N', '--disable-renderer', action='store_const', const=True, help='disable video rendering') parser.add_argument('-o', '--out', metavar='FILE', help='output file path') parser.add_argument('directory', help='directory containing ROM files') args = parser.parse_args() - s = Suite(args.directory, wall=args.wall_time, game=args.game_frames) + s = Suite(args.directory, wall=args.wall_time, game=args.game_frames, renderer=None if args.disable_renderer else 'software') s.collect_tests() results = s.run() fout = sys.stdout