(self, addr, num_bytes, factor=1)
Iterate over graphical memory (pixel-by-pixel, contiguous rows).
Iterate over graphical memory (pixel-by-pixel, contiguous rows).
Iterate over graphical memory ( pixel - by - pixel contiguous rows ) .
def _walk_memory(self, addr, num_bytes, factor=1):
        """Iterate over graphical memory (pixel-by-pixel, contiguous rows)."""
        # factor supports tandy-6 mode, which has 8 pixels per 2 bytes
        # with alternating planes in even and odd bytes (i.e. ppb==8)
        ppb = factor * self._ppb
        page_size = self._page_size // factor
        bank_size = self._bank_size // factor
        row_size = self._bytes_per_row // factor
        # first row
        page, x, y = self._get_coords(addr)
        offset = min(row_size - x//ppb, num_bytes)
        if self._coord_ok(page, x, y):
            yield page, x, y, 0, offset
        # full rows
        bank_offset, page_offset, start_y = 0, 0, y
        while page_offset + bank_offset + offset < num_bytes:
            y += self._interleave_times
            # not an integer number of rows in a bank
            if offset >= bank_size:
                bank_offset += bank_size
                start_y += 1
                offset, y = 0, start_y
                if bank_offset >= page_size:
                    page_offset += page_size
                    page += 1
                    bank_offset, offset = 0, 0
                    y, start_y = 0, 0
            if self._coord_ok(page, 0, y):
                ofs = page_offset + bank_offset + offset
                if ofs + row_size > num_bytes:
                    yield page, 0, y, ofs, num_bytes - ofs
                else:
                    yield page, 0, y, ofs, row_size
            offset += row_size
def _walk_memory ( self , addr , num_bytes , factor = 1 ) : # factor supports tandy-6 mode, which has 8 pixels per 2 bytes # with alternating planes in even and odd bytes (i.e. ppb==8) ppb = factor * self . _ppb page_size = self . _page_size // factor bank_size = self . _bank_size // factor row_size = self . _bytes_per_row // factor # first row page , x , y = self . _get_coords ( addr ) offset = min ( row_size - x // ppb , num_bytes ) if self . _coord_ok ( page , x , y ) : yield page , x , y , 0 , offset # full rows bank_offset , page_offset , start_y = 0 , 0 , y while page_offset + bank_offset + offset < num_bytes : y += self . _interleave_times # not an integer number of rows in a bank if offset >= bank_size : bank_offset += bank_size start_y += 1 offset , y = 0 , start_y if bank_offset >= page_size : page_offset += page_size page += 1 bank_offset , offset = 0 , 0 y , start_y = 0 , 0 if self . _coord_ok ( page , 0 , y ) : ofs = page_offset + bank_offset + offset if ofs + row_size > num_bytes : yield page , 0 , y , ofs , num_bytes - ofs else : yield page , 0 , y , ofs , row_size offset += row_size