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

[cmds] Add accurate train timing to sl #1723

Merged
merged 2 commits into from
Sep 15, 2023
Merged

[cmds] Add accurate train timing to sl #1723

merged 2 commits into from
Sep 15, 2023

Conversation

ghaerr
Copy link
Owner

@ghaerr ghaerr commented Sep 15, 2023

Adds an accurate 40ms "cycle time" between each train re-display, so that the sl train should always chug along at a constant speed on all systems (or at least as fast as possible on slower systems). sl now calculates a minimum cycle of 40 ms and will add a delay if the last display cycle was quicker than that. This now helps the illusion that all trains have equal conductors (yes, I'm talking about your 8088 systems @Vutshi).

In order to continue to use sl as an indicator of how fast or slow your system may actually be without a delay, a new -f option was added: sl -f will run the trains off the tracks if your system is fast enough (which is the same as sl previously with no option).

To summarize our steam powered evolution:

sl     # train running at 40ms/frame or slower on all systems
sl -s  # this train emits more ANSI sequences than slow systems can handle
sl -f  # this train doesn't delay or stop for anybody

This finalizes all of the reported problems in #1619.

@ghaerr ghaerr merged commit 2d489a1 into master Sep 15, 2023
2 checks passed
@ghaerr ghaerr deleted the sl5 branch September 15, 2023 20:07
@Vutshi
Copy link

Vutshi commented Sep 15, 2023

At this stage, ELKS might just happen to possess the most advanced railway system on the planet.

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