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

use templates for TLCS900 I/O ports #12758

Merged
merged 4 commits into from
Sep 15, 2024

Conversation

felipesanches
Copy link
Contributor

@felipesanches felipesanches commented Sep 13, 2024

Based on feedback from @cuavas at #12684 (comment), this PR uses templates to "avoid copy/pasta".

@felipesanches
Copy link
Contributor Author

@cuavas, I consider this ready for review.

@felipesanches
Copy link
Contributor Author

I noticed that it would, as usual, be problematic to declare the enum Ports outside of the device class, as that way it would be declared globally. And when I tried to declare it inside the tmp95c063_device class, it became uncomfortable to keep prepending "tmp95c061_device::" to all references to port names (like tmp95c061_device::PORT_A). Maybe I'm unaware of a better way of doing it, so I would appreciate if you have any suggestions.

One alternative approach that I pushed as a separate commit, so that it is easier to drop it if not considered good, was to use static constexpr uint8_t statements for the I/O port names, inside the cpu device classes (tmp95c061_device and tmp95c063_device). That works, but I am not sure what @cuavas thinks. Please let me know.

@cuavas
Copy link
Member

cuavas commented Sep 15, 2024

That’s much neater, thanks.

@cuavas cuavas merged commit f26d792 into mamedev:master Sep 15, 2024
0 of 5 checks passed
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.

2 participants