Sprite table to VRAM with or without DMA?
Moderator: BigEvilCorporation
Sprite table to VRAM with or without DMA?
Hi guys!
I am reading some info about sending the sprite table without DMA because DMA can cause some glitches for this operation. Is that right? Do you know the reason for that?
Thanks!
I am reading some info about sending the sprite table without DMA because DMA can cause some glitches for this operation. Is that right? Do you know the reason for that?
Thanks!
The man who moves a mountain begins by carrying away small stones. Confucius, 551-479 BC
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Sprite table to VRAM with or without DMA?
You can get problems when you update sprite table during active frame regardless of using CPU or DMA to do the transfer.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 209
- Joined: Sat Sep 08, 2012 10:41 am
- Contact:
Re: Sprite table to VRAM with or without DMA?
I've recently gone down the DMA route and it's working just fine for me.
Previously I was setting individual sprite properties (X, Y, flip flags) by reading bytes from the VDP, setting values and writing them back, but this slowed my game down to a crawl.
Now I keep a local copy of the entire sprite table in RAM, and DMA it across in the vertical interrupt routine. Works a treat!
Previously I was setting individual sprite properties (X, Y, flip flags) by reading bytes from the VDP, setting values and writing them back, but this slowed my game down to a crawl.
Now I keep a local copy of the entire sprite table in RAM, and DMA it across in the vertical interrupt routine. Works a treat!
A blog of my Megadrive programming adventures: http://www.bigevilcorporation.co.uk
Re: Sprite table to VRAM with or without DMA?
I usually do that, but in some wikis say that DMA works fine but the cache should not be completely update, causing some problems with the drawn sprites. I have some random sprite disappearing (not because a known reason) and the problem should be DMA writing. I see that SGDK did not use DMA also for that stuff, so i think it should be a good reason.BigEvilCorporation wrote:Now I keep a local copy of the entire sprite table in RAM, and DMA it across in the vertical interrupt routine. Works a treat!
The man who moves a mountain begins by carrying away small stones. Confucius, 551-479 BC
-
- Very interested
- Posts: 2440
- Joined: Tue Dec 05, 2006 1:37 pm
- Location: Estonia, Rapla City
- Contact:
Re: Sprite table to VRAM with or without DMA?
The cache not updating happens when your DMA (or CPU transfer) reaches active frame. When your update happens and finishes in the blanking/border there will not be problems.
Mida sa loed ? Nagunii aru ei saa
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
http://www.tmeeco.eu
Files of all broken links and images of mine are found here : http://www.tmeeco.eu/FileDen
-
- Very interested
- Posts: 3131
- Joined: Thu Nov 30, 2006 9:46 pm
- Location: France - Sevres
- Contact:
Re: Sprite table to VRAM with or without DMA?
Next SGDK version will use DMA for sprites update. Definitely use it if you can, it's a lot faster than updating sprites independently and from 68K.
Re: Sprite table to VRAM with or without DMA?
Ok i understand. Thanks guys!!!
The man who moves a mountain begins by carrying away small stones. Confucius, 551-479 BC