Add initial SRAM class and refactor to use it

This commit is contained in:
cassidoxa
2022-02-20 00:21:33 -05:00
parent 633c221d6f
commit 8795a4b393
6 changed files with 294 additions and 30 deletions

View File

@@ -19,6 +19,12 @@ def snes_to_pc(value):
def is_bundled():
return getattr(sys, 'frozen', False)
def count_set_bits(val):
if val == 0:
return 0
else:
return (val & 1) + count_set_bits(val >> 1)
def local_path(path):
if local_path.cached_path is not None:
return os.path.join(local_path.cached_path, path)