jotego / jtcores

FPGA cores compatible with multiple arcade game machines and KiCAD schematics of arcade games. Working on MiSTer FPGA/Analogue Pocket
https://patreon.com/jotego
GNU General Public License v3.0
216 stars 38 forks source link

toki: no double-line buffer #632

Open jotego opened 4 months ago

jotego commented 4 months ago

@vertrex, it looks like the reason you need 96MHz is because you are not using a double-line buffer, but a single line. I think you are trying to fill all the line data during blanking in a single buffer and then dump it during the active time.

That approach, although doable, was not the standard one at the time. Even today, there is no benefit in doing it that way as you will still allocate a whole 1kB of BRAM, not the 256 bytes you explicitly declared.

https://github.com/jotego/jtcores/blob/e63a12e41d22ded5734f5a4b15361b62ac68ba8c/cores/toki/hdl/sprite.v#L29

Instead of doing that, follow what the other cores do. There is a module that already implements the dual memory and synthesizes well across the different platforms. From the point of view of the core, it is straight forward to use it. You have a full line time to draw the sprites in one buffer, while data is dumped from the other buffer. This will allow you to go down to 48MHz.

jotego commented 4 months ago

I forgot to mention that the module name is jtframe_obj_buffer