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

Fix cpu6 detect #34

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Fix cpu6 detect #34

wants to merge 2 commits into from

Conversation

phire
Copy link
Contributor

@phire phire commented Jul 20, 2022

CLR needs to set V flag depending on value for various cpu6 detection code to work.

Also stub parity enable/disable.

Allows ?DSKT to correctly detect and report that it's running on cpu6

Before:

./centurion ../SOFTERM/\?/\?DSKT.4.bin
Centurion Binary ../SOFTERM/?/?DSKT.4.bin loaded; entry at 0164
[07]?DSKT 7.0

** CPU 5 **
RETURN TO LOADER(L); ERROR LOG ON CRT(C), PRINTER(P), OR BOTH(B)? 

After

./centurion ../SOFTERM/\?/\?DSKT.4.bin
Centurion Binary ../SOFTERM/?/?DSKT.4.bin loaded; entry at 0164
[07]?DSKT 7.0

** CPU 6 **
RETURN TO LOADER(L); ERROR LOG ON CRT(C), PRINTER(P), OR BOTH(B)? 

Needs to set V flag depending on value for various cpu6 detection
code to work
Now cpu6 detection works, code actually executes these
alu_out ^= ALU_V;
// Explicitly clears L and F flags
alu_out &= ~(ALU_L | ALU_F);
logic_flags(v);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be neat if you describe CPU detection logic somewhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As a comment?

Code just executes a clr to a non-zero value and checks the v flag. As CPU5 doesn't implement "small immediates", it clears to zero and v flag is zero.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aha, got it. CPU5 ignored the remaining nibble of the operand, where the constant was pushed in in cpu6.
Still perhaps worth leaving somewhere. In code comments or maybe on wiki.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah so we finally know wtf was going on. Cool

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.

3 participants