0100 ;BUTTERFINGERSõ0110 ;BY KEVIN C. GEVATOSKYõ0120 ;(c)1989, ANTIC PUBLISHING INC.õ0130 ;õ0140 DOSINI = $0Cõ0150 VKEYBD = $0208 ;KB int. vector.õ0160 KBCODE = $D209 ;Current key.õ0170 CH1 = $02F2 ;Prior key.õ0180 CH = $02FC ;Last key.õ0190 SH_CLR = 118 ;Key codes.õ0200 CT_CLR = 182õ0210 CT_SH_CLR = 246õ0220 ;õ0230 *= $0600õ0240 ;õ0250 ;This program provides two entryõ0260 ;points so that it can beõ0270 ;started from DOS or BASIC.õ0280 ;õ0290 STARTõ0300 JMP INIT ;For DOS entry.õ0310 NOP ;For BASIC entryõ0320 PLA ;w/ X=USR(1540)õ0330 ;õ0340 ;Makes the program RESET-proofõ0350 ;õ0360 INITõ0370 LDA DOSINI ;Get current DOSõ0380 STA NEW_INI+1 ;init addressõ0390 LDA DOSINI+1 ;and save inõ0400 STA NEW_INI+2 ;new vector.õ0410 LDA # NEW_INI ;old vector.õ0440 STA DOSINI+1õ0450 BNE SET_KBVEC ;(JUMP)õ0460 ;õ0470 NEW_INIõ0480 JSR $FFFF ;New DOS init.õ0490 ;õ0500 ;Jump here on initialization orõ0510 ;RESET to setup a new keyboardõ0520 ;trap vector.õ0530 ;õ0540 SET_KBVECõ0550 SEI ;Kill IRQ's.õ0560 LDA VKEYBD ;Save system KBõ0570 STA SYSKBV ;interrupt addrõ0580 LDA VKEYBD+1 ;replace w/theõ0590 STA SYSKBV+1 ;addr to ourõ0600 LDA # KEY_TRAPõ0630 STA VKEYBD+1õ0640 CLI ;Restore IRQ's.õ0650 RTS õ0660 ;õ0670 ;Interrupt routine to replaceõ0680 ;SHFT+CLEAR and CTRL+CLEARõ0690 ;with SHFT+CTRL+CLEAR.õ0700 ;õ0710 KEY_TRAPõ0720 PHA õ0730 LDA KBCODE ;Get current keyõ0740 CMP #SH_CLR ;Filter out theõ0750 BEQ GOT_YA ;standard clearõ0760 ;õ0770 CMP #CT_CLR ;screen keys.õ0780 BEQ GOT_YAõ0790 ;õ0800 CMP #CT_SH_CLR ; Check forõ0810 BNE GO_KB_INT ; our specialõ0820 ; keyõ0830 CLR_SCR ; combinationõ0840 LDA #SH_CLRõ0850 STA CH ;Put clr-screenõ0860 STA CH1 ;code for Editorõ0870 GOT_YAõ0880 PLA ;Return from theõ0890 PLA ;interrupt.õ0900 RTI õ0910 ;õ0920 GO_KB_INTõ0930 PLA ;Pass all otherõ0940 JMP (SYSKBV) ;keys on to OSõ0950 ;õ0960 SYSKBVõ0970 .DS 2 ;keybd handler.õ0980 *= $02E0 ;DOS RUN addressõ0990 .WORD STARTõ1000 .END õ