furrtek / Arcade-TMNT_MiSTer

Konami's Teenage Mutant Ninja Turtles for the MiSTer FPGA platform
https://www.patreon.com/furrtek
GNU General Public License v2.0
29 stars 8 forks source link

Partial fix to missing shadows #18

Open jotego opened 1 year ago

jotego commented 1 year ago

The asserted output of AJ84 was used by mistake in the RTL. Changing it to fit the schematics reveal the shadows.

imagen

Although it doesn't completely fix it. I think the priority logic should choose the background when the shadow is enabled. That part is still not working.

This PR also adds a pause option I need myself.

jotego commented 1 year ago

The priority problem must be related to the generation of NOBJ here:

image

that feeds the priority PROM and it isn't selecting the right layer. I was having the same problem in Super Contra, which uses the same chip set. I think that signal is mediated by the shadow bit, so it should mark the sprite pixel as blank if it is a shadow.

In my implementation I use:

assign blank_n = pxl[3:0]!=0 && !shadow;

And that makes the scroll background to be selected for the shadow part of a sprite.

jotego commented 1 year ago

It looks like rather than assigning the blank output directly, what k051937 is overwrite the pxl[3:0] bits to zero when a shadow should occur. That signals the layer mixing logic that the object layer is transparent. But, at the same time the shadow bit is kept high, so the visible layer underneath will be dimmed.

Logic in k051937 seems to try to do this (set pxl[3:0] low for shadows) but there must be some bug in its current form.