# Path: pym2149/iface.py
# class Config(lurlene.iface.Config): pass
# 
# class Platform: pass
# 
# class YMFile(Prerecorded): pass


from .iface import Config, Platform, YMFile
from diapyr import types
import logging
# pym2149 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.
#
# pym2149 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 pym2149.  If not, see <http://www.gnu.org/licenses/>.


log = logging.getLogger(__name__)
stclock = 2000000
spectrum128crystal = 17734470 # Correct according to service manual.
spectrumclock = spectrum128crystal // 10
defaultscale = 8

class ClockInfo:

    trishapes = frozenset([0xa, 0xe])
    tonescale = 16

    @classmethod
    def _shapescale(cls, shape):
        # Musically, the triangular shapes have twice the scale:
        return 512 if shape in cls.trishapes else 256


# Path: pym2149/iface.py
# class Config(lurlene.iface.Config): pass
# 
# class Platform: pass
# 
# class YMFile(Prerecorded): pass


# Path: pym2149/clock.py
from .iface import Config, Platform, YMFile
from diapyr import types
import logging

# pym2149 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.
#
# pym2149 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 pym2149.  If not, see <http://www.gnu.org/licenses/>.


log = logging.getLogger(__name__)
stclock = 2000000
spectrum128crystal = 17734470 # Correct according to service manual.
spectrumclock = spectrum128crystal // 10
defaultscale = 8

class ClockInfo:

    trishapes = frozenset([0xa, 0xe])
    tonescale = 16

    @classmethod
    def _shapescale(cls, shape):
        # Musically, the triangular shapes have twice the scale:
        return 512 if shape in cls.trishapes else 256


    @types(Config, Platform, YMFile)