Thank you Wayne!
I found the code where you left it :-)
I changed it to test (as before) whether there is a sound device, and if so if device 0 is an AY-3-8910 type. If yes, it calls "AY_CHIME" which I added to ay38910.asm; otherwise it calls the system beep as before. The chime itself is a little chord with an envelope, and probably not everybody’s cup of tea, so I won’t send a pull request for that.
I did stumble across spk.asm however, which is coded around the assumption that the 1 bit speaker is controlled by bit 2 of the RTC latch. My own little beeper happens to be on bit 0 of port 1.
I refactored this so that there are config variables like this in cfg_MASTER.asm
SPKENABLE .EQU FALSE ; SPK: ENABLE RTC LATCH IOBIT SOUND DRIVER (SPK.ASM)
SPKPORT .EQU RTCIO ; SPK: THE PORT WITH THE SPEAKER IO BIT
SPKSHADOW .EQU HB_RTCVAL ; SPK: THE SHADOW VALUE FOR THE PORT THAT HAS TO BE MAINTAINED
SPKMASK .EQU 00000100b ; SPK: THE BIT MASK TO ACTUALLY TOGGLE
So SPKSHADOW is the address of the shadow value the port should be returned to after the beep. Simply setting the enable to true (as is done in the few system config files that use it) should give the same behaviour as before. But it’s now easy to adjust to other IO bits.
The only problem, as usual: I can’t actually test whether it doesn’t break any other system.
Want me to send a pull request?
Martin