(self, display, addr, byte_array)
Set bytes in EGA video memory.
Set bytes in EGA video memory.
Set bytes in EGA video memory .
def set_memory(self, display, addr, byte_array):
        """Set bytes in EGA video memory."""
        # EGA memory is planar with memory-mapped colour planes.
        # Within a plane, 8 pixels are encoded into each byte.
        # The colour plane is set through a port OUT and
        # determines which bit of each pixel's attribute is affected.
        mask = self._plane_mask & self._master_plane_mask
        # return immediately for unused colour planes
        if mask == 0:
            return
        for page, x, y, ofs, length in self._walk_memory(addr, len(byte_array)):
            pixarray = (
                bytematrix.ByteMatrix.frompacked(
                    byte_array[ofs:ofs+length], height=1, items_per_byte=8
                ).render(0, mask)
            )
            width = pixarray.width
            substrate = display.pages[page].pixels[y, x:x+width] & ~mask
            display.pages[page].pixels[y, x:x+width] = (pixarray & mask) | substrate
def set_memory ( self , display , addr , byte_array ) : # EGA memory is planar with memory-mapped colour planes. # Within a plane, 8 pixels are encoded into each byte. # The colour plane is set through a port OUT and # determines which bit of each pixel's attribute is affected. mask = self . _plane_mask & self . _master_plane_mask # return immediately for unused colour planes if mask == 0 : return for page , x , y , ofs , length in self . _walk_memory ( addr , len ( byte_array ) ) : pixarray = ( bytematrix . ByteMatrix . frompacked ( byte_array [ ofs : ofs + length ] , height = 1 , items_per_byte = 8 ) . render ( 0 , mask ) ) width = pixarray . width substrate = display . pages [ page ] . pixels [ y , x : x + width ] & ~ mask display . pages [ page ] . pixels [ y , x : x + width ] = ( pixarray & mask ) | substrate