Upload speed on display time

For anything related to VDP (plane, color, sprite, tiles)

Moderators: BigEvilCorporation, Mask of Destiny

Post Reply
Miquel
Very interested
Posts: 478
Joined: Sat Jul 30, 2016 12:33 am

Upload speed on display time

Post by Miquel » Wed Nov 13, 2019 1:16 am

I’m trying to do a map mode, or also known mode 7, on Megadrive/Genesis. So far the best idea I got is to use the idle time, or background “thread”, to upload pixels to the vdp nonstop independently from any synchronism, meaning no vblank will trigger it. This way it uses all idle time for this task and don’t disturb any game activities going on.

Now, the problem is idle time can occur after vblank and/or on display time. So I need the vdp throughput to be as fast as the cpu can calculate a pixel, the current code generates 8 pixels, so a long, every 128 cycles on the 68k in average. I know there is a queue of few words, so it’s great to soften latencies on the code and on the chip, but also means it’s a game about averages.

The question is: in average, every how many cpu cycles a word is upload into the vpd on display time?
In case it matters: without using dma.

I know the alternative is to buffer it and upload on vblank, but on the current way I do both steeps on a single pass, therefor faster… if the vpd is quick enough.

In case region matters, I’m focusing on NTSC 60hz, since is the worst case scenario.
Help. Spanish TVs are brain washing people to be hostile to me.

TmEE co.(TM)
Very interested
Posts: 2379
Joined: Tue Dec 05, 2006 1:37 pm
Location: Estonia, Rapla City
Contact:

Re: Upload speed on display time

Post by TmEE co.(TM) » Thu Nov 14, 2019 12:48 am

There's 16 or 18 access slots spread around one line during rendering, depending on 256 or 320 pixel mode, each capable of accepting one byte so 16 or 18 bytes are possible to transfer in best case during a line. 4x 68K cycles is 3.5 pixels, these access slots come in triplets that are 16 pixels apart with 32 pixel gap every triplet, plus a large gap during offscreen part. If you try to transfer more data per line you'll get stalled by the VDP to prevent data corruption.
When rendering is not happening or it is disabled there's one access slot every 2 pixels and DMA can use all of them while 68K can only use something under half of them in tightest possible loop.
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

Miquel
Very interested
Posts: 478
Joined: Sat Jul 30, 2016 12:33 am

Re: Upload speed on display time

Post by Miquel » Sun Nov 17, 2019 7:23 am

Ops! I forgot to mention the resolution, currently I’m using 256px mode, but it’s a static parameter, so it can be changed to 320px with no effort.

320px->18 bytes/line
256px->16 bytes/line -> 2 long/128px
4 cycles -> 3.5 px => 128 cycles -> 112 px

Well… it seems it fits! The non-buffered version is really much simpler. It brings hope for this little project. Thanks for the help!
Help. Spanish TVs are brain washing people to be hostile to me.

Post Reply