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

machine/wd_fdc.cpp: Simplify/optimize how bus inverting is handled #11375

Merged
merged 1 commit into from Jul 2, 2023

Conversation

mgarlanger
Copy link
Contributor

Simplifies how bus inverting is handled, no longer has an if check, but always perform an xor with the value defined in the class. For chips that do inverting, the value will be set to 0xff. For chips without inverting, it is set to 0x00.

@@ -99,7 +99,7 @@ class wd_fdc_device_base : public device_t {
bool disable_mfm;
bool enmf;
bool has_enmf;
bool inverted_bus;
uint8_t bus_invert_value;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I wasn't really happy with the name of the variable, if someone has a better idea, let me know.

@cuavas cuavas changed the title wd_fdc.cpp: simplify/optimize how bus inverting is handled machine/wd_fdc.cpp: simplify/optimize how bus inverting is handled Jul 2, 2023
@cuavas cuavas changed the title machine/wd_fdc.cpp: simplify/optimize how bus inverting is handled machine/wd_fdc.cpp: Simplify/optimize how bus inverting is handled Jul 2, 2023
@cuavas
Copy link
Member

cuavas commented Jul 2, 2023

@galibert do you have an opinion on this? It looks correct, and it’s a net reduction in source code lines. I wouldn’t count on it improving performance – a test/conditional move is likely just as fast as loading the value from a data member.

@galibert galibert merged commit 2d00887 into mamedev:master Jul 2, 2023
5 checks passed
@galibert
Copy link
Member

galibert commented Jul 2, 2023

Yeah, I don't see that as having any performance impact, whatever :-)

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.

None yet

3 participants