.MEBRK LDX #&FF \ The #&FF part of this instruction is modified by the TXS \ SVE routine so that it sets the stack pointer back to \ the value it had before we set BRKV to point to MEBRK \ in the SVE routine. Modifying this instruction means \ we don't need to use the stack variable, which saves \ us both a byte in this instruction, as well the byte \ of the stack variable LDY #0 \ Set Y to 0 to use as a loop counter below LDA #7 \ Set A = 7 to generate a beep before we print the error \ message .MEBRKL JSR OSWRCH \ Print the character in A (which contains a beep on the \ first loop iteration), and then any non-zero \ characters we fetch from the error message INY \ Increment the loop counter LDA (&FD),Y \ Fetch the Y-th byte of the block pointed to by \ (&FD &FE), so that's the Y-th character of the message \ pointed to by the MOS error message pointer BNE MEBRKL \ If the fetched character is non-zero, loop back to the \ JSR OSWRCH above to print the it, and keep looping \ until we fetch a zero (which marks the end of the \ message) BEQ retry \ Jump to retry to wait for a key press and display the \ disc access menu (this BEQ is effectively a JMP, as we \ didn't take the BNE branch above)Name: MEBRK [Show more] Type: Subroutine Category: Save and load Summary: The BRKV handler for disc access operationsContext: See this subroutine in context in the source code References: This subroutine is called as follows: * SVE calls MEBRK
This routine is used to display error messages from the disc filing system while disc access operations are being performed. When called, it makes a beep and prints the system error message in the block pointed to by (&FD &FE), which is where the disc filing system will put any disc errors (such as "File not found", "Disc error" and so on). It then waits for a key press and returns to the disc access menu. BRKV is set to this routine at the start of the SVE routine, just before the disc access menu is shown, and it reverts to BRBR at the end of the SVE routine after the disc access menu has been processed. In other words, BRBR is the standard BRKV handler for the game, and it's swapped out to MEBRK for disc access operations only. When it is the BRKV handler, the routine can be triggered using a BRK instruction. The main difference between this routine and the standard BRKV handler in BRBR is that this routine returns to the disc access menu rather than restarting the game, and it doesn't decrement the brkd counter.
Label MEBRKL is local to this routine
Configuration variable: OSWRCH = &FFEE
The address for the OSWRCH routine
Scan the keyboard until a key is pressed and display the disc access menu