.export _mouse_buttons, _mouse_pos, _mouse_info
.constructor initmouse,27
- .import popa,popax
+ .import popax
.importzp ptr1
.include "atari.inc"
;--------------------------------------------------------------------
; Initialize mouse routines
-; void __fastcall__ mouse_init (unsigned char port, unsigned char type);
+; void __fastcall__ mouse_init (unsigned char type);
_mouse_init:
- pha ; remember mouse type
- jsr popa
- sta port_nr
- pla ; get mouse type again
-
- cmp #MAX_TYPE+1
+ cmp #MAX_TYPE+1 ; Check for a valid type
bcc setup
ifail: lda #0 ; init. failed
; unsigned char mouse_buttons(void)
_mouse_buttons:
- ldx port_nr
- lda STRIG0,x
+ ldx #0
+ lda STRIG0
bne nobut
; lda #14
;??? sta COLOR1
- ldx #0
lda #1
rts
-nobut: ldx #0
- txa
+nobut: txa
rts
;--------------------------------------------------------------------
t1_vec: tya
pha
txa
- pha
+ pha
.ifdef DEBUG
lda RANDOM
sta COLBK ; debug
.endif
- lda port_nr
- lsr ; even number 0/2
+ lda PORTA
tay
- lda PORTA,y
- ldy port_nr
- cpy #0
- beq oddp
- cpy #2
- beq oddp
-
- lsr
- lsr
- lsr
- lsr
-oddp: tay
mouse_vec:
jsr st_check ; will be modified; won't be ROMmable
mouse_off:
.res 1
-port_nr:
- .res 1
mouse_pm0:
.res 1
.export _mouse_buttons, _mouse_info
.import _readjoy
- .import popa, popax, addysp1
+ .import popax, addysp1
.importzp ptr1, sp, sreg
.include "c64.inc"
; --------------------------------------------------------------------------
;
-; unsigned char __fastcall__ mouse_init (unsigned char port,
-; unsigned char type);
+; unsigned char __fastcall__ mouse_init (unsigned char type);
;
_mouse_init:
- jsr popa ; Ignore type and port
-
lda OldIRQ+1 ; Already initialized?
bne AlreadyInitialized ; Jump if yes
;
; Wrapper for GEOS standard input device interface
;
-
+
.export _mouse_init, _mouse_done
.export _mouse_hide, _mouse_show
.export _mouse_box
.export _mouse_pos, _mouse_info
.export _mouse_move, _mouse_buttons
- .import popa, popsreg, addysp1
+ .import popsreg, addysp1
.importzp sp, sreg, ptr1
.include "../inc/const.inc"
; --------------------------------------------------------------------------
;
-; unsigned char __fastcall__ mouse_init (unsigned char port,
-; unsigned char type);
+; unsigned char __fastcall__ mouse_init (unsigned char type);
;
_mouse_init:
- jsr popa ; ignore all parameters
-
jsr StartMouseMode
jsr MouseOff