(self, args)
GET: Read a sprite from the screen.
GET: Read a sprite from the screen.
GET : Read a sprite from the screen .
def get_(self, args):
        """GET: Read a sprite from the screen."""
        if self._mode.is_text_mode:
            raise error.BASICError(error.IFC)
        x0, y0 = (values.to_single(_arg).to_value() for _arg in islice(args, 2))
        step = next(args)
        x, y = (values.to_single(_arg).to_value() for _arg in islice(args, 2))
        array_name, = args
        array_name = self._memory.complete_name(array_name)
        if array_name not in self._memory.arrays:
            raise error.BASICError(error.IFC)
        elif array_name[-1:] == values.STR:
            raise error.BASICError(error.TYPE_MISMATCH)
        x0, y0 = self._get_window_physical(x0, y0)
        x1, y1 = self._get_window_physical(x, y, step)
        self._last_point = x1, y1
        byte_array = self._memory.arrays.view_full_buffer(array_name)
        y0, y1 = sorted((y0, y1))
        x0, x1 = sorted((x0, x1))
        # Tandy screen 6 simply GETs twice the width, it seems
        width = x1 - x0 + 1
        x1 = x0 + self._mode.sprite_builder.width_factor * width - 1
        # the whole sprite must fit or it's IFC
        error.throw_if(not self.graph_view.contains(x0, y0))
        error.throw_if(not self.graph_view.contains(x1, y1))
        # set size record
        # read from screen and convert to byte array
        sprite = self.graph_view[y0:y1+1, x0:x1+1]
        packed_sprite = self._mode.sprite_builder.pack(sprite)
        try:
            byte_array[:len(packed_sprite)] = packed_sprite
        except ValueError:
            # cannot modify size of memoryview object - sprite larger than array
            raise error.BASICError(error.IFC)
def get_ ( self , args ) : if self . _mode . is_text_mode : raise error . BASICError ( error . IFC ) x0 , y0 = ( values . to_single ( _arg ) . to_value ( ) for _arg in islice ( args , 2 ) ) step = next ( args ) x , y = ( values . to_single ( _arg ) . to_value ( ) for _arg in islice ( args , 2 ) ) array_name , = args array_name = self . _memory . complete_name ( array_name ) if array_name not in self . _memory . arrays : raise error . BASICError ( error . IFC ) elif array_name [ - 1 : ] == values . STR : raise error . BASICError ( error . TYPE_MISMATCH ) x0 , y0 = self . _get_window_physical ( x0 , y0 ) x1 , y1 = self . _get_window_physical ( x , y , step ) self . _last_point = x1 , y1 byte_array = self . _memory . arrays . view_full_buffer ( array_name ) y0 , y1 = sorted ( ( y0 , y1 ) ) x0 , x1 = sorted ( ( x0 , x1 ) ) # Tandy screen 6 simply GETs twice the width, it seems width = x1 - x0 + 1 x1 = x0 + self . _mode . sprite_builder . width_factor * width - 1 # the whole sprite must fit or it's IFC error . throw_if ( not self . graph_view . contains ( x0 , y0 ) ) error . throw_if ( not self . graph_view . contains ( x1 , y1 ) ) # set size record # read from screen and convert to byte array sprite = self . graph_view [ y0 : y1 + 1 , x0 : x1 + 1 ] packed_sprite = self . _mode . sprite_builder . pack ( sprite ) try : byte_array [ : len ( packed_sprite ) ] = packed_sprite except ValueError : # cannot modify size of memoryview object - sprite larger than array raise error . BASICError ( error . IFC )