The main one changes SYS_ExpanderControl and adds reset sequences in the cold boot code and SYS_Reset as discussed in the thread.
The other one changes SYS_CopyMemoryExt to make sure that the control state taken from address [$1f8] has bits 0 and 1 cleared. Otherwise, storing a rogue value in $1f8 and calling SYS_CopyMemoryExt would allow you to set SCLK and disable the RAM. SYS_ExpanderControl already prevents you from doing this. SYS_SpiExchangeBytes should also be sanitized, but all the declared 134 cycles are already used.
Tests
I tested that the two code paths of SYS_ExpanderControl work as expected. I burned a ROM and ran a variety of tests without any observable problem.
This pull request proposes changes to the rom to implement the extended control proposal discussed in thread https://forum.gigatron.io/viewtopic.php?f=4&t=331
Two commits:
Tests I tested that the two code paths of SYS_ExpanderControl work as expected. I burned a ROM and ran a variety of tests without any observable problem.