From 3d85621819e226f8c2b756d7c104172fba4207a4 Mon Sep 17 00:00:00 2001 From: cuz Date: Thu, 13 Sep 2001 16:00:55 +0000 Subject: [PATCH] Removed the port parameter from mouse_init git-svn-id: svn://svn.cc65.org/cc65/trunk@906 b7a2c559-68d2-44c3-8de9-860c34a00d81 --- libsrc/atari/mouse.s | 38 +++++++-------------------------- libsrc/c64/mouse.s | 7 ++---- libsrc/geos/mousesprite/mouse.s | 9 +++----- 3 files changed, 13 insertions(+), 41 deletions(-) diff --git a/libsrc/atari/mouse.s b/libsrc/atari/mouse.s index a6eb380fa..9c722b49c 100644 --- a/libsrc/atari/mouse.s +++ b/libsrc/atari/mouse.s @@ -16,7 +16,7 @@ .export _mouse_buttons, _mouse_pos, _mouse_info .constructor initmouse,27 - .import popa,popax + .import popax .importzp ptr1 .include "atari.inc" @@ -56,15 +56,10 @@ initmouse: ;-------------------------------------------------------------------- ; 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 @@ -203,16 +198,14 @@ _mouse_hide: ; 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 ;-------------------------------------------------------------------- @@ -379,28 +372,15 @@ nyami: tya 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 @@ -592,7 +572,5 @@ omy: .res 1 ; old y pos mouse_off: .res 1 -port_nr: - .res 1 mouse_pm0: .res 1 diff --git a/libsrc/c64/mouse.s b/libsrc/c64/mouse.s index 5886fc8c1..c65c6e2e7 100644 --- a/libsrc/c64/mouse.s +++ b/libsrc/c64/mouse.s @@ -12,7 +12,7 @@ .export _mouse_buttons, _mouse_info .import _readjoy - .import popa, popax, addysp1 + .import popax, addysp1 .importzp ptr1, sp, sreg .include "c64.inc" @@ -35,13 +35,10 @@ XCORR = SPRITE_WIDTH ; -------------------------------------------------------------------------- ; -; 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 diff --git a/libsrc/geos/mousesprite/mouse.s b/libsrc/geos/mousesprite/mouse.s index 5bf1f1e75..9fb22714a 100644 --- a/libsrc/geos/mousesprite/mouse.s +++ b/libsrc/geos/mousesprite/mouse.s @@ -5,14 +5,14 @@ ; ; 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" @@ -24,13 +24,10 @@ ; -------------------------------------------------------------------------- ; -; 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 -- 2.39.5