mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-11 09:31:34 +11:00
Merge pull request #265 from gwilymk/gc-vram-at-the-correct-time
Run the GC after copying the tiles rather than before
This commit is contained in:
commit
3ec95a0277
|
@ -112,22 +112,20 @@ impl RegularMap {
|
|||
self.bg_h_offset().set(self.x_scroll);
|
||||
self.bg_v_offset().set(self.y_scroll);
|
||||
|
||||
vram.gc();
|
||||
|
||||
if !self.tiles_dirty {
|
||||
return;
|
||||
}
|
||||
|
||||
let screenblock_memory = self.screenblock_memory();
|
||||
|
||||
unsafe {
|
||||
dma_copy16(
|
||||
self.tiles.as_ptr() as *const u16,
|
||||
screenblock_memory,
|
||||
self.size.num_tiles(),
|
||||
);
|
||||
if self.tiles_dirty {
|
||||
unsafe {
|
||||
dma_copy16(
|
||||
self.tiles.as_ptr() as *const u16,
|
||||
screenblock_memory,
|
||||
self.size.num_tiles(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
vram.gc();
|
||||
|
||||
self.tiles_dirty = false;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue