Skip to content
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

konami/mystwarr_v.cpp, k053246_k053247_k055673.cpp: improve sprite blending #13328

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

FredYeye
Copy link
Contributor

@FredYeye FredYeye commented Feb 3, 2025

This pull request is split into three commits:

  1. d0faecd
    The sprite effect attribute bits in mystwarr, metamrph and viostorm are used for sprite blending purposes. I changed the sprite callbacks to attach the attribute bits.

  2. e7f911e
    Blending was being done in reverse. There are probably several reasons why this was never noticed, but two reasons would be that 0% and 100% blending worked as intended and almost no games use sprite blending (at least in current MAME). Simple solution: reverse the operands to alpha_blend_r32().

  3. 8184130
    Optional commit: minor cleanup of zdrawgfxzoom32GP(), the function that contains the alpha_blend_r32() calls. Initially I had planned to make bigger changes, like condensing the switch-cases, but I wasn't satisfied with my attempts at doing so. Instead I opted for a more conservative cleanup pass. It appears to give a marginal speedup as a bonus.
    This is the least important commit of the three, so if it's deemed unnecessary it can be dropped.


This fixes transparent sprites in mystwarr, metamrph and viostorm. Mystwarr & viostorm make little use of these; it's a bit more apparent in metamrph.
I assume this affects other systems too - like konami GX? I ran all GX games with -bench 400 and didn't run into any sprites that use any transparency. Either GX games do not have transparent sprites or they're not tagged as such in current MAME. This is hardly the perfect testing method, so please let me know if I should be testing any other games and systems.

mark sprites with their attribute bits for blending
-move variable declarations closer to use
-use appropriate variable types
-mark applicable variables as const
-move "cull off-screen objects" early out check earlier in function
@angelosa
Copy link
Member

angelosa commented Feb 4, 2025

I'm not gonna judge the changes here (they looks reasonable to me), you may give a shot at dadandrn Centaur and Fungus stages (both uses blending in one form or another). Don't think sexyparo stages 3L and 3W (i.e. Castlevania stage and its mission 2 quota satisfied equivalent) are affected here but you may try anyway.

@FredYeye
Copy link
Contributor Author

FredYeye commented Feb 4, 2025

Good call on dadandrn! I had trouble finding real HW footage so I didn't dig into it earlier. Found a video here to compare against. I switched it over to using the mystwarr sprite callback and blending does seem to work! It was using the gaiapols callback which is slightly different, so I will play through the rest of the game and see if anything looks out of place.

Will check sexyparo soonish, whenever I have time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants