# HG changeset patch # User William Astle # Date 1667772027 25200 # Node ID d5ae140d19d454cae47332db23daf234013ec8ef # Parent 686b600a62eef74e8e9726bfba06eed5becb92c7 Make sure DP is set correcting during IRQ handling Since DP may have been modified arbitrarily when an IRQ occurs, force it back to 0 before running the IRQ handler, notably the keyboard code. By being able to rely on DP being set correctly, the code size and execution time are both improved somewhat. diff -r 686b600a62ee -r d5ae140d19d4 src/lwbasic.s --- a/src/lwbasic.s Sun Nov 06 14:57:32 2022 -0700 +++ b/src/lwbasic.s Sun Nov 06 15:00:27 2022 -0700 @@ -452,6 +452,8 @@ endc rti irqhandler0 lda PIA0.DB ; clear VSYNC flag + clra ; make sure DP is pointing to the right place + tfr a,dp bsr keyb_read ; go handle the keyboard rti ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;