apple/apple2e.cpp: update LC memory map when LC state changes #11996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
It appears that during a reset, the expected and executed language card state changes do not also update the system memory map. This can cause a reset vector to fail when the language card RAM has been banked over ROM. The following software hangs when reset is asserted:
Merlin running from 32 Meg Hard Drive Image
BBC Basic running from Applecorn
A reset hang can be demonstrated from a clean boot by entering the following code into the monitor. It banks in the LC over ROM and waits for the user to press reset. If the LC bank is uninitialized and reset is pressed, it will hang in a cascade of
BRK
instructions.The Apple //c will hang a little differently since it copies an IRQ/BRK vector into the LC RAM area when it boots. The interrupt service routine will attempt to jump to a ROM location but it isn't banked in, a
BRK
will be hit, and the routine will be triggered again.I must stress that I don't fully understand how memory mapping works. I copied the pattern seen in parts of the code, consolidated it into a function
lcrom_update()
, and inserted calls to it wherever the language card state changed. These changes resolve the reset vector problems but someone wiser than me should review what I've done carefully. TheALTZP
softswitch affects the language card area but I gather changes tom_altzp
followed by a call toauxbank_update()
bank AUX memory into the LC RAM area automatically (though it is not explicitly stated).A true slot 0 language card in an early model Apple II does not change its state when reset so this has been left alone. According to Jeff Mazur there is no hardware reset of
m_romswitch
and the extended ROM code supports that so that has not been changed. I don't know enough about the CEC computers to comment and have tried to leave its LC mapping undisturbed.