(
            self, queues, values, input_methods, memory,
            initial_width, video_mem_size, adapter, monitor,
            codepage, fonts
        )
Initialise the display.
Initialise the display.
Initialise the display .
def __init__(
            self, queues, values, input_methods, memory,
            initial_width, video_mem_size, adapter, monitor,
            codepage, fonts
        ):
        """Initialise the display."""
        self._queues = queues
        self._values = values
        self._memory = memory
        # low level settings
        if adapter == 'ega':
            if monitor in MONO_TINT:
                adapter = 'ega_mono'
            elif video_mem_size < 131072:
                # less than 128k means 64k, as EGA has memory in 64k blocks
                adapter = 'ega_64k'
        self._adapter = adapter
        self._monitor = monitor
        self._video_mem_size = video_mem_size
        # prepare video modes
        self.mode = modes.get_mode(
            0, initial_width, self._adapter, self._monitor, self._video_mem_size
        )
        # video mode settings
        self.colorswitch, self.apagenum, self.vpagenum = 1, 0, 0
        # current attribute
        self.attr = self.mode.attr
        # border attribute
        self._border_attr = 0
        # prepare fonts
        self._fonts = {}
        if fonts:
            self._fonts = {
                height: font.Font(height, font_dict, codepage)
                for height, font_dict in iteritems(fonts) if font_dict
            }
        # we must have an 8-pixel font; use the default CP437 font if none provided
        # but note that we interpret the characters through the codepage provided
        if 8 not in self._fonts:
            self._fonts[8] = font.Font(8, None, codepage)
        # copy as 8-pixel hardware BIOS font (for CGA textmodes)
        # as opposed to the loadable 8-pixel memory font used in graphics modes
        self._bios_font_8 = self._fonts[8].copy()
        # text screen
        self._codepage = codepage
        self.cursor = Cursor(queues, self.mode)
        self.text_screen = TextScreen(
            self._queues, self._values, self.mode, self.cursor, self._adapter
        )
        # page buffers, set by _set_mode
        self.pages = None
        # screen aspect ratio: used to determine pixel aspect ratio, which is used by CIRCLE
        # all adapters including PCjr target 4x3, except Tandy
        if self._adapter == 'tandy':
            aspect = (3072, 2000)
        else:
            aspect = (4, 3)
        # Tandy pixel aspect ratio is different from normal
        # suggesting screen aspect ratio is not 4/3.
        # Tandy pixel aspect ratios, experimentally found with CIRCLE (on DOSBox?):
        # screen 2, 6:     48/100   normal if aspect = 3072, 2000
        # screen 1, 4, 5:  96/100   normal if aspect = 3072, 2000
        # pcjr: screen 1: .833, s2: .833/2, s3: .833*2 s4:.833 s5:.833 s6: .833/2
        # (checked with CIRCLE on MAME)
        # .833 == 5:6 corresponding to screen aspect ratio of 4:3
        # --> old value SCREEN 3 pixel aspect 1968/1000 not quite (but almost) consistent with this
        #     and I don't think it was really checked on Tandy -- dosbox won't run SCREEN 3
        #
        # colour palette
        self.colourmap = self.mode.colourmap(
            self._queues, self._adapter, self._monitor, self.colorswitch
        )
        # graphics operations
        self.graphics = graphics.Graphics(
            input_methods, self._values, self._memory, aspect, self.colourmap
        )
        # initialise a fresh textmode screen
        self._set_mode(self.mode, 1, 0, 0, erase=True)
def __init__ ( self , queues , values , input_methods , memory , initial_width , video_mem_size , adapter , monitor , codepage , fonts ) : self . _queues = queues self . _values = values self . _memory = memory # low level settings if adapter == 'ega' : if monitor in MONO_TINT : adapter = 'ega_mono' elif video_mem_size < 131072 : # less than 128k means 64k, as EGA has memory in 64k blocks adapter = 'ega_64k' self . _adapter = adapter self . _monitor = monitor self . _video_mem_size = video_mem_size # prepare video modes self . mode = modes . get_mode ( 0 , initial_width , self . _adapter , self . _monitor , self . _video_mem_size ) # video mode settings self . colorswitch , self . apagenum , self . vpagenum = 1 , 0 , 0 # current attribute self . attr = self . mode . attr # border attribute self . _border_attr = 0 # prepare fonts self . _fonts = { } if fonts : self . _fonts = { height : font . Font ( height , font_dict , codepage ) for height , font_dict in iteritems ( fonts ) if font_dict } # we must have an 8-pixel font; use the default CP437 font if none provided # but note that we interpret the characters through the codepage provided if 8 not in self . _fonts : self . _fonts [ 8 ] = font . Font ( 8 , None , codepage ) # copy as 8-pixel hardware BIOS font (for CGA textmodes) # as opposed to the loadable 8-pixel memory font used in graphics modes self . _bios_font_8 = self . _fonts [ 8 ] . copy ( ) # text screen self . _codepage = codepage self . cursor = Cursor ( queues , self . mode ) self . text_screen = TextScreen ( self . _queues , self . _values , self . mode , self . cursor , self . _adapter ) # page buffers, set by _set_mode self . pages = None # screen aspect ratio: used to determine pixel aspect ratio, which is used by CIRCLE # all adapters including PCjr target 4x3, except Tandy if self . _adapter == 'tandy' : aspect = ( 3072 , 2000 ) else : aspect = ( 4 , 3 ) # Tandy pixel aspect ratio is different from normal # suggesting screen aspect ratio is not 4/3. # Tandy pixel aspect ratios, experimentally found with CIRCLE (on DOSBox?): # screen 2, 6:     48/100   normal if aspect = 3072, 2000 # screen 1, 4, 5:  96/100   normal if aspect = 3072, 2000 # pcjr: screen 1: .833, s2: .833/2, s3: .833*2 s4:.833 s5:.833 s6: .833/2 # (checked with CIRCLE on MAME) # .833 == 5:6 corresponding to screen aspect ratio of 4:3 # --> old value SCREEN 3 pixel aspect 1968/1000 not quite (but almost) consistent with this #     and I don't think it was really checked on Tandy -- dosbox won't run SCREEN 3 # # colour palette self . colourmap = self . mode . colourmap ( self . _queues , self . _adapter , self . _monitor , self . colorswitch ) # graphics operations self . graphics = graphics . Graphics ( input_methods , self . _values , self . _memory , aspect , self . colourmap ) # initialise a fresh textmode screen self . _set_mode ( self . mode , 1 , 0 , 0 , erase = True )