-
Notifications
You must be signed in to change notification settings - Fork 2.2k
model2.cpp: Hooked some outputs (lamps, wheel) #14617
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
base: master
Are you sure you want to change the base?
Conversation
src/mame/sega/model2.cpp
Outdated
| output().set_value("Lamp_Race_Leader", BIT(data, 7)); | ||
| } | ||
|
|
||
| if (strncmp(name, "indy500", 7) == 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Absolutely no at this. Just generate a function depending on what's the machine_config caller. So for example:
void model2a_state::srallyc(machine_config &config)
{
[...]
io.out_pf_callback().set(FUNC(model2a_state::srallyc_outputs_w));
}
void model2_state::srallyc_outputs_w(u8 data)
{
m_output[1] = data;
output().set_value("Lamp_Start", BIT(data, 2));
output().set_value("Lampe_View", BIT(data, 5)); // Lampe?
output().set_value("Lamp_Race_Leader", BIT(data, 7));
}Beyond being ugly and prone to breakage, there are two extra reasons about why calling the base system name is a bad juju:
- you are iterating for every single string compare;
- the clones won't hookup anything (iirc);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Clones do hook. Thanks for the feedback.
|
@angelosa I hope these changes will make the integration of the code possible. Thank you again. |
|
Afaik set_value is deprecated and should be removed in favour of output_finder when encountered. Adding even more shouldn't be the way to go |
|
Better use 6 generic lamps, like How is the wheel motor shared with m_driveio_comm_data? |
|
Uff. Okay I'm tired for today. I did this exactly to avoid generic lamps and define them. I didn't do the wheel hooks but they work. |
|
But defined outputs are not wanted? Will tell people straight what which output does. |
|
Personal preference: generic output tags in most cases. |
|
@happppp changed to generic lamp output. if this works for you I will also fix the outputs for model2o. |
|
Lamps are on bit 2-7, right? So it's i+2, not i. And you only need one function. And I'm not a fan of "contact MAMEdev" popmessage. To be honest if it was me, I'd use logerror instead of obscuring the game screen. (note, my opinion here may differ from model2 driver authors) |
|
Contact mame Dev is not from me. Will fix the rest. I appreciate the time and patience. |
|
At bare minimum a Also, this goes beyond the scope of this PR. |
|
okay I think I got this. |
5f229b7 to
305affe
Compare
|
great now my changes conflict suddenly? |
|
It means you rebased on an earlier revision and not HEAD of master git branch. |
305affe to
880fda3
Compare
hooked some outputs for model 2 based on SailorSats work. Added definitions to output names for Lamps and wheel.