home *** CD-ROM | disk | FTP | other *** search
/ Loadstar 138 / 138.d81 / freezer.s < prev    next >
Text File  |  2022-08-26  |  2KB  |  103 lines

  1. open =$ffc0
  2. readst =$ffb7
  3. setlfs =$ffba
  4. setnam =$ffbd
  5. load =$ffd5
  6. getin =$ffe4
  7. clrchn =$ffcc
  8. close =$ffc3   ;a
  9. chrin =$ffcf
  10. chkout =$ffc9  ;x
  11. chkin =$ffc6   ;x
  12. plot =$fff0
  13. chrout =$ffd2
  14. color'pointer =243
  15. screen'line'pointer =209
  16. print'number =$bdcd ;x,a
  17. clear'line =59903
  18. background =53281
  19. border =53280
  20. unlisten =$ffae
  21. clall =$ffe7
  22.  
  23. ;important locations
  24.  
  25. vectors =$318
  26. scnkey =$ff9f
  27.  
  28. .org $c000
  29. .obj "@0:freeze c000"
  30.  
  31. .mem
  32. ;dis
  33.  
  34. start jsr $aefd
  35. jsr $ad8a
  36. jsr $b7f7; strip comma, get number
  37.  
  38. sty vectors  ; store base address
  39. sta vectors+1; in interrupt vector
  40.  
  41. lda #33      ; add 33 to vector
  42. clc          ; to point to wedge
  43. adc vectors
  44. sta vectors
  45. lda #0
  46. adc vectors+1
  47. sta vectors+1
  48.  
  49. ;note that I couldn't add WEDGE-START
  50. ;because WEDGE isn't defined yet, and
  51. ;would cause a phase error in BUDDY.
  52. ;so if any code is added above WEDGE, 
  53. ;the number added to VECTOR must be
  54. ;manually adjusted.
  55.  
  56. rts          ;and we're wedged in!
  57.  
  58. wedge pha    ;stash .A in stack
  59. txa 
  60. pha          ;stash .X in stack
  61. tya
  62. pha          ;Stash .Y in stack
  63.  
  64. lda 1        ;stash location 1
  65. pha
  66. lda #$77
  67. sta 1        ;make sure kernal is on
  68. lda 53280
  69. pha          ;stash border color
  70.  
  71. - inc 53280  ;cycle border color
  72.   lda 53280
  73.   and #15
  74. bne -
  75.   jsr scnkey ;scan keyboard every 15
  76.   bit 197    ;cycles. if no key then
  77.   bvc +
  78.   lda 56320
  79.   and #16
  80.   beq +
  81.   lda 653
  82.   beq -
  83. ;because we're in an interrupt, there
  84. ;are no interrupts to scan the
  85. ;keyboard, so we must do it manually
  86.  
  87. + pla          ;key pressed. restore the
  88. sta 53280    ;border color
  89. jsr scnkey   ;scan keyboard and get key
  90. jsr getin    ;to clear keyboard buffer.
  91.  
  92. pla          ;restore ROM as they were
  93. sta 1        ;when interrupted.
  94. pla
  95. tay          ;restore .Y
  96. pla
  97. tax          ;restore .X
  98. pla          ;restore .A
  99. rti          ;return from interrupt
  100.  
  101.  
  102.  
  103.