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

When the Player is hit, the framerate drops #286

Closed
thobbsinteractive opened this issue Sep 5, 2024 · 3 comments · Fixed by #288
Closed

When the Player is hit, the framerate drops #286

thobbsinteractive opened this issue Sep 5, 2024 · 3 comments · Fixed by #288
Assignees
Labels
bug Something isn't working

Comments

@thobbsinteractive
Copy link
Owner

This seems to happen as the red flash is applied to the colour pallet. There are many possible causes (thread locking), but the pallet shift should not be one of them. It would be interesting to see what is taking the processing time.

@thobbsinteractive thobbsinteractive self-assigned this Sep 5, 2024
@thobbsinteractive thobbsinteractive added the bug Something isn't working label Sep 5, 2024
@thobbsinteractive
Copy link
Owner Author

When the player is hit the pallet is adjusted using PaletteChanges_47760.
This calls sub_41A90_VGA_Palette_install(...) that calls VGA_Set_Palette(...) and eventually SDL_SetPaletteColors(m_gamePalletisedSurface->format->palette, m_currentPalletColours, 0, 256);
Looking at the diagnostic window, this looks fine. The code is running very fast (1ms or less).

@thobbsinteractive
Copy link
Owner Author

If could be the fade back to normal that is costing time.
Calling: sub_90B27_VGA_pal_fadein_fadeout() seems to be costing 15ms

@thobbsinteractive
Copy link
Owner Author

Okay, so there is a manual delay of 10ms in fix_sub_9A0FC_wait_to_screen_beam();. Before I remove this I must be sure of its impact

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
1 participant