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

mb-audit failure for Linux version #963

Open
tomcw opened this issue Jun 6, 2021 · 4 comments
Open

mb-audit failure for Linux version #963

tomcw opened this issue Jun 6, 2021 · 4 comments

Comments

@tomcw
Copy link
Contributor

tomcw commented Jun 6, 2021

In cea2, "mb-audit: a Mockingboard test suite for emulators", @audetto asked:


Interesting, and surprising when I run it on the linux version I got a failure.
Turns out that the issues was me running bigger batches of CPU code (16 ms vs 1 ms).

So the question I have now is:

if we know that 1ms is ok and 16ms is too long

https://github.com/AppleWin/AppleWin/blob/master/source/Windows/AppleWin.cpp#L132

when the MB is updated here https://github.com/AppleWin/AppleWin/blob/master/source/Windows/AppleWin.cpp#L217

Is there a maximum?
Is it possible that 1ms is too long as well?
Should the update really be done for each cpu instruction (like the video)?

@tomcw
Copy link
Contributor Author

tomcw commented Jun 6, 2021

What are the failure codes you get?

In mb-audit there is a test (T6522_B) with a big gap (~$9000 cycles) between reads of the 6522 timer.
https://github.com/tomcw/mb-audit/blob/0c02f0e7f3e437c1aa62c7d80bdf4c80c4d4aa9e/chip-6522.a#L1695
But I know this isn't necessarily the same thing you are describing.

@audetto
Copy link
Contributor

audetto commented Jun 6, 2021

This is the error I got

mb-audit v0.5-beta, 2021
                    1  2  3  4  5  6  7
               $00:          ?  C
               $80:          ?  C
                SP:            ABV
65C02 detected
Slot #5 :Mockingboard failed test:SSI263
Test: 41:05:00
Expected:00 Actual:01

Now, the fix was simple, I just have to run cpu cycles in batches of 1ms rather than the 16.6ms I was doing before.
What is curious is

  • batches of 15ms still work, 16ms or more is too long
  • this problem did not manifest earlier (but I probably do not test enough)
  • the real card does the equivalent of MB_PeriodicUpdate constantly rather than in batches (of 1 or 16 ms), can one write a test that fails with AW's 1ms period?

@audetto
Copy link
Contributor

audetto commented Jun 6, 2021

And this is what I get if I remove MB_PeriodicUpdate altogether

mb-audit v0.5-beta, 2021
                    1  2  3  4  5  6  7
               $00:          ?  ?
               $80:          ?  ?
                SP:
65C02 detected
Multi-card tests passed
Slot #5 :Press CTRL+RESET (ESC to skip)
Slot #4 :Press CTRL+RESET (ESC to skip)
Reset tests passed
Slot #5 :Tone: B:456
Slot #4 :Tone: B:456
All tests passed (total=$0419)

Should this be a failure?

@tomcw
Copy link
Contributor Author

tomcw commented Jun 6, 2021

Well the ? just means that a 6522 was detected at either $00 or $80... but mb-audit was unable to match what it detected to any of the known cards.

And there's a clue here...

Slot #5 :Tone: B:456
Slot #4 :Tone: B:456

This means that it only found an AY-3-8913 at $80, but not at $00.
NB. If it found an AY8913 at only $00, it would display Slot #5 :Tone: A:123.
And if it found an AY8913 at $00 and at $80, it would display Slot #5 :Tone: A:123,B:456.

AY8913 detection is done by writing to the AY8913's registers, and then attempting to read them back.

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

2 participants