(self, display, addr, num_bytes)
return byte_array
Retrieve bytes from EGA memory.
Retrieve bytes from EGA memory.
Retrieve bytes from EGA memory .
def get_memory(self, display, addr, num_bytes):
        """Retrieve bytes from EGA memory."""
        plane = self._plane % (max(self._planes_used) + 1)
        byte_array = bytearray(num_bytes)
        if plane not in self._planes_used:
            return byte_array
        for page, x, y, ofs, length in self._walk_memory(addr, num_bytes):
            pixarray = display.pages[page].pixels[y, x:x+length*8]
            byte_array[ofs:ofs+length] = (pixarray >> plane).packed(8)
        return byte_array
def get_memory ( self , display , addr , num_bytes ) : plane = self . _plane % ( max ( self . _planes_used ) + 1 ) byte_array = bytearray ( num_bytes ) if plane not in self . _planes_used : return byte_array for page , x , y , ofs , length in self . _walk_memory ( addr , num_bytes ) : pixarray = display . pages [ page ] . pixels [ y , x : x + length * 8 ] byte_array [ ofs : ofs + length ] = ( pixarray >> plane ) . packed ( 8 ) return byte_array