mirror of
https://github.com/oliverschmidt/contiki.git
synced 2024-12-23 01:29:33 +00:00
49 lines
1.1 KiB
ArmAsm
49 lines
1.1 KiB
ArmAsm
|
|
;---------------------------------------------------------------------
|
|
;; The 1351 mouse code was taken from the CC65 libraries,
|
|
;; written by Ullrich von Bassewitz
|
|
;---------------------------------------------------------------------
|
|
|
|
.macpack generic
|
|
|
|
.import _ctk_mouse_joyx, _ctk_mouse_joyy
|
|
.import _ctk_mouse_firebutton
|
|
.export _ctk_mouse_asm_irq
|
|
.import _ctk_mouse_joy, _ctk_mouse_1351
|
|
;---------------------------------------------------------------------
|
|
|
|
;---------------------------------------------------------------------
|
|
.code
|
|
|
|
;---------------------------------------------------------------------
|
|
_ctk_mouse_asm_irq:
|
|
lda #0
|
|
sta _ctk_mouse_firebutton
|
|
|
|
jsr _ctk_mouse_joy
|
|
;; jsr_ctk_mouse_1351
|
|
|
|
; lda _ctk_mouse_joybutton
|
|
; ora _ctk_mouse_1351button
|
|
; sta _ctk_mouse_firebutton
|
|
|
|
lda _ctk_mouse_joyy
|
|
clc
|
|
adc #$32
|
|
sta $d001
|
|
sta $d003
|
|
|
|
lda _ctk_mouse_joyx
|
|
clc
|
|
adc #$18
|
|
sta $d000
|
|
sta $d002
|
|
lda #0
|
|
adc _ctk_mouse_joyx+1
|
|
and #1
|
|
beq :+
|
|
lda #3
|
|
:
|
|
sta $d010
|
|
jmp $ea31
|