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

Suzy - Math timing wrong #67

Open
42Bastian opened this issue Nov 8, 2021 · 8 comments
Open

Suzy - Math timing wrong #67

42Bastian opened this issue Nov 8, 2021 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@42Bastian
Copy link
Contributor

The timing either SuzyMath or Timers seems to be wrong. Using cycle_check I see that multiplication takes 36 cycles and multiplication with sign and accu 41 cycles.

@laoo laoo self-assigned this Nov 8, 2021
@laoo laoo added the bug Something isn't working label Nov 8, 2021
@laoo
Copy link
Owner

laoo commented Nov 8, 2021

@42Bastian could you attach some some code testing it? I'll debug it.

@42Bastian
Copy link
Contributor Author

Here two versions of cycle_check. Signed + Accu and one w/o.
Signed/Accu shows 160 the other 154.
Both do 1024 multiplications, time in in 64us ticks

cycle_check_sign_accu.zip
cycle_check.zip

@laoo
Copy link
Owner

laoo commented Nov 8, 2021

Sorry, the test was wrong. I'll try something different

@laoo
Copy link
Owner

laoo commented Nov 8, 2021

@42Bastian I was looking into it and it's hard to obtain desired timing without some "magic constants". I'll try to work with some simpler tests before this.

@42Bastian
Copy link
Contributor Author

Well, I think most important is that timers are correct and math cycles are not more than on hardware. Cycle accurate emulation of the Lynx is hard to achieve esp. when then manual says that you should not rely on exact timing ;-)

@laoo
Copy link
Owner

laoo commented Nov 9, 2021

@42Bastian I thing that generally top priority have the issues to make Felix correct and stable, especially to run all official games. Achieving cycle-exactness should be next and to that we should devise a set of possible simple tests to check and correct relation between CPU cycles and timers. Hardest part could be to obtain cycle exact sprite blitting.

@42Bastian
Copy link
Contributor Author

That's what I wanted to say. Even the official docs state, that one should no rely on exact cycles. So yes, first step should be to have the sprite engine work correctly. There are still many flaws (xor sprite, tilt/stretch).
I will try to prepare simple tests.

@laoo
Copy link
Owner

laoo commented Nov 9, 2021

@42Bastian Official docs instruct game developer. We're doing something completely different, as we are here emulator developers and trying to make cycle-exact emulator is perfectly OK ;)

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
Development

No branches or pull requests

2 participants