NDS: Stop flushing VRAM after copying to it

The VRAM memory area isn't cacheable, so there is no need to use
DC_FlushRange(), and we can improve performance a bit by removing the
call.

This function would only be required if we were using DMA to copy the
data to VRAM. In that case, the source in main RAM would have to be
flushed before doing the DMA copy. However, CopyHWords() is a plain CPU
copy, so this isn't needed at all.

The following two articles are a nice introduction to cache handling on
the NDS:

https://web.archive.org/web/20210622053504/https://www.coranac.com/2009/05/dma-vs-arm9-fight/

https://web.archive.org/web/20210622053550/https://www.coranac.com/2010/03/dma-vs-arm9-round-2/
This commit is contained in:
Antonio Niño Díaz 2025-03-25 19:21:53 +00:00
parent d7e1525ff4
commit 60a3b0742a

View File

@ -448,8 +448,6 @@ GfxResourceID Gfx_AllocTexture(struct Bitmap* bmp, int rowWidth, cc_uint8 flags,
}
}
// Ensure anything in data cache is flushed to VRAM
DC_FlushRange((u8*)VRAM_A + offset, tex_size);
VRAM_CR = banks;
int sSize = (Math_ilog2(tex->width) - 3) << 20;