(self, addr)
return page, x, y
Get video page and coordinates for address.
Get video page and coordinates for address.
Get video page and coordinates for address .
def _get_coords(self, addr):
        """Get video page and coordinates for address."""
        addr = int(addr) - self._video_segment * 0x10
        # modes 1-5: interleaved scan lines, pixels sequentially packed into bytes
        page, addr = divmod(addr, self._page_size)
        # 2 x interleaved scan lines of 80bytes
        bank, offset = divmod(addr, self._bank_size)
        row, col = divmod(offset, self._bytes_per_row)
        x = col * 8 // self._bitsperpixel
        y = bank + self._interleave_times * row
        return page, x, y
def _get_coords ( self , addr ) : addr = int ( addr ) - self . _video_segment * 0x10 # modes 1-5: interleaved scan lines, pixels sequentially packed into bytes page , addr = divmod ( addr , self . _page_size ) # 2 x interleaved scan lines of 80bytes bank , offset = divmod ( addr , self . _bank_size ) row , col = divmod ( offset , self . _bytes_per_row ) x = col * 8 // self . _bitsperpixel y = bank + self . _interleave_times * row return page , x , y