1
0
mirror of https://github.com/cc65/cc65.git synced 2024-10-01 15:54:59 +00:00

Removed the port parameter from mouse_init

git-svn-id: svn://svn.cc65.org/cc65/trunk@906 b7a2c559-68d2-44c3-8de9-860c34a00d81
This commit is contained in:
cuz 2001-09-13 16:00:55 +00:00
parent 40aa38a6fd
commit 3d85621819
3 changed files with 13 additions and 41 deletions

View File

@ -16,7 +16,7 @@
.export _mouse_buttons, _mouse_pos, _mouse_info .export _mouse_buttons, _mouse_pos, _mouse_info
.constructor initmouse,27 .constructor initmouse,27
.import popa,popax .import popax
.importzp ptr1 .importzp ptr1
.include "atari.inc" .include "atari.inc"
@ -56,15 +56,10 @@ initmouse:
;-------------------------------------------------------------------- ;--------------------------------------------------------------------
; Initialize mouse routines ; Initialize mouse routines
; void __fastcall__ mouse_init (unsigned char port, unsigned char type); ; void __fastcall__ mouse_init (unsigned char type);
_mouse_init: _mouse_init:
pha ; remember mouse type cmp #MAX_TYPE+1 ; Check for a valid type
jsr popa
sta port_nr
pla ; get mouse type again
cmp #MAX_TYPE+1
bcc setup bcc setup
ifail: lda #0 ; init. failed ifail: lda #0 ; init. failed
@ -203,16 +198,14 @@ _mouse_hide:
; unsigned char mouse_buttons(void) ; unsigned char mouse_buttons(void)
_mouse_buttons: _mouse_buttons:
ldx port_nr ldx #0
lda STRIG0,x lda STRIG0
bne nobut bne nobut
; lda #14 ; lda #14
;??? sta COLOR1 ;??? sta COLOR1
ldx #0
lda #1 lda #1
rts rts
nobut: ldx #0 nobut: txa
txa
rts rts
;-------------------------------------------------------------------- ;--------------------------------------------------------------------
@ -379,28 +372,15 @@ nyami: tya
t1_vec: tya t1_vec: tya
pha pha
txa txa
pha pha
.ifdef DEBUG .ifdef DEBUG
lda RANDOM lda RANDOM
sta COLBK ; debug sta COLBK ; debug
.endif .endif
lda port_nr lda PORTA
lsr ; even number 0/2
tay tay
lda PORTA,y
ldy port_nr
cpy #0
beq oddp
cpy #2
beq oddp
lsr
lsr
lsr
lsr
oddp: tay
mouse_vec: mouse_vec:
jsr st_check ; will be modified; won't be ROMmable jsr st_check ; will be modified; won't be ROMmable
@ -592,7 +572,5 @@ omy: .res 1 ; old y pos
mouse_off: mouse_off:
.res 1 .res 1
port_nr:
.res 1
mouse_pm0: mouse_pm0:
.res 1 .res 1

View File

@ -12,7 +12,7 @@
.export _mouse_buttons, _mouse_info .export _mouse_buttons, _mouse_info
.import _readjoy .import _readjoy
.import popa, popax, addysp1 .import popax, addysp1
.importzp ptr1, sp, sreg .importzp ptr1, sp, sreg
.include "c64.inc" .include "c64.inc"
@ -35,13 +35,10 @@ XCORR = SPRITE_WIDTH
; -------------------------------------------------------------------------- ; --------------------------------------------------------------------------
; ;
; unsigned char __fastcall__ mouse_init (unsigned char port, ; unsigned char __fastcall__ mouse_init (unsigned char type);
; unsigned char type);
; ;
_mouse_init: _mouse_init:
jsr popa ; Ignore type and port
lda OldIRQ+1 ; Already initialized? lda OldIRQ+1 ; Already initialized?
bne AlreadyInitialized ; Jump if yes bne AlreadyInitialized ; Jump if yes

View File

@ -5,14 +5,14 @@
; ;
; Wrapper for GEOS standard input device interface ; Wrapper for GEOS standard input device interface
; ;
.export _mouse_init, _mouse_done .export _mouse_init, _mouse_done
.export _mouse_hide, _mouse_show .export _mouse_hide, _mouse_show
.export _mouse_box .export _mouse_box
.export _mouse_pos, _mouse_info .export _mouse_pos, _mouse_info
.export _mouse_move, _mouse_buttons .export _mouse_move, _mouse_buttons
.import popa, popsreg, addysp1 .import popsreg, addysp1
.importzp sp, sreg, ptr1 .importzp sp, sreg, ptr1
.include "../inc/const.inc" .include "../inc/const.inc"
@ -24,13 +24,10 @@
; -------------------------------------------------------------------------- ; --------------------------------------------------------------------------
; ;
; unsigned char __fastcall__ mouse_init (unsigned char port, ; unsigned char __fastcall__ mouse_init (unsigned char type);
; unsigned char type);
; ;
_mouse_init: _mouse_init:
jsr popa ; ignore all parameters
jsr StartMouseMode jsr StartMouseMode
jsr MouseOff jsr MouseOff