Skip to content

shangha3_v.cpp: proposed fix for shangha3 drawing phantom drop shadows for player sprites #10329

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

angelosa
Copy link
Member

@angelosa angelosa commented Sep 11, 2022

  • shangha3 dislikes MAME shadow factor default of 0.6 when drawing player sprite, causing a phantom square shadow when moving player sprite, cfr. screenshot. Setting it to 1.0 prevents it to happen.

result

@ghost
Copy link

ghost commented Sep 11, 2022

isn't setting it to 1.0 just disabling shadows?

maybe there's meant to be some kind of shadow that isn't rendering properly?

@angelosa
Copy link
Member Author

I've already tried to check if there's an extra bit setting in blitter lists (no unknowns) & if bit 0 of paletteram is used for anything (it's not)

1.0 doesn't disable them but makes the ratio to be stronger on the shadow bank.
And from the refs I've saw there's no cursor shadow at all, cfr. MT bug ref

@angelosa
Copy link
Member Author

Also note: there's an extra blink artifact that happens once the continue box appears, something that is fixed again with 1.0 as shadow factor.

@cuavas
Copy link
Member

cuavas commented Sep 12, 2022

The shadow factor is set as a group contrast value on the underlying palette. This is a simple intensity scale factor – @davidhaywood is right, setting it to 1.0 causes it to have no effect. I don’t think this is really a “fix”.

@angelosa
Copy link
Member Author

So what it could be then, because I'm decidedly lost here. If a set_shadow_factor of 1.0 shouldn't be set in any place then it should throw an exception, but the documentation clearly states that it accept a range of 0.0 - 1.0 ...

@cuavas
Copy link
Member

cuavas commented Sep 12, 2022

Yes, it accepts a range of 0.0 (shadows are completely black) to 1.0 (shadows have no effect). I haven’t tested it, but it might even be possible to set values larger than 1.0 to cause it to “overdrive” the the shadow instead.

@angelosa
Copy link
Member Author

0122x
This is the output with this patch applied. I still see shadows here (because they output thru pen 14). There's chance that the driver is overcomplicating things and this can be done in another way.

@cuavas
Copy link
Member

cuavas commented Sep 12, 2022

Possibly – maybe it shouldn’t be trying to use the palette shadow feature at all.

@angelosa angelosa marked this pull request as draft December 2, 2022 15:45
@angelosa angelosa added the PoC label Dec 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants