PVR question
-
- DC Developer
- Posts: 9951
- https://www.artistsworkshop.eu/meble-kuchenne-na-wymiar-warszawa-gdzie-zamowic/
- Joined: Sun Dec 30, 2001 9:02 am
- Has thanked: 0
- Been thanked: 1 time
-
- DCEmu Ultra Poster
- Posts: 1754
- Joined: Wed Jul 17, 2002 11:25 am
- Has thanked: 0
- Been thanked: 0
I agree. I think BlackAura should write a book on programming the Dreamcast. Maybe two books, one for beginners, one more advanced. I mean he already has tutorials and stuff he can use there, and whether he realizes it or not, he can analyze things in a way that most people can not. I mean shoot, as a final project he can include his work on Genesis Plus/DC. He can have other programmers contribute ideas/tips/information to the book, too. There is an amazing amount of talent around here!Ian Micheal wrote:Ok that fixed it reading, what you wrote, in the other topics i searched thanks Black aura Some one should take all the info you write and make it a dev book for dreamcast. I buy it!
I think the some one should be you. Really i buy a book that you write on programing and the dreamcast.
About NeoCD DC, thanks to everyone who contributed or worked on it in one way or another. I have never seen such open and large-scale cooperation in a project here before. Simply amazing. Ian: When you get everything sorted out that you need to for a new release, try to make bi- and trilinear filtering optional. Some people may not like the filtered appearance, they want raw pointy pixels.
- Christuserloeser
- Moderator
- Posts: 5948
- Joined: Thu Aug 28, 2003 12:16 am
- Location: DCEvolution.net
- Has thanked: 10 times
- Been thanked: 0
- Contact:
-
- bleemcast! Creator
- Posts: 882
- Joined: Wed Oct 17, 2001 7:44 pm
- Location: Los Angeles, CA
- Has thanked: 0
- Been thanked: 0
- Contact:
I may have missed what you're trying to accomplish here, and I have no idea what the "dcache" function you mentioned actually does...
... but from a cursory glance at the thread, you're probably better off:
Using the cachable area of memory,
Writing all your data in whatever order you choose,
Flushing the portion of the cache that isn't already replaced.
By not using the cache, EVERY since write to that area goes through to main memory -- think "VERY VERY VERY" slow.
Also, if you aren't writing in DWORDs, you'll suffer a fetch as well -- think "REALLY VERY VERY VERY" slow.
Since the cache is only a certain size, whenever you write data beyond that size, a small amount (called a "line") is automatically flushed to main memory and the new line is read in to replace it.
For example, you're updating 512x512x2 bytes, that's 512K -- WAY more than the cache size, so if you're actually flushing all that memory, you're wasting the cycles for everything beyond the size of the cache itself.
There's a few caveats to handle, like how many "ways" or "sets" the cache has to handle, but again, that'll still be far faster than using non-cachable writes.
Then again, if you're doing a large block of contiguous memory, just use the SQs and that'll be the FASTEST (yes, with the appropriate caveats).
Rand.
... but from a cursory glance at the thread, you're probably better off:
Using the cachable area of memory,
Writing all your data in whatever order you choose,
Flushing the portion of the cache that isn't already replaced.
By not using the cache, EVERY since write to that area goes through to main memory -- think "VERY VERY VERY" slow.
Also, if you aren't writing in DWORDs, you'll suffer a fetch as well -- think "REALLY VERY VERY VERY" slow.
Since the cache is only a certain size, whenever you write data beyond that size, a small amount (called a "line") is automatically flushed to main memory and the new line is read in to replace it.
For example, you're updating 512x512x2 bytes, that's 512K -- WAY more than the cache size, so if you're actually flushing all that memory, you're wasting the cycles for everything beyond the size of the cache itself.
There's a few caveats to handle, like how many "ways" or "sets" the cache has to handle, but again, that'll still be far faster than using non-cachable writes.
Then again, if you're doing a large block of contiguous memory, just use the SQs and that'll be the FASTEST (yes, with the appropriate caveats).
Rand.
-
- DC Developer
- Posts: 9951
- Joined: Sun Dec 30, 2001 9:02 am
- Has thanked: 0
- Been thanked: 1 time
That's pretty much what it's doing. The dcache thingy is a KOS utility function which clears the data cache over a certain range.Using the cachable area of memory,
Writing all your data in whatever order you choose,
Flushing the portion of the cache that isn't already replaced.
I think it's using words instead of dwords too. Wasn't really designed with the Dreamcast in mind, of course. The thing was partially written in x86 assembly at one point.
-
- Soul Sold for DCEmu
- Posts: 4865
- Joined: Fri Jul 11, 2003 9:56 pm
- Has thanked: 2 times
- Been thanked: 4 times
Ended up doing this and it worked and speed really did change. I think the dreamcast needs sqaure textures or i do 512*256 but have to change all the offsets.
With this im only moving what i need to fosters pointed this out to me.
yes i will make the filters a menu option so you will have the options.
Code: Select all
dcache_flush_range(vidram_buf, 512*224*2);
pvr_txr_load_dma(vidram_buf, vidram_tex, 512*224*2, 1); // dma
yes i will make the filters a menu option so you will have the options.
Dreamcast forever!!!
-
- Soul Sold for DCEmu
- Posts: 4865
- Joined: Fri Jul 11, 2003 9:56 pm
- Has thanked: 2 times
- Been thanked: 4 times
-
- DCEmu Cool Poster
- Posts: 1048
- Joined: Thu May 16, 2002 5:01 pm
- Location: Madrid, Spain
- Has thanked: 0
- Been thanked: 0
I'd buy that book too, I need it!!!Ian Micheal wrote:Ok that fixed it reading, what you wrote, in the other topics i searched thanks Black aura Some one should take all the info you write and make it a dev book for dreamcast. I buy it!
I think the some one should be you. Really i buy a book that you write on programing and the dreamcast.
-
- Soul Sold for DCEmu
- Posts: 4865
- Joined: Fri Jul 11, 2003 9:56 pm
- Has thanked: 2 times
- Been thanked: 4 times
How would i convert this to Dwords from words? Is this only the Cpu core using this and thats the same one in genesis plus thats used in both. It's pretty fast now lacking maybe only 3 to 5% speed from fullspeed with out sfx.BlackAura wrote:That's pretty much what it's doing. The dcache thingy is a KOS utility function which clears the data cache over a certain range.Using the cachable area of memory,
Writing all your data in whatever order you choose,
Flushing the portion of the cache that isn't already replaced.
I think it's using words instead of dwords too. Wasn't really designed with the Dreamcast in mind, of course. The thing was partially written in x86 assembly at one point.
I like to explore any way to gain speed on this.
Dreamcast forever!!!
-
- Mental DCEmu
- Posts: 415
- Joined: Thu Oct 10, 2002 7:18 pm
- Has thanked: 0
- Been thanked: 0
- Contact:
and I think Rand should write a book on proper assembly programming or just proper DC assembly programmingAlexvrb wrote:I agree. I think BlackAura should write a book on programming the Dreamcast. Maybe two books, one for beginners, one more advanced. I mean he already has tutorials and stuff he can use there, and whether he realizes it or not, he can analyze things in a way that most people can not. I mean shoot, as a final project he can include his work on Genesis Plus/DC. He can have other programmers contribute ideas/tips/information to the book, too. There is an amazing amount of talent around here!Ian Micheal wrote:Ok that fixed it reading, what you wrote, in the other topics i searched thanks Black aura Some one should take all the info you write and make it a dev book for dreamcast. I buy it!
I think the some one should be you. Really i buy a book that you write on programing and the dreamcast.