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

rc2014: fix callback initialization #11947

Merged
merged 2 commits into from
Jan 22, 2024
Merged

rc2014: fix callback initialization #11947

merged 2 commits into from
Jan 22, 2024

Conversation

mmicko
Copy link
Member

@mmicko mmicko commented Jan 18, 2024

All RC2014 related drivers were broken after #11333 so this is attempt to fix it.
By architecture this is most similar to S100 but did not see any callback logic like this in implementation there.

Please suggest if there are better ways to do it.

@cuavas
Copy link
Member

cuavas commented Jan 18, 2024

Is there a reason it’s using device callbacks and not virtual member functions on the card devices for bus events? You can see various other bus implementations that use virtual member functions to notify cards of broadcast events.

Alternatively, if you really need to connect and disconnect event handlers dynamically, there’s util::notifier.

@mmicko
Copy link
Member Author

mmicko commented Jan 18, 2024

Thanks for suggestion @cuavas. Main concern from beginning was speed. Most of signals would be fine, but there are also two clock signals on board that could come from clock generator card(s) or even some variants of CPU card, and those are driving serial boards (with ACIA or SIO). For main clock (since only that one is used to drive CPU) I have used ability to set bus speed and use derive clock (just with factor 1,1) but that is not something I could use for 2nd clock signal.
Correct me if I am wrong, your suggestion is to use virtual methods for cards, and keep list of connected cards in bus class and loop trough all of them on devcb write ?
Anyway will experiment to see what kind of performance impact it gives compared to current code.

@cuavas
Copy link
Member

cuavas commented Jan 18, 2024

Yeah, you can keep a vector of references to cards, and then iterate over it and call the virtual member function on each one. I think bus/intellec4 does this for various signals.

If a signal is very high frequency, devcb doesn’t give the best performance either – it does have significant overhead.

@mmicko
Copy link
Member Author

mmicko commented Jan 21, 2024

@cuavas Have redone bus callback as virtual member functions

@cuavas cuavas merged commit 40bc562 into mamedev:master Jan 22, 2024
5 checks passed
@mmicko mmicko deleted the rc2014_fix branch January 22, 2024 17:00
@mmicko
Copy link
Member Author

mmicko commented Jan 22, 2024

Thanks for cleanup and merge.

MooglyGuy pushed a commit to MooglyGuy/mame that referenced this pull request Jan 28, 2024
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

2 participants