(self, display, addr, mem_bytes)
Set bytes in textmode video memory.
Set bytes in textmode video memory.
Set bytes in textmode video memory .
def set_memory(self, display, addr, mem_bytes):
        """Set bytes in textmode video memory."""
        addr -= self._video_segment*0x10
        last_row = 0
        for i in xrange(len(mem_bytes)):
            page, offset = divmod(addr+i, self._page_size)
            row, row_offset = divmod(offset, self._text_width*2)
            col = row_offset // 2
            try:
                if (addr+i) % 2:
                    c = display.pages[page].get_byte(1+row, 1+col)
                    a = mem_bytes[i]
                else:
                    c = mem_bytes[i]
                    a = display.pages[page].get_attr(1+row, 1+col)
                display.pages[page].put_char_attr(1+row, 1+col, int2byte(c), a)
            except IndexError:
                pass
            last_row = 1 + row
def set_memory ( self , display , addr , mem_bytes ) : addr -= self . _video_segment * 0x10 last_row = 0 for i in xrange ( len ( mem_bytes ) ) : page , offset = divmod ( addr + i , self . _page_size ) row , row_offset = divmod ( offset , self . _text_width * 2 ) col = row_offset // 2 try : if ( addr + i ) % 2 : c = display . pages [ page ] . get_byte ( 1 + row , 1 + col ) a = mem_bytes [ i ] else : c = mem_bytes [ i ] a = display . pages [ page ] . get_attr ( 1 + row , 1 + col ) display . pages [ page ] . put_char_attr ( 1 + row , 1 + col , int2byte ( c ) , a ) except IndexError : pass last_row = 1 + row