TASEmulators / TASEmulators/BizHawk

Unify emu.setislagged, emu.setlagcount, and tastudio.setlag

Open
#4,173 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

re: Lua API/scripting Request: Feature/Enhancement Tool: TAStudio
Dominant language
C#
Stars
2.8k
Forks
468
PR merge metrics
No merged PRs in 30d

Description

Summary

There are three separate ways of looking at lag in the Hawk Lua API: the lag flag (emu.setislagged), lag counter (emu.setlagcount), and TAStudio red bars (tastudio.setlag). These three values should be the three different ways of looking at the same information, but are in fact completely unrelated. There should be one simple setlag call that keeps all these values in sync.

Repro
while true do
    emu.setislagged(math.random() < 0.5)
    emu.setlagcount(math.random() * 1000)
    tastudio.setlag(emu.framecount(), math.random() < 0.5)

    emu.frameadvance()
end
Host env.
  • BizHawk 2.10.0 Windows 10

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing the Lua API entry points emu.setislagged, emu.setlagcount, and tastudio.setlag, then compare how each value is stored and updated. Confirm the intended shared lag state and verify that one setlag call keeps the lag flag, counter, and TAStudio red bars synchronized.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
api
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.