Skip to content

Conversation

@Gerporgl
Copy link

@Gerporgl Gerporgl commented Sep 16, 2025

Hi!

This is my attempt at optimizing the main menu drawing speed.

The slow speed was not ideal for the user experience, but I also noticed cases where the gcode sender on a PC (UGS) would stutter when jogging with the keyboard while the pendant was on the main menu. It took me a while to figure out it was the problem, but whenever I would put the pendant on any other scene I would not experience that problem. To solve this issue initially (and I think permanently in my case) I've disabled the flow control.

I figured out what was slow was the real time opening and decoding of menu button PNGs.
I optimized it by caching those button images in sprites so that it is only done once.

I tested 2 variants of this approach, but memory constrains forced me to use my first version (v1) that uses a lower sprite blending quality, resulting in a need for new png buttons images that use 2 level of transparency rather than 256, since sprite drawing only support key color transparency.

Overall this optimization makes the main menu navigation very snappy, I think it's a great improvement!
Try it out and make sure you update the new file system image as well.

I've currently left the "v2" in comment so it can be tried manually. The v2 would not require new png images, but unfortunately it causes memory issues it seems because of the 3 sprite buffers needed for each button state. In some cases other image resources would not load in other scenes.

A final note that I've only tested this on the CYD pendant with capacitive touch screen and physical buttons (although I also have the m5dial, but didn't have the time to test that one).

Gerporgl added 2 commits September 15, 2025 21:19
… several different approach, but memory contrains forced a lower sprite blending quality, resulting in new png buttons set that use 2 level of transarency rather than 256, since sprite drawing only support key color transparency.
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.

1 participant