(self)
return t
Fix tile loader
Fix tile loader
Fix tile loader
def read_tile_from_rom(self):
        """Fix tile loader"""
        surf_buf = bytearray(64)
        for xa, xb in ((4, 5), (6, 7), (0, 1), (2, 3)):
            for y in range(8):
                twopix = ord(self.fd1.read(1))
                pixa = twopix & 0xf
                pixb = (twopix >> 0x4) & 0xf
                surf_buf[(8*y)+xa] = pixa
                surf_buf[(8*y)+xb] = pixb

        t = pygame.image.fromstring(bytes(surf_buf), (8, 8), "P")
        return t
def read_tile_from_rom ( self ) : surf_buf = bytearray ( 64 ) for xa , xb in ( ( 4 , 5 ) , ( 6 , 7 ) , ( 0 , 1 ) , ( 2 , 3 ) ) : for y in range ( 8 ) : twopix = ord ( self . fd1 . read ( 1 ) ) pixa = twopix & 0xf pixb = ( twopix >> 0x4 ) & 0xf surf_buf [ ( 8 * y ) + xa ] = pixa surf_buf [ ( 8 * y ) + xb ] = pixb t = pygame . image . fromstring ( bytes ( surf_buf ) , ( 8 , 8 ) , "P" ) return t