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

apple/apple2e.cpp: Correctly reset IOU softswitches on system reset #12003

Merged

Conversation

xotmatrix
Copy link
Contributor

@xotmatrix xotmatrix commented Feb 3, 2024

Some IOU softswitches are not being reset when the system is reset. This can leave the display and annunciators in an incorrect state after a reset.

From a fresh start, enter the following into the monitor to enable 80-column video and then press RESET. Note the 80-column video remains enabled which is not correct.

*C00D:1

From a fresh start, enter the following into the monitor to draw MouseText characters to the screen and then press RESET. Note the MouseText characters remain enabled which is not correct.

*C00F:1 N 428:40 41 42 43 44 45

This patch corrects these issues by adding reset handling for the missing IOU softswitches:

  • 80COL
  • ALTCHR
  • AN0
  • AN1
  • AN2
  • AN3

In addition, reset code related to MMU, IOU, and LC softswitches has been reorganized into logical groups.

@rb6502
Copy link
Contributor

rb6502 commented Feb 3, 2024

I think we have enough duplicated code now to break a lot of this out into a class member function and just call it from both the keyboard reset and machine_reset().

@xotmatrix
Copy link
Contributor Author

xotmatrix commented Feb 3, 2024

I'm all for a single reset routine. People have grown impatient with me for not accepting that they perform different tasks on some philosophical level.

That said, some care should be given to m_romswitch and possibly other flip-flops that do not change on a hardware reset and start in an unknown state.

@rb6502
Copy link
Contributor

rb6502 commented Feb 4, 2024

It's not philosophical so much as a MAME architectural thing.

machine_reset() is intended to be a power-on everything-gets-hit reset, and there isn't a native concept of something like Control-Reset where only some components know about it. The reset everything machine_reset() style is totally reasonable for all the stuff MAME emulates where it has no reset switch (arcades, synthesizers, some consoles/handhelds) but you still would like to be able to reset it. The A2 obviously isn't that.

There's a lot of overlap so we definitely want both cases calling a common routine, but they can't be 100% identical since machine_reset() should put things like ROMSWITCH into a reasonable known state that a Control-Reset doesn't touch. That's obviously a much longer list on the II/II Plus than the IIe/IIc, so hopefully for the IIe/IIc we can have most of what both paths do in the common routine.

@rb6502 rb6502 changed the title apple/apple2e.cpp: reset IOU softswitches apple/apple2e.cpp: Correctly reset IOU softswitches on system reset Mar 9, 2024
@rb6502 rb6502 merged commit d6e5fbd into mamedev:master Mar 9, 2024
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.

None yet

2 participants