PVR question

If you have any questions on programming, this is the place to ask them, whether you're a newbie or an experienced programmer. Discussion on programming in general is also welcome. We will help you with programming homework, but we will not do your work for you! Any porting requests must be made in Developmental Ideas.
BlackAura
DC Developer
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

Post by BlackAura »

I thought the dcache thing would work. Chances are that modifying the thing to generate the display in the right order would be really hard, because it doesn't use the same scanline-based approach that Genesis Plus does.
Alexvrb
DCEmu Ultra Poster
DCEmu Ultra Poster
Posts: 1754
Joined: Wed Jul 17, 2002 11:25 am
Has thanked: 0
Been thanked: 0

Post by Alexvrb »

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! :D

I think the some one should be you. Really i buy a book that you write on programing and the dreamcast.
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!

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. :D
User avatar
Christuserloeser
Moderator
Moderator
Posts: 5948
Joined: Thu Aug 28, 2003 12:16 am
Location: DCEvolution.net
Has thanked: 10 times
Been thanked: 0
Contact:

Post by Christuserloeser »

:o A book about DC programming would be great! So much interested ppl would start programming for the DC... I would buy this book...

Let's open a thread for contributions to it!


Chris
Insane homebrew collector.
Rand Linden
bleemcast! Creator
bleemcast! Creator
Posts: 882
Joined: Wed Oct 17, 2001 7:44 pm
Location: Los Angeles, CA
Has thanked: 0
Been thanked: 0
Contact:

Post by Rand Linden »

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.
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

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.
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.

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.
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

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.

Code: Select all

  dcache_flush_range(vidram_buf, 512*224*2); 
  pvr_txr_load_dma(vidram_buf, vidram_tex, 512*224*2, 1); // dma 
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.
Dreamcast forever!!!
BlackAura
DC Developer
DC Developer
Posts: 9951
Joined: Sun Dec 30, 2001 9:02 am
Has thanked: 0
Been thanked: 1 time

Post by BlackAura »

You can easily just upload part of the image (like you did there). You could use a texture size of 512x256 (which is what Genesis Plus does), but you do need to change the texture coordinates.
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

So it can be done great Im going to try it. Problem im saying is with dma on it's sort of freezing only the controled sprite seems it's effecting the controls on games that scroll it's wierd.
Dreamcast forever!!!
doragasu
DCEmu Cool Poster
DCEmu Cool Poster
Posts: 1048
Joined: Thu May 16, 2002 5:01 pm
Location: Madrid, Spain
Has thanked: 0
Been thanked: 0

Post by doragasu »

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! :D

I think the some one should be you. Really i buy a book that you write on programing and the dreamcast.
I'd buy that book too, I need it!!!
Ian Micheal
Soul Sold for DCEmu
Soul Sold for DCEmu
Posts: 4865
Joined: Fri Jul 11, 2003 9:56 pm
Has thanked: 2 times
Been thanked: 4 times

Post by Ian Micheal »

BlackAura wrote:
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.
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.

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.
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.

I like to explore any way to gain speed on this.
Dreamcast forever!!!
q_006
Mental DCEmu
Mental DCEmu
Posts: 415
Joined: Thu Oct 10, 2002 7:18 pm
Has thanked: 0
Been thanked: 0
Contact:

Post by q_006 »

Alexvrb wrote:
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! :D

I think the some one should be you. Really i buy a book that you write on programing and the dreamcast.
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!
and I think Rand should write a book on proper assembly programming or just proper DC assembly programming :!:
Post Reply