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

Pattern loop point lookahead #24

Open
pinobatch opened this issue Dec 24, 2017 · 0 comments
Open

Pattern loop point lookahead #24

pinobatch opened this issue Dec 24, 2017 · 0 comments

Comments

@pinobatch
Copy link
Owner

Profiling Pently (issue #5) reveals that more complex tracks cause CPU time spikes at the start of patterns, particularly "Isometry" which uses five play commands to start all five tracks at once and ends up taking roughly 3800 cycles. This can happen to a lesser extent if multiple patterns hit their loop point (PATEND in pattern bytecode) at the same time. So during downtime, look for the first track that may hit a play or PATEND on the next row and proactively (re)start it. This should help smooth out peaks other than on the first frame.

Also consider run this sort of lookahead in pently_start_music, which in some games may be done on a blank screen when worst-case CPU use isn't as critical.

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

No branches or pull requests

1 participant