DMA Fill
Posted: Fri Jun 19, 2009 11:07 pm
Hi All,
I'm trying to do a DMA fill on a non-contiguous chunk of VRAM by setting auto-increment to > 2. I have a rectangular set of tiles laid out top-to-bottom, left-to-right as a sprite would be. Within the rectangle, every 8 bytes is one row down. What I want to do is draw a vertical line through the rectangle by issuing a DMA fill with auto increment set to 8. However, what appears to happen is that the high byte of the DMA data is written to the current vram address, then the low byte is written to the next address and then every 8 bytes after that. What I end up with is a pattern like this:
I've played around with starting on odd and even addresses, different auto-increment settings, putting zeros in high or low bytes, but nothing works.
It seems that no matter what you do, the VDP will write two consecutive bytes at the start of the DMA fill, and then honor the auto-increment setting from there onwards. It is therefore impossible to fill every N'th byte of VRAM without the two-byte start. Is DMA fill useful for anything but filling contiguous regions of VRAM. Can anyone think of a way to do what I want?
I'm trying to do a DMA fill on a non-contiguous chunk of VRAM by setting auto-increment to > 2. I have a rectangular set of tiles laid out top-to-bottom, left-to-right as a sprite would be. Within the rectangle, every 8 bytes is one row down. What I want to do is draw a vertical line through the rectangle by issuing a DMA fill with auto increment set to 8. However, what appears to happen is that the high byte of the DMA data is written to the current vram address, then the low byte is written to the next address and then every 8 bytes after that. What I end up with is a pattern like this:
Code: Select all
**
*
*
*
*
*
*
*
*
It seems that no matter what you do, the VDP will write two consecutive bytes at the start of the DMA fill, and then honor the auto-increment setting from there onwards. It is therefore impossible to fill every N'th byte of VRAM without the two-byte start. Is DMA fill useful for anything but filling contiguous regions of VRAM. Can anyone think of a way to do what I want?