kthacker | 62e146c | 2006-04-17 15:11:35 +0000 | [diff] [blame] | 1 | |
| 2 | ;--------------------------------------------------------------------- |
| 3 | ;; The 1351 mouse code was taken from the CC65 libraries, |
| 4 | ;; written by Ullrich von Bassewitz |
| 5 | ;--------------------------------------------------------------------- |
| 6 | |
| 7 | .macpack generic |
| 8 | |
| 9 | .import _ctk_mouse_joyx, _ctk_mouse_joyy |
| 10 | .import _ctk_mouse_firebutton |
| 11 | .export _ctk_mouse_asm_irq |
| 12 | .import _ctk_mouse_joy, _ctk_mouse_1351 |
| 13 | ;--------------------------------------------------------------------- |
| 14 | |
| 15 | ;--------------------------------------------------------------------- |
| 16 | .code |
| 17 | |
| 18 | ;--------------------------------------------------------------------- |
| 19 | _ctk_mouse_asm_irq: |
| 20 | lda #0 |
| 21 | sta _ctk_mouse_firebutton |
| 22 | |
| 23 | jsr _ctk_mouse_joy |
| 24 | ;; jsr_ctk_mouse_1351 |
| 25 | |
| 26 | ; lda _ctk_mouse_joybutton |
| 27 | ; ora _ctk_mouse_1351button |
| 28 | ; sta _ctk_mouse_firebutton |
| 29 | |
| 30 | lda _ctk_mouse_joyy |
| 31 | clc |
| 32 | adc #$32 |
| 33 | sta $d001 |
| 34 | sta $d003 |
| 35 | |
| 36 | lda _ctk_mouse_joyx |
| 37 | clc |
| 38 | adc #$18 |
| 39 | sta $d000 |
| 40 | sta $d002 |
| 41 | lda #0 |
| 42 | adc _ctk_mouse_joyx+1 |
| 43 | and #1 |
| 44 | beq :+ |
| 45 | lda #3 |
| 46 | : |
| 47 | sta $d010 |
| 48 | jmp $ea31 |