jotego / jt12

FM sound source written in Verilog, fully compatible with YM2612, YM3438 (JT12), YM2203 (JT03) and YM2610 (JT10)
GNU General Public License v3.0
116 stars 18 forks source link

Fix timer length #43

Closed greyrogue closed 4 years ago

greyrogue commented 4 years ago

--Looks like a simple off by one error int the timer length. --Fixes Genesis Konami speed issues.

jotego commented 4 years ago

Thanks a lot @greyrogue Now that it's merged, I will replace the comparison: mult+1'b1<mult_max with a less or equal comparison without addition: mult <= mult_max which probably synthesizes in a bit less area.

greyrogue commented 4 years ago

I think that moves it the wrong way. Instead of 0-23, you get a range of 0-25 with mult<=mult_max. Maybe the cleaner way is to keep mult<mult_max, and change mult_max to 23 (and 383 for timer B).

greyrogue commented 4 years ago

I had used mult+1'b1 because the same expression appears two lines lower. A smart compiler would notice they are the same and only implement it once in logic. But I think using 23 and 383 might be the better way to handle it, as those are actually the max values.