Support HGR mode again

This commit is contained in:
kris 2019-07-07 21:12:10 +01:00
parent 740dafbd74
commit fc4a63fffe

View File

@ -41,11 +41,16 @@ class Video:
self.aux_memory_map = screen.MemoryMap( self.aux_memory_map = screen.MemoryMap(
screen_page=1) # type: screen.MemoryMap screen_page=1) # type: screen.MemoryMap
self.pixelmap = screen.DHGRBitmap( self.pixelmap = screen.DHGRBitmap(
palette=palette, palette=palette,
main_memory=self.memory_map, main_memory=self.memory_map,
aux_memory=self.aux_memory_map aux_memory=self.aux_memory_map
) )
else:
self.pixelmap = screen.HGRBitmap(
palette=palette,
main_memory=self.memory_map,
)
# Accumulates pending edit weights across frames # Accumulates pending edit weights across frames
self.update_priority = np.zeros((32, 256), dtype=np.int) self.update_priority = np.zeros((32, 256), dtype=np.int)
@ -89,16 +94,22 @@ class Video:
) -> Iterator[Tuple[int, int, List[int]]]: ) -> Iterator[Tuple[int, int, List[int]]]:
"""Transform encoded screen to sequence of change tuples.""" """Transform encoded screen to sequence of change tuples."""
if is_aux: if self.mode == VideoMode.DHGR:
target_pixelmap = screen.DHGRBitmap( if is_aux:
main_memory=self.memory_map, target_pixelmap = screen.DHGRBitmap(
aux_memory=target, main_memory=self.memory_map,
palette=self.palette aux_memory=target,
) palette=self.palette
)
else:
target_pixelmap = screen.DHGRBitmap(
main_memory=target,
aux_memory=self.aux_memory_map,
palette=self.palette
)
else: else:
target_pixelmap = screen.DHGRBitmap( target_pixelmap = screen.HGRBitmap(
main_memory=target, main_memory=target,
aux_memory=self.aux_memory_map,
palette=self.palette palette=self.palette
) )