[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Can Ctrl-C interrupt be removed from ProDOS BASIC?



To kill CTRL-C characters, just patch into the KSW vector in the zero page
at locations $38-$39.  Something like this should do the trick:

* Patch out the KSW vector to ignore CTRL-C

Patch   lda $38
        sta oldKSW
        lda $39
        sta oldKSW+1
        lda #myKSW
        sta $38
        lda #>myKSW
        sta $39
        rts

* The patch code

myKSW   jsr (oldKSW)     ;Call the standard keyin routine
        cmp #$83         ;Was CTRL-C pressed?
        bne noCTRLC      ;No
        lda #$00         ;Play like NUL was hit
noCTRLC rts

At some point, the patch should probably be removed, so use this routine:

* Unpatch the KSW vector

Unpatch lda oldKSW
        sta $38
        lda oldKSW+1
        sta $39
        rts
oldKSW  ds   2


I haven't actually run this code, so I can't guarantee it will work, but
something very much along these lines should do the trick.

- Eric S.

--
Eric D. Shepherd                   | Apple II Alliance Charter Member
InterNet: uerics@mcl.mcl.ucsb.edu  |           ACM Member
FidoNet:  1:206/2713 Eric Shepherd | Programming Law #1: "When in
AOL:      Sheppy                   | doubt, rewrite from scratch."