# Path: pyskool/snapshot.py
# def get_snapshot(fname):
#     ext = fname[-4:].lower()
#     if ext not in ('.sna', '.z80', '.szx', '.tzx'):
#         raise SnapshotError("{0}: Unknown file type '{1}'".format(fname, ext[1:]))
#     with open(fname, 'rb') as f:
#         data = bytearray(f.read()) # PY: 'return f.read()' in Python 3
#     if ext == '.sna':
#         ram = data[27:49179]
#     elif ext == '.z80':
#         ram = _read_z80(data)
#     elif ext == '.szx':
#         ram = _read_szx(data)
#     elif ext == '.tzx':
#         ram = _read_tzx(data)
#     if len(ram) != 49152:
#         raise SnapshotError("RAM size is {0}".format(len(ram)))
#     mem = [0] * 16384
#     mem.extend(ram)
#     return mem


from .snapshot import get_snapshot
# Copyright 2012, 2014 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of Pyskool.
#
# Pyskool is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# Pyskool is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Pyskool. If not, see <http://www.gnu.org/licenses/>.


class Udg:
    def __init__(self, attr, data, mask=None):
        self.attr = attr
        self.data = data
        self.mask = mask
        # If paper is set, it will override attr (see _get_all_colours() and
        # _build_image_data_bd_any() on PngWriter)
        self.paper = None

_BLANK_UDG = Udg(0, [0] * 8)

class SkoolMemory:
    def __init__(self, snafile, custom):

# Path: pyskool/snapshot.py
# def get_snapshot(fname):
#     ext = fname[-4:].lower()
#     if ext not in ('.sna', '.z80', '.szx', '.tzx'):
#         raise SnapshotError("{0}: Unknown file type '{1}'".format(fname, ext[1:]))
#     with open(fname, 'rb') as f:
#         data = bytearray(f.read()) # PY: 'return f.read()' in Python 3
#     if ext == '.sna':
#         ram = data[27:49179]
#     elif ext == '.z80':
#         ram = _read_z80(data)
#     elif ext == '.szx':
#         ram = _read_szx(data)
#     elif ext == '.tzx':
#         ram = _read_tzx(data)
#     if len(ram) != 49152:
#         raise SnapshotError("RAM size is {0}".format(len(ram)))
#     mem = [0] * 16384
#     mem.extend(ram)
#     return mem


# Path: pyskool/skoolimage.py
from .snapshot import get_snapshot

# Copyright 2012, 2014 Richard Dymond (rjdymond@gmail.com)
#
# This file is part of Pyskool.
#
# Pyskool is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License as published by the Free Software
# Foundation, either version 3 of the License, or (at your option) any later
# version.
#
# Pyskool is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License along with
# Pyskool. If not, see <http://www.gnu.org/licenses/>.


class Udg:
    def __init__(self, attr, data, mask=None):
        self.attr = attr
        self.data = data
        self.mask = mask
        # If paper is set, it will override attr (see _get_all_colours() and
        # _build_image_data_bd_any() on PngWriter)
        self.paper = None

_BLANK_UDG = Udg(0, [0] * 8)

class SkoolMemory:
    def __init__(self, snafile, custom):

        self.snapshot = get_snapshot(snafile)