home *** CD-ROM | disk | FTP | other *** search
- open =$ffc0
- readst =$ffb7
- setlfs =$ffba
- setnam =$ffbd
- load =$ffd5
- getin =$ffe4
- clrchn =$ffcc
- close =$ffc3 ;a
- chrin =$ffcf
- chkout =$ffc9 ;x
- chkin =$ffc6 ;x
- plot =$fff0
- chrout =$ffd2
- color'pointer =243
- screen'line'pointer =209
- print'number =$bdcd ;x,a
- clear'line =59903
- background =53281
- border =53280
- unlisten =$ffae
- clall =$ffe7
-
- ;important locations
-
- vectors =$318
- scnkey =$ff9f
-
- .org $c000
- .obj "@0:freeze c000"
-
- .mem
- ;dis
-
- start jsr $aefd
- jsr $ad8a
- jsr $b7f7; strip comma, get number
-
- sty vectors ; store base address
- sta vectors+1; in interrupt vector
-
- lda #33 ; add 33 to vector
- clc ; to point to wedge
- adc vectors
- sta vectors
- lda #0
- adc vectors+1
- sta vectors+1
-
- ;note that I couldn't add WEDGE-START
- ;because WEDGE isn't defined yet, and
- ;would cause a phase error in BUDDY.
- ;so if any code is added above WEDGE,
- ;the number added to VECTOR must be
- ;manually adjusted.
-
- rts ;and we're wedged in!
-
- wedge pha ;stash .A in stack
- txa
- pha ;stash .X in stack
- tya
- pha ;Stash .Y in stack
-
- lda 1 ;stash location 1
- pha
- lda #$77
- sta 1 ;make sure kernal is on
- lda 53280
- pha ;stash border color
-
- - inc 53280 ;cycle border color
- lda 53280
- and #15
- bne -
- jsr scnkey ;scan keyboard every 15
- bit 197 ;cycles. if no key then
- bvc +
- lda 56320
- and #16
- beq +
- lda 653
- beq -
- ;because we're in an interrupt, there
- ;are no interrupts to scan the
- ;keyboard, so we must do it manually
-
- + pla ;key pressed. restore the
- sta 53280 ;border color
- jsr scnkey ;scan keyboard and get key
- jsr getin ;to clear keyboard buffer.
-
- pla ;restore ROM as they were
- sta 1 ;when interrupted.
- pla
- tay ;restore .Y
- pla
- tax ;restore .X
- pla ;restore .A
- rti ;return from interrupt
-
-
-
-