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

heath/h19.cpp Implement Shift-Reset functionality #11330

Merged
merged 1 commit into from Jun 14, 2023

Conversation

mgarlanger
Copy link
Contributor

The H19 allowed the user to press the right-shift and reset key to reset the system. Since the h89 shared the common terminal board in the H19, this reset also was routed to the h89 cpu board and reset the entire computer. The actual reset occurs on the release of the keys.

In mame, the default key for reset is F10. Using the right-shift and F10 now causes the machine (either H19 or H89) to be reset.

A few other general cleanup of comments, formatting, etc. is also done in this PR.

@rb6502 rb6502 merged commit 2c02460 into mamedev:master Jun 14, 2023
5 checks passed
@cuavas
Copy link
Member

cuavas commented Jun 14, 2023

This has way too much wrong with it.

Copy link
Member

@cuavas cuavas left a comment

Choose a reason for hiding this comment

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

There’s too much wrong with this. I’m going to revert it.

m_drq_allowed = false;
m_access_track_sector = false;

m_fdc->reset();
Copy link
Member

Choose a reason for hiding this comment

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

Child devices are reset automatically on reset – you shouldn’t be resetting them from device_reset.

Comment on lines +188 to +192
m_crtc->reset();
m_ace->reset();
m_beep->reset();
m_mm5740->reset();
m_maincpu->reset();
Copy link
Member

Choose a reason for hiding this comment

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

Once again, you shouldn’t be resetting child devices from device_reset.

Comment on lines 288 to +291
void heath_tlb_device::mm5740_data_ready_w(int state)
{
check_for_reset();

Copy link
Member

Choose a reason for hiding this comment

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

Is this when the reset key combination is actually checked, or does it happen out-of-band? If it happens out-of-band, you should attach callbacks to the relevant keys so you get a notification when they’re changed.

Comment on lines +34 to +38
void heath_intr_cntrl::device_reset()
{
m_intr_lines = 0;
}

Copy link
Member

Choose a reason for hiding this comment

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

This value comes from inputs. You shouldn’t change it on reset. If the devices that produce those inputs deassert their outputs on reset, it’s their responsibility to update the outputs on reset.

Comment on lines +366 to +372
m_h37->reset();
m_intr_cntrl->reset();
m_console->reset();
m_serial1->reset();
m_serial2->reset();
m_serial3->reset();
m_maincpu->reset();
Copy link
Member

Choose a reason for hiding this comment

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

Once again, you shouldn’t be resetting child devices here – that happens automatically.

Comment on lines +399 to +405
void h89_state::reset_line(uint8_t data)
{
if (data == ASSERT_LINE)
{
reset();
}
}
Copy link
Member

Choose a reason for hiding this comment

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

Read/write line members conventionally use int values.

Comment on lines +183 to +185
m_interrupts_blocked = false;
m_drq_raised = false;
m_fd_irq_raised = false;
Copy link
Member

Choose a reason for hiding this comment

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

You shouldn’t be changing inputs on reset. If the devices connected to those inputs deassert them on reset, it’s their responsibility to push the change.

cuavas added a commit that referenced this pull request Jun 14, 2023
This reverts commit 2c02460.

This PR obviously wasn't reviewed properly.  It has very obvious issues,
in particular:
* Resetting child devices from device_reset/machine_reset.  Child
  devices are automatically reset when a device is reset.
* Changing input state on reset.  This leads to state getting out of
  sync.  Devices that change their outputs on reset are responsible for
  pushing out the update.
@happppp
Copy link
Member

happppp commented Jun 14, 2023

FYI to do a full system reset:
machine().schedule_soft_reset();

@cuavas
Copy link
Member

cuavas commented Jun 14, 2023

FYI to do a full system reset: machine().schedule_soft_reset();

But that will also reset things attached to serial ports, etc. Calling reset() on the root device has almost the same effect, although it doesn’t wait to return to the scheduler, which can upset some CPUs.

@mgarlanger
Copy link
Contributor Author

Reverting seems a little excessive when the machine runs fine with the new functionality and there is existing code that does the same things that this PR does wrong in such popular systems as C64/C128- https://github.com/mamedev/mame/blob/master/src/mame/commodore/c64.cpp#L1447 (and there are may other examples of it in the code).

Anyways, new PR #11339 addresses the comments raised in this PR.

pauldevine pushed a commit to pauldevine/mame that referenced this pull request Jun 21, 2023
pauldevine pushed a commit to pauldevine/mame that referenced this pull request Jun 21, 2023
)"

This reverts commit 2c02460.

This PR obviously wasn't reviewed properly.  It has very obvious issues,
in particular:
* Resetting child devices from device_reset/machine_reset.  Child
  devices are automatically reset when a device is reset.
* Changing input state on reset.  This leads to state getting out of
  sync.  Devices that change their outputs on reset are responsible for
  pushing out the update.
sonninnos pushed a commit to libretro/mame that referenced this pull request Jul 20, 2023
sonninnos pushed a commit to libretro/mame that referenced this pull request Jul 20, 2023
)"

This reverts commit 2c02460.

This PR obviously wasn't reviewed properly.  It has very obvious issues,
in particular:
* Resetting child devices from device_reset/machine_reset.  Child
  devices are automatically reset when a device is reset.
* Changing input state on reset.  This leads to state getting out of
  sync.  Devices that change their outputs on reset are responsible for
  pushing out the update.
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

4 participants